Forum Moderators: coopster

Message Too Old, No Replies

Lists in a database

         

RammsteinNicCage

3:46 am on Jan 1, 2005 (gmt 0)

10+ Year Member



I'm creating a database for the first time, yay. :) Anyway, I had a question about a list, more specifically a tracklisting, in a database.

I was thinking that I would have a table that would contain all of the albums. Each album would have a field for name, release date, the cover image, the tracklisting, and any additional information about the album (producer, guest vocals, etc in a paragraph with each piece of info on a new line).

So, there are two problems - albums have different numbers of tracks and will have a different amount of lines for the additional information. So, should each get only one field for it? And if so, how would I go about doing that to make sure that each track and info piece will have it's own line?

Jennifer

baze22

7:22 am on Jan 1, 2005 (gmt 0)

10+ Year Member



If it were me....

I'd break it up into probably 3 tables: Artist, Album, Tracks

Sample breakdown might be

Artist
------
artistID
artistname, bio info , etc

Album
------
albumID
artistID
albumname, daterealeased, any other album info

Tracks
------
trackID
albumID
maybe artist ID (depending on how you have searches set up)
any other specific track info

Then all albums by an artist would have that artist's ID. All tracks for that album would have that album's ID. Then it would be easy to pull up albums by an artist and tracks for a given album.

baze

RammsteinNicCage

3:57 am on Jan 2, 2005 (gmt 0)

10+ Year Member



Oops, I should have mentioned that it was just for one artist, but thanks for the tips on the database structure. :) I take it that each track would have it's own row in the tracks table and then I would "link" those to the album in the albums table, right?

Jennifer

baze22

5:18 am on Jan 2, 2005 (gmt 0)

10+ Year Member



That would do it.

baze