0% found this document useful (0 votes)
18 views

BCA-C104-SM04

Uploaded by

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

BCA-C104-SM04

Uploaded by

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

Entity-Relationship Diagrams

A conceptual data model of an information system is created using the


data modelling technique known as ER-modeling in software
engineering. Entity-Relationship Diagrams, ER Diagrams, or ERDs
are the names given to diagrams produced utilising this ER modelling
technique.

Purpose of ERD

 The process of creating the ERD helps the database analyst


better comprehend the data that will be stored in the database.
 The ERD is a tool for documentation.
 Finally, the logical organisation of the database is linked to
users via the ERD. The ERD in particular does a good job of
explaining the database's logic to users.

Components of an ER Diagrams

1. Entity

A real-world thing, whether living or inanimate, can be an entity if it


can simply be recognised. In an ER diagram, an entity is represented
by a rectangle. Students, professors, classes, and courses provided, for
instance, can all be treated as entities in a database for a school. These
entities all have a few traits or characteristics that define them as
distinct entities.

Entity Set

A group of similar entity types is referred to as an entity set. Entities


that share similar attribute values can be found in an entity set. For
instance, a Student set might include every student in a school, and an
instructor set would include every instructor in a school from every
faculty. Disjoint entity sets are not required.
2. Attributes

The qualities of entities, also referred to as attributes, are used to


identify them. Every attribute has a value. As an illustration, a student
entity might have the characteristics name, class, and age.
It is possible to assign attributes a domain or range of values. A
student's name, for instance, cannot be a number. It must follow the
alphabet. The age of a pupil cannot be negative, etc.

There are four types of Attributes:

1. Key attribute
2. Composite attribute
3. Single-valued attribute
4. Multi-valued attribute
5. Derived attribute

1. Key attribute: A key is an attribute, or set of properties, that


specifically identifies one entity inside the group of other
entities. For Instance One student can be distinguished from
other students by his roll_number,

Primary key: One of the potential keys the database designer


selected to specifically identify the entity set is the primary key.

2. Composite attribute: A composite attribute is one that


combines several different attributes. For instance, the student
address in a student entity is a composite attribute because an
address is made up of additional details like a pin code, state,
and country.
3. Single-valued attribute: A single value is contained in a single-
valued attribute. Such as Social Security Number.

4. Multi-valued Attribute: An attribute is referred to as multi-valued


if it can have more than one value. The double ellipse represents
properties that have multiple values. A person may have multiple
phone numbers, email addresses, etc.

5. Derived attribute: Derived attributes are those whose values are


derived from those of other attributes that are actually present in the
database but which do not physically reside there. For instance,
date_of_birth can be used to determine age. Derived characteristics
are represented by the dashed ellipse in the ER diagram.
3. Relationships

Relationships are the connections between different entities. The


diamond-shaped box stands for relationships. For instance, a student
enrols in a course and a worker works in a department. Here, the
terms "relationships" refer to Works_at and Enrols.
Cardinality

The term "cardinality" refers to the number of entities in one entity set
that, via a relationship set, can be related to the number of entities in
other sets.

Types of Cardinalities

1. One to One: One entity from entity set A can only contain one
entity from entity set B, and the other way around. Let's assume
that each student has a single student ID that is only ever
assigned to them. Thus, there will be a one-to-one relationship.

Using Sets, it can be represented as:

2. One to many: One-to-many relationships are those where one


instance of one entity is linked to multiple instances of another entity.
For instance, a client can place many orders; multiple customers
cannot place the same order.
Using Sets, it can be represented as:

3. Many to One: While one entity from entity set B can be linked to
several entities from entity set A, more than one entity from entity set
A can only be linked to one entity from entity set B. For instance,
while numerous students can attend one institution, only one student
can attend multiple universities at once.
Using Sets, it can be represented as:

4. Many to Many: A single entity from A may be linked to multiple


entities from B and vice versa. For instance, a student may be
assigned to numerous projects, and numerous students may be
assigned to a single project.

Using Sets, it can be represented as:


The major elements of the Library are shown in this ER diagram,
including the employees, readers, books, publishers, reports, and
authentication system. It makes it possible to comprehend the
connections between different items.
Entities and their Attributes –

 Book Entity: The author, ISBN, title, edition, category, and price
are all listed. The primary key for a book entity is its ISBN.
 Reader Entity: UserId, Email, Address, Phone, and Name are
included. Firstname and lastname are combined to form the
attribute name. Multi-valued phone number attribute. The primary
key for the Readers entity is UserId.
 Publisher Entity: Name, PublisherId, and Year of Publication are
present. The primary key is PublisherID.
 Authentication System Entity: It has a password and LoginId
with LoginID acting as the Primary Key.
 Reports Entity: There are UserId, Registration, Book, and
Issue/Return dates. The primary key of the reports entity is
Reg_no.
 Staff Entity: Name and staff_id are present, with staff_id serving
as the Primary Key.
 Reserve/Return Relationship Set: The three characteristics are
the Reserve Date, Due Date, and Return Date.

Relationships between Entities –

 A reader can reserve N books but one book can be reserved by


only one reader. The relationship 1:N.
 A publisher can publish many books but a book is published by
only one publisher. The relationship 1:N.
 Staff keeps track of readers. The relationship is M:N.
 Staff maintains multiple reports. The relationship 1:N.
 Staff maintains multiple Books. The relationship 1:N.
 Authentication system provides login to multiple staffs. The
relation is 1:N.

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