What you are seeing here is most probably the most important child pattern.
I would assume that we need to start from the standard parent-child relationship of "one kitchen
employs one-or-more chef
s". So we would have a foreign key in the cuisinier
/ chef table that contains the ID of the atelier_cuisine
/ kitchen where the cuisinier
in question works.
But for some reason, the kitchen must be able to point at the most important cook/chef working there. Only that numCuisinier
or chefID / cookID is a poor naming of that foreign key column, as it misleads, just as it mislead us in your example. If you gave it a name like numCuisinierChef
or "chef/cook in chief ID", the column name would be self-explanatory.
But, the way the columns were named here, it could also be just the other way around: a chef/cook works in one or more kitchens, but one kitchen is his or her most important employer.
Without a documentation or comments in the data model, you're fried, really ...
Hope this helps rather than confuses - as the data model and the naming does ...
Maybe one clue. MarceloBarbosa actually inspired me to that:
If , in atelier_cuisine
, numCuisinier
is null-able, and , in cuisinier
, numCuisine
is NOT NULL, then atelier_cuisine
is the parent, and cuisinier
is the child, and vice-versa.
Marco the Sane
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…