0% found this document useful (0 votes)
34 views6 pages

Dbms Actvty 2

An entity-relationship (ER) diagram visually represents the relationships between different entities in a database. To create an ER diagram, one identifies the relevant entities and their attributes, defines the relationships between entities, and draws the entities as rectangles connected by lines representing relationships. Cardinality and other notations are then added to further specify the nature of the relationships. ER diagrams provide a clear way to design and understand the structure and logic of a database before implementation.

Uploaded by

Mmi Indabettu
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)
34 views6 pages

Dbms Actvty 2

An entity-relationship (ER) diagram visually represents the relationships between different entities in a database. To create an ER diagram, one identifies the relevant entities and their attributes, defines the relationships between entities, and draws the entities as rectangles connected by lines representing relationships. Cardinality and other notations are then added to further specify the nature of the relationships. ER diagrams provide a clear way to design and understand the structure and logic of a database before implementation.

Uploaded by

Mmi Indabettu
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/ 6

CREATING AN ENTITY-RELATIONSHIP (ER) DIAGRAM INVOLVES VISUALLY REPRESENTING THE

RELATIONSHIPS BETWEEN DIFFERENT ENTITIES IN A DATABASE. FOLLOW THESE STEPS TO


CREATE AN ER DIAGRAM:
Identify Entities: Determine the en es involved in the system you're modelling. En es are
objects, concepts, or things that have a ributes and can be stored in a database.

Identify Relationships: Define the rela onships between the en es. Rela onships describe
how the en es are connected or associated with each other.

Determine Attributes: Identify the attributes (properties) of each entity. Attributes provide
details about the entities and are used to describe them further.

Draw Entities: Use rectangles to represent entities. Write the entity name inside the
rectangle.

Draw Relationships: Use diamonds to represent relationships. Connect the related entities
with lines and label the lines to describe the relationship type (one-to-one, one-to-many,
many-to-many).

Add Attributes: For each entity, draw ovals or ellipses connected to the entity's rectangle
to represent attributes. Write the attribute names inside these shapes.

Define Primary Keys: Identify the primary key for each entity. The primary key uniquely
identifies each record within the entity.

Specify Cardinality: Indicate the cardinality of the relationships using numbers or symbols
near the relationship lines. Common notations include "1" for one, "M" for many, and "0"
for optional relationships.

Draw Crow's Foot Notation: Use lines or arrows to represent the cardinality and
participation constraints. Crow's Foot notation is commonly used for this purpose.

Refine and Review: Review the diagram to ensure accuracy and completeness. Make any
necessary adjustments to improve the clarity and correctness of the diagram.

Documentation: Create documentation to accompany the diagram, explaining the


entities, relationships, attributes, and any other important details. `

Use ER Diagram Tools: There are several software tools available for creating ER diagrams,
such as Lucidchart, Draw.io, Microsoft Visio, or even simple drawing tools like pen and
paper.

Remember that ER diagrams are a visual representation of a database's structure and


relationships. They help in designing and understanding database systems before actual
implementation. Be sure to communicate effectively with stakeholders and team members
to ensure the accuracy of the diagram and its alignment with the intended system design.
What is an ER diagram?
An Entity Relationship Diagram (ERD) is a visual representation of different entities
within a system and how they relate to each other. It is a tool used to design and model
relational databases, and shows the logical structure of the database. ER diagrams use
symbols to represent entities, attributes, and relationships, which help to illustrate the
relationships between the entities in the database. ER diagrams are commonly used in
software engineering and database design to help developers and stakeholders
understand and design complex databases. For example, the elements writer, novel,
and a consumer may be described using ER diagrams the following way:

What is the use of ER Diagrams?


What are the uses of ER diagrams? Where are they used? Although they can be used
to model almost any system they are primarily used in the following areas.

ER Models in Database Design

They are widely used to design relational databases. The entities in the ER schema
become tables, attributes and converted the database schema. Since they can be used
to visualize database tables and their relationship, it’s commonly used for database
troubleshooting as well.
Entity relationship diagrams in software engineering

Entity relationship diagrams are used in software engineering during the planning
stages of the software project. They help to identify different system elements and their
relationships with each other. It is often used as the basis for data flow diagrams or
DFD’s as they are commonly known.

For example, an inventory software used in a retail shop will have a database that
monitors elements such as purchases, item, item type, item source and item price.
Rendering this information through an ER diagram would be something like this:

Entity Relationship Diagram (ERD) Symbols and Notations

There are three basic elements in an ER Diagram: entity, attribute, relationship. There
are more elements which are based on the main elements. They are weak entity, multi
valued attribute, derived attribute, weak relationship, and recursive relationship.
Cardinality and ordinality are two other notations used in ER diagrams to further define
relationships.

Entity

An entity can be a person, place, event, or object that is relevant to a given system. For
example, a school system may include students, teachers, major courses, subjects,
fees, and other items. Entities are represented in ER diagrams by a rectangle and
named using singular nouns.

Weak Entity

A weak entity is an entity that depends on the existence of another entity. In more
technical terms it can be defined as an entity that cannot be identified by its own
attributes. It uses a foreign key combined with its attributed to form the primary key. An
entity like order item is a good example for this. The order item will be meaningless
without an order so it depends on the existence of the order.

Attribute

An attribute is a property, trait, or characteristic of an entity, relationship, or another


attribute. For example, the attribute Inventory Item Name is an attribute of the entity
Inventory Item. An entity can have as many attributes as necessary. Meanwhile,
attributes can also have their own specific attributes. For example, the attribute
“customer address” can have the attributes number, street, city, and state. These are
called composite attributes. Note that some top level ER diagrams do not show
attributes for the sake of simplicity. In those that do, however, attributes are
represented by oval shapes.
Multivalued Attribute

If an attribute can have more than one value it is called a multi valued attribute. It is
important to note that this is different from an attribute having its own attributes. For
example, a teacher entity can have multiple subject values.

Multivalued Attribute

If an attribute can have more than one value it is called a multi valued attribute. It is
important to note that this is different from an attribute having its own attributes. For
example, a teacher entity can have multiple subject values.

Derived Attribute

An attribute based on another attribute. This is found rarely in ER diagrams. For


example, for a circle, the area can be derived from the radius.
Relationship
A relationship describes how entities interact. For example, the entity “Carpenter” may
be related to the entity “table” by the relationship “builds” or “makes”. Relationships are
represented by diamond shapes and are labeled using verbs.

Recursive Relationship

If the same entity participates more than once in a relationship it is known as a


recursive relationship. In the below example an employee can be a supervisor and be
supervised, so there is a recursive relationship.

Cardinality and Ordinality


These two further defines rela onships between en es by placing the rela onship in the context
of numbers. In an email system, for example, one account can have mul ple contacts. The
rela onship, in this case, follows a “one to many” model. There are a number of nota ons used to
present cardinality in ER diagrams. Chen, UML, Crow’s foot, Bachman are some of the popular
nota ons. Creately supports Chen, UML and Crow’s foot nota ons.The following example uses
UML to show cardinality

BY :MUDASSIR AHMMAD

You might also like