Create multiple tables or just one

What is the best approach in this case:
Create a single address table (id, country, city, boulevard, street)

or do 3 as follows:

country (id, country)
cities (id, city, id_country)
address (id, id_country, id_city, boulevard, street)

or

country (id, country)
cities (id, city, id_country)
address (id, id_city, boulevard, street)

-1
source share
2 answers

It is not possible to answer reliably since there is not enough information. The answer depends on your requirements.

, , / -, .

  • : , DB , , ( , )
  • . --, , ( , , , .. )

"" ( , ..) , . ( , , , , ).

  • : , ,
  • : , ,

- . , , (, ) .

, /. , .

+4

, , . . .

, . E- . .

, , , , , , . , .

, .

+1

Source: https://habr.com/ru/post/1656442/


All Articles