CS 4250: Database Management Systems

Spring 2022 - Homework 3

Due Tuesday, 3 May 2022, at midnight

This is an individual assignment. All work must be entirely your own. You should not look at any other student's work (in whole or in part, on paper or on screen), nor allow anyone else to look at yours, nor discuss the assignment with other students, during the course of this assignment.

(Strongly prefer plain text. Will accept PDF or MSWord documents, if typed.) Upload to the CS Homework system on or before midnight on 3 May 2022.

  1. Consider a relation R with attributes ABCDEF. You are given the following dependencies B -> A, D -> E, AC -> E.

    1. Attribute closure of B?

    2. Attribute closure of C?

    3. Attribute closure of D?

    4. Attribute closure of AC?

    5. Attribute closure of ABCDEF?

    6. Identify which, if any, of the above are candidate keys.
  2. Consider a relation R with attributes ABCDE. You are given the following dependencies AC -> B, AC -> D, AC -> E, C -> E.

    1. List all (candidate) keys for R.

    2. Is R in 3NF? Why or why not?

    3. Is R in BCNF? Why or why not?

  3. Consider a relation R with attributes ABCDE. You are given the following dependencies A -> B, A -> C, A -> D, A -> E, C -> A.

    1. List all (candidate) keys for R.

    2. Is R in 3NF? Why or why not?

    3. Is R in BCNF? Why or why not?

  4. Consider a relation R with attributes ABCDE. You are given the following dependencies AB -> C, AB -> D, AB -> E, D -> B.

    1. List all (candidate) keys for R.

    2. Is R in 3NF? Why or why not?

    3. Is R in BCNF? Why or why not?

  5. Suppose that we have the following three tuples in a legal instance of a relation schema S with attributes primary_key, A, B and C. (The primary_key field contains the primary key of the table. The 'attribute names' column is not part of the relation; it is only there to name rows and columns so your answers can clearly discuss them.)
    attribute namesprimary_keyA B C
    tuple 114 1 7
    tuple 222 5 6
    tuple 338 5 3

    1. For each of the following dependencies, can you infer whether or not it holds over schema S? Why or why not?
      1. A -> B

      2. B -> A

    2. Can you identify any functional dependencies that hold over fields A, B and / or C? If so, please name one.

      (N.B. primary_key is not on the list of A, B and / or C. FDs involving the primary_key field should not be in your answer.)

  6. Suppose you are given a relation R(A, B, C, D). For each of the following sets of FDs, assume they are the only dependencies that hold for R. Do the following: a) identify the candidate key(s) for R. b) State whether or not the proposed decomposition of R into smaller relations is a good decomposition and briefly explain why or why not.

    1. A -> C, B -> D; decompose into AC and BD.
      1. Candidate keys:
      2. Analysis:

    2. A -> B, B -> C, B -> D; decompose into ABC and BCD.
      1. Candidate keys:
      2. Analysis:

    3. A -> CD, B -> C; decompose into ACD and BC.
      1. Candidate keys:
      2. Analysis:

    4. C -> B, A -> D; decompose into ACD and BC.
      1. Candidate keys:
      2. Analysis:

  7. Suppose you are given a relation R with attributes ABCDEF. You are given functional dependencies F -> E, A -> B, C -> A, and C -> D. Using the decomposition techniques described in class, decompose this relation into relations in "good" normal forms. For each of the new relations you create, identify the normal form it is in.

    If you choose not to decompose the relations into the best normal form we discussed, explain why you made that choice. If there are any interesting issues or potential problems with your decomposition, explain what they are.