Functional Dependencies Flashcards
(77 cards)
How does E-R and Functional Dependencies relate?
What are Functional Dependencies?
In relational database theory, a functional dependency is a constraint between two sets of attributes in a relation from a database. In other words, functional dependency is a constraint that describes the relationship between attributes in a relation.
Explain Assertions on a schema.
Explain Assertions on a domain.
What are FDs really?
What are FDs really?
• Functional dependencies represent a special kind of
constraints of a domain – dependency constraints.
• The database we design should properly capture all
constraints of the domain.
• We can use FDs to verify that our design indeed
captures the constraints we expect, and add more
constraints to the design when needed.
What’s so functional about FDs?
What’s so functional?
• X → A is a (deterministic) function from X
to A. Given values for the attributes in the
set X, we get the value of A.
• Example:
– code → name
– imagine a deterministic function f(code)
which returns the name associated with a
given code.
What is the difference between dependence and reference?
Explain Multiple Attributes on R/LHS
What’s the difference between the LHS of a FD, and a key?
FD: code, period → teacher ?
Given values for a code and a period, starting from any relation where
they appear, is it possible to reach more than one teacher value by following
keys and references?
Explain Trivial FD:s.
Is this a trivial FD?
course, period → course, name
course, period → course, name
Shorthand for
course, period → course (trivial)
course, period → name (not trivial)
Explain Inferring FD:s.
Explain closure of attribute set X.
How do you compute closure?
How to find all the implied FDs?
Simplifying trick to find F+?
Explain how to find keys. What is a super key? Minimal super key?
Schedules(code, name, period, #students,
teacher, room, #seats, weekday, hour)
Are these superkeys?
X = {code, period, weekday, hour}
Y = {code, period, weekday}