Lecture 1
Lecture 1
Lecture 1
The result of the requirement analysis step is a concisely written set of users’
requirements.
Once, this step is completed, the next step is to create a conceptual database
schema for the database, using a high-level conceptual data model.
This step is called conceptual database design.
Entity-Relationship (ER) model is a high-level conceptual data model.
ER MODEL - ENTITIES & ATTRIBUTES
You already know these !
Check the handout for the definitions and examples for entities, different types of
attributes and keys.
Select an important entity in a context you are familiar. Add simple attributes,
a multivalued attribute, a composite attribute and a key to the entity you
identified.
Try not to use the attributes shown in the handouts.
Exchange what you have drawn with your peer. What have they written?
ER MODEL - BINARY RELATIONSHIPS
You already know these too !
Check the handout for the definitions and examples for different
cardinalities in binary relationships such as 1:1, 1:N and M:N
Now draw examples for each cardinality ratio above associated with binary
relationships.
Exchange what you have drawn with your peer. What has he/she drawn?
ER MODEL - WEAK ENTITIES
Weak entities are entities that cannot be uniquely identified alone in a domain.
Following restrictions must hold with relevance to weak entities
The owner entity set and the weak entity set must participate in a one-to-many
relationship set (one owner entity is associated with one or more weak entities,
but each weak entity has a single owner). This relationship set is called the
identifying relationship set of the weak entity set.
The weak entity set must have total participation in the identifying relationship set.
Can you think of an weak entity in a domain you know?
ER MODEL - TERNARY RELATIONSHIPS
Ternary relationships could be used when there is a common attribute that needs all three
entities together, (ex: quantity)
Include the ternary relationship plus one or more of the binary relationships, if they
represent different meanings and if all are needed
ACTIVITY
ER model we discussed so far has been enhanced by adding several new concepts
leading to the development of the EER model.
An important extension included in the EER model is the specialization and
generalization concepts.
Specialization is the process of defining a set of subclasses of an entity type.
Employee & permanent employee
In many cases an entity type has numerous subgroupings or subtypes of its entities
that are meaningful and need to be represented explicitly because of their
significance to the database application.
Ex: the entities that are members of the EMPLOYEE entity type may be distinguished
further into contract employees and permanent employees
Such subtypes could be represented in EER diagrams using ‘ISA’ relationships
EER MODEL - ISA RELATIONSHIPS (CONTD.)
ename
Note that the subclasses may have their eId age
own attributes and relationships. Employee
Every entity in the subclass is also an
employee entity and have all the have all
of the attributes of Employees entity.
ISA
Thus attributes of the permanent contractId
employee include all attributes of salary
employee entity and those of
permanent employee. Permanent Employee Contract Employee
Hours_ Hours_
rate worked
OVERLAPPING CONSTRAINT
ISA ISA
contractId salary
salary
GPA
ISA ISA
contractId salary
salary
GPA
In a blank paper draw two ISA relationships, one which is having a covering constraint
and another which is having a overlapping constraint.
Exchange what you have drawn with your peer. What have they drawn?
Have you understood the concepts properly?
EER MODEL - AGGREGATION
There are several different "modeling traps" (called connection traps) that
you can fall into when designing your ER model.
Two connection traps that we will look at are:
Fan traps
Chasm traps
FAN TRAP
N 1 1 N
Employee has Department has Project
FAN TRAP (CONTD.)
Which projects does employee E3 work on?
CHASM TRAP