N
N
NightFantom2014-09-20 23:47:21
MySQL
NightFantom, 2014-09-20 23:47:21

How to implement a database if the site has a choice of cities?

Hello!
Task: Let there be an ad site. The site has the ability to select a city. How to implement a database in such a way that the search takes into account the city and does not have everything in one table (If it's real)?
How are databases built in general, with the possibility of choosing a city?
PS Only I study to design a DB.
Thanks in advance.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan, 2014-09-21
@0neS

ads table with id, city_id, ...
fields cities table with id, ... fields
There is no point in making its own table with ads for each city, this is complete nonsense.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question