0% found this document useful (0 votes)
265 views22 pages

ER Diagram Part 1

The document describes the key concepts in entity-relationship (ER) modeling including entities, attributes, relationships, cardinalities, weak entities, and the basic structure of an ER diagram using rectangles, diamonds, lines, and other symbols. ER modeling is a graphical technique to understand and organize data independently of the database implementation. The ER diagram shows the logical structure and design of the database at the conceptual level.

Uploaded by

Dev Babbar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
265 views22 pages

ER Diagram Part 1

The document describes the key concepts in entity-relationship (ER) modeling including entities, attributes, relationships, cardinalities, weak entities, and the basic structure of an ER diagram using rectangles, diamonds, lines, and other symbols. ER modeling is a graphical technique to understand and organize data independently of the database implementation. The ER diagram shows the logical structure and design of the database at the conceptual level.

Uploaded by

Dev Babbar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd

ER Diagram

• ER Modeling is a “top-down” approach to database


design.
• ER diagram is the graphical representation of the
overall logical structure of the database.
• Used at the conceptual design phase of the design
process.
Important terms:
• Entity sets
• Relationship sets
• Attributes
ER modelling
• ER modelling : A graphical technique for
understanding and organizing the data independent
of the actual database implementation
• Entity: Any thing that may have an independent
existence and about which we intend to collect
data. Also known as Entity type.
• Entity instance: a particular member of the entity
type e.g. a particular student
• Attributes: Properties/characteristics that describe
entities Relationships: Associations between
entities
ENTITY

• A real-world thing either living or non-living that is


easily recognizable and no recognizable. It is anything
in the enterprise that is to be represented in our
database. It may be a physical thing or simply a fact
about the enterprise or an event that happens in the
real world.
• An entity can be place, person, object, event or a
concept, which stores data in the database. The
characteristics of entities are must have an attribute,
and a unique key. Every entity is made up of some
'attributes' which represent that entity.
Weak Entity Sets
• An entity set that does not have sufficient attributes to form a
primary key is termed a weak entity set.
• An entity set that has a primary key is termed a strong entity
set.
• For a weak entity set to be meaningful, it must be associated
with another entity set, called the identifying or owner entity
set.
• The weak entity set is said to be existence dependent on the
identifying strong entity set.
• The relationship associating the weak entity set with the
identifying entity set is called the identifying relationship.
• The discriminator is a set of attributes for the weak entity set
Weak Entities

• A weak entity is a type of entity which doesn't have its key


attribute. It can be identified uniquely by considering the
primary key of another entity. For that, weak entity sets need
to have participation.
Strong Entity Set Weak Entity Set
Strong entity set always has a It does not have enough
primary key. attributes to build a primary key.
It is represented by a rectangle It is represented by a double
symbol rectangle symbol.
The member of a strong entity set is The member of a weak entity set
called as dominant entity set. called as a subordinate entity set.
Primary Key is one of its attributes In a weak entity set, it is a
which helps to identify its member. combination of primary key and
partial key of the strong entity
set.
In the ER diagram the relationship The relationship between one
between two strong entity set strong and a weak entity set
shown by using a diamond symbol. shown by using the double
diamond symbol.
Attributes
Types of Attributes Description
Simple attribute Simple attributes can't be divided any further. For
example, a student's contact number. It is also called an
atomic value.
Composite attribute It is possible to break down composite attribute. For
example, a student's full name may be further divided
into first name, second name, and last name.
Derived attribute This type of attribute does not include in the physical
database. However, their values are derived from other
attributes present in the database. For example, age
should not be stored directly. Instead, it should be
derived from the DOB of that employee.
Single-valued attribute: The attribute which takes up only a single value for each
entity instance is single-valued attribute. Example: The
age of a student.

Multivalued attribute Multivalued attributes can have more than one values.
For example, a student can have more than one mobile
number, email address.
Relationships
• A relationship type between two entity types
defines the set of all associations between
these entity types .
• Each instance of the relationship between
members of these entity types is called a
relationship instance.
• E.g if Works-for is the relationship between
the Employee entity and the department
entity, then Ram works for Comp.sc
department, shyam works –for electrical
department ..etc are relationship instances of
the relationship, works-for
many to many
Mapping Cardinality
• One to one (1:1)
• One to many(1:M)
• Many to one (M:1)
• Many to many (M:N)

Note: To distinguish among these types, we draw either


a directed line (→ one) or an undirected line (—many)
between the relationship set and the entity set.
• employee head-of department (1:1)
• student enrolls course (m:n)
• lecturer offers course (1:n) assuming a course
is taught by a single lecturer
• Employee worksfor Department(M:1)
• The minimum and maximum values of this
connectivity is called the cardinality of the
relationship
Relationship Participation
• Total : Every entity instance must be
connected through the relationship to another
instance of the other participating entity types
• Partial: All instances need not participate
1. Total Participation

• It specifies that each entity in the entity set


must compulsorily participate in at least one
relationship instance in that relationship set.
• That is why, it is also called as mandatory
participation.
• Total participation is represented using a
double line between the entity set and
relationship set.
 
Partial Participation-
 

• It specifies that each entity in the entity set may or


may not participate in the relationship instance in
that relationship set.
• That is why, it is also called as optional participation.
• Partial participation is represented using a single line
between the entity set and relationship set.
Basic Structure of ER Diagram
• Rectangles divided into two parts :
 The first part contains the name of the entity set.
 The second part contains the names of all the attributes of the
entity set. Attributes that are part of the primary key are
underlined.
• Rectangles: This symbol represent 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
ER Diagram
ER MODEL
• Consider the following requirements list:
• The airline has one or more airplanes.
• An airplane has a model number, a unique registration
number, and the capacity to take one or more passengers.
• An airplane flight has a unique flight number, a departure
airport, a destination airport, a departure date and time,
and an arrival date and time.
• Each flight is carried out by a single airplane.
• A passenger has given names, a surname, and a unique
email address.
• A passenger can book a seat on a flight.
E R MODEL
• A university registrar’s office maintains data about the
following entities: (a) courses, including number, title, credits,
syllabus, and prerequisites;
• (b) course offerings, including course number, year, semester,
section number, instructor(s), timings, and classroom;
• (c) students, including student-id, name, and program; and
• (d) instructors, including identification number, name,
department, and title.
Further, the enrollment of students in courses and grades
awarded to students in each course they are enrolled for must be
appropriately modeled. Construct an E-R diagram for the
registrar’s office. Document all assumptions that you make about
the mapping constraints
ER Diagram
• Basic structure of ER Diagram
– Rectangles
– Diamonds
– Lines
– Undivided rectangles
– Dashed lines
Summary

– Double lines
– Double diamonds
• Mapping cardinality
– Cardinality limits
• Composite attributes
• Roles
• Non-binary relationship sets
• Weak entity sets
• ER Diagram Design Issues
– Use of Entity Sets v/s Attributes
– Use of Entity Sets v/s Relationship Sets
– Binary v/s n-ary relationships
– Placement of Relationship Attributes

You might also like