E-R Model In DBMS
E-R Model In DBMS
E-R Model In DBMS
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.
It develops a conceptual design for the database. It also
it’s own.
The weak entity is represented by double rectangle.
WEAK ENTITY SETS
A weak entity set is an entity set that does not contain
sufficient attributes to uniquely identify its entities. In
other words, a primary key does not exist for a weak
entity set. However, it contains a partial key called as a
discriminator. Discriminator can identify a group
of entities from the entity set.
2. ATTRIBUTE
The attribute is used to describe the property of an entity.
Eclipse is used to represent an attribute.
For example, id, age, contact number, name, etc. can be
attributes of a student.
KEY ATTRIBUTE
The key attribute is used to represent the main
characteristics of an entity. It represents a primary key.
The key attribute is represented by an ellipse with the
text underlined.
COMPOSITE ATTRIBUTE
An attribute that composed of many other attributes is
known as a composite attribute. The composite attribute
is represented by an ellipse, and those ellipses are
connected with an ellipse.
MULTIVALUED ATTRIBUTE
An attribute can have more than one value. These attributes
are known as a multivalued attribute. The double oval is
used to represent multivalued attribute.
For example, a student can have more than one phone
number.
DERIVED ATTRIBUTE
An attribute that can be derived from other attribute is
known as a derived attribute. It can be represented by a
dashed ellipse.
For example, A person's age changes over time and can be
derived from another attribute like Date of birth.
CASE STUDY
Construct an E-R diagram for a car insurance company
whose customers own one or more cars each. Each car
has associated with it Zero to any number of recorded
accidents .
CASE STUDY
RELATIONSHIP
A relationship is an association between two or more
entities of same or different entity set. A set of
relationships of same type is known as relationship set.
DEGREE OF RELATIONSHIP
The number of different entity sets participating in a
relationship set is called as degree of relationship.
Types of relationship
Unary Relationship
Binary Relationship
Ternary Relationship
UNARY RELATIONSHIP
When there is only one entity set participating in a
relation, the relationship is called Unary.
BINARY RELATIONSHIP
When there are two entities set participating in a relation,
the relationship is called Binary.
For example, Student is enrolled in course.
TERNARY RELATIONSHIP
When there are three entities set participating in a
relation, the relationship is called Ternary.
For example, Employee works in a department located in
any location.
CARDINALITY OF
RELATIONSHIP
The cardinality of a relationship is the number of entities
to which another entity can map under that relationship.
It is most useful in describing the relationship sets that
as follows:
i. One to one (1:1)
ii. One to many (1:M)
iii. Many to one (M:1)
iv. Many to many (M:M)
ONE-TO-ONE
In one-to-one mapping, an entity in E1 is associated with at
most one entity in E2, and an entity in E2 is associated
with at most one entity in E1.
For example, a female can marry to one male, and a male
can marry to one female.
ONE-TO-MANY
When only one instance of the entity on the left, and more
than one instance of an entity on the right associates with
the relationship then this is known as a One-To-Many
relationship.
For example, Scientist can invent many inventions, but the
invention is done by the only specific scientist.
MANY-TO-ONE
When more than one instance of the entity on the left, and
only one instance of an entity on the right associates with
the relationship then this is known as a Many-To-One
relationship.
For Example, Student enrolls for only one course, but a
course can have many students.
MANY-TO-MANY
When more than one instance of the entity on the left, and
more than one instance of an entity on the right
associates with the relationship then this is known as a
Many-To-Many relationship.
For example, Employee can assign by many projects and a
project can have many employees.
KEYS
Keys play an important role in the relational database.
It is used to uniquely identify any record or row of data