Database design
A database design is a set of database specifications that can actually be implemented in a specific DBMS product.
DB design = Logical design + some physical design
Three design stages
Conceptual design (conceptual schema)
Logical design (logical schema)
Physical design (physical schema)
Steps for Transforming a
Data Model into a Database Design I

Steps for Transforming a
Data Model into a Database Design II

Steps for Transforming a
Data Model into a Database Design III

How to select the primary key
Some database designers take the position that, for consistency, if one table has a surrogate key, all of the tables in the database should have a surrogate key. Others think that such a policy is too rigid; after all, there are good data keys, such as ProductSKU (which would use SKU codes discussed in Chapter 2). If such a key exists, it should be used instead of a surrogate key. Your organization may have standards on this issue that you should follow.
Be aware that DBMS products vary in their support for surrogate keys.
Microsoft Access 2013, Microsoft SQL Server 2014, and MySQL 5.6 provide them.
Microsoft SQL Server 2014 allows the designer to pick the starting value and increment of the key, and MySQL 5.6 allows the designer to pick the starting value.
Oracle’s Oracle Database, however, does not provide direct support for surrogate keys, but you can obtain the essence of them in a rather backhanded way, as discussed in Chapter 10B.
In this book, we use surrogate keys unless there is some strong reason not to. In addition to the advantages described here, the fact that they are fixed simplifies the enforcement of minimum cardinality, as you will learn in the last section of this chapter.
Specify Candidate (Alternate) Keys
What NULL means
Null status indicates whether or not the value of the column can be NULL.
Data types
Creata Table Statement
CREATE TABLE Persons
(
P_Id INT NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Address varchar(255),
City varchar(255) DEFAULT ‘Sandnes’ NULL
);
Data constraints
Data constraints are limitations on data values:
DDL Constraints
Constraints can be defined within the CREATE TABLE statement, or they can be added to the table after it is created using the ALTER table statement.
Create table example
