0% found this document useful (0 votes)
18 views7 pages

Lecture - 10

Uploaded by

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

Lecture - 10

Uploaded by

aryankrsingh7030
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 7

ER Diagram –

ERDs, also called ER diagrams or ER models, are used to describe data and how pieces of data
interact with one another. For this reason, ERDs are extremely important in database design
and projects that require a clear structure of all data — think of it as the standardized way to
draw a database diagram. By applying this standard, your team can easily understand the
structure of a database or the information you collect within your system.
ER diagrams help to explain the logical structure of databases. ER diagrams are created based
on three basic concepts: entities, attributes and relationships.

Fig. Components of ER Diagram

How to Draw an Entity Relationship Diagram

There are a few basic steps to take to draw an ER diagram

1. Determine the Entities in Your ERD

Start by identifying the “what”s in your system or architecture. Entities are represented with
a rectangle.
2. Add Attributes to Each Entity
Next, consider the attributes that you need to describe each entity. These are drawn and
labelled inside ovals. Connect these to the relevant entity and position your attributes.

3. Define the Relationships Between Entities


Now, think through the relationships or verbs taking place within your system. The easiest
way to do this is to look at each entity and try to connect it to another by saying, “What does
the ___ do with the ___.”

4. Add Cardinality to Every Relationship in your ER Diagram


The final step for this simple ER diagram is to define the amount of data that will come from
each entity. Cardinality is a simple notation that quickly tells your ERD reader whether there
are zero, one, many, or some combination of those factors between each entity.

Symbols used for ER diagram


Recursive Relationships in ER diagrams
A relationship between two entities of a similar entity type is called a recursive relationship.
Here the same entity type participates more than once in a relationship type with a different
role for each instance. In other words, a relationship has always been between occurrences
in two different entities. However, the same entity can participate in the relationship. This
is termed a recursive relationship.

Let us suppose that we have an employee table. A manager supervises a subordinate. Every
employee can have a supervisor except the CEO and there can be at most one boss for each
employee. One employee may be the boss of more than one employee. Let’s suppose that
REPORTS_TO is a recursive relationship on the Employee entity type where each Employee
plays two roles.
1. Supervisor
2. Subordinate
Supervisor
Employee Supervises
1

N
Supervised

N
Player Play with

Case Study –
A General Hospital consists of a number of specialized wards (such as Radiology, Oncology,
etc). Information about ward includes unique name, total numbers of current patients. Each
ward hosts a number of patients, who were admitted by a consultant (doctors) employed by
the Hospital. On admission, the date and time are kept. The personal details of every patient
include name, Medical Recode Number (MRN), set of phones and one address (city, street,
code). A separate register is to be held to store the information of the tests undertaken. Each
test has unique episode No., category and the final result of test. Number of tests may be
conducted for each patient. Doctors are specialists in a specific ward and may be leading
consultants for a number of patients. Each patient is assigned to one leading consultant but
may be examined by other doctors, if required.
draw an ER diagram to represent the data requirements as following:
– Identify the main entity types.
– Identify the main relationship types between the entity types.
– Identify attributes and associate them with entity or relationship types.
– Determine candidate and primary key attributes for each (strong) entity type.
– Determine the multiplicity constraints for each relationship. State any
assumptions necessary to support your design.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy