Errors in ER Diagram Do not represent a

  • Slides: 27
Download presentation
Errors in ER Diagram • Do not represent a concept as both a relationship

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

Online Bookstore

Online Bookstore

Roles missing!! Every entity type must have a key Should publisher be an entity

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?

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

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

Should author be an entity type?

Should author be an entity type?

Diagram is disconnected Not all concepts need to be modelled ?

Diagram is disconnected Not all concepts need to be modelled ?

Not sure what this relationship type is

Not sure what this relationship type is

Crime Database

Crime Database

Key attribute missing for crime instance Should officer be an entity type? Does the

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.

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

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?

Key attribute for punishment is missing Case officer?

Flight Reservation

Flight Reservation

Draw the rectangles! Avoid chains of composite attributes!

Draw the rectangles! Avoid chains of composite attributes!

Passenger/Reservation? Departure vs arrival airport? Solution is in the textbook (exercise section)

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

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?

Electronic Medical Records

Electronic Medical Records

Medications could be made into an entity type Physicians? See example from homework 1

Medications could be made into an entity type Physicians? See example from homework 1

Online Photo Sharing

Online Photo Sharing

Username is not a composite attribute!! password should not be a component of the

Username is not a composite attribute!! password should not be a component of the composite attribute.

College Football/Basketball

College Football/Basketball

You can't have both relationship type and entity type called teams/coaches/players Every entity type

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

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

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

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 a team but not

Every entity type must have a key Can a coach a team but not a player who plays for the team? Can a coach a player who does not play for the team coached by the coach?