Presentation is loading. Please wait.

Presentation is loading. Please wait.

Database Design – Lecture 6 Moving to a Logical Model.

Similar presentations


Presentation on theme: "Database Design – Lecture 6 Moving to a Logical Model."— Presentation transcript:

1 Database Design – Lecture 6 Moving to a Logical Model

2 2 Lecture Objectives How to convert from the conceptual model to the logical model Refining the key structure of an entity Refining relationships between entities based on Business Rules

3 3 Converting Entities 1. Add attributes to each entity 2. Verify PK defined in conceptual model – is it appropriate for table or does another unique (generic) PK need to be defined 3. Remove derived values

4 4 Converting Relationships 4. For 1:M connectivity, take the PK of the ‘1’ table and make it an FK in the ‘M’ table 5. For M:N connectivity, create a bridge table Include the PK from each of the original tables as composite PK in the bridge table. These will also be FKs in the bridge table Add additional attributes to the bridge table as required 6. For Strong – Weak Entity relationships, take the PK of the Strong Entity and include it as part of the PK of the Weak Entity. It will also be an FK in the Weak Entity

5 5 Example Conversion Given the following ERD, convert to a logical model using the techniques provided

6 6 Example Conversion 1. Add attributes 2. Refine PK’s (this may involve creating a new, more meaningful PK) 3. Remove derived values (none in this example) 4. All relationships revised (1:1, 1:M, M:N) Note new entity created to handle M:N relationship between book and customer Note relationship appropriate now between librarian and borrow transactions

7 7 In Summary A conceptual model can have a few attributes or many attributes depending on the level of detail provided in a narrative Most often, we will add as many attributes as are known to the initial conceptual model to get it to an adequate level of detail (or as close to logical as possible)

8 8 Example Logical Design SAS (Support A Student) Window Cleaning wants to keep track of its students and the jobs they are assigned. For an employee information such as name, address, email and phone number are required. Students are grouped into job categories as their salary is calculated by the category they are in. The category includes code, description and hourly rate. A student can on have one job category at a time but each job category can have many students. All jobs are tracked by an id number, a start date, an end date and a cost. More than one employee will work on a job and an employee will have many jobs assigned to them.


Download ppt "Database Design – Lecture 6 Moving to a Logical Model."

Similar presentations


Ads by Google