Question regarding efficient table usage in MySQL

60 views Asked by At

I want my users in my web app to be able to sign up for different "events". Each event has things describing it such as name, date of event, the description, and people describing the event. Should I create an individual table for each event? Or should I have an event be a row/column in an event table?

2

There are 2 answers

0
DeveloperChris On BEST ANSWER

In a relational database you would create multiple tables, each one for a different aspect of the event. so you could have an organiser table a location table and an events table

In the event table you would have the id of the organiser and the id of the location, and then data about the event. So the three tables describe the event more fully but you don't need to repeat data. An organiser may have multiple events, at multiple locations. each organiser and location only needs one entry (usually) in their respective tables.

DC

0
Mitch Wheat On

Events would normally be modelled as rows in an Event table.