What is the difference between the relationship with "identification" and "non-identification" relationship (Mysql Workbench)

2

I've been learning Database for some time and I do not know the difference. I would very much like to know. On the internet I even found answers, but they are not very enlightening.

    
asked by anonymous 02.05.2015 / 17:56

1 answer

1

Relationships with and without identification are concepts of MER (Model Entity Relationship). In practice, a ID relationship is one that is represented by a foreign key that is part of the composition of the primary key of the referenced table. An unidentified relationship

Giving an example of the real world:

A book belongs to one person, and the person can have several books. But the book can also exist without the person and he can change ownership. The relationship between a book and an owner is an unidentified relationship .

A book, however, is written by one author, and the author may have written several books. But the book needs to be written by an author, it can not exist without one. So the relationship between the book and the author is a relationship with identification .

Example of the relationship with identification :

CREATE TABLE LivroAutores (
  autor_id INT NOT NULL,
  livro_id INT NOT NULL,
  PRIMARY KEY (autor_id, livro_id),
  FOREIGN KEY (autor_id) REFERENCES Autores(autor_id),
  FOREIGN KEY (livro_id) REFERENCES Livros(livro_id)
);
    
02.05.2015 / 19:34