1. Home
  2. Explore
  3. Computer Science
  4. Functional Dependencies

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

Functional Dependencies

  • 48Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: FD Foundations
  • spaceFlip card
  • KI knew it
  • DI didn't know it
  • ←Previous card
  • →Next card

What does a functional dependency mean in a relational schema?

Tap to flipClick to flipspace

If two tuples agree on the attributes on the left-hand side, they must also agree on the attributes on the right-hand side.

Or swipe the card

48 cards

  1. What does a functional dependency mean in a relational schema?

    If two tuples agree on the attributes on the left-hand side, they must also agree on the attributes on the right-hand side.

  2. What does it mean for a functional dependency to hold in every instance of a schema?

    Every valid instance must satisfy the dependency: matching left-hand-side values imply matching right-hand-side values.

  3. What are Armstrong’s three basic inference rules for functional dependencies?

    Reflexivity, augmentation, and transitivity.

  4. What is the closure of a set of functional dependencies, written F-plus?

    The set of all functional dependencies that can be inferred from F.

  5. If A determines B and B determines C, what additional dependency follows?

    A determines C.

  6. What does it mean for Armstrong’s inference rules to be sound and complete?

    Soundness means they derive only dependencies that follow from the given dependencies; completeness means they can derive every dependency that follows.

  7. What does the union rule infer when the same attributes determine two different sets?

    If X determines Y and X determines Z, then X determines the union of Y and Z.

  8. What does the decomposition rule infer from a dependency with multiple right-hand-side attributes?

    If X determines the union of Y and Z, then X determines Y and X determines Z separately.

  9. What does pseudo-transitivity infer from X determining Y and ZY determining W?

    The union of Z and X determines W.

  10. Why are union, decomposition, and pseudo-transitivity called derived rules?

    Because each follows from the three basic Armstrong rules: reflexivity, augmentation, and transitivity.

  11. Are the derived rules sound, and are they needed for completeness?

    They are sound, but they are not needed for completeness because they follow from the basic Armstrong rules.

  12. How can two dependencies with the same left-hand side be combined using the union rule?

    Keep the common left-hand side and combine the right-hand sides. For example, if X determines Y and X determines Z, then X determines both Y and Z.

  13. How can a closure of functional dependencies be computed by repeated inference?

    Start with F, repeatedly apply reflexivity, augmentation, and transitivity, and add every newly derived dependency until no new ones appear.

  14. Why does the repeated procedure for computing F-plus eventually stop?

    A finite set of attributes permits only finitely many functional dependencies, so eventually no new dependencies can be added.

  15. What is the closure of an attribute set X with respect to F?

    X-plus is the set of all attributes that can be functionally determined by X using dependencies in F.

  16. How do you compute the closure of an attribute set?

    Start with the attributes in X. Whenever a dependency has a left-hand side already contained in the current set, add its right-hand-side attributes. Repeat until the set stops growing.

  17. Why does the attribute-closure algorithm begin with X itself?

    Every attribute in X is already determined by X, so X must be included in X-plus.

  18. What does it mean to apply a dependency while computing X-plus?

    If the dependency’s entire left-hand side is in the current closure, add its right-hand-side attributes.

  19. How can you test whether a proposed dependency X determines Y follows from F?

    Compute X-plus and check whether it contains every attribute in Y.

  20. How can attribute closure be used to test whether X is a superkey?

    Compute X-plus and check whether it contains every attribute of the relation.

  21. What two conditions make a superkey a candidate key?

    It must determine every attribute of the relation, and no proper subset of it may also be a superkey.

  22. In the example with attributes A, B, C, G, H, and I, what is the closure of AG?

    AG-plus contains A, B, C, G, H, and I, so AG is a superkey.

  23. In the same example, why is AG a candidate key rather than just a superkey?

    Neither A-plus nor G-plus contains all the relation’s attributes, so neither proper subset is a superkey.

  24. How can the closure of a set of functional dependencies be obtained using attribute closures?

    For each attribute set X, compute X-plus; for every attribute set Y contained in X-plus, include the dependency X determines Y.

  25. What is the BCNF condition for a functional dependency?

    For every dependency in the closure, either the dependency is trivial or its left-hand side is a superkey.

  26. What prerequisite normal form must a relation satisfy before it can be in BCNF?

    It must be in first normal form.

  27. What is a trivial functional dependency?

    A dependency whose right-hand-side attributes are all included in its left-hand side.

  28. Why does the department-name dependency violate BCNF in the instructor-with-department relation?

    Department name determines building and budget, but it is neither a trivial determinant nor a superkey of the full relation.

  29. How is a relation decomposed when a dependency X determines Y violates BCNF?

    Create one relation containing X and Y, and another containing the original attributes except the attributes in Y that are not already in X.

  30. How does the instructor-with-department relation decompose using department name determining building and budget?

    One relation contains department name, building, and budget; the other contains the instructor attributes, including ID and department name.

  31. Why are the resulting instructor and department relations in BCNF in the example?

    Their nontrivial dependencies have a key on the left-hand side: instructor ID in the instructor relation and department name in the department relation.

  32. What does it mean for a decomposition to be lossless?

    Joining the decomposed relations must recover exactly the original relation for every valid instance, without adding spurious tuples.

  33. What is a useful lossless-join test for decomposing a relation into two relations?

    The relations must together cover the original attributes, and their common attributes must functionally determine all attributes of at least one of the two relations.

  34. Why does having common attributes help two decomposed relations be joined?

    The common attributes provide the basis for matching tuples in the natural join.

  35. Why does a common attribute set that is a key in one component support a lossless join?

    The key identifies at most one matching tuple in that component, preventing the join from creating extra tuple combinations.

  36. What does it mean for a decomposition to preserve functional dependencies?

    Each dependency can be checked using the individual decomposed relations, without joining them back together.

  37. Why is dependency preservation important for database design?

    Checking a dependency by joining relations can be expensive, so it is preferable to check dependencies in individual relations.

  38. Does BCNF decomposition always preserve functional dependencies?

    No. A BCNF decomposition can be lossless but still fail to preserve some functional dependencies.

  39. In the city-street-zip example, what happens when the dependency zip determines city is used for BCNF decomposition?

    The relation decomposes into zip-city and street-zip relations.

  40. Why is the city-street-zip decomposition lossless but not dependency-preserving?

    The shared zip attribute determines the entire zip-city component, supporting a lossless join; however, city-and-street determining zip cannot be checked in either component alone.

  41. What are the three main goals to consider when normalizing a relational schema?

    Use well-formed relations, ensure lossless reconstruction, and preferably preserve dependencies.

  42. What can go wrong if a decomposition is lossy?

    The original relation may not be reconstructible exactly; joining the components can produce spurious tuples.

  43. How can decomposition affect query cost?

    Queries that previously used one relation may need joins across multiple relations, making them more expensive.

  44. Why can normalization goals involve trade-offs?

    A decomposition may reduce redundancy and anomalies but increase the cost of queries or make some dependencies harder to check.

  45. Does being in BCNF guarantee that a relation has no redundancy or anomalies?

    No. A relation can satisfy BCNF and still have redundancy and insertion or update anomalies.

  46. Why can an instructor table containing instructor ID, child name, and phone number have redundancy even if it is in BCNF?

    An instructor may have multiple children and multiple phone numbers, producing combinations that repeat the instructor’s information.

  47. What anomalies can occur in an instructor-child-phone table with multiple children and phone numbers?

    Adding a phone number may require multiple tuples, and updating repeated information may require changing it in multiple tuples.

  48. Why might a relation with independent multiple-valued facts require a normal form beyond BCNF?

    Its redundancy is not captured by functional dependencies, so BCNF—and even 3NF—may not remove the problem; a higher normal form such as 4NF may be needed.

Card 1 of 48
Card 1 of 48

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent