You are on page 1of 5

Experiment No 6

Title of Assignment : Design and draw an ER/EER diagram using standard notations for given
problem definition and convert this diagram into Database Tables.

Relevant Theory / Literature Survey: (Brief Theory Expected)
.Data Model
Data Model is collection of conceptual tools for describing
data
data relationship
data semantics and
consistency constraints
Data Model are classified into three types
1.Object Based logical model
(a) ER Model
(b) Object oriented model
(c) Function Model
2.Recored-Based logical Model
(a)Relationship Model
(b)Network Model
(c)Hierarchical Model
3.Physical Model
(a)Unifying Model
(b)Frame Memory
Entity-Relationship Diagram:-
An E-R diagram can express the overall logical structure of a database graphically. E-R diagrams
are simple and clear-qualities that may well account in large part for the Widespread use of the E-R
Model. Such a diagram consist of the following major component.
Rectangles:- which represents entity set
Ellipses:-which represent attribute
Diamonds:-which represent relationship sets
Lines:-Which link attributes to entity sets and entity set to relationship sets.
Double Ellipses:- which denote derived attributes
Double Lines:- which indicates total participation of entity in a relationship set
Double Rectangles:- which represents weak entity sets.


Extended ER Features:-
Following are the Extended Entity Relationship Features of E-R Model
1.Specialization
2.Generalization
3.Aggretion
4.Attributes Inheritance
Specialization:-
It is the process of designing sub groupings within an entity set. Consider an account entity which
can be classified into
Saving Account
Checkings Account
Checking account can be further be classified into
Standard
Gold
Senior
Hence, Specialization of account entity is savings account and checking account
Specialization of checking account is standard, gold and senior checking account. In
E-R diagram, Specialization is depicted by a triangle component labeled ISA.

Generalization:-
It is a containment relationship that exists between a higher level entity set and one more lower
level entity set .Attributes of higher level entity set and of lower level entity set are common. this
commonality is express by generalization

Aggregation:-
Aggregation is an abstraction through which relationship are treated as higher-level entities.It helps
to express relationship among relationships. To illustrate the need of aggregation consider the
database describing information about employees who work on particular project and use a number
of different machines in their work.

Attributes Inheritance:
A crucial property of the higher and lower level entity created by specialization and generalization
is attribute inheritance .The attributes of higher of higher-level entity
set are said to be inherited by the lower-level entity set .A lower level entity sets(or subclass) also
inherits participation in the relationship sets in which its higher-level entity(or super class)
participates.

Design Analysis / Implementation Logic:
(Algorithm / Flow Chart / Pseudo Code / UML diagram / DFD as per requirement)
Steps in E-R Modeling
Identify the entities
Find relationships
Identify key attributes for every entity
Identify other relevant attributes
Draw complete E-R diagram with all attributes including Primary key.
Testing:
(Input/ Output)
Case Study ER Model For a college DB
Assumptions :
A college contains many departments
Each department can offer any number of courses
Many instructors can work in a department
An instructor can work only in one department
For each department there is a Head
An instructor can be head of only one department
Each instructor can take any number of courses
A course can be taken by only one instructor
A student can enroll for any number of courses
Each course can have any number of students

Step 1: Identify the Entities
DEPARTMENT
STUDENT
COURSE
INSTRUCTOR
Step 2: Find the relationships
One course is enrolled by multiple students and one student enrolls for multiple courses,hence the
cardinality between course and student is Many to Many.
The department offers many courses and each course belongs to only one department, hence the
cardinality between department and course is One to Many.
One department has multiple instructors and one instructor belongs to one and only one
department , hence the cardinality between department and instructor is one to Many.
Each department there is a Head of department and one instructor is Head of department
,hence the cardinality is one to one .
One course is taught by only one instructor, but the instructor teaches many courses,hence the
cardinality between course and instructor is many to one.
Step 3: Identify the key attributes
Deptname is the key attribute for the Entity Department, as it identifies the
Department uniquely.
Course# (CourseId) is the key attribute for Course Entity.
Student# (Student Number) is the key attribute for Student Entity.
Instructor Name is the key attribute for Instructor Entity.
Step 4: Identify other relevant attributes
For the department entity, the relevant attribute is location
For course entity, course name,duration,prerequisite
For instructor entity, room#, telephone#
For student entity, student name, date of birth

Step 5: Draw complete E-R diagram with all attributes including Primary Key

Conclusion:
Thus we have studied and implemented the ER-Model for college DB.

You might also like