Small Music Store Database [ER HELP]

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • ra1N1
    New Member
    • Aug 2013
    • 1

    #1

    Small Music Store Database [ER HELP]

    I am creating a small music store db to store about 100 songs and artists. and i'm going to create some forms so data can be added through a frontend. The tables i'm using are -

    _Customers (reg info)
    _Artist (link with songs)
    _Songs (link with artist, 100 atm.)
    _Playlist (some playlists created),
    _Transaction (displays what songs customers bought).

    This is how it looks, although i'm not sure if my fields can be improved on - [imgnothumb]http://i.imgur.com/tXbWWAN.jpg[/imgnothumb]

    Could i have help linking the relationships up so it all fits together?

    i'm thinking possibly _Artist would be a foreign key so i can relate _Songs to it and _Playlist and _Transaction would be a composite key.

    Thanks!
    Last edited by TheSmileyCoder; Aug 12 '13, 12:39 PM. Reason: /Changed image code from [img] to [imgnothumb]
  • TheSmileyCoder
    Recognized Expert Moderator Top Contributor
    • Dec 2009
    • 2322

    #2
    Hi ra1N1, and welcome to Bytes

    Your customers table looks ok.

    Your artist table does NOT look ok. A artist is a single entity and cannot be related directly to a featured artist. The relation between a artist and a featured artist should go through the song.
    I would recommend only have ArtistName and ArtistID in your artist table.

    Presuming a song can only have 1 artist, and 1 featured artist, then we need to store that information directly with the song. So the song table would look like:
    SongID
    SongTitle
    SongArtist (Foreign key,related to tbl_Artist)
    SongFeatured (foreign key, related to tbl_Artist)
    Furthermore, you have marked the song title to be the primary key. A title is not guaranteed to be unique so this is a bad idea.

    The transactions table. You have marked customerID as the primary key. This doesn't make sense unless you only expect each of your customers to only make a single purchase. You can either give it a TransactionID, or make a compound primary key on SongID and CustomerID.

    I don't really see how playlists fit into what you have described, so I wont say anything about that.

    Comment

    Working...