I am attempting to make an ER diagram where the customer buys music online. We were just in the first weeks of tackling database so a lot of topics isn't introduced yet. Here's what I've done so far:

ER diagram of online music store

I know there are things that are lacking or things that can still be improved, I just want to know:

  1. How can I categorize the artist into solo, group or band? And how can I give them relationships to the 'artist' entity? Also can is it necessary or I can just disregard that option?

  2. Is my 'list of genre', 'list of album', and 'list of track' okay to use?

  3. On the 'purchase' entity, what happens when the customer would only buy tracks and not albums? Are my attributes fine?

  • Your diagram combines elements of two different thought processes. The first is analysis of the subject matter (online music store). The second is database design (your solution to representing the data). If your course does not teach you the difference between analysis and design, you will have to learn it elsewhere. – Walter Mitty Apr 21 at 9:39

A few points that came across my mind while looking at this. The overall thought and design isn't bad, so I think you're on the right track as far as storing the product information.

  1. I'm curious what kind of information is expected to be put into the "List of..." tables. As a note for names with more than one word you would do yourself a favor and NOT use spaces. Code can get tricky when dealing with table names or field names that have spaces in them, underscores are fairly common to use instead.

  2. For the purchasing portion, check out some other posts that use tables like this:

TABLE INVOICE(Invoice_ID [PK],Cust_ID [FK], Date,...)

TABLE INVOICE_Details (Detail_ID[PK], Invoice_ID[FK], Product_ID[FK],...)

This layout would give every track and album a separate Product_ID to be purchased, and the invoice for each sale would compile the invoice details. This would also allow for pricing different tracks based on their demand.

  1. To answer your question on categorizing solo artists vs. groups, I wouldn't worry too much about that, since artists can go all Beyonce and leave their group, or join another one. Just focus on the credit for each track\album and what's said there. If you really wanted to include that information, put it into the Artist table with other attributes, like their genre, stage name, and such.
| improve this answer | |
  • First of all, thank you so much. I really need a feedback. 1. Well, many to many relationship isn't recommended by my teacher to use so i made an another entity to separate the relationship. For example, one album can be purchased many times and one purchase can buy many albums so i found that many to many. I feel like there's something wrong with my solution, because a purchase can also get to buy the same list and therefore it is also many to many. Is there a good solution on this case? I am thinking we can add a FK to the list of album from the PK of the customer? Is that okay? – log Feb 6 at 15:42

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.