6

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?

María Antignolo
  • 388
  • 4
  • 17
andrecoweb
  • 171
  • 1
  • 2
  • 6
  • Referential integrity. See: http://stackoverflow.com/questions/9347917/what-does-a-dashed-dotted-relationship-line-represent-in-sql-management-studio – wally Aug 24 '15 at 14:57
  • 4
    In MySQL Workbench EER Diagrams the dotted line indicates a non-identifying relationship, a solid line indicates an identifying relationship : https://dev.mysql.com/doc/workbench/en/wb-relationship-tools.html – PaulF Aug 24 '15 at 15:30
  • @PaulF why did you add your answer as comment and not as a normal answer? – Mike Lischke Aug 25 '15 at 07: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 Aug 25 '15 at 09:30
  • Also, the documentation was updated after seeing this SO entry. Hopefully it's a little clearer now. – Philip Olson Aug 25 '15 at 15:20
  • Hello PaulF. Do you mind if I add the answer with some example cases? – María Antignolo Feb 03 '20 at 10:06

1 Answers1

9

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.

A l w a y s S u n n y
  • 36,497
  • 8
  • 60
  • 103
María Antignolo
  • 388
  • 4
  • 17