0% found this document useful (0 votes)
36 views11 pages

ER Diagram Symbols and Concepts

The document provides an overview of the Entity-Relationship (E-R) model, which is a high-level data model used for designing databases. It explains key concepts such as entities, attributes, relationships, and the structure of E-R diagrams, including the symbols used to represent these elements. Additionally, it covers various types of entities, attributes, relationship types, cardinality, and the steps to create and convert E-R diagrams into database schemas.

Uploaded by

devasandra2006
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
36 views11 pages

ER Diagram Symbols and Concepts

The document provides an overview of the Entity-Relationship (E-R) model, which is a high-level data model used for designing databases. It explains key concepts such as entities, attributes, relationships, and the structure of E-R diagrams, including the symbols used to represent these elements. Additionally, it covers various types of entities, attributes, relationship types, cardinality, and the steps to create and convert E-R diagrams into database schemas.

Uploaded by

devasandra2006
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Unit II

E-R Model
Entity-Relationship modeling

E – R Model Concepts: Entity, Entity types, Entity sets, Attributes, Types of attributes, key
attribute, and domain of an attribute. Relationships between the entities. Relationship types,
roles and structural constraints, degree and cardinality ratio of a relationship. Weak entity
types, E -R diagram.

2.1 ENTITY–RELATIONSHIP MODEL (ER MODEL)

 ER model stands for an Entity-Relationship model.


 It is a high-level data model.
 An ER model is a design or blueprint of a database that can later be implemented as a
database.
 An Entity–relationship model (ER model) describes the structure of a database with the
help of a diagram, which is known as Entity Relationship Diagram (ER Diagram)
 ER Diagram stands for Entity Relationship Diagram, also known as ERD is a diagram that
displays the relationship of entity sets stored in a database. In other words, ER diagrams
help to explain the logical structure of databases

2.1 E -R diagram

ER Diagram is the structural format of the database.

 ER diagrams are used to represent the E-R model in a database, which makes them easy
to be converted into relations (tables).
 ER diagrams provide the purpose of real-world modeling of objects which makes them
intently useful.
 ER diagrams require no technical knowledge and no hardware support.
 These diagrams are very easy to understand and easy to create even for a naive user.
 It gives a standard solution for visualizing the data logically.

Symbols Used in ER Model

ER Model is used to model the logical view of the system from a data perspective which consists
of these symbols:
 Rectangles Rectangles represent Entities in the ER Model.
 Ellipses Ellipses represent Attributes in the ER Model.
 Diamond Diamonds represent Relationships among Entities.
 Lines Lines represent attributes to entities and entity sets with other
relationship types.
 Double Ellipse Double Ellipses represent Multi-Valued Attributes.
 Double Rectangle Double Rectangle represents a Weak Entity.

1
Components of ER Diagram
ER Model consists of Entities, Attributes, and Relationships among Entities in a Database
System.

2.2 Entity ,Entity set and Entity types

Entity

An entity is referred to as an object or thing that exists in the real world. For example,
customer, car, pen, etc.
An Entity may be an object with a physical existence – a particular person, car, house, or
employee – or it may be an object with a conceptual existence – a company, a job, or a university
course.

Entity Set
An Entity is an object of Entity Type and a set of all entities is called an entity set

2
Entity types

1. Strong Entity

A Strong Entity is a type of entity that has a key Attribute. Strong Entity does not depend on
other Entity in the Schema. It has a primary key, that helps in identifying it uniquely, and it is
represented by a rectangle. These are called Strong Entity Types.

2. Weak Entity
An Entity type has a key attribute that uniquely identifies each entity in the entity set. But some
entity type exists for which key attributes can’t be defined. These are called Weak Entity types.

For Example, A company may store the information of dependents (Parents, Children, Spouse)
of an Employee. But the dependents don’t have existed without the employee. So Dependent
will be a Weak Entity Type and Employee will be Identifying Entity type for Dependent, which
means it is Strong Entity Type.

A weak entity type is represented by a Double Rectangle. The participation of weak entity types
is always total. The relationship between the weak entity type and its identifying strong entity
type is called identifying relationship and it is represented by a double diamond.

2.3 Attributes

Attributes are the properties that define the entity type. For example, Roll_No, Name,
DOB, Age, Address, and Mobile_No are the attributes that define entity type Student. In ER
diagram, the attribute is represented by an oval.

Types of Attribute

