I’ve got a question about a database design. I’m making a webpage where users can create events (i.e user ‘Jane’ creates an event called ‘My Birthday Party’).
Other users are able to join this event, so user ‘John’ could attend Janes event ‘My Birthday Party’.
In order for Jane to see who and how many guests (users) are coming to her birthday party is it necessary to create a relation table between users and events?
Let’s say 100 guests (users) are attending, that would require me to make 100 rows in a relation table which links each user to the event. Can this be done otherwise?
Thanks in advance, if anything is unclear please tell me 🙂
Yes, you will want to create a
JOINtable for the users and the events. Similar to this:Then to query, you would use something like this: