Download presentation
Presentation is loading. Please wait.
1
The Entity-Relationship Model
Chapter 2 The slides for this text are organized into chapters. This lecture covers Chapter 2, on the Entity-Relationship approach to database design. The important issue of how to map from ER diagrams to relational tables is deferred until the relational model and the integrity constraints it supports have been introduced. ER to relational mapping, together with a discussion of the related SQL commands, is discussed in Chapter 3. 1
2
Exercise name Customer ssn addr acct# balance What can you say about policy of the bank from the ER diagram? What can you say about the policy of the company? CustAcct Account name Employees ssn lot Manages deptid budget Dept 7
3
Exercise name Customer ssn addr acct# balance CustAcct Account What can you say about policy of the bank from the ER diagram? No joint account; a customer can have multiple accounts Unique SSN for Customer and acct# for Account Can a customer exist in the DB without having an account? Can an account exist without a customer? 7
4
Exercise What can you say about the policy of the company?
name Employees ssn lot deptid budget Dept Manages What can you say about the policy of the company? Each dept must have a single manager A manager can manage multiple depts Unique SSN for Customer and deptid for Dept Can a dept exist in the DB without having a manager? 7
5
Design Exercise Design a DB using ER, and sketch the resulting diagram. State any important assumptions you made in reaching the design. Show explicitly whether relationships are 1-1, 1-M, or N-M. UVA registrar’s office: It maintains data about each class, including the instructor, students, enrollment, time and place of the class meetings. For each student-class pair, a grade is recorded. Hospital: It maintains all patients visited, including age and address. It also keeps track of the information about billing, visits, data, reason for visit, and treatment. 12
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.