Docsity

CS127 HW #2: ER Diagram & Relational Schema for Stan's Kingdom & Musicians' Webapp, Assignments of Database Management Systems (DBMS)

Toggle sidebar
bg1
Fall 2009 CS127 Homework #2 Due: September 28 14:30
Problem 1
The Brutal Police State of Zdonik has a rigid societal structure, people are
organized into several different castes based on knowledge of databases and
contributions to the codebase of DBMSs: Database Professor, Database Pro-
grammer, Database Administrator, and Database Student. The laws of the
society are laid out in Stan’s Code:
1. Professors can advise several students for a certain amount of time, in a
certain place
2. Professors can be contributors to the codebase of multiple databases
3. Codebases for databases have names (unique), lifespans, and can have
several contributors
4. Students may have only one advisor, but one advisor may have several
students
5. Students can only contribute to the codebase of databases their professors
have worked on, and MUST contribute to at least one during their time
as students
6. Database programmers can contribute to the codebase of multiple databases,
but usually only for a few years before moving on
7. Database administrators master one particular database, and so contribute
to the codebase of only one
8. Database administrators are so proud of their mastery, they often advertise
how long they have spent mastering the database they work with
9. Database administrators NEVER work together, guarding their precious
trade secrets, so they do not collaborate with anyone except the program-
mers who designed the database they work with.
Draw the E-R Diagram for Stan’s Kingdom. Give the relational schema.
Problem 2
For each table in the schema of the above problem, identify subset of attributes
which form a primary key or foreign key. Make it clear when the primary key
for the table is the union of multiple attributes.
1
pf2

Partial preview of the text

Download CS127 HW #2: ER Diagram & Relational Schema for Stan's Kingdom & Musicians' Webapp and more Assignments Database Management Systems (DBMS) in PDF only on Docsity!

Fall 2009 CS127 Homework #2 Due: September 28 14:

Problem 1

The Brutal Police State of Zdonik has a rigid societal structure, people are organized into several different castes based on knowledge of databases and contributions to the codebase of DBMSs: Database Professor, Database Pro- grammer, Database Administrator, and Database Student. The laws of the society are laid out in Stan’s Code:

  1. Professors can advise several students for a certain amount of time, in a certain place
  2. Professors can be contributors to the codebase of multiple databases
  3. Codebases for databases have names (unique), lifespans, and can have several contributors
  4. Students may have only one advisor, but one advisor may have several students
  5. Students can only contribute to the codebase of databases their professors have worked on, and MUST contribute to at least one during their time as students
  6. Database programmers can contribute to the codebase of multiple databases, but usually only for a few years before moving on
  7. Database administrators master one particular database, and so contribute to the codebase of only one
  8. Database administrators are so proud of their mastery, they often advertise how long they have spent mastering the database they work with
  9. Database administrators NEVER work together, guarding their precious trade secrets, so they do not collaborate with anyone except the program- mers who designed the database they work with.

Draw the E-R Diagram for Stan’s Kingdom. Give the relational schema.

Problem 2

For each table in the schema of the above problem, identify subset of attributes which form a primary key or foreign key. Make it clear when the primary key for the table is the union of multiple attributes.

Fall 2009 CS127 Homework #2 Due: September 28 14:

Problem 3

Stan is launching a webapp for musicians to share their instruments with other starving bluegrass artists. Suppose that each musician can’t afford to own one of each instrument. In fact, we will call the true owner and maintainer of each instrument a “custodian.” Give a reasonable E/R diagram and relational schema for the following problem:

  1. Each instrument has a type, value, custodian (above), and a registration number (which is specific to each custodian) so that the custodian can keep track of that instrument.
  2. Each renter has a unique name, date, address. A musician might be a renter and/or a custodian as well.
  3. Each custodian has only ONE insurance company for ALL instruments, and ONE insurance policy per instrument.
  4. Each instrument has one custodian. However, one custodian may own many instruments.
  5. Each rental is recorded and is defined as the pairing of an instrument to a renter for some start and end time.
  6. Stan wishes to maintain a record of all bluegrass albums that are affiliated with the webapp. Each album must have a record of attributions to all musicians on the album AND all custodians who contributed instruments to that album.

Problem 4

For each table in the above problem, identify the attribute as a primary key, foreign key, or other attribute. Make it clear when the primary key for the table is a concatenation of multiple columns.