Key Attribute
The attribute which uniquely identifies each entity in the entity set is called the key
attribute. For example, Roll_No will be unique for each student. In ER diagram, the key attribute
is represented by an oval with underlying lines.

3
Composite Attribute
An attribute composed of many other attributes is called a composite attribute. For
example, the Address attribute of the student Entity type consists of Street, City, State, and
Country. In ER diagram, the composite attribute is represented by an oval comprising of ovals.

Multivalued Attribute
An attribute consisting of more than one value for a given entity. For example,
Phone_No (can be more than one for a given student). In ER diagram, a multivalued attribute is
represented by a double oval.

Derived Attribute
An attribute that can be derived from other attributes of the entity type is known as a
derived attribute. e.g.; Age (can be derived from DOB). In ER diagram, the derived attribute is
represented by a dashed oval.

The Complete Entity Type Student with its Attributes can be represented as:

4
2.4 Relationship

Relationship Type

A Relationship Type represents the association between entity types. For example,
‘Enrolled in’ is a relationship type that exists between entity type Student and Course. In ER
diagram, the relationship type is represented by a diamond and connecting the entities with
lines.

Relationship Set

A set of relationships of the same type is known as a relationship set. The


following relationship set depicts S1 as enrolled in C2, S2 as enrolled in C1, and S3 as
registered in C3.

Degree of a Relationship Set


The number of different entity sets participating in a relationship set is called the degree of a
relationship set.
1. Unary Relationship
When there is only ONE entity set participating in a relation, the relationship is called a unary
relationship. For example, one person is married to only one person.

2. Binary Relationship
When there are TWO entities set participating in a relationship, the relationship is called
a binary relationship. For example, a Student is enrolled in a Course.

5
3. n-ary Relationship
When there are n entities set participating in a relation, the relationship is called an n-ary
relationship.

2.4 Cardinality

The number of times an entity of an entity set participates in a relationship set is known
as cardinality. Cardinality can be of different types

1. One-to-One (1:1)
When one entity in each entity set takes part at most once in the relationship, the
cardinality is one-to-one.

2. One-to-Many (1:M)
If entities in the first entity set take part in the relationship set at most once and entities
in the second entity set take part many times (at least twice), the cardinality is said to be one-
to-many.

2. Many-to-One (M:1)
If entities in the first entity set take part in the relationship set many times (at least twice),
while entities in the second entity set take part at most once, the cardinality is said to be many-
to-one.

4. Many-to-Many (M:M)

The cardinality is said to be many to many if entities in both the entity sets take part
many times (at least twice) in the relationship set.

6
2.5 Participation Constraints

Participation Constraints tell us that the participation in a relationship can either be total or
partial.

7
2.6 Structural Constraints of Relationships in ER Model
Structural Constraints are also called Structural properties of a database management
system (DBMS). Cardinality Ratios and Participation Constraints taken together are called
Structural Constraints. The name constraints refer to the fact that such limitations must be
imposed on the data, for the DBMS system to be consistent with the requirements.

Steps to draw a ER diagram


 The very first step is Identifying all the Entities, and place them in a Rectangle, and
labeling them accordingly.
 The next step is to identify the relationship between them and pace them
accordingly using the Diamond, and make sure that, Relationships are not connected
to each other.
 Attach attributes to the entities properly.
 Remove redundant entities and relationships.
 Add proper colors to highlight the data present in the database.

Seven Steps to convert ER Diagram

Step 1 : Converting strong entities


Step 2 : Converting weak entity
Step 3 : Converting one-to-one relationship
Step 4 : Converting one-to-many relationship
Step 5 : Converting many-to-many relationship
Step 6 : Converting multivalued attributes
Step 7 : Converting n-ary relationship

EXAMPLES

Example 1:Strong Entity Set With Only Simple Attributes

Roll No Name Sex

Schema : Student ( Roll_no , Name , Sex )

8
Example 2: Strong Entity Set With Composite Attributes

Roll_no First_name Last_name House_no Street City

Schema : Student ( Roll_no , First_name , Last_name , House_no , Street , City )

Example 3:Strong Entity Set With Multi Valued Attributes

Roll_No City

Roll_No Mobile_no

9
Example 4:Translating Relationship Set into a Table

Emp_no Dept_id since

Schema : Works in ( Emp_no , Dept_id , since )

Example 5 : Student Information Database

10
11

You might also like