Database Systems: The Complete Book
Solutions for Chapter 2
Solutions for Section 2.1
Exercise 2.1.1
The E/R Diagram.
Exercise 2.1.8(a)
The E/R Diagram
Kobvxybz
Solutions for Section 2.2
Exercise 2.2.1
The Addresses entity set is nothing but a single address, so we would prefer to make address an attribute of Customers. Were the bank to record several addresses for a customer, then it might make sense to have an Addresses entity set and make Lives-at a many-many relationship.
The Acct-Sets entity set is useless. Each customer has a unique account set containing his or her accounts. However, relating customers directly to their accounts in a many-many relationship conveys the same information and eliminates the account-set concept altogether.
Solutions for Section 2.3
Exercise 2.3.1(a)
Keys ssNo and number are appropriate for Customers and Accounts, respectively. Also, we think it does not make sense for an account to be related to zero customers, so we should round the edge connecting Owns to Customers. It does not seem inappropriate to have a customer with 0 accounts;
they might be a borrower, for example, so we put no constraint on the connection from Owns to Accounts. Here is the The E/R Diagram,
showing underlined keys and
the numerocity constraint.
Exercise 2.3.2(b)
If R is many-one from E1 to E2, then two tuples (e1,e2) and (f1,f2) of the relationship set for R must be the same if they agree on the key attributes for E1. To see why, surely e1 and f1 are the same. Because R is many-one from E1 to E2, e2 and f2 must also be the same. Thus, the pairs are the same.
Solutions for Section 2.4