L7 Integrity Contraints Flashcards
What are integrity contraints?
Integrity constraints are logical statements that restrict the set of allowable relations in a database.
What is the relationship between Keys and Functional Dependencies (FD)?
Keys are special cases of Functional Dependencies (FDs).
for instance: Stating that DNAME is a key of DEPT, means that no two distinct tuples in r2 have the same DNAME.
What are inclusion dependencies?
The existence of attributes in a table R whose values must be a subset of the values of the corresponding attributes in another table S
What is the relationship between Foreign Keys and Inclusion Dependencies?
Foreign keys are special cases of Inclusion dependencies (IND).
What is a foreign key?
A foreign key is a field (or collection of fields) in one table that uniquely identifies a row of another table
What are data dependencies?
Constraints that depend on the equality or inequality of values in tuples of relations are called data dependencies.
Name two examples of data dependencies.
FDs and INDs are data dependencies
What are domain dependencies?
Constraints that restrict the allowable domain values are called domain dependencies (DDs)
Name an example of a domain dependency (DD).
- An example of a DD is that SALARY ranges between 15 and 40.
- Another example of a DD is that ENAME is a string of at most 25 characters.
What are cardinality constraints?
Constraints that restrict the cardinality of a projection of a relation onto a set of attributes are called cardinality constraints (CCs)
What are cardinality contstraints (CC)?
Constraints that restrict the cardinality of a projection of a relation onto a set of attributes are called cardinality constraints (CCs)
Name an example of a cardinality constraint (CC)?
- An example of a CC is that there should not be more managers than employees.
- Another example of a CC is that the number of students doing the MSc course should not exceed 100.
What is a functional dependency?
An FD over R is a statement of the form R: X →Y where X and Y are subsets of schema(R).
We say that X functionally determines Y .
An FD X → Y is satisfied in a relation r, if whenever two rows in r have the same X -value they also have the same Y -value.
An FD X → Y is satisfied in a relation r , if for each X -value of r there is at most one Y -value.