Chapter 9 (9.8 & 9.10)
What is a reference tuple
A FK value that is referencing the tuple containing the matching CK value
What is a simple candidate key?
A candidate key that is not composite.
What is a foreign key?
A foreign key is a set of attributes of some relvar R2 whose values are required to match values of some candidate key of some relvar R1.
A foreign key in R2 is a set of attributes of R2, say FK, such that:
A.) There exists a relvar R1 (R1 and R2 not necessarily distinct) with a candidate key CK. B.) It is possible to rename some subset of the attributes of FK, such that FK becomes FK' (say) and FK' and CK are of the same (tuple) type. C.) For all time, each value of FK in the current value of R2 yields a value for FK' that is identical to the value of CK in some tuple in the current value of RI.
What type of relvars have candidate keys?
All types, including views.
How many candidate keys do relvars have?
At least one candidate key.
What is a referential path?
Chain of arrows that show a referential constraint
What are the two types of keys called if a relvar has two or more candidate keys?
Exactly one key is a primary key, and the others are alternate keys.
If SK is a super key for relvar R and A is an attribute of R, then the ____ _____ SK ⇒A holds for all attributes A of R
Functional dependency
What is a candidate key definition short for?
It is really just short hand for a certain relvar constraint.
What is a Candidate Key?
K is a candidate key for R if and only if it has both of the following properties: a) Uniqueness: No legal value of R ever contains two distinct tuples with the same value for K. b) Irreducibility: No proper subset of K has the uniqueness property.
What is a composite candidate key?
One involving two or more attributes
What is a superset of a candidate key?
Superkey. Superkey has the uniqueness property but not necessarily the irreducibility property.
What is candidate key inference?
System uses it to determine if keys can or must be declared
What happens if the relvar has only one candidate key?
The candidate key is considered the primary key.
What is referential integrity?
The database must not contain any unmatched foreign key values?
What is the basic tuple-level addressing mechanism in the relational model?
The only system-guarenteed way of pinpointing some specific tuple is by means of some candidate key value
How do you represent the referential constraints on a database?
Use a referential diagram.
What is a "view"?
Virtual relvars
Is it possible for a given relvar to have two or more candidate keys?
Yes
What does a foreign key represent to a tuple containing the matching CK value?
a reference