On 28-Jul-2001 Ben Bleything wrote:
> Hello all!
> 
> I have a question for all of you... I would very much appreciate your
> input.
> 
> I'm building a database for a radio station.  The database must allow
> the DJ to enter what they play and when, and allow the program director
> to create weekly reports for the record labels.

<snip>

Consider the case of the same recording that appears on two albums, the
original release and again on "The Best of ..."

The album is a different entity from the tracks. and they should be
seperate tables:

table album (
 alb_id smallint unsigned auto_increment not null default 0,
 title varchar(60),
 rec_label smallint unsigned,
 primary key (id)
);

table track (
 alb_id smallint unsigned not null,
 trk tinyint unsigned not null,
 genre tinyint unsigned not null default 0,
 title varchar(60),
 play_len smallint unsigned not null default 180,
 artist1 smallint unsigned not null default 0,
 artist2 smallint unsigned        
 unique index idx_at (alb_id,trk),
 index idx_art (artist1)
);

Will give you a range of 65535 albums * 255 tracks.
This should make for a simple play_log:

table play_log (
  dj_id tinyint unsigned,
  playat datetime,
  alb_id smallint unsigned,
  trk_id tinyint unsigned
);


Regards,
-- 
Don Read                                       [EMAIL PROTECTED]
-- It's always darkest before the dawn. So if you are going to 
   steal the neighbor's newspaper, that's the time to do it.
                            (53kr33t w0rdz: sql table query)

---------------------------------------------------------------------
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/           (the list archive)

To request this thread, e-mail <[EMAIL PROTECTED]>
To unsubscribe, e-mail <[EMAIL PROTECTED]>
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php

Reply via email to