mercredi 3 décembre 2014

what is the best way to represent an album and song entity in a ecommece schema?


I'm designing a simple mp3(music) ecommerce site, customers can either buy a single Track or whole Album, an Album is made up of Tracks, so there is a one to many relationship between an Album and a Track as shown below. I thought it would be a good idea to have one Orders table and one Product table, the idea I had is to have a generic Product table to represent either a Track or an Album as a Product but I'm kinda struggling to design that on my ERD. I was thinking in a inheritance approach. all Tracks will have the same price but Albums will have an individual prices.


What is the best way to achieve this requirement? in the orders table I need to see if it was a Track or Album purchased and money spent.


Snippet of the ERD





Aucun commentaire:

Enregistrer un commentaire