270 likes | 290 Views
Errors in ER Diagram. Do not represent a concept as both a relationship type and an attribute Make sure every entity type must have a key attribute
E N D
Errors in ER Diagram • Do not represent a concept as both a relationship type and an attribute • Make sure every entity type must have a key attribute • Relationship type connects 2 entity types (In general, cannot connect a relationship to another entity type; There is an extension which allows it (see fig. 8.11) • Avoid chain of composite attributes • Don’t forget to include role names for recursive relationships
Roles missing!! Every entity type must have a key Should publisher be an entity type? Can a product have multiple prices?
Key attribute for author is missing Customers?? Can a book have multiple prices?
Author has no key attribute Can’t tell what’s the price of the book purchased by user; not sure what payment method is used
Diagram is disconnected Not all concepts need to be modelled ?
Key attribute missing for crime instance Should officer be an entity type? Does the database store only offenders who have been proven guilty of committing the crime; what about criminal suspects?
You cannot relate an entity type to a relationship type via another relationship type. Every entity type must have a key
Roles missing! Every entity type must have a key Use of “Identifies” as key is wrong Try to avoid chain of composite attributes
Key attribute for punishment is missing Case officer?
Draw the rectangles! Avoid chains of composite attributes!
Passenger/Reservation? Departure vs arrival airport? Solution is in the textbook (exercise section)
Need to distinguish between scheduled and actual arrival/departure information Flights should not be a multivalued attribute of airport What is the difference between destination of flight and arrival airport?
Medications could be made into an entity type Physicians? See example from homework 1
Username is not a composite attribute!! password should not be a component of the composite attribute.
You can't have both relationship type and entity type called teams/coaches/players Every entity type must have a key Name of entity type should be singular Does college player have salary?
Results for different games played by a team are not available (only #wins and #losses)
Where do the stats derived from? Cannot draw a line from one entity type to another without a relationship type
Every entity type must have a key Cannot tell which player plays in a game
Every entity type must have a key Can a coach coach a team but not a player who plays for the team? Can a coach coach a player who does not play for the team coached by the coach?