Chapter 5 - Database Design Flashcards
What is Database Design?
A set of database specifications that can actually be implemented in a DBMS.
What are the Three (3) Database Designs?
Conceptual Design (or Schema)
Logical Design: Modified conceptual design implemented in a specific DBMS
Physical Design: Includes aspects when implemented in the DBMS such as record, table structure, index, etc.
What are the Two (2) Big Steps for Transforming a Data Model into a Database Design?
- Create a Table for Each Entity
- Create Relationships by Placing Foreign Keys
What are the Sub-steps for Creating a Table for Each Entity?
Specify primary key
Specify properties for each column
Verify normalizations (Any functional dependencies)
What are the Sub-steps for Creating Relationships by Placing Foreign Keys?
Strong entity relationships (1:1; 1:N; N:M)
ID-Dependent and non-ID-Dependent weak entity relationships
Subtypes
Recursive (1:1; 1:N; N:M)
How do you Represent Weak Entities with the Relational Model?
If ID-Dependent, then you must add the primary key of the parent entity.
If not ID-Dependent, use the same techniques as for strong entities
How do you Represent a 1:1 Relationship with the Relational Model?
The key from one relation is placed in the other as a foreign key. It does not matter which table gets the FK
How do you Represent a 1:N Relationship with the Relational Model?
A 1:N relationship is saved by placing the key from one table into another as a foreign key.
The foreign key always goes into the many side of the relationship. The 1 side is called the parent and the N side is called the child
How do you Represent a N:M Relationship with the Relational Model?
To create a N:M relationship, a new table is created. This is called the intersection table.
The intersection table has a composite key consisting of the keys from each table it connects.
How do you Represent a Recursive Relationship with the Relational Model?
1:1 and 1:N relationships are saved by using a foreign key to itself.
N:M relationships are saved by creating an intersecting relation
How does the HSD (Heather Sweeney Design) differ from the ER model in Ch. 4 to the Database Design in Ch. 5?
A new intersection table is created for SEMINAR_CUSTOMER and CONTACT connecting SEMINAR and CUSTOMER.
Foreign keys are added to the LINE_ITEM table, which is the many or child side to INVOICE and PRODUCT
Know Cascading ramifications of On Update and On Delete (Parent - Child - Referential Integrity Constraint - Cascading Behavior)
INVOICE - LINE ITEM - InvoiceNumber in LINE_ITEM must exist in InvoiceNumber in INVOICE - Yes cascading On Delete
PRODUCT - LINE_ITEM - ProductNumber in LINE_ITEM must exist in ProductNumber in PRODUCT - Yes cascading On Update