Database Management Systems CSC 5-415

Assignment #1  Courtesy ( Arthur Keller, UCSC)

LOGISTICS AND LATE POLICY REMINDER

THE ASSIGNMENT

  1. We would like to design a database to maintain information about hospital staff, including doctors and nurses, and patients at the hospital. The information we need includes:

    Specify an entity-relationship diagram for this database. Don't forget to underline key attributes and include arrowheads indicating the multiplicity of relationships. Note that there is no single right answer to this question, although some answers may be better than others.

  2. The following E/R diagram is an attempt to design a database in which a store keeps a permanent record of customers (identified by social-security numbers) and the items they buy (identified by a unique item ID assigned by the store).

    However, there is a problem with this design, related to our ability to recover the history of, say, orders by a particular customer for a particular item.

    (a)
    Explain what the problem is and propose a solution.

    (b)
    Draw a revised E/R diagram that implements your solution.

  3. Consider an E/R diagram such as the one below, with a ternary relationship and arrows entering two of the related entity sets, A and B.
     / \
    |---| / \ |---|
    | A |<------------- ------------->| B |
    |---| \ / |---|
    \ /
    |
    |
    |---|
    | C |
    |---|
    There is a correct interpretation, which is that, given A and C entities, there is at most one related B entity, and, given B and C entities, there is at most one related A entity. There is also an incorrect interpretation "given a C entity, there is at most one related A entity and at most one related B entity."

    (a)
    Give an example of a relationship set that meets the correct interpretation of the diagram but does not meet the incorrect interpretation. You may use abstract entities, like a1, a2, b1, and so on, or you may give the entity sets a real interpretation (e.g., movies), and use actual values in the triples of your relationship set.

    (b)
    Does every relationship set that satisfies the incorrect interpretation also satisfy the correct interpretation? Justify your answer.

    (c)
    On the other hand, if the incorrect interpretation is what we want to say, there is another E/R diagram that says it. Draw this diagram.

  4. In this problem, we shall design a database involving cities, the countries they are in, and "consulates." The relevant information:

    Draw an E/R diagram that represents, as best you can, the information described above. Do not forget to indicate keys, possible weak entity sets, and arrows on relationships where appropriate.