Pupeno wrote:

Now that I'm thinking about a fourth solution: Have two totally separate tables for groups and persons (this is what I really like) and then, one table to relate songs to persons, and another table to relate songs to groups. The problem with that is that, sometimes, I need to get all the musicians that are related to a song, including both, persons and groups, to just list them, BUT, with some identification if it's a person or a group, so in the listing I can do some exceptions.



- how about...

- 6 tables:
PERSON
* person_id
* name

GROUP
* group_id
* name

PERSON-TO-GROUP LINK TABLE
* person_id
* group_id

ALBUM
* album_id
* title

SONG
* song_id
* title
* album_id

SONG-TO-PERSON-OR-GROUP LINK TABLE
* song_id
* person_id
* group_id
* role (performer, lyricist, etc.)

- left joins across song-to-person-or-group and person and group will return whichever is the case.

- ian

--
+-------------------------------------------------------------------+
| Ian Sales                                  Database Administrator |
|                                                                   |
|                              "If your DBA is busy all the time... |
|                               ...he's not doing his job properly" |
| eBuyer                                      http://www.ebuyer.com |
+-------------------------------------------------------------------+


-- MySQL General Mailing List For list archives: http://lists.mysql.com/mysql To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]



Reply via email to