3
I have been learning Database for some time and do not know the difference. I would very much like to know. On the Internet I found answers, but they are not very enlightening.
3
I have been learning Database for some time and do not know the difference. I would very much like to know. On the Internet I found answers, but they are not very enlightening.
3
Relationships with and without identification are concepts of MER (Entity Relationship Model). In practice, a relationship identifying is the one that is represented by a foreign key that is part of the primary key composition of the referenced table. A relationship unidentified
Giving an example of the real world:
A book belongs to a 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 a relationship unidentified.
A book, however, is written by an author, and the author may have written several books. But the book needs to be written by an author, it cannot exist without one. So the relationship between the book and the author is a relationship identifying.
Example of the relationship identifying:
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)
);
Browser other questions tagged database mysql-workbench relationship
You are not signed in. Login or sign up in order to post.