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

  • 57Unfamiliar
  • 0Learning
  • 0Familiar
  • 0Mastered
Topic: FD Foundations

What does a functional dependency, such as α→β\alpha \to \betaα→β, mean for tuples in a relation?

57 questions

  1. 1

    What does a functional dependency, such as α→β\alpha \to \betaα→β, mean for tuples in a relation?

    Model answer

    Whenever two tuples agree on the attributes in α\alphaα, they must also agree on the attributes in β\betaβ.

    Explanation

    A functional dependency expresses a constraint that holds for every instance of the relational schema.

  2. 2

    How can you determine whether a functional dependency holds in a relation instance?

    Model answer

    Check every pair of tuples: if they match on the left-hand-side attributes, they must match on the right-hand-side attributes.

    Explanation

    This pairwise condition is the defining rule for a functional dependency.

  3. 3

    Which three Armstrong axioms can be used to infer functional dependencies?

    Model answer

    They are reflexivity, augmentation, and transitivity.

    Explanation

    These three basic rules form the foundation for deriving additional functional dependencies.

  4. 4

    What does it mean that Armstrong's axioms are sound and complete?

    Model answer

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

    Explanation

    Together, these properties establish that the axioms provide a correct and sufficient inference system for functional dependencies.

  5. 5

    What is the closure set F+F^+F+ of a set of functional dependencies FFF?

    Model answer

    F+F^+F+ is the set of all functional dependencies that can be inferred from FFF using Armstrong's axioms.

    Explanation

    The closure includes the original dependencies and every additional dependency implied by them.

  6. 6

    If A→BA \to BA→B and B→CB \to CB→C are given, what new dependency follows, and by which axiom?

    Model answer

    A→CA \to CA→C follows by transitivity.

    Explanation

    Any agreement on AAA implies agreement on BBB, which in turn implies agreement on CCC.

  7. 7

    If A→CA \to CA→C, what dependency follows by augmenting both sides with GGG?

    Model answer

    AG→CGAG \to CGAG→CG follows by augmentation.

    Explanation

    Augmentation adds the same attribute set to both sides of a functional dependency.

  8. 8

    Given A→CA \to CA→C, CG→ICG \to ICG→I, and the augmentation rule, how can you derive AG→IAG \to IAG→I?

    Model answer

    First derive AG→CGAG \to CGAG→CG by augmentation, then combine it with CG→ICG \to ICG→I by transitivity to obtain AG→IAG \to IAG→I.

    Explanation

    The right-hand side of the first dependency matches the left-hand side of the second, so transitivity applies.

  9. 9

    State the union rule for functional dependencies.

    Model answer

    If α→β\alpha \to \betaα→β and α→γ\alpha \to \gammaα→γ, then α→βγ\alpha \to \beta\gammaα→βγ.

    Explanation

    When the left-hand sides are identical, their right-hand sides can be combined into one dependency.

  10. 10

    State the decomposition rule for functional dependencies.

    Model answer

    If α→βγ\alpha \to \beta\gammaα→βγ, then both α→β\alpha \to \betaα→β and α→γ\alpha \to \gammaα→γ follow.

    Explanation

    Decomposition splits a dependency with a combined right-hand side into separate dependencies.

  11. 11

    State the pseudo-transitivity rule for functional dependencies.

    Model answer

    If α→β\alpha \to \betaα→β and γβ→δ\gamma\beta \to \deltaγβ→δ, then γα→δ\gamma\alpha \to \deltaγα→δ.

    Explanation

    The first dependency supplies β\betaβ from α\alphaα, allowing the second dependency to be applied when γ\gammaγ is also known.

  12. 12

    Why are union, decomposition, and pseudo-transitivity called derived rules rather than basic Armstrong axioms?

    Model answer

    They can be proved from reflexivity, augmentation, and transitivity, so they are consequences of the three basic axioms.

    Explanation

    The derived rules are sound and useful, but they are not needed as additional axioms for completeness.

  13. 13

    What is the attribute closure α+\alpha^+α+ of an attribute set α\alphaα with respect to FFF?

    Model answer

    It is the set of all attributes that can be functionally determined by α\alphaα using the dependencies in FFF.

    Explanation

    The closure describes the attributes reachable from α\alphaα by repeatedly applying the given functional dependencies.

  14. 14

    Why must an attribute closure be specified with respect to a set of functional dependencies?

    Model answer

    The attributes that can be inferred from a starting set depend on which functional dependencies are available.

    Explanation

    Thus, α+\alpha^+α+ is always computed relative to a particular dependency set such as FFF.

  15. 15

    How is an attribute-closure computation initialized?

    Model answer

    Initialize the result to the starting attribute set α\alphaα.

    Explanation

    Every attribute in α\alphaα is trivially determined by α\alphaα, so it belongs in the closure.

  16. 16

    What update should be made during the computation of α+\alpha^+α+ when β→γ\beta \to \gammaβ→γ is in FFF and β\betaβ is already in the result?

    Model answer

    Add the attributes in γ\gammaγ to the result.

    Explanation

    The current result already contains the attributes needed to determine β\betaβ, and β\betaβ determines γ\gammaγ.

  17. 17

    Why can a closure algorithm add γ\gammaγ when the current result contains β\betaβ and β→γ\beta \to \gammaβ→γ is given?

    Model answer

    The starting set determines the current result, so it determines β\betaβ; since β\betaβ determines γ\gammaγ, transitivity shows that the starting set determines γ\gammaγ.

    Explanation

    This is the reasoning that justifies adding newly implied attributes to the closure.

  18. 18

    When does the iterative computation of an attribute closure stop?

    Model answer

    It stops when another pass through the dependencies adds no new attributes.

    Explanation

    At that point the result no longer changes, so the complete closure has been found.

  19. 19

    Using the dependencies in the example, what attributes are added when computing (AG)+(AG)^+(AG)+?

    Model answer

    Starting with AGAGAG, add BBB and CCC using dependencies from AAA, then add HHH and III using dependencies from CGCGCG; the closure is ABCGHIABCGHIABCGHI.

    Explanation

    Once CCC has been added, the current set contains CGCGCG, which determines both HHH and III.

  20. 20

    How can attribute closure be used to determine whether a set of attributes is a superkey?

    Model answer

    A set is a superkey if its closure contains every attribute of the relation.

    Explanation

    Containing the whole relation in the closure means the set functionally determines every attribute.

  21. 21

    What two properties must be checked to determine whether a superkey is a candidate key?

    Model answer

    It must be a superkey and it must be minimal, meaning none of its proper subsets is a superkey.

    Explanation

    A candidate key is a minimal superkey, not merely any set that determines the whole relation.

  22. 22

    In the example where AGAGAG is a proposed key, what does computing A+A^+A+ show?

    Model answer

    A+A^+A+ contains AAA, BBB, CCC, and HHH, but not all attributes of the relation, so AAA alone is not a superkey.

    Explanation

    The dependencies from AAA yield BBB and CCC, and those allow HHH to be obtained, but the closure does not cover the whole relation.

  23. 23

    Why must every key in the example include attribute GGG?

    Model answer

    Because GGG does not appear on the right-hand side of any given functional dependency, it cannot be derived from other attributes.

    Explanation

    An attribute that cannot be obtained from other attributes must be included in any set that determines the whole relation.

  24. 24

    How can you test whether a proposed dependency α→β\alpha \to \betaα→β follows from FFF without computing all of F+F^+F+?

    Model answer

    Compute α+\alpha^+α+ and check whether it contains every attribute in β\betaβ.

    Explanation

    The dependency follows exactly when the closure of its left-hand side includes its right-hand side.

  25. 25

    How can attribute closures be used to compute the functional-dependency closure F+F^+F+?

    Model answer

    Compute the closure of each relevant attribute set, then include dependencies from each starting set to the attributes in its closure.

    Explanation

    Collecting the dependencies implied by these closures provides an alternative way to obtain F+F^+F+.

  26. 26

    What are the two requirements for a relation to be in BCNF with respect to a set of functional dependencies?

    Model answer

    The relation must be in first normal form, and every dependency in the closure must be trivial or have a superkey on its left-hand side.

    Explanation

    A dependency is trivial when its right-hand side is a subset of its left-hand side; otherwise, BCNF requires the determinant to be a superkey.

  27. 27

    Why does the instructor-with-department relation violate BCNF when department name determines building and budget?

    Model answer

    The dependency is nontrivial, but department name is not a superkey of the combined relation.

    Explanation

    It therefore satisfies neither of the alternatives required by BCNF.

  28. 28

    What general action is taken when a functional dependency violates BCNF?

    Model answer

    Decompose the relation using the violating dependency.

    Explanation

    The decomposition separates the attributes determined by the violating dependency into a smaller relation.

  29. 29

    For a violating dependency α→β\alpha \to \betaα→β on schema RRR, how are the two schemas in the described BCNF decomposition formed?

    Model answer

    Form one schema as α∪β\alpha \cup \betaα∪β and the other as R−(β−α)R - (\beta - \alpha)R−(β−α).

    Explanation

    The second schema removes only the attributes on the right-hand side that are not already in α\alphaα.

  30. 30

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

    Model answer

    One relation contains department name, building, and budget; the other is the instructor relation containing ID, name, salary, and department name.

    Explanation

    The department attributes determined by department name form one schema, while building and budget are removed from the original combined schema.

  31. 31

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

    Model answer

    Their nontrivial dependencies have a key on the left-hand side: instructor ID determines the instructor attributes, and department name determines the department attributes.

    Explanation

    Each relation therefore satisfies the BCNF requirement for every nontrivial dependency described.

  32. 32

    What does it mean for a decomposition of RRR into R1R_1R1​ and R2R_2R2​ to be lossless?

    Model answer

    For every possible instance, naturally joining the decomposed relations reconstructs exactly the original relation, without losing or adding tuples.

    Explanation

    A lossy decomposition can produce extra combinations when the decomposed relations are joined.

  33. 33

    What schema-coverage and overlap conditions are part of the stated lossless-join test?

    Model answer

    The union of the decomposed schemas must cover all attributes of the original schema, and the schemas must share at least one attribute.

    Explanation

    The common attributes provide the basis for joining, while the union condition ensures the original attributes are represented.

  34. 34

    What key condition on the common attributes guarantees lossless joining under the stated test?

    Model answer

    The intersection R1∩R2R_1 \cap R_2R1​∩R2​ must be a key of at least one of the two relations.

    Explanation

    A key on the intersection prevents the join from matching one tuple with multiple competing tuples on that side.

  35. 35

    Why is the instructor-and-department decomposition lossless in the example?

    Model answer

    The relations share department name, which is a key in the department relation.

    Explanation

    The shared attribute identifies a unique department tuple to join with each matching instructor tuple.

  36. 36

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

    Model answer

    Every dependency can be checked using the decomposed relations individually, without joining them back into a larger relation.

    Explanation

    Dependency preservation allows constraints to be verified within the smaller relations.

  37. 37

    Why is dependency preservation desirable in a database design?

    Model answer

    If checking a dependency requires joining decomposed relations, constraint checking can be expensive.

    Explanation

    Natural joins can require substantial computation, so being able to check dependencies on individual relations is preferable.

  38. 38

    In the example with city, street, and ZIP code, which dependencies are given, and which attribute set is a key?

    Model answer

    The dependencies are CS→ZCS \to ZCS→Z and Z→CZ \to CZ→C, and CSCSCS is a key.

    Explanation

    Here CCC, SSS, and ZZZ denote city, street, and ZIP code; together, city and street determine all three attributes.

  39. 39

    Why does the dependency Z→CZ \to CZ→C violate BCNF in the city-street-ZIP relation?

    Model answer

    It is nontrivial, and ZZZ is not a superkey of the relation.

    Explanation

    The dependency therefore fails both alternatives in the BCNF condition.

  40. 40

    What two relations result from decomposing the city-street-ZIP schema using Z→CZ \to CZ→C?

    Model answer

    The decomposition produces ZCZCZC and SZSZSZ.

    Explanation

    The first schema is the union of the determinant and dependent attributes; the second removes the dependent attribute not already in the determinant.

  41. 41

    Why is the ZCZCZC, SZSZSZ decomposition lossless under the stated criterion?

    Model answer

    The relations intersect on ZZZ, and ZZZ determines ZCZCZC, making the intersection a key for the ZCZCZC relation.

    Explanation

    The schemas also cover the original attributes and have a nonempty intersection, so they meet the stated lossless-join conditions.

  42. 42

    Why is the ZCZCZC, SZSZSZ decomposition not dependency-preserving?

    Model answer

    The dependency CS→ZCS \to ZCS→Z cannot be checked in either relation alone because it involves attributes from both.

    Explanation

    Checking that dependency requires joining the decomposed relations to recover the original three-attribute schema.

  43. 43

    What are the first two alternatives in the third normal form condition described in the content?

    Model answer

    For every dependency in the closure, it must be trivial or its left-hand side must be a superkey.

    Explanation

    These are the same two alternatives used in the stated BCNF condition.

  44. 44

    What additional condition distinguishes the described third normal form rule from BCNF?

    Model answer

    Each attribute on the nontrivial part of the right-hand side must belong to some candidate key of the relation.

    Explanation

    This condition provides an alternative for dependencies whose left-hand side is not a superkey.

  45. 45

    Must all the attributes on the nontrivial right-hand side of a dependency belong to the same candidate key for the stated 3NF condition?

    Model answer

    No. Each attribute may belong to a candidate key, and those candidate keys need not be the same.

    Explanation

    The condition is satisfied even if different right-hand-side attributes are contained in different candidate keys.

  46. 46

    What is the relationship between BCNF and third normal form in the described conditions?

    Model answer

    Every BCNF relation is in third normal form, but a relation in third normal form need not be in BCNF.

    Explanation

    BCNF satisfies the first two 3NF alternatives, while 3NF also permits its candidate-key-based relaxation.

  47. 47

    What design goals should a decomposition aim to achieve?

    Model answer

    Each resulting schema should be in a good normal form, the decomposition should be lossless, and it should preferably preserve dependencies.

    Explanation

    These goals seek to reduce design problems without losing the ability to reconstruct data or enforce constraints.

  48. 48

    What problem can occur if a decomposition is lossy?

    Model answer

    It may be impossible to reconstruct the original relation correctly from the decomposed relations.

    Explanation

    A lossy join can fail to reproduce the original data exactly and may introduce extra combinations.

  49. 49

    How can decomposition make dependency checking more expensive?

    Model answer

    A dependency may no longer be checkable in one decomposed relation, so the system may need to join relations before checking it.

    Explanation

    The need for joins to verify constraints is one reason dependency preservation matters.

  50. 50

    Why can queries become more expensive after decomposition?

    Model answer

    A query that could use one original relation may need to retrieve data from multiple decomposed relations and join them.

    Explanation

    For example, finding an instructor's building after the instructor-department decomposition requires consulting the department relation as well.

  51. 51

    Why may database design require trade-offs among normalization goals?

    Model answer

    Decomposition can reduce redundancy and anomalies but may increase query or constraint-checking costs; keeping relations less decomposed can retain those costs in the opposite direction.

    Explanation

    Designers must weigh the consequences of redundancy, reconstruction, dependency checking, and query performance.

  52. 52

    How can a relation be in BCNF yet still contain substantial redundancy involving instructor children and phone numbers?

    Model answer

    If each instructor can have multiple children and multiple phones, combinations of those independent facts can be repeated even when there are no nontrivial functional dependencies.

    Explanation

    The example relation stores instructor ID, child name, and phone, and the repetition arises from the multiple values rather than from a functional dependency.

  53. 53

    Why does the instructor-child-phone relation satisfy BCNF despite its redundancy?

    Model answer

    It has no nontrivial functional dependencies, so there is no nontrivial dependency that violates the BCNF condition.

    Explanation

    BCNF checks functional dependencies and therefore does not detect this source of redundancy.

  54. 54

    What insertion and update anomalies can arise in the instructor-child-phone example?

    Model answer

    Adding a phone number may require multiple tuples when an instructor has multiple children, and updating repeated information may require changes in multiple tuples.

    Explanation

    The same instructor information is repeated across combinations of children and phone numbers.

  55. 55

    How can decomposing the instructor-child-phone relation reduce the described anomalies?

    Model answer

    Store children in one relation and phone numbers in another, so each kind of multiple-valued information is represented separately.

    Explanation

    Separating the independent facts avoids repeating every child-phone combination in one table.

  56. 56

    What does this example show about the limits of BCNF and third normal form?

    Model answer

    A relation can already be in BCNF, and therefore also in third normal form, while still having redundancy and anomalies that these forms do not remove.

    Explanation

    The example's redundancy is not captured by nontrivial functional dependencies.

  57. 57

    Which higher normal form is identified as relevant to the instructor-child-phone problem?

    Model answer

    Fourth normal form is identified as a higher normal form that addresses this kind of problem.

    Explanation

    The example motivates considering normal forms beyond BCNF and third normal form.

1 of 57
Question 1 of 57

Ask anything

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

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent