Dbms Actvty 2
Dbms Actvty 2
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.
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.
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:
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
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
Recursive Relationship
BY :MUDASSIR AHMMAD