Aswin Er Diagram
Aswin Er Diagram
Aswin Er Diagram
Process of developing data structures from user requirements
• logical structure
• physical structure
GOALS
I. information content requirements
II. natural and easy-to-understand
III. processing and performance requirements
Database Design Steps
Proj.Scope
Requirements Collection
and Analysis
Internal Schema
DB Requirements
Requirements Collection
and Analysis
Database Design Steps
Requirements Collection
and Analysis
I.Requirements Analysis
Purpose: identify/describe data required by
users
Input: Functional and Data requirements
Output: User specifications
Database Design Steps
Proj.Scope
Requirements Collection
and Analysis
Internal Schema
DB Requirements
Conceptual Design
Database Design Steps
Conceptual Design
Database Design Steps
Conceptual Design
Database Design Steps
Conceptual Design
Database Design Steps
Conceptual Design
Database Design Steps
Conceptual Design
Database Design Steps
Conceptual Design
II.Conceptual Design
Purpose: synthesize diff. users' views to global
database design
Input: User requirements from (I) & functional
requirements
Output: high-level data model
Database Design Steps
Proj.Scope
Requirements Collection
and Analysis
Internal Schema
DB Requirements
Logical Design
Database Design Steps
Proj.Scope
Requirements Collection
and Analysis
Internal Schema
DB Requirements
•Property of an entity
Employee WORKS_FOR
Department
r1
emp1
r2 d1
emp2
r3 d2
emp3
r4 d3
emp4
emp5 r5
– TOTAL PARTICIPATION.
• Existence dependency : Entity exists only when it
participates in a relationship.
EMPLOYEE
e1 SUPPORTS DEPENDENT
e2 r1 d1
e3 r2 d2
e4 r.3 d.3
e5 . .
.
. . .
. Every DEPENDENT must
participate in SUPPORTS
• Partial dependency: Entity may or may
not participate in a relationship
• For example, MANAGES has partial participation of
EMPLOYEE and total participation of DEPARTMENT
EMPLOYEE
e1 MANAGES DEPARTMENT
e2 r1 d1
e3 r2 d2
e4 r.3 d.3
e5 . .
. Every Dept has
. . .
. a manager
Not every Employee
is a manager
ER NOTATION
Attribute
Entity type
Key attribute
Weak entity type
Multivalued attribute
Relationship type
Derived attribute
WORKS-
EMPLOYEE DEPARTMENT
FOR 1
N
SUPERVISES
(1,N) (0,1)
PROFESSOR STUDENT
(1,N) (1,N)
TUTORS
• Naming conventions
– Singular names for entity types
– Upper case for entity types and relationships
– Lower case (with upper case first letter) for
attribute
– Relationship names readable from left to
right, top to bottom
• Role name
– Role played by entity in relationship instance
• E.g., relationship MARRIED between two persons
where entity type is PERSON; role names
distinguish both persons are husband and wife
Role name
wife child
1 N
PERSON
IsMarriedTo IsChildOf
1 1
husband parent
Ic-no
• Attributes of relationship
– Relationships may have attributes
• E.g., WORKS_ON relationship between
EMPLOYEE and PROJECT may have hour as
attribute
N WORK_ M
EMPLOYEE PROJECT
ON
hour
DEPENDENTS_
OF
Name
Key = Ssn+name DEPENDENT
Relationship
Another example:
Partial
key
A
B
C
D
E
Example
• Organization made up of various departments, each
having a name, identifying no., and an employee A
who is the manager. A department may be located in
different places.
A
B
C
D
E
• Information about employees include name,
identification number, birthdate, address, sex, and B
salary. Each employee is assigned to one department.
The date the manager is appointed to a department is
also tracked. Employees may be directly supervised by
another employee.
A
B
C
D
E
• Each project within the organisation is controlled by a
department. Employees (not necessarily from the
controlling dept.) are assigned to projects. C
A
B
C
D
E
• Information about projects include project name,
D
no., and location. Hours spent by employees on each
project are also kept.
A
B
C
D
E
• Information about employees’ dependents are kept.
E
These include name, sex, birthdate and relationship.
Enhanced ER Model (EER)
– Superclasses/subclasses, attribute
inheritance
– Generalization/specialization
– Membership constraint
– Specialization hierarchies, specialization
lattices, multiple inheritance
Superclasses/Subclasses and
Attribute Inheritance
• An entity type (set) may have additional
sub-groups that are meaningful and need
be represented explicitly because of their
significance to the database application
• Example:
– Superclass: Employee
– Subclass: Administrative Officers, Lecturers,
Technicians, Clerical Officers, Cleaners
• Superclass/subclass relationship called
an IS-A relationship
– E.g., Lecturer IS-A Employee
– Notation used is subset symbol ⊂ on
connecting line from Superclass to subclass
– “d” within circle indicates ‘disjoint’
– double line between Superclass and circle
indicates TOTAL participation
• An entity in a subclass inherits all
attributes of its Superclass
Surname FirstName Birthdate
Address
Name
ICNo Sex
EMPLOYEE
Price LicenseNo
VEHICLE
Colour d Tonnage
CAR TRUCK
Height
NoOfPassengers COE
Aggregation
• In ER, a relationship type cannot be connected
directly to another relationship type
• To overcome this, aggregates are used
• Example: