Jump to content

Advice about database Music Structure


samona

Recommended Posts

Hi,

 

I was wondering if I could get some advice/comments/critiques on the database below.  I want to make sure I'm going about this database correctly.

 

Thanks.

 

CREATE TABLE IF NOT EXISTS `Artists` (
  `ArtistID` mediumint( unsigned NOT NULL auto_increment,
  `ArtistName` varchar(255) default NULL,
  `ArtistNotes` varchar(255) default NULL,
  `ArtistLink` varchar(255) default NULL,
    PRIMARY KEY  (`ArtistID`)
) ENGINE=MyISAM;

CREATE TABLE IF NOT EXISTS `Tracks` (
  `TrackID` mediumint( unsigned NOT NULL auto_increment,
  `TrackTitle` varchar(255) default NULL,
  `TrackNumber` varchar(255) default NULL,
  `TrackLength` varchar(255) default NULL,
  `TrackCategory` varchar(255) default NULL,
    PRIMARY KEY  (`TrackID`)
) ENGINE=MyISAM;

CREATE TABLE IF NOT EXISTS `Categories` (
  `CategoryID` mediumint( unsigned NOT NULL auto_increment,
  `CategoryDescription` varchar(255) default NULL,
    PRIMARY KEY  (`CategoryID`)
) ENGINE=MyISAM;


CREATE TABLE IF NOT EXISTS `Recordings` (
  `RecordID` mediumint( unsigned NOT NULL auto_increment,
  `RecordTitle` varchar(255) default NULL,
  `RecordArtist` varchar(255) default NULL,
  `RecordCategory` varchar(255) default NULL,
  `RecordLabel` varchar(255) default NULL,
  `RecordNotes` varchar(255) default NULL,
  `RecordFileLocation` varchar(255) default NULL,
  `RecordDate` varchar(255) default NULL,
    PRIMARY KEY  (`RecordID`)
) ENGINE=MyISAM;

Link to comment
https://forums.phpfreaks.com/topic/187755-advice-about-database-music-structure/
Share on other sites

Here's the problem, and it's not necessarily a problem with your setup: We don't know what you're trying to achieve with this database. You can structure a database several ways and each way be just as good as the other, it really just depends on how you're gonna be using it and what you're gonna be doing with it.

Thanks for the reply.  Basically what I want to do is set up a website with information about artists, thri music, and their  bios.  People should be able to search for singers by name, by song, and search for music by category.  I'm not sure if I'm making it too complicated.

I think in this situation I would set it up somewhat similar to how you have it. I would have 3 tables: artist info, albums, tracks. I'm not sure what you're using "categories" for, but I think it could be used as a column in your albums tables (If I am thinking of this correctly) Inside albums, I would have a column that refers to an artist id and in the tracks I would have a column to reference to an album id. That way you can keep everything tied together. Hope this helps a bit!  ;)

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.