70 likes | 218 Views
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 340 Introduction to Database Systems (Chapter 7 Tutorial). Exercise 1 Transform the following ER diagram to a relational schema that
E N D
Riyadh Philanthropic Society For Science Prince Sultan College For Woman Dept. of Computer & Information Sciences CS 340 Introduction to Database Systems (Chapter 7 Tutorial)
Exercise 1 • Transform the following ER diagram to a relational schema that • shows referential integrity constraints. 1 N 1 1 N N M M N N Chapter 7 Tutorial 1
Exercise 1 (Solution) • BANK A_C • ACCOUNT • BANK_BRANH L_C • LOAN • CUSTOMER Code Name Addr AcctNo SSN AcctNo Balance Type BCode BNo BCode BranchNo Addr LoanNo SSN LoanNo Amount Type BCode BNo SSN Name Phone Addr Chapter 7 Tutorial 2
Exercise 2 • Transform the following EER diagram to a relational schema that • shows referential integrity constraints. Chapter 7 Tutorial 3
Exercise 2 (Solution) • RESEDENT_PATENT • OUT_PATENT • RESPONSIBLE_PHYSICIAN • BED PID PName AdmitDate DateDischarged PhysicianID BedID PID PName AdmitDate CheckBackDate PhysicianID PhysicianID BedID Chapter 7 Tutorial 4
Exercise 3 • Map the following relational schema into an ER schema. This is part • of a process known as reverse engineering, where a conceptual • schema is created for an existing implemented database. Chapter 7 Tutorial 5
Exercise 3 (Solution) BookID Title PName PAddress PPhone N 1 B-P BOOK PUBLISHER M AuthorName DateOut BOOK- LOANS BOOK- COPIES NoOfCopies DueDate BranchID N LIBRARY-BRANCH BORROWER CardNo BranchName Address BName BAddress BPhone Chapter 7 Tutorial 6