PDA

View Full Version : Music Database Design help


samuurai
11-20-2007, 04:45 PM
Hi,

I'm creating a music database and I just need a bit of advise regarding design, being fairly new to database design and just need some of my ideas confirmed.

I'm thinking of having three tables.
Tracks
Albums
Artists

However, I will most likely have a lot of duplicated data if I populate the Albums table with all the tracks, because at the end of the day, the Albums have tracks.

So what i'm wondering is, in the Albums table, should I have a text field with comma seperated pointers to the Track_ID of all the tracks included with the album? Or should I have the data duplicated into the Albums table?

What approach would you use?

nikos101
11-20-2007, 05:09 PM
don't use a database for the music files, only store text info about your music

samuurai
11-20-2007, 05:15 PM
EDIT - I understand what you mean now.

Yes, this is what I want to do..... it's for a website and I won't be hosting MP3's, I just want text info, but I need to know how the two tables should relate.

nikos101
11-20-2007, 05:51 PM
I meant use a database only for text. You should store music in a directory on your server.

TheShaner
11-20-2007, 06:10 PM
Ideally you want to reduce duplicate data as much as possible, specifically none if achievable, although there are certain situations where duplicate data will result in faster search times and well worth the extra storage overhead, but i won't get into that, haha.

For a simple database like yours, you can do this with no duplicate data and have very efficient search times.

Here's an example of how to set it up with the tables you have listed with example fields:
Artist table Album table Tracks table
----------- ------------ ------------
*artist_id <-------> *artist_id <------> *artist_id
artist_name *album_number <----> *album_number
artist_start_date album_name *track_number
artist_bio album_genre track_name
album_date track_time
Hope this helps you get started. An asterisk (*) indicates that the field is a key field. If you want to know about normalization, which is in essence reducing duplicate data, you can check this link here: http://en.wikipedia.org/wiki/Database_normalization

-Shane

samuurai
11-20-2007, 09:27 PM
Fantastic reply, thank you! That makes a lot of sense.

I'll read that article now...

Thanks VERY much!