Got a bit stuck, need a hand.
I need to store events at the database, and events may happen at
- different location
- multiple locations
- at the same time
so these are my tables
CREATE TABLE location(id, name, address)
and
CREATE TABLE event (id, name, date)
Where should I add the location in this design?
The simple (id, name, date, location_id REFERENCES location) won't do, because one event may happen at different locations and I don't want to store 2+ rows of the same event since event is unique.
Best Answer
Hmm... I'm a bit confused. By definition, if two events happen at different places, then they're different events.
My advice in this scenario is to tave 3 tables as follows:
And then two other "parent" tables