I’ve been playing around with Active Record a bit, and I have noticed that A.C./ORM always uses the following database model when creating a one-to-one relationship
Person
id | country_id | name | …
Country
id | tld | name | …
No I wondered, isn’t this a violiation of the third Normal Form? This clearly states “Every non-prime attribute is non-transitively dependent on every key of the table”. Well this country_id isn’t dependent of personid is it?
So is this wrong or am I just not getting the point?
A functional dependency, A => B, means that each distinct value of A can, by definition, only be associated with a single value of B. In other words, if you know A, then B is a given. In this case, a given
personidcan only be associated with onecountry_id, thereforepersonid => country_id.