0% found this document useful (0 votes)
2 views

Oose First Unit

The document provides an overview of Entity Relationship Diagrams (ERD), which are used to model the structure and relationships of entities in a database. It covers key concepts such as entities, attributes, relationships, and extended features like generalization, specialization, and aggregation. ER diagrams facilitate the visualization and logical representation of real-world objects and their interactions, making them essential for database design.

Uploaded by

abdulshakkur344
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views

Oose First Unit

The document provides an overview of Entity Relationship Diagrams (ERD), which are used to model the structure and relationships of entities in a database. It covers key concepts such as entities, attributes, relationships, and extended features like generalization, specialization, and aggregation. ER diagrams facilitate the visualization and logical representation of real-world objects and their interactions, making them essential for database design.

Uploaded by

abdulshakkur344
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

OBJECT ORIENTED SOFWARE ENGINEERING (OOSE)

UNIT 1: INTRODUCTION TO ENTITY RELATIONSHIP DIAGRAM (ERD)


1. Entity
2. Attribute
3. Relationship
4. Extended Features of E-R Diagram
a. Generalization
b. Specialization
c. Aggregation

Introduction of ER Model:
The Entity Relationship Model is a model for identifying entities to be represented
in the database and representation of how those entities are related.
Peter Chen developed the ER diagram in 1976. The ER model was created to
provide a simple and understandable model for representing the structure and logic
of databases. It has since evolved into variations such as the Enhanced ER Model
and the Object Relationship Model.
The Entity Relationship Diagram explains the relationship among the entities
present in the database. ER models are used to model real-world objects like a
person, a car, or a company and the relation between these real-world objects. In
short, the ER Diagram is the structural format of the database.

The Entity Relationship Diagram explains the relationship among the entities
present in the database. ER models are used to model real-world objects like a
person, a car, or a company and the relation between these real-world objects. In
short, the ER Diagram is the structural format of the database.
Why Use ER Diagrams?

 ER diagrams represent the E-R model in a database, making them easy to


convert 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.

What is Entity?
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. Entities refer to
tables used in databases. Entity Type is represented as

What is Attribute?
Attribute are the properties that define the entity type. For example,
RollNo, Name, DOB, Age, Address, and MobileNo are the attributes that
define entity type Student. In ER diagram, the attribute is represented by
an oval.

Types of Attributes:
1. 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.

2. 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.

3. 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.

4. 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:
 Types of Relationships:

 One-to-One (1:1): Each instance of Entity A is related to exactly one instance of


Entity B and vice versa. Example: A "Person" has one "Passport."
 One-to-Many (1:N): An instance of Entity A can relate to many instances of Entity
B, but an instance of Entity B relates to only one instance of Entity A. Example: A
"Teacher" teaches many "Courses."
 Many-to-Many (M:N): An instance of Entity A can relate to many instances of
Entity B, and an instance of Entity B can relate to many instances of Entity A.
Example: A "Student" enrolls in many "Courses," and each "Course" can have many
"Students." (Implemented in databases using a junction table.)

 Attributes on Relationships:

 Relationships can have attributes of their own, especially in many-to-many


relationships.
 Example: A "Borrow" relationship between "Customer" and "Book" might have an
attribute "Borrow Date."

Cardinality:

 Specifies the number of instances of an entity that can be associated with another
entity.
 Represented using numbers (e.g., 1, N) or notation like "Crow’s Foot."
 Extended Features of E-R Diagram:
Generalization, Specialization and Aggregation in
ER Model

Using the ER model for bigger data creates a lot of complexity while
designing a database model, So in order to minimize the complexity
Generalization, Specialization, and Aggregation were introduced in the ER
model. These were used for data abstraction. In which an abstraction
mechanism is used to hide details of a set of objects. In this article we will
cover the concept of Generalization, Specialization, and Aggregation with
example.

Generalization
Generalization is the process of extracting common properties from a set
of entities and creating a generalized entity from it. It is a bottom-up
approach in which two or more entities can be generalized to a higher-
level entity if they have some attributes in common. For Example,
STUDENT and FACULTY can be generalized to a higher-level entity
called PERSON as shown in Figure 1. In this case, common attributes like
P_NAME, and P_ADD become part of a higher entity (PERSON), and
specialized attributes like S_FEE become part of a specialized entity
(STUDENT).
Generalization is also called as ‘ Bottom-up approach”.
Specialization
In specialization, an entity is divided into sub-entities based on its
characteristics. It is a top-down approach where the higher-level entity is
specialized into two or more lower-level entities. For Example, an
EMPLOYEE entity in an Employee management system can be
specialized into DEVELOPER, TESTER, etc. as shown in Figure 2. In this
case, common attributes like E_NAME, E_SAL, etc. become part of a
higher entity (EMPLOYEE), and specialized attributes like TES_TYPE
become part of a specialized entity (TESTER).
Specialization is also called as ” Top-Down approch”.

Aggregation:
Aggregation in an Entity-Relationship Diagram (ERD) is a concept used to
model a situation where a relationship itself becomes an entity, allowing it to
participate in another relationship. It provides a higher level of abstraction by
treating a relationship as a single unit that can be connected to other entities or
relationships.

You might also like