Download as pdf or txt
Download as pdf or txt
You are on page 1of 12

Design the database for a programming language support

environment. In this environment, programmers produce programs,


which are written in given programming languages. Each program
is written by a given programmer, can call other programs, and can
be used by given users. Users are recognised by their log-in name;
programmers are recognised by their log-in name and by their code
number; programs have compound names that include the
program’s name, the extension, and the programmer’s code number.
Programs have a version number, a date, and a short description;
some programs interact with DBMSs. each DBMS maintains stored
data in the form of relations, with several attributes and one primary
key attribute. Each database is defined by a database administrator
who is a programmer specialized in data management.

1
ENTITY RELATIONSHIP ANALYSIS - ADDITIONAL
FEATURES.

SPECIAL CASES IN E-R ANALYSIS:


1. MANY-TO-MANY RELATIONSHIPS.
2. ENTITY SUB-TYPES AND SUPERTYPES
3. SUPERORDINATE AND SUBORDINATE TYPES
THE ENHANCED ENTITY-RELATIONSHIP MODEL
TOOLS FOR ENTITY-RELATIONSHIP MODELLING

References:

Connolly & Begg, Database Systems, Fourth Edition pp 453-455.


Fifth Edition pp219-238

Overview of the database design process

Data requirements Processing requirements

Conceptual Schema
Transaction design

Logical design Frequencies,


performance
constraints
Physical design

Data definition language Data manipulation


statements language statements

2
Special Cases in E-R Analysis :
Many : Many relationships

Where do you
record the result
of a student for a
class?

decompose into
1 : many/
many : 1

Ternary Relationships
Relationships considered so far are binary ie they involve two entities. It is
possible for relationships to link three entities eg:

"A supplier may supply a range of parts to a number of projects. Each part
is available from a number of suppliers. Each project uses a number of parts
which are available from a number of suppliers."

Many-to-many relationships exist between:


Part and Project
Project and Supplier
Supplier and Project
Supplied_By
Supplies
This could be represented by:

Used_On

3
Decomposing the many-to-many
relationships gives:

It looks as if there may be redundant relationships but it is not possible to link


PROJECT to SUPPLIER via PART because of fan traps. This is illustrated by
an occurence diagram for SUPPLIES_PART, PART and USES_PART:

SupplierA SupplierB

ProjectX
ProjectY
ProjectZ

4
A simpler entity realtionship structure which represents
the same information uses a single linker entity to
represent the ternary relationship:

10

5
11

Enhanced (Extended) entity relationship model - EER (or E2R) model

EER model is an attempt to


provide more meaning than
can be incorporated in the
entity relationship model.

It is based on developing the


features for representing
supertype/subtype
relationships.

Specialisation is the process


of defining a set of Specialisation
subclasses. There may be d Disjunction
several specialisations of the Total
Specialisation
same entity type

12

6
Enhanced (Extended) entity relationship model - EER (or E2R) model

EER model is an attempt to


provide more meaning than
can be incorporated in the
entity relationship model.

It is based on developing the


features for representing
supertype/subtype
relationships.

Specialisation is the process


of defining a set of Specialisation
subclasses. There may be d Disjunction
several specialisations of the Total
Specialisation
same entity type

13

Enhanced (Extended) entity relationship model - EER (or E2R) model

EER model is an attempt to


provide more meaning than
can be incorporated in the
entity relationship model.

It is based on developing the


features for representing
supertype/subtype
relationships.

Specialisation is the process


of defining a set of Specialisation
subclasses. There may be d Disjunction
several specialisations of the Total
Specialisation
same entity type

14

7
Enhanced (Extended) entity relationship model - EER (or E2R) model

EER model is an attempt to


provide more meaning than
can be incorporated in the
entity relationship model.

It is based on developing the


features for representing
supertype/subtype
relationships.

Specialisation is the process


of defining a set of Specialisation
subclasses. There may be d Disjunction
several specialisations of the Total
Specialisation
same entity type

15

…members may pay their fees monthly or annually.


Some of those paying annually are office-holders.
Monthly payers have a registered bank account

Member
Bank account
Have_registered
d
Monthly
Annual

Office holder

16

8
Specialization lattices

The specialisation may


form a lattice rather
than a hierarchy. The
subclass is shared by
the superclasses. An
entity instance of an
engineering manager
must have
corresponding entity
instances in engineer,
salaried employee and
manager

ENGINEERING
MANAGER

17

Categories and categorization


It may be necessary to model a single superclass/subclass
relationship with more than one superclass.

In this example an entity instance ACCOUNT_HOLDER is either a


person or a company. It is a partial category ie some
persons/companies may not be account holders.

18

9
Subsets may overlap.
In this example PERSONS are specialized as either
ENGINEERS or MANAGERS but some people are both
engineers and managers. This

19

Categorisations and specialisations

A category with multiple superclasses is equivalent to the


specialisation of a single superclass. If there are many shared
attributes it is better to represent as a single superclass.

20

10
Simplified EER
conceptual schema
for a university
database

21

Database design
tools
Software tools are
available that help in the
process of database
design. A typical
architecture for such
tools is shown. They
simplify the
documentation of design
but tend not to be good at
dealing with design
choices etc.

22

11
Summary and conclusion
Entity relationship modelling provides an approach to generating the
conceptual design of a database

The extended entity relationship model provides support for


subtype/sypertype entities.

To some extent data modelling is a “black art”

Data modelling ends to produce many separate objects that may be


reflected in the logical design.

23

An organization keeps a register of individuals and


companies that provide computing services. Individuals are
identified by individual names and have an address, whereas
companies are identified by trading names and have a
company address. Both individuals and companies are
classified as either consultants or hardware suppliers and
some may be both. An average hourly rate is stored for each
consultant. Consultants may be software consultants or
hardware consultants or both. Internal sections of the
organization can also provide consultancy services. Each
such internal section has a section name. The organization
uses its own identifiers to identify consultants.
The organization holds maintenance contracts with some of
the hardware suppliers. Details held on maintenance
contracts include start date and serial number of equipment
covered.

24

12

You might also like