Is Identifying / Non-Identifying Relationship the same as Mandatory / Optional Relationship?

StackOverflow https://stackoverflow.com/questions/23554059

  •  18-07-2023
  •  | 
  •  

Question

Basically, what is the difference between Identification and Modality of a relationship? If they are the same thing, why MySQL Workbench implements them separately?

Further Explanation:

I get that Identification of a relationship means that the foreign key in the referencing table can be NULL if the relationship is Non-Identifying and cannot be NULL otherwise; And MySQL Workbench implements this feature O.K. Identifying relationships are represented by a bold line while Non-Identifying ones are symboled by dashed-lines.

I was sure until now that modality(Optional/Mandatory Relationship) is the same thing! But MySQL Workbench implements modality compeletely separately. And In ERD it is depicted by "O" or "I" near the Entity. It is shown here.

Was it helpful?

Solution

No.

Identifying/non-identifying relates to child keys. In an identifying relationship, the child record can only exist if the parent record exists. It identifies the child record. An identifying relationship is mandatory in the child table - it forms (all or part of) the key for the child table.

A non-identifying relationship can still be mandatory or optional, it's just that the child record can exist independently from the foreign key.

Mandatory/optional just tells you whether or not the field must have a value. This might be a foreign key field, but it doesn't have to be. If it's mandatory but not a foreign key, you can put any value you wish into the column (as long as it meets the other constraints); it just can't be null.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top