Tables Flashcards
💗💗Integrity Constraints💗💗
💗What is an Integrity Constraint? 💗Domain Constraint? 💗Key Constraint? 💗Entity Integrity Constraint? 💗Referential Integrity Constraint? 💗Table Constraint? 💗Assertions?
💗Integrity Constraints - is a condition specified on a database
table and restricts the data that could be stored in the table.
💗Domain Constraint - value in the column must be drawn
from the domain associated with that column.
💗Key Constraint - cannot insert duplicate values into the
primary key.
💗Entity Integrity Constraint - primary key values cannot be
null.
💗Referential Integrity Constraint -
💗Table Constraint - constraints within tables
💗Assertions - constraints between multiple tables
What is Normalization (Schema Refunement) ?
Normalization is a database design technique that reduces data redundancy and eliminates undesirable characteristics like Insertion, Update and Deletion Anomalies.
2 Properties of decomposition?
- – Loss - less join property
- – Dependency preserving property
Normal Forms have been proposed to preserve above properties.
What is functional dependency?
Functional Dependency is a relationship that when one attribute uniquely determine another attribute.
😁 Normal Forms?
😁 Normal Forms - refers to a series of tests performed on relational schemas to improve their goodness.
😁 1st Normal Form?
😁 Steps from UNF to 1NF?
😁 1st Normal Form - A relation in 1st normal form, if domains of all attributes in that relation are atomic. (simple & indivisible)
Avoid multivalued & composite attributes.
😁 Steps from UNF to 1NF -
– Remove the outermost repeating group and create a new relation.
– Add to this relation a copy of the PK of the original relation.
– Name the new relation.
– Repeat steps until no more repeating groups.
😁 2nd Normal Form?
😁 Steps from 1NF to 2NF?
😁 2nd Normal Form - A relation is in 2nd normal form if every non-prime attribute in the relation is not partially dependent on any key of the relation.
😁 Steps from 1NF to 2NF
– Remove the attributes that are only partially functionally dependent on the composite key, and place them in a new relation.
– Add to this relation a copy of the attributes which are the determinants of these offending attributes. These will automatically become the primary key of this new relation.
– Name the new relation.
– Rename the original relation.
😁 3rd Normal Form?
😁 Steps from 2NF to 3NF?
😁 3rd Normal Form - A relation is in 3rd normal form if the relation is in 2NF and no non-prime attribute is transitively dependent on any key.
😁 Steps from 2NF to 3NF
– Remove the offending attributes that are transitively dependent on the non-key attribute(s), and place them in a new relation.
– Add to this relation a copy of the attributes which are the determinants of these offending attributes. These will automatically become the primary key of this new relation.
– Name the new relation.
– Rename the original relation.
Boyce - Codd Normal Form?
A relation is in BCNF if every determinant is a super key.