0% found this document useful (0 votes)
34 views7 pages

Basics of ER-Model

Uploaded by

Tejaswini Beri
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)
34 views7 pages

Basics of ER-Model

Uploaded by

Tejaswini Beri
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
You are on page 1/ 7

BASICS OF ER -MODEL

 ER model stands for an Entity-Relationship model. It is a high-level data model. This


model is used to define the data elements and relationship for a specified system.
 ER (Entity Relationship) diagram is a graphical representation of the logical
structure of the database.
 It displays all the constraints and relationships that exist among the different
components.
 ER diagrams are created based on three basic concepts: entities, attributes and
relationships.

Entity:
 Entity is any physical object which may be a human, place, thing, or any event i.e.
student, chair, Lahore etc. Each entity contains some attributes i.e. student entity
attributes are rollno, Student_name etc.

Strong Entity Set:


 A strong entity set contains its own primary key.
 Single rectangle represents it.

For example: A US Bank can uniquely identify by its bank number.

Weak Entity Set:


 A weak entity set do not hold its own primary key.
 To uniquely identify any tuple of weak entity, attributes of weak entity is
combined with strong entity primary key.
 double rectangle represents the weak entity.

Note: An entity that depends on another entity is considered as a weak entity.


Relationship between strong and weak entity:
The relation in-between one strong and one weak entity is represented by a double
diamond symbol.

 As, Loan must be taken by some customer. so, the loan is fully participating in
relation. And every customer does not acquire the loan. so, customer is partially
participating in relation.
Attributes

 Entities are represented by means of their properties, called attributes. All


attributes have values. For example, a student entity may have name, class, and age
as attributes.

Types of Attributes

Consider example:
1. Simple Attributes:

Simple attributes are those attributes which cannot be divided further.

2. Composite attribute :

Composite attributes are made of more than one simple attribute. For example, a
student's complete name may have first_name and last_name.

3. Single Valued Attributes:


Single valued attributes are those attributes which can take only one value for a
given entity from an entity set.

4. Multi Valued Attributes:


Multi valued attributes are those attributes which can take more than one value for a
given entity from an entity set.
5. Derived Attributes:
Derived attributes are the attributes that do not exist in the physical database, but
their values are derived from other attributes present in the database.

6. Key Attributes:
Key attributes are those attributes which can identify an entity uniquely in an entity
set.
For example, the roll_number of a student makes him/her identifiable among
students.
 Super Key − A set of attributes (one or more) that collectively identifies an
entity in an entity set.
 Candidate Key − A minimal super key is called a candidate key. An entity set
may have more than one candidate key.
 Primary Key − A primary key is one of the candidate keys chosen by the
database designer to uniquely identify the entity set.

 Foreign keys- Foreign keys are the column of the table used to point to the
primary key of another table.

NOTATIONS: Following are the main components and its symbols in ER Diagrams:

 Rectangles: This Entity Relationship Diagram symbol represents entity types


 Ellipses : Symbol represent attributes
 Diamonds: This symbol represents relationship types
 Lines: It links attributes to entity types and entity types with other relationship
types
 Primary key: attributes are underlined
 Double Ellipses: Represent multi-valued attributes
Relationships:
 In ER Model, a Relationship is a relation between entities. The Diamond symbol is
use to represent the relationship between Entities.
Example-

Enrolled in’ is a relationship that exists between entities Student and Course.

Relationship Set
Relationship set is a set of same type of relationships in entity set. A relationship set
may be strong or weak. Let explain both these terms,
I. Strong Relationship Set:
 A strong relationship exists in-between two strong entity sets.
 Strong Relationship represents through a diamond symbol as below.

II. Weak Relationship Set:


 A weak relationship exists in-between the strong and weak entity set.
 Representation of weak relationship is double diamond symbol.

Types of Relationships:

a. One-to-One Relationship

2. One-To-Many Relationship.
3. Many-to-one relationship

4. Many-to-many relationship

You might also like