Databases
Functional dependencies and normal forms
Closure, candidate keys and 1NF to BCNF, which exist to remove redundancy and update anomalies.
In two minutes
One idea to a line
The closure of a set X is everything X determines using the dependencies. X is a superkey exactly when its closure is all attributes.
2NF: no non-prime attribute depends on part of a candidate key. 3NF: for every dependency X → A, X is a superkey or A is prime. BCNF: for every dependency, X is a superkey.
Every BCNF relation is in 3NF, and every 3NF relation is in 2NF. A relation with only single-attribute keys is always in 2NF.
Decomposition into 3NF can always be lossless and dependency preserving. BCNF can always be lossless but may lose a dependency.
A prime attribute is one that belongs to some candidate key.
Slips people make here
Interviewers know them too
Checking only the first candidate key when finding prime attributes.
Applying the dependencies once instead of until the closure stops growing.
Saying 3NF means "no transitive dependency" without the prime attribute exception.
Your practice here
Not started
10 written questions, and 3 kinds of calculation that change every time
No answers yet