CH 6- Transforming Data Models into Database Designs Flashcards
database design
-a set of database specifications that can actually be implemented as a database in a specific DB MS product.
systems analysis and design stages
– Conceptual design (conceptual schema)
– Logical design (logical schema)
– Physical design (physical schema)
Transforming a Data Model into a Database Design (steps)
- Create a table for each entity
- Create relationships
- Specify Minimum cardinality
- Create a table for each entity
– Specify the primary key (consider surrogate keys, as appropriate) – Specify alternate keys – Specify properties for each column: ▪ Null status ▪ Data type ▪ Default value (if any) ▪ Data constraints (if any) – Verify normalization
- Specify Minimum cardinality
– O-O relationships
– M-O relationships
– O-M relationships
– M-M relationships
Selecting the Primary Key
• The ideal primary key is short, numeric, and fixed.
• Surrogate keys meet the ideal, but have two
disadvantages to users:
– They have no meaning to users (an ID used as a
surrogate key may give no indication of the related
table)
– When data is shared with among different databases
(an ID used in one database may have no meaning to
a user in another database)
Specify Column Properties: Null Status
& Alternate Keys
• Null status indicates whether or not the value of the
column can be NULL.
———————————————————————
•The terms candidate key and alternate key are
synonymous.
•Candidate keys are alternate identifiers of unique
rows in a table
default value
-the value supplied by the DBMS when a new row is created.
Data constraints
1) Domain constraints
2) Range constraints
3) Interrelation constraints
4) Interrelation constraints
Domain constraints
-limit column values to a particular set of values.
Range constraints
-limit values to a particular interval of values (within a given range)
Interrelation
limit a column’s values in comparison to values in other columns in the same table.
Interrelation constraints
limit a column’s values in comparison to values in other columns in other tables (referential integrity constraints on foreign keys).
1:1 Strong Entity Relationship
Place the primary key of one entity in the other entity
as a foreign key.
1-N Strong Entity Relationships
• Place the primary key of the table on the one side of the relationship into the table on the many side of the
relationship as the foreign key.
• The one side is the parent table and the many side is the child table, so “place the key of the parent in the child.”