Exercise 4.1.1: Design a database for a bank, including information about customers and their accounts
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. Exercise 4.1.2: Modify your solution to Exercise 4.1.1 as follows: a) Change your diagram so an account can have only one customer. b) Further change your diagram so a customer can have only one account. 4.1. THE ENTITY/RELATIO NSH IP MODEL 139 ! c) 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. ! d) Further modify your diagram so that customers can have a set of addresses, and at each address there is a set of phones. Exercise 4.1.3: Give an E /R diagram for a database recording information about teams, players, and their fans, including: 1. For each team, its name, its players, its team captain (one of its players), and the colors of its uniform. 2. For each player, his/her name. 3. For each fan, his/her name, favorite teams, favorite players, and favorite color. Remember that a set of colors is not a suitable attribute type for teams. How can you get around this restriction? Exercise 4.1.4: Suppose we wish to add to the schema of Exercise 4.1.3 a relationship Led-by among two players and a team. The intention is that this relationship set consists of triples (playerl, player2, team) such that player 1 played on the team at a time when some other player 2 was the team captain. a) Draw the modification to the E /R diagram. b) Replace your ternary relationship with a new entity set and binary relationships. ! c) Are your new binary relationships the same as any of the previously existing relationships? Note that we assume the two players are different, i.e., the team captain is not self-led. Exercise 4.1.5: Modify Exercise 4.1.3 to record for each player the history of teams on which they have played, including the start date and ending date (if they were traded) for each such team. Exercise 4.1.9: Design a database suitable for a university registrar. This database should include information about students, departments, professors, courses, which students are enrolled in which courses, which professors are teaching which courses, student grades, TA’s for a course (TA’s are students), which courses a department offers, and any other information you deem appropriate. Note that this question is more free-form than the questions above, and you need to make some decisions about multiplicities of relationships, appropriate types, and even what information needs to be represented. Exercise 4.4.1: One way to represent students and the grades they get in courses is to use entity sets corresponding to students, to courses, and to “enrollments.” Enrollment entities form a “connecting” entity set between students and courses and can be used to represent not only the fact that a student is taking a certain course, but the grade of the student in the course. Draw an E /R diagram for this situation, indicating weak entity sets and the keys for the entity sets. Is the grade part of the key for enrollments? Exercise 4.4.2: Modify your solution to Exercise 4.4.1 so that we can record grades of the student for each of several assignments within a course. Again, indicate weak entity sets and keys. Exercise 4.4.3: For your E /R diagrams of Exercise 4.2.6(a)-(c), indicate weak entity sets, supporting relationships, and keys. xercise 4.4.4: Draw E /R diagrams for the following situations involving weak entity sets. In each case indicate keys for entity sets. a) 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. ! b) 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. Solve all the exercises with suboptions like a, b, c and all. Please draw a flowchart where it is necessary.
Expert Answer
OR