7

In the use of table relationship. What is the difference in the use of solid line and dotted line?

For Example

TABLE : MESSAGES / TABLE : USERS

An User have 0 or Many Messages.

Solid line or Dotted Line?

6
  • Referential integrity. See: stackoverflow.com/questions/9347917/…
    – wally
    Commented Aug 24, 2015 at 14:57
  • 4
    In MySQL Workbench EER Diagrams the dotted line indicates a non-identifying relationship, a solid line indicates an identifying relationship : dev.mysql.com/doc/workbench/en/wb-relationship-tools.html
    – PaulF
    Commented Aug 24, 2015 at 15:30
  • @PaulF why did you add your answer as comment and not as a normal answer? Commented Aug 25, 2015 at 7:06
  • @MikeLischke: I just looked at it as telling the OP to read the documentation which is not something I should get any credit for. I guess I could put it there so it can be marked as answered for future reference.
    – PaulF
    Commented Aug 25, 2015 at 9:30
  • Also, the documentation was updated after seeing this SO entry. Hopefully it's a little clearer now. Commented Aug 25, 2015 at 15:20

1 Answer 1

10

As stated at the comments, a dotted line indicates non-identifying relationship.

SOLID LINE => IDENTIFYING relationship

Definition from mySQL docs: An identifying relationship is one where the child table cannot be uniquely identified without its parent. Typically this occurs where an intermediary table is created to resolve a many-to-many relationship. In such cases, the primary key is usually a composite key made up of the primary keys from the two original tables.

Example: We have an application that registers the arrival time of the employees with this model:

user { id_user, name, department, job } 
arrival_log { id_user, arrival_time, department }

Each row of arrival_log requires the user_id to be specified. Without the user_id, we wouldn't know who reached the offices. The entity arrival_log is a weak one because it depends on other entities' existence (user) to work.

DOTTED LINE => NON-IDENTIFYING relationship.

Definition: A non-identifying relationship is one where the child can be identified independently of the parent.

Example:

flower( flower_id, flower_latin_name, flower_type_id )
flower_type( flower_type_id, name, description )

The relationship between flower and flower_type is non-identifying because each flower_type can be identified without having to exist in the flower table.

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.