Reputation: 4256
I have a database where I store an undefined number of events. I also have an application which reads that database in order to show those events.
In my app people can put comments about that database, so my question is:
Where do I store those comments?
I have thought two ways:
OPTION I -> Create a table for each event and then store that event comments there (could I have problems if too many tables are saved?)
OPTION II -> Create a table for all comments of all events and identify each comment with an Event ID field
I accept any suggestion. I do it all about performance :)
Upvotes: 0
Views: 22
Reputation: 204746
Use one Comments table and refer to the event (Option 2). That table could look like this
comments table
--------------
id int PK auto_increment
event_id int FK
content text
Upvotes: 2