Professional Documents
Culture Documents
5fd1c748-de47-491c-b051-20b34245982b
5fd1c748-de47-491c-b051-20b34245982b
5fd1c748-de47-491c-b051-20b34245982b
2
INDEX
1. 4
Introduction
3. 7
Components of ER Diagram
4. 17
Advantages of ER Model
5. 18
Disadvantages of ER Model
6. 19
Specifications of ER Diagram
6. 21
Conclusion
7. 22
Reference
3
Introduction
4
Working with ER Diagrams
For example, in the below diagram, anyone can see and understand what the diagram
wants to convey: Developer develops a website, whereas a Visitor visits a website.
5
Components of ER Diagram
Entity
6
Rhombus is used to setup relationships between two or more entities.
Weak Entity
To represent a Key attribute, the attribute name inside the Ellipse is underlined.
7
Derived Attribute for any Entity
Derived attributes are those which are derived based on other attributes, for example,
age can be derived from date of birth.
To represent a derived attribute, another dotted ellipse is created inside the main
ellipse.
Double Ellipse, one inside another, represents the attribute which can have multiple
values.
8
ER Diagram: Entity
Weak entity is an entity that depends on another entity. Weak entity doesn't have anay
key attribute of its own. Double rectangle is used to represent a weak entity.
ER Diagram: Attribute
9
An Attribute describes a property or characteristic of an entity. For example, Name,
Age, Address etc can be attributes of a Student. An attribute is represented using
eclipse.
10
ER Diagram: Composite Attribute
An attribute can also have their own attributes. These attributes are known as
Composite attributes.
ER Diagram: Relationship
11
1. Binary Relationship
2. Recursive Relationship
3. Ternary Relationship
Binary Relationship means relation between two Entities. This is further divided
into three types.
The above example describes that one student can enroll only for one course and a
course will also have only one Student. This is not what you will usually see in
real-world relationships.
The below example showcases this relationship, which means that 1 student can opt
for many courses, but a course can only have 1 student. Sounds weird! This is how it is.
12
Many to One Relationship
It reflects business rule that many entities can be associated with just one entity.
For example, Student enrolls for only one Course but a Course can have many
Students.
The above diagram represents that one student can enroll for more than one courses.
And a course can have more than 1 student enrolled in it.
13
ER Diagram: Recursive Relationship
Relationship. st
For example, in the diagram above, we have three related entities, Company, Product
and Sector. To understand the relationship better or to define rules around the model,
we should relate two entities and then derive the third one.
14
A Company operates in only one Sector / each sector has many companies operating
in it.
Considering the above two rules or relationships, we see that although the complete
relationship involves three entities, but we are looking at two entities at a time.
Advantages of ER Model
diagram.
• Highly integrated with relational model: ER model can be easily converted into
relational model by simply converting ER model into tables.
• Easy conversion to any data model: ER model can be easily converted into
another data model like hierarchical data model, network data model and so on.
15
Disadvantages of ER Model
• Popular for high level design: ER model is very popular for designing high level
design
Specifications of ER Diagram
16
entity types (which classify the things of interest) and specifies relationships
that can exist between entities (instances of those entity types).
• Entity– relationship modeling was developed for database and design by Peter
Chen and published in a 1976 paper,[1] with variants of the idea existing
previously.[2] Some ER models show super and subtype entities connected by
generalization-specialization relationships,[3] and an ER model can be used also
in the specification of domain-specific ontologies.
• Requirements Gathering
17
This helps the users to plan how to organize data.
• Documentation Tool
ER Diagrams can work as a documentation to make others understand the core of
the database.
• Blueprint
An ER Diagram is considered as the blueprint of the database.
Conclusion
With the help of Entity-Relationship diagram we can create the required database
and perform queries. For example in case of Airline Reservation System we can
make queries like to find the schedule time of a flight, number of booked seats in a
flight, flight fares etc with the help of query language like SQL Relational Algebra,
Relational Calculus etc.
18
Because the two models employ similar design principles, we can convert an E-R
design into a relational design. Converting a database representation from an E-R
diagram to a table format is the way we arrive at a relational-database design from
an E-R diagram.
Reference
www.google.com
Text Book
19