Assume the following Reservations table. Reservation_Number is the only candidate key:
Reservation_Number Guest_Name
------------------ ------------
1 john smith
2 john smith
3 john smith
4 jane doe
5 bob anderson
Is this table in 3rd normal form?
- It doesn't violate 1st normal form. A table is in 1NF when it has a primary key and the domain of each attribute contains only atomic values, and the value of each attribute contains only a single value from that domain. Reservation_Number is the primary key and both Reservation_Number and Guest_Name meet the atomic criteria.
- It doesn't violate 2nd normal form. A table is in 2NF when it is in 1NF and every non-prime attribute of the table is dependent on the whole of every candidate key. Guest_Name is the only non-prime attribute and it is fully dependent on the only candidate key, Reservation_Number.
- It doesn't violate 3rd normal form. A table is in 3NF when it is in 2NF and every non-prime attribute of the table is non-transitively dependent on every superkey of the table. The only non-prime attribute, Guest_Name, is non-transitively dependent on the only superkey, Reservation_Number.
Yet there is redundancy in this table. I could remove these redundancies by:
- creating a Guest table with Guest_Id and Guest_Name.
- replacing Guest_Name in the Reservations table with the Guest_Id FK.
How could the original Reservations table be in 3rd normal form yet have redundancies in Guest_Name? If it is violating the normal forms, then how and why?