Академический Документы
Профессиональный Документы
Культура Документы
ER Model : Components
1. Entity
An entity can be called as the basic object which represents the ER Model. It can
be a real world object/thing present physically or can be an object/thing present
logically/virtually. Entities are the objects or things or articles or pieces that have
a existence without any dependence on any other object.
For example : Bank account can be an entity, Loan can be an entity, Bank branch
can be an entity etc. These entities have their own properties which are known as
attributes.
STUDENT
ID Name AGE
1 Ahamd 12
2 Ali 13
Above is an example of a table called Student having 2 rows (1,Ahmad,12) and (2,Ali,13) .
Using this we can understand the difference.
Entity
It is something which has real existence. Like tuple1 contains information about Ahmadid,
name and Age) which has existence in real world . So the tuple1 is an entity. So we may
say each tuple is an entity.
Entity Type
It is collection of entity having common attribute. As in Student table each row is an entity
and have common attributes. So STUDENT is an entity type which contains entities having
attributes id, name and Age.Also each entity type in a database is described by a name and
a list of attribute.So we may say a table is an entity type
Entity SET
It is a set of entities of same entity type. so a set of one or more entities of Student Entity
type is an Entity Set.
2. Attribute
Once the entities are defined, their properties support them and are known
as the attributes. These attributes also consists of specific values
corresponding to the type of entity they are related with. Attributes
describes the properties and characteristics of the entity.
For example : Attributes of Bank account (Which is an entity) can be “ Account
No, Account Holder Name, Balance etc.”. Also, values of attributes are domain
specific. It means, if account is an entity then balance cannot be negative. There
exists six types of attributes for specific types of entities.
a) Simple Attribute : Simple attribute are those attributes which cannot be divided
further because of their atomic nature.
Let’s make it clear with an example. The Account number of a customer can be a
simple attribute as it cannot be divided further. Date of birth of a person is
another example of simple attribute.
b) Composite Attribute : Composite attributes are those attributes which are the
combination of two or more than two simple attributes joined together.
For example : Name of a customer of account holder can be a composite
attribute.
Hafiz + waleed + khalid → First Name + Middle Name + Last Name {Composite
Attributes}
c) Derived Attribute : Derived Attributes are those attributes whose values are
derived from the already stored attributes in the database.
For example : Database consisting of height of a class. Then value of average
height can be derived from the already available data of students.
d) Single Valued Attribute : Single valued attribute are those which contains only
a single specified value or a single unique value.
For example : Nic Number, SSN No etc.
e) Multi Valued Attribute : Multi-valued attributes are those which can have
multiple value against them.
For example : Address, email, Phone number are multi-valued attributes.
f) Null Value Attribute : Null value attributes are those which can be left blank
without passing any value.
For example : A person can have a name without middle name and hence middle
name field can be left blank or null.
Waleed + khalid → First Name + _______ + Last Name
3. Relationship
ER Model : Relationship
ER Diagram : Introduction
An Entity Relationship Model is generated through ER Diagram i.e. known
as Entity Relationship Diagram which constitutes of various symbols with
the help of which entities, attributes and relationships are represented
diagrammatically. Each of these components has a separate notation. Let’s
discuss them together.
1. Entity : The entity is denoted through a rectangle. These rectangles are named
according to the names of entities.
ER Diagram : Entity
For example : Let the entities be Company, Course, Class and Loan. Then they
will be represented as :
Entity Example
2. Weak Entity : When attributes of an entity are not capable of determining the
entity uniquely, it is called as weak entity. Weak entity is denoted through a
double rectangle.
For example : In a bank, bank branch can be deduced as a weak entity as its
attributes are not enough to determine it uniquely.
Weak Entity Example
ER Diagram : Relationship
Relationship Example
4. Attributes : Attributes in Entity Relationship Diagram are denoted through an
ellipse.
ER Diagram : Attribute
Attribute Example
5. Key Attribute : Key attribute is a type of attribute which alone can determine
the entity uniquely. These are denoted through an ellipse with underline.
For example : An account holding customer of bank can have multiple emails,
multiple mobile numbers and even multiple addresses(Permanent and
Corresponding). They can be termed as multi valued attributes.
For example : Consider the name of a person(First Name + Middle Name + Last
Name).
Total Participation
10. Partial Participation of Entity in Relation : As the name suggests, some of the
entities participates in the relation fully and some of them participates partially.
Partial relation is denoted using single line.
Partial Participation
Specialization : Example
2. Generalization
Aggregation : Concept