The following questions are taken from the course's required textbook and do not belong to me - H. G. Molina, J. Ullman, J. Widom : Database Systems The Complete Book, Pearson/Prentice Hall 2009.
Q1: Page 138 - Exercise 4.1.1
Design a database for a bank, including information about customers and their accounts. Information about a customer includes their name, address, phone, and Social Security number. Accounts have numbers, types (e.g., savings, checking) and balances. Also record the customer(s) who own an account. Draw the E /R diagram for this database. Be sure to include arrows where appropriate, to indicate the multiplicity of a relationship.Q2: Page 138/139 - Exercise 4.1.2
Modify your solution to Exercise 4.1.1 as follows:
- Change your diagram so an account can have only one customer.
- Further change your diagram so a customer can have only one account.
- Change your original diagram of Exercise 4.1.1 so that a customer can have a set of addresses (which are street-city-state triples) and a set of phones. Remember that we do not allow attributes to have nonprimitive types, such as sets, in the E /R model.
- Further modify your diagram so that customers can have a set of addresses, and at each address there is a set of phones.
Q3: Page 139 - Exercise 4.1.3
Give an E /R diagram for a database recording information about teams, players, and their fans, including:
- For each team, its name, its players, its team captain (one of its players), and the colors of its uniform.
- For each player, his/her name.
- For each fan, his/her name, favorite teams, favorite players, and favorite color.
Q4: Page 156 - Exercise 4.4.4
Draw E /R diagrams for the following situations involving weak entity sets. In each case indicate keys for entity sets.
- Entity sets Courses and Departments. A course is given by a unique department, but its only attribute is its number. Different departments can offer courses with the same number. Each department has a unique name.
- Entity sets Leagues, Teams, and Players. League names are unique. No league has two teams with the same name. No team has two players with the same number. However, there can be players with the same number on different teams, and there can be teams with the same name in different leagues.