Question

Before I go ahead and convert my entity relationship diagram into SQL statements, I thought I'd ask if someone could verify if this model doesn't contain any absurdities and anomalies that will appear once I have a SQL database schema.

I am particularly unsure about my cardinality of a relationship between Customer and VIP. Also, Supplier and CD relationship. start_date of the VIP entity - should it be a weak key? Are there any other potential weak keys besides the name attribute of the Song entity?

E/R Model

Legend

  • Entity enter image description here
  • Attribute enter image description here
  • Weak Entity enter image description here
  • Relationship enter image description here
  • Identifying Relationship enter image description here
  • Cardinality Ratio enter image description here

I've used the following websites as references to construct my diagram:

  1. http://en.wikipedia.org/wiki/File:ERD_Representation.svg
  2. http://en.wikipedia.org/wiki/Entity-relationship_model
  3. http://www.cse.ohio-state.edu/~gurari/course/cse670/cse670Ch2.xht

Software used to create the diagram: Dia (Linux)

Was it helpful?

Solution

Sorry this is a late answer, but in case it's useful there are two improvements you can make.

1) The "is-a" relationship between "VIP" and "CUSTOMER" indicates the presence of a superclass (customer) and subclass (vip). You may want to model VIP as a subclass.

2) Since you are tracking dates for the relationship "rents", the cardinality must be taken "over time". Therefore the cardinality on both sides is "N" (i.e., not "1" on the side of customers)

Minor improvement: in "Song" (weak entity class) set the partial identifier as "track" rather than "name"; this will allow for multiple recordings of the same song on a CD (e.g., 2 versions). The track number will always be unique within the CD

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top