Constrainsts in Databases Flashcards
A ________ is a relationship among data elements that the DBMS is required to enforce
constraint
What are 5 types of constraints?
- Functional Dependencies
- Inclusion Dependencies
- Value-based constraints
- Tuple-based constraints
- Assertions
DB instances that satisfy all constraints are called _____
legal
Many kinds of constraints can expressed in ____
RA
What is an equivalent way to represent R (subset) S?
R-S = (empty set)
What is an equivalent way to represent R = (empty set)?
R (subset) (empty set)
_______________ style of expressing constraints is common in SQL
equal-to-emptyset
Give examples of a domain constraint on an attribute
Integers only/ strings of length 20
What is a key constraint?
A set of attributes for a relation that does not allow 2 tuples in a relation instance to have the same values
What is a foreign-key constraint?
A value appearing in the attribute(s) of one relation must also appear as a value in attribute(s) that are a key of another relation
(Foreign) Key constraints are special cases of ____________ dependencies and ___________ dependencies
functional, inclusion
________ dependencies are constraints in the form X -> Y where X, Y are sets of attributes
functional
In FDs, the values of X ________ the values of Y
determines
Why are relation keys are special case of the FD X->Y?
Y is just the whole set of attributes of a relation when determining a key
What form do INDs take?
Constraints of the form R[X] (subset) S[Y]