I'm having a hard time understanding when to use identifying or non-identifying relationships. I've read some answers here on SO, but I'm still confused. I guess I'm just that slow...
So I've included a picture - of a small part - of my ER diagram that contains drink recipes:
My obvious question is; Which of these relations, if any, should be identified? - and why?
As you can see; I only have one-to-many non-identifying relationship
- which makes me think I must be doing something wrong - but it works though.
The relation between glassware
and recipes
for instance:
Each recipe requires a glass - which means a recipe cannot exist without a glass - I guess. So I've set recipes.fk_glassware_id
to NN
, and the given id must correspond to an id in the glassware
-table. (one glass can span over multiple recipes, therefore one-to-many
). But should it be a identified relationship?
What about the relations between recipes_rel_tags
and recipes
- and tags
-tables. Should any of those be identified relations? No entry in this table can exist without any of the linked tables..
EDIT:
I've added a new picture of my diagram. Now the fk_
's in my _rel_
-tables looks like primarykeys - all of them - when I changed the relationships to identified
.
What does that mean?