Lecture Slides available: PDF PowerPoint Entity Relationship Modelling - 2Contents
Overview
Country Bus CompanyA Country Bus Company owns a number of busses. Each bus is allocated to a particular route, although some routes may have several busses. Each route passes through a number of towns. One or more drivers are allocated to each stage of a route, which corresponds to a journey through some or all of the towns on a route. Some of the towns have a garage where busses are kept and each of the busses are identified by the registration number and can carry different numbers of passengers, since the vehicles vary in size and can be single or double-decked. Each route is identified by a route number and information is available on the average number of passengers carried per day for each route. Drivers have an employee number, name, address, and sometimes a telephone number. Entities
Relationships
Draw E-R Diagram
Attributes
Problems with ER ModelsThere are several problems that may arise when designing a conceptual data model. These are known as connection traps. There are two main types of connection traps:
Fan trapsA fan trap occurs when a model represents a relationship between entity types, but the pathway between certain entity occurrences is ambiguous. It occurs when 1:m relationships fan out from a single entity.
A single site contains many departments and employs many staff. However, which staff work in a particular department? The fan trap is resolved by restructuring the original ER model to represent the correct association.
Chasm trapsA chasm trap occurs when a model suggests the existence of a relationship between entity types, but the pathway does not exist between certain entity occurrences. It occurs where there is a relationship with partial participation, which forms part of the pathway between entities that are related.
Enhanced ER Models (EER)The basic concepts of ER modelling is not powerful enough for some complex applications... We require some additional semantic modelling concepts:
First we need some new entity constructs.
Subclasses need not be mutually exclusive; a member of staff may be a manager and a sales person. The purpose of introducing superclasses and subclasses is to avoid describing types of staff with possibly different attributes within a single entity. This could waste space and you might want to make some attributes mandatory for some types of staff but other staff would not need these attributes at all. SpecialisationThis is the process of maximising the differences between members of an entity by identifying their distinguishing characteristics.
GeneralisationGeneralisation is the process of minimising the differences between entities by identifying common features. This is the identification of a generalised superclass from the original subclasses. This is the process of identifying the common attributes and relationships. For instance, taking: car(regno,colour,make,model,numSeats) motorbike(regno,colour,make,model,hasWindshield) And forming: vehicle(regno,colour,make,model,numSeats,hasWindshielf) In this case vehicle has numSeats which would be NULL if the vehicle was a motorbike, and has hasWindshield which would be NULL if it was a car. CategorisationLeft as an exercise to research. AggregationLeft as an exercise to research.
|
|