Normalisation Flashcards
(15 cards)
What is a primary key?
An attribute or combination of attributes that uniquely identifies a row
What is a functional dependency?
When one attribute uniquely determines another attribute within a relation. It is a constraint that describes how attributes in a table relate to each other
What is a key?
A set of attributes for which no two tuples in a relation instance have the same values for all attributes of the key
What is a superkey?
When every attribute of a relation is found under the key
What is a candidate key?
A minimal superkey of a Relation
What is a closure in a database?
The full set of attributes that can be determined from a set of known attributes
What anomalies can come from bad relations?
- Redundancy
- Update anomalies
- Insert anomalies
- Deletion anomalies
What are the characteristics of 1st Normal For?
- Relations must be atomic (Cannot be broken down any further, single values, no objections, arrays)
- No repeating groups
What are the characteristics of 2nd Normal Form?
- No partial-key dependencies (Every non-key attribute is dependent on all attributes of all candidate keys)
What are the characteristics of 3rd Normal Form?
All attributes are determined only by the keys (“The key, the whole key, and nothing but the key”)
What is a trivial dependency?
A -> B is a trivial function dependency if B is a subset of A
What are the characteristics of Boyce-Codd Normal Form?
Slightly stronger version of 3NF
- Every determinant is a candidate key (can uniquely identify any row)
“The key, the whole key, and nothing but the key, so help me Codd”
Why is normalisation better?
- No redundancy
- Efficiency
- No duplication
- Changes can cascade across relations
What are the consequences of normalisation?
- More tables
- More complexity
- More relationships
- Queries become more complex
What would be the benefits of denormalisation?
To improve the speed of queries