ENTITY RELATIONSHIP MODEL (top-down-approach)
It is a logical structure of the data base design graphically represented of the process is
called ER- Model.
It is also referred as E-R data model or E-R model.
This E-R model is basically collection of basic objects is called entities and its
relationship.
An entity is a real world thing or objects.
This E-R model widely used in database design.
It is the graphical techniquei.e used to convert the requirement of the system to a
graphical representation for easy to understanding.
It is a Home conceptual model that used the objects as entity,attributes, and
relationship.
Its basic component is ER diagram. It is simple and developer understand system better.
This model is considered as a top-down approach of designing a requirement.
Top-down approach means design entities first after the will goes to Attributes is called
top-down approach(parent node – child node) .
What is entity?
An entity is referred to as a real-world objects.
It can be a name,place,object, class etc., these are represented by a rectangle in a ER-
diagram.
There are 2 types of entities
A) 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.
B) Weak entity: An entity that depends on another entity called a weak entity. The weak
entity doesn't contain any key attribute of its own. The weak entity is represented by a
double rectangle.
DOB AGE
WHAT is attribute?
The attribute is used to describe the property of an entity.
Eclipse is used to represent an attribute.
It can be age,roll_number,or marks for a student.
A) 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 text-Underline
B) Composite Attribute
An attribute that composed of many other attributes is known as composite attribute.
The composite attribute is represented by an ellipse and those ellipse are connected
with ellipse.
Name
First_Name Middle_Name
Last_Name
C) Multilevel Attribute
An attribute can have more than one value. These attributes are known as a multi
valued attribute. The double oval is used to represent multi valued attribute.
For example, a student can have more than one phone number.
D) 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:
Relationship?
A relationship is used to describe the relation between entities. Diamond or rhombus is
used to represent the relationship.
A) One-to-One Relationship
When only one instance of an entity is associated with the relationship, then it is known
as one to one relationship.
B) One-to-many-relationship
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.
C) Many-to-one relationship
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 it is known as a many-to-one
relationship.
For example, Student enrolls for only one course, but a course can have many students.
D) Many-to-many relationship
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 it is known as a many-to-
many relationship.
For example, Employee can assign by many projects and project can have many employees .