HiFi Call Girl Service Hyderabad | Whatsapp No ð 9352988975 ð VIP Escorts Ser...
Â
5e7ry754.pptx
1. The Entity Relationship Model
ïµ ER model was introduced by peter Chenn in 1976.
ïµ The ER model defines the conceptual (or logical) view of a database.
ïµ It is used for designing
ïµ It works around real world entities and the relationships among them.
ïµ A database schema in the ER model can be represented pictorially as ER diagram.
ïµ An ER diagram maps well into a relational schema.
2. Why ER model is useful
ïµ An ER Model maps well to the relational model i.e the constructs used in ER Model
can be easily transformed into relational tables.
ïµ An ER Model can be used by the database designer communicate the database design
to the user.
ïµ An ER Model can be used as a design plan by the database developer to implement
data model in specific DBMS software.
4. 1. Entities
ïµ An Entity is a âthingâ or âobjectâ in the real world that is distinguishable from other objects.
ïµ Entity can be any thing that has independent existence and about which we collect data. It is also
called entity type.
Example: in a school database, the students, teacher , classes, courses or projects can be taken as
an entity.
ïµ Entities are represented by means of rectangles.
ïµ Entities have attributes that give them their identity.
Example: students have rollno, name, and address
ïµ Entities become table in relational model.
Student Teacher Course
5. Entity set
ïµ An Entity Set is a collection of similar type of entities, that share same attribute.
Example: A student set may contain all the students of a school; A teacher set may contain all the
teachers of a school from all faculties.
Entity set
ïµ Entity set need not be disjoint
Example: The entity set Employee(all employee of a bank) and the entity set customer (all customers
of Bank) may have members in common.
E1
E2
E3
6. 2. Attribute
ïµ An entity is represented by a set of attribute.
ïµ Attribute are used to describe the property of an entity
Example: a student entity may have roll_no, Name, DOB, Age, Address, Mobile_no as
attribute.
ïµ For each attribute there is a set of permitted values, called domain (or range) of that
attribute.
Example: A student name cannot be a numeric value. It has to be alphabetic. A studentâs age
cannot be negative, etc. A student roll_no can be numeric between some range like(0-10000)
ïµ Attribute are represented by Ellipse
Attribute
9. 3. Relationship
ïµ A relationship is an association among entities.
ïµ For example :
ïµ An employee works_at a department
ïµ A student enrolls in a course
Here, works_at and enrolls are called relationship
ïµ Relationship are represented by diamond-shaped box.
Relationship
11. Degree of Relationship
ïµ The number of different entity sets participating in a relationship set is called a degree
of a relationship set
1. Unary
2. Binary
3. Ternary
4. N-ary
12. Degree of RelationshipâŠâŠ
1. Unary relationship: (degree =1)
A unary relationship is only one entity participate in a relationship, the relationship is called as a unary
relationship.
For example, one person is married to only one person.
2. Binary relationship: (degree=2)
A binary relationship is when two entities participate in a relationship, and is the most common relationship
degree.
For example: student is enrolled in course.
Person Married_to
Course
Enrolled
13. Degree of RelationshipâŠâŠ..
3. Ternary Relationship: (degree=3)
A ternary relationship is when three entities participate in the relationship.
example, the university might need to record which teachers taught which courses.
4. n-ary relationship: (degree=n)
When there are n entities set participating in a relation, the relationship is called n-ary
relationship.
Course Subject
CST
Teacher
14. Relationship Constraints:
1. Cardinality ratio
ï Maximum number of relationship instances that an entity can participate in.
ï Possible cardinality ratios for binary relationship -> 1:1, 1:N, N:1, M:N
Employee Department
Manage
s
1 1
Employee Works_f
or
Department
N 1
Student Department
studies
M N
15. Relationship Constraints:
2. Participation Constraints
ï Specifies whether existence of an entity depends on its being related to another entity.
ï 2 types : total participation and partial participation
Employee Manages Employee
Partial Total
Employee Manages Department
E1
E2
E3
E4
E5
D1
D2
D3
d4