I working on a website, some of the features are similar to Stackoverflow.
One of them is it has multiple items of a type(in SO assume, multiple question).
Each item is related to multiple values of another type(City).(In SO assume, each queston is related to multiple tags. a tag is entry from a table say Tags).
Hence my tables are:
Cities(Id, Name, IsAcive)
MyItems(Id, DisplayText, AciveInCities)
Here one myitems
entry can be active in multiple cities.
My question is how should I define AciveInCities
column in database. A comma separated CityIds or comma separated city names or some where in different table?
This is a web application where I would like to user be able to search MyItems by cities. Hence saving cityname/id in same table could be fast.
Are there any problems with any of these three approaches?
If this is duplicate question please redirect me to correct one, I could not find one.
Thanks