Hello,
I just started learning PHP and MySQL (yeah, total noob here...) and I am trying to work out a database design for a basic music database. I learned about normalization, so I decided to draw some tables that break up my data into the most basic parts and visualize the relationships. Please see the first image attachment.
What would be the proper way to model the relationship between the performer of a CD and the band or artist, as a CD could be performed by either a band or an individual artist?
Is my chart "legal"? I don't even know if I can combine two fields like that. I read something about joining fields in MySQL, but so far I'm not sure I'm heading in the right direction.
>>>
If it's any help, here is some additional information.
Some results I will want from the database would be:
- List CD's by a particular band
- List CD's by a particular artist
Listing a CD by an artist should also include bands, because I want to display both solo and collaboration albums on the artist's profile. In other words,
- Band's profile displays only the band's albums
- Artist's profile displays both the artist's and related bands' albums.
My solution to that is to create a separate table which contains band membership info with dates (joined/left the band). This way I can hopefully output album data relevant to a particular artist, because a band could exist before or after a given artist participated. My second attachment is this extra table.
Maybe I could incorporate this extra table to solve my original problem, I'm not sure. I apologize if this is a frequently asked question. I browsed forum and saw similar questions, but couldn't quite make the connection between the answers and my own problem. Thanks
