I have a table in my database that stores musicians in a table as well as an event table. What I’m trying to do is keep track of what musicians played at what event. What is the most efficient way to do this? Should I put the event_id in the musician table and create a new record for each event the musician plays in? Should I create a separate lookup table with the event_id and the musician_id and join on the table when trying to get the musicians that played at a particular event? The problem is I have about 50 musicians currently and they could be playing 50 events per year, that’s a lot of redundant data and there’s also the probability that some will play in more events and that number might increase to 100 musicians at some point. Any ideas?
I have a table in my database that stores musicians in a table as
Share
I won’t lay out the tables for you, but the basic structure would be:
musicians– details about the artists (eg. 50 records)events– details about an event (e.g. 50 records)musicians_events– joint table that lists which events an artist played atThe joint table would consist simply of 2 fields: musician ID an event ID, both being foreign keys back to their respective parent table.
With your stated data size, you’d have 50 musician records, 50 event records, and potentially, 2,500 musician-event records if every musician played at every event.