V
V
Valentine2018-02-01 14:45:07
MySQL
Valentine, 2018-02-01 14:45:07

Why bind MySQL tables with foreign keys if you still have the ability to select from multiple tables by key?

For example, I have a country (id, country) table and a cities (id, country_id, city) table.
I can say that the country_id in cities is the id in country, but what will it give if you can just leave everything as it is and query the selections from two tables in the same way? And linked tables, even when empty, take up more space. Explain, please.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
T
tema_sun, 2018-02-01
@tema_sun

https://en.wikipedia.org/wiki/Referential_Integrity

V
Valentine, 2018-02-05
@valentinesowl

Thanks

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question