A
A
Artem Prokhorov2021-10-07 16:26:25
SQL
Artem Prokhorov, 2021-10-07 16:26:25

How to set different types of links using Foreign key?

Well, that is, the standard assignment of a key to a foreign key and the subsequent description of the foreign key results in a 1 to 1 relationship, but how do you make it clear that the relationship is 1 to many or many to many?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
R
Rsa97, 2021-10-07
@kotcich

In MySQL, the foreign key (Foreign Key) serves only for additional automatic control over the integrity of the database. In a child table, a field cannot take a value that is not included in the list of values ​​of the associated field of the parent table or NULL.
The type of connection in MySQL is not taken into account.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question