0% found this document useful (0 votes)
6 views73 pages

DBMS - Unit - 2 - Database DesignandERdiagrams - Teams

The document provides an overview of Database Design and Entity-Relationship (ER) Diagrams, covering key concepts such as entity sets, attributes, relationships, and normalization. It details the structure of ER models, including types of relationships (unary, binary, ternary, and n-ary) and constraints like cardinality and participation. Additionally, it explains the representation of entities and attributes in ER diagrams, including key attributes and weak entities.

Uploaded by

G.Chandra Shekar
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)
6 views73 pages

DBMS - Unit - 2 - Database DesignandERdiagrams - Teams

The document provides an overview of Database Design and Entity-Relationship (ER) Diagrams, covering key concepts such as entity sets, attributes, relationships, and normalization. It details the structure of ER models, including types of relationships (unary, binary, ternary, and n-ary) and constraints like cardinality and participation. Additionally, it explains the representation of entities and attributes in ER diagrams, including key attributes and weak entities.

Uploaded by

G.Chandra Shekar
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/ 73

Vallurupalli Nageswara Rao Vignana Jyothi Institute of

Engineering &Technology

Department of Computer Science & Engineering

SUBJECT: Database Management System


Subject Code: 19PC1CS04

Topic Name: Database Design and ER Diagrams


II year, sec: B

Bhagya Rekha Konkepudi


Assistant Professor
Email: [email protected]
1
<Web link of your created resource if any>

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022
Agenda
▪ Entity sets, Relationships and Relationship sets
▪ ER diagrams
▪ Entities, Attributes
▪ Additional features of ER Model
▪ Conceptual Design with the ER Model
▪ Conceptual Design for Large enterprises.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 2
Database Design

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 3
Database Techniques

E-R Modelling

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 4
Database Techniques Cont.….
Normalization

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 5
Entity Relationship Model
▪ An Entity–relationship model (ER model) describes the structure of a database with
the help of a diagram, which is known as Entity Relationship Diagram (ER Diagram). An
ER model is a design or blueprint of a database that can later be implemented as a
database.
▪ The E-R model basically employs Three basic notions:
▪ Entity Sets
▪ Relationship sets
▪ Attributes

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 6
Entity sets, Relationships and Relationship sets
Entity Set
▪ An Entity may be an object with a physical existence E1
– a particular person, car, house, or employee E2
– or it may be an object with a conceptual existence E3
– a company, a job, or a university course.
▪ An Entity is an object of Entity Type and set of all entities is called as entity set and they are of same type.
They also share same properties.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 7
Entity sets, Relationships and Relationship sets Cont..
Attribute
▪ Attributes are the properties which define the entity type.
▪ For example, Employee No, Employee Name, DOB, Age, Address, Mobile Number are the
attributes which defines entity type Employee.
▪ In ER diagram, attribute is represented by an oval.

E1
E2
E3

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 8
Entity sets, Relationships and Relationship sets Cont..
Relationship Set
▪ A relationship type represents the association between entity types.
▪ For example, ‘Works Under’ is a relationship type that exists between entity type Employee and
department.
▪ A set of relationships of same type is known as relationship set. The following relationship set
depicts E1 is works under D2, E2 works under D1 and E3 works under D3.

E1
E2
E3

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 9
Entity sets, Relationships and Relationship sets Cont..
Relationship Set
Let us understand the definition in mathematical relation.
In detail, the entity set E1, E2, …., En participate in relationship set R.

E1
E2
E3

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 10
Entity sets, Relationships and Relationship sets Cont..
Properties of Relationship type
▪ Degree of relationship
▪ Degree of relationship type is the number of participating entity types.
▪ A relationship type of degree two is called the binary relationship and one of
degree 3 is called ternary relationship
▪ Role name and recursive relationship
▪ Each entity type that participates in a relationship type plays a particular role
in the relationship.
▪ The role name signifies the role that a participating entity plays from entity
type in each relationship instance and help to explain what the relationship
means.
▪ For example in works for relationship type employee plays the role of
employee and dept plays the role of dept.
▪ Role name are not technically necessary where all the participating entity
types are distinct. Since each participating entity type name can be used as
role name.
▪ However, in some cases the same entity type participates more then once in a
relationship type in different roles. In such cases the role name becomes
essential for distinguishing the meaning of each participation such
relationship types are called recursive relationship.
Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 11
Entity sets, Relationships and Relationship sets Cont..
Degree of Relationship set
The number of entity sets that participated in a relationship set is called degree of relationship. There are
various types of relationship as shown below.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 12
Entity sets, Relationships and Relationship sets Cont..
Unary Relationship Set
In this Relation ship set only one entity set participate in a relationship set.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 13
Entity sets, Relationships and Relationship sets Cont..
Binary Relationship Set
In this Relation ship set only two entity sets will participate in a relationship set.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 14
Entity sets, Relationships and Relationship sets Cont..
Ternary Relationship Set
In this Relation ship set only three entity sets will participate in a relationship set.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 15
Entity sets, Relationships and Relationship sets Cont..
N-Ary Relationship Set
N-Ary relationship set is nothing but ‘n’ entity sets will participate in a relationship set.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 16
Constraints
An E-R Enterprise schema may define certain constraints to which contents of the database may conform.
So, it is necessary for us to understand the below concepts to implement them in database:

▪ Cardinality ratios
▪ Key Constraints
▪ Participation Constraints

E1
E2
E3

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 17
Constraints Cont.…
Cardinality ratios for binary relationship
▪ Cardinality ratio for binary relationship specifies the maximum number of the relationship instances that
an entity can participate in.
▪ for example in the works for binary relationship type, department : employee is of cardinality ratio 1:N,
meaning that each department can be related to any number of employees but an employee can be
related to only one department.
▪ The possible cardinality ratios for binary relationship types are :
▪ One to One (1:1)
▪ One To Many (1: N)
▪ Many To One (N: 1)
E1
▪ Many To Many (N: M) E2
E3

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 18
Constraints Cont.…
One to One
An entity in entity type (E) can be associated with only one number of entities in another entity type (D),
and an entity in entity type (D) can be associated with only one number of entities in entity type (E).

Only one Employee(Manager) can manage a department and only one department will be managed by
employee

E1
E2
E3

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 19
Constraints Cont.…
One to Many
An entity in entity type (E) can be associated with any number of entities in another entity type (D), and an
entity in entity type (D) can be associated with any number of entities in entity type (E).

An Employee can have more than one dependent details and a dependent belong to only one employee in an
organization.

E1
E2
E3

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 20
Constraints Cont.…
Many to One
An entity in an entity type (E) is associated with an entity in another entity type (D), and an entity in entity
type (D) can be associated with any number of entities in entity type (E).
An Employee works under department but department can contain many employees.

E1
E2
E3

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 21
Constraints Cont.…
Many to Many
An entity in entity type (E) can be associated with any number of entities in another entity type (P), and
an entity in entity type (P) can be associated with any number of entities in entity type (E).
More than one employee can on one or many projects.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 22
Constraints Cont.…
Key Constraints
• Keys play an important role in the relational database.
• It is used to uniquely identify any record or row of data from the table. It is also used to establish and
identify relationships between tables.
• There are different keys in entity relational model that are mentioned below.

Super Key

Candidate Key

Primary Key

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 23
Constraints Cont.…
▪ Super Key
▪ The set of attributes that collectively allows us to uniquely identify an entity in the entity set.
▪ Example: Employee No Attribute of the entity set employee is sufficient to uniquely identity an entity, Thus employee ID is
super key. Similarly the combination of employee ID and employee name is also a super key.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 24
Constraints Cont.…
▪ Candidate Key
▪ The minimal set of attribute which can uniquely identify a entity set is known as Candidate Key.
▪ Example: Employee NO in the entity set Employee where the value of candidate key which is unique and Not NULL is
sufficient to uniquely identify an entity.
▪ The candidate key can be simple (having only one attribute) or composite as well.
Example: (Emp No and Dept No) is a composite candidate key for relation Employee and department.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 25
Constraints Cont.…
Primary Key
▪ There are will be only one primary key in an entity set where as it can have more than one candidate key.
▪ Example: Employee No and employee address are candidate keys but employee No can be chosen as primary key.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 26
Constraints Cont.…
Participation constraints
▪ The participation constraint specifies whether the existence of an entity depends on its being related
to another entity via the relationship type.
▪ This constraint specifies the minimum number of relationship instances that each entity can
participate in, and is sometime called minimum cardinality constraint.
▪ There are two types of participation constraints
▪ Total participation constraints
▪ Partial participation constraints

E1
E2
E3

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 27
Constraints Cont.…
Total participation constraints
▪ The participation of an entity type E in a relationship type R is said to be total if every entity in entity
type E participates in at least one relationship in relationship type R.
▪ For example if a company policy states that every employee must work for a department, then an
employee entity can exist only if it participate in at least one works for relationship instance.
▪ Thus the participation of employee in works for relationship type is called total participation, meaning
that every entity in “the total set of” employee entities must be related to a department entity via works
for relationship type.
▪ Total participation is also called existence dependency.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 28
Constraints Cont.…
Partial participation constraints
▪ In some cases we do not expect every employee to manage a department, so the participation of
employee in the “Has” relationship type is partial, meaning that some or “part of the set of”
employee entities are related to some dependent entity via ”HAS”, but not necessarily all.
▪ “If only some entities in entity type E participate in relationship in relationship type R, the
participation of entity type E in relationship type R is said to be partial”

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 29
E-R diagrams
▪ E-R Diagrams can express the overall logical structure of database graphically.
▪ These are 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 relationships it’s commonly used for
database troubleshooting as well.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 30
E-R diagrams Cont..

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 31
E-R diagrams
Major components of E-R Diagram

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 32
E-R diagrams Cont..
Entity
An entity is an object or component of data. An entity is represented as rectangle in an ER diagram.

In the above ER diagram we have two entities customer and account participate in a relationship
“Depositor”.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 33
E-R diagrams Cont..
▪ Weak Entity:
An entity that cannot be uniquely identified by its own
attributes and relies on the relationship with other entity is
called weak entity.
▪ The weak entity is represented by a double rectangle.
▪ The Below ER Diagram is an example showing the
relationship between Loan and payment where payment is
weak entity set so double outlined and the relationship is
also double outlines with “Loan_Payment”.
Loan Number Payment Number
LN123456789 001
LN123456789 002
LN123456897 001
LN123456897 002
Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 34
E-R diagrams Cont..
Attribute
An attribute describes the property of an entity. An attribute is represented as Oval in an ER diagram.
Following are different types of attributes:
▪ Key attribute (Primary Key)
▪ Multivalued attribute
▪ Single Valued attribute
▪ Derived attribute
▪ Composite attribute
▪ Descriptive Attribute

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 35
E-R diagrams Cont..
Key attribute (primary Key)
▪ A key attribute can uniquely identify an entity from an entity set.
▪ Key attribute is represented by oval same as other attributes however the text of key attribute is
underlined.
▪ For example, Customer number is primary key which is underlined and attribute employee name is
normal attribute.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 36
E-R diagrams Cont..
Multi-valued attribute
▪ An attribute that can hold multiple values is known as multivalued attribute. It is represented with double
ovals in an ER Diagram.

In the above Example, The attribute phone number of the entity Customer can contain multiple values as there
might be Customers holding more than two numbers and both numbers might be registered into bank enterprise
as part communication.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 37
E-R diagrams Cont..
Single-valued attribute
Simple attributes are those that cannot be divided further.

The attributes mentioned in the above example are simple attributes.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 38
E-R diagrams Cont..
Derived attribute
▪ A derived attribute is one whose value is dynamic and derived from another attribute. It is represented
by dashed oval in an ER Diagram.
▪ As per the below diagram, The attribute “Age” for each customer is derived attribute and is calculated
using the “Date Of Birth” Attribute of Customer.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 39
E-R diagrams Cont..
Composite attribute
▪ An attribute that is a combination of other attributes is known as composite attribute.

In the above ER diagram, Employee name is composed of three attributes i.e. First Name, Middle Name and
Last Name.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 40
E-R diagrams Cont..
Descriptive attribute
▪ The attribute(s) used for describing the relationship is called descriptive attributes, also referred as
relationship attributes.
▪ They are actually used for storing information about the relationship. A relationship can have zero or
more attributes.
▪ As per the ER Diagram, customer is in relation “Depositor” with Account. The attribute “Access Date” is
descriptive attribute which stores only one value Date w.r.t last access date of the account by the
customer.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 41
E-R diagrams Cont..
Relationship
A relationship is represented by diamond shape in ER diagram, it shows the relationship among entities.
There are four types of relationships:

▪ One to One
▪ One to Many
▪ Many to One
▪ Many to Many

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 42
E-R diagrams Cont..
One to One Relationship
▪ The Entity Employee is associated with at most one entity in Entity Set Department and Vice Versa.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 43
E-R diagrams Cont..
One to Many Relationship
▪ When a single instance of an entity is associated with more than one instances of another entity then it
is called one to many relationship.
▪ In the below Example, the entity Customer has one to many relationship with Payment i.e. it can have
more than one payment.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 44
E-R diagrams Cont..
Many to One Relationship
When more than one instances of an entity is associated with a single instance of another entity then it is called many
to one relationship.
In the below Example, The entity Loan must be associated with some Branch i.e. the loan must be taken or tagged to
one branch for sure. In another way, More than one Loan entity will be associated with the Branch entity.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 45
E-R diagrams Cont..
Many to Many Relationship
When more than one entity of an Entity type (C) is
associated with any number of entities in another
entity type (L), and an entity in entity type (L) can be
associated with any number of entities in entity type
(C).

To understand this example with an ER diagram using


Bank enterprise, we can say that a customer can take
multiple loans like Home Loan, car loan or Personal in
an enterprise and a Loan can also include more than
an customer if we can consider some kind of business
loans or home loans as well.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 46
Extended E-R Features
▪ As the complexity of data increased in the late 1980s, it became more and more difficult to use the
traditional ER Model for database modelling.
▪ Hence following improvements or enhancements were made to the existing ER Model to make it able to
handle the complex applications better.
1. Specialization
2. Generalization
3. Attribute Inheritance
4. Aggregation

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 47
Extended E-R Features Cont..
Specialization
▪ The process of designating sub groupings which are distinct within an entity set is called specialization.
▪ For instance, a subset of entities within an entity set may have attributes that are not shared by all the
entities in entity set.
▪ The E-R Model provides a means for representing these distinctive entity groupings and is represented by
shape “Triangle” component labeled “IS A”.
▪ The “IS A” relationship may also be referred as superclass-subclass relationship. Higher and lower level
entity sets are depicted as regular entity sets.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 48
Extended E-R Features Cont..
Example of Specialization
▪ To understand the concept easily, let us consider an
entity set “PERSON” with attributes Person ID, Name,
Street and City. And this Entity can be divided into
subgroupings i.e. entity sets Employee and Customer.
▪ The specialized entities Employee and Customer have
specialized attributes like Salary and Credit Rating
along with the Person Entity attributes.
▪ Also we can see that Employee has specialized entities
Officer, Teller and secretary will have specialized
attributes like Office Number, Station Number and
Hours Worked along with the attributes of Employee.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 49
Extended E-R Features Cont..
Generalization
▪ Generalization is the process of extracting common properties from set of entities and create a
generalized entity from it.
▪ This is bottom up approach in which 2 or more entities can be generalized into a higher level entity.In
another words, we can say that generalization is inversion of specialization.
▪ There is no difference between specialization and generalization, it is simply the approach that we use
while design the new levels of entity representation will be distinguished.
▪ Similar to Specialization, In E-R Model Generalization is represented by shape “Triangle” component
labeled “IS A”.
▪ The “IS A” relationship may also be referred as superclass-subclass relationship. Higher and lower level
entity sets are depicted as regular entity sets.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 50
Extended E-R Features Cont..
Example of Generalization
▪ The sample example of specialization can be used here
to understand Generalization as well.
▪ Let us start understand the example using bottom up
approach where the designer might have identified
Customer and Employee entity based on the
requirements.
▪ But if we check the attributes of Both
Employee(Employee ID, Employee Name, Employee
street, employee city and Employee Salary) and
Customer(Customer ID, Customer Name, Customer City,
Credit Rating and Customer Street), then we can find
similarities in the attributes of both Entity Sets.
▪ So Such commonality can be expressed as
Generalization.
Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 51
Extended E-R Features Cont..
Constraints on Generalization
▪ There are two different types of constraints that designer may need to choose constraints on particular
generalization.
▪ Constraints involved in determining the entities for low level entity set.
▪ Condition defined/attribute defined
▪ User defined

▪ Constraints related to whether or not entities belong to more than one lower level entity set within a
single generalization
▪ Disjoint
▪ Overlapping

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 52
Extended E-R Features Cont..
Constraints on Generalization
Constraints involved in determining the entities for low level entity set.
▪ Condition defined/attribute defined
▪ Membership of the lower level entity sets is evaluated by checking the explicit condition.
▪ Example: All employee entities are evaluated on the defining designation attribute. i.e. the entities
satisfy the designation “Teller” belong to the lower level entity Tester.
▪ User defined
▪ Based on the business requirement, the Designer can define the super-class, sub-class relationship.
▪ Example: Manager delegates the roles and responsibilities and will promote or demote them to
particular designation.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 53
Extended E-R Features Cont..
Constraints on Generalization
Constraints related to whether or not entities belong to more than one lower level entity set within a single
generalization
▪ Disjoint
▪ An entity belong to no more than one lower level entity set.
▪ Example: An employee can satisfy only one condition for the designation attribute. i.e. at an instance
the attribute can hold only one value either Clerk or Accountant or manager but cannot by more
than one at a time.
▪ Overlapping
▪ The same entity may belong to more than one lower level entity set.
▪ Example: In an organization, Relationship Manager of bank can manage more than one team entity
that are lower entity sets of employee.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 54
Extended E-R Features Cont..
Completeness Constraint
Final constraint on generalization and specialization specifies which entity should belong to lower level
entity by following any of the below:
▪ Total Generalization/Specialization
▪ Each Higher level entity should belong to Low-level entity
▪ Example: The Account Entity Set can be considered Total, as the Account type should be Savings or
Checking for Sure.
▪ Partial Generalization/Specialization
▪ Some High level entities may not belong to any low level entity set.
▪ Example: when a employee joins an organization as fresher, then he will not fall into any low level
entity sets i.e. Accountant, Clerk or Manager.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 55
Extended E-R Features Cont..
Attribute inheritance
▪ A Crucial property of the higher level and lower level entities created by specialization and generalization
is attribute inheritance.
▪ Attributes of higher-level entity-sets are inherited by lower-level entity-sets. Example: The attributes of
the employee and Customer are inherited from Person.
▪ These Low level entity sets also inherit the participation of the Relationships also from the higher-level
entity-sets. Although a lower-level entity-set can participate in its own relationship-sets, too. Example:
As the Employee entity set participates in Relationship “Works For” Then, The low level entity sets Teller,
Secretary and Manager also participate in the relationship “Works For”.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 56
Extended E-R Features Cont..
Hierarchy
▪ Another concept that can be depicted here is
Hierarchy of Entity Sets and it can either Single
Inheritance or Multiple inheritance.
▪ In Detail, If the Low Level entity set participates in
only one “IS A” relationship then it is called Single
Inheritance.
▪ W.r.t Multiple Inheritance, If Low Level entity
participated in more than one “IS A” relationship
then it is called multiple Inheritance and the
structure is also called as “Lattice”.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 57
Extended E-R Features Cont..
Aggregation
▪ Aggregation is a process when relation between two entities
is treated as a single entity.
▪ Another option is to treat works_on relationship as an
aggregate.
▪ Build a relationship against the aggregate
▪ manages implicitly includes set of entities participating in a
works_on relationship instance.
▪ Jobs can also have no manager.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 58
Design Issues
▪ Till now, we learned to design an ER diagram and we have gone through different ways of defining entity
sets and relationships among them.
▪ Also learned about designing shapes that represent a relationship, an entity, and its attributes.
▪ But users often mislead the concept of the elements and the design process of the ER diagram. Thus, it
leads to a complex structure of the ER diagram and certain issues that does not meet the characteristics
of the real-world enterprise model.
▪ Let us discuss the basic design issues of an ER database schema in the following points:
▪ Use of Entity sets Vs Attributes
▪ Use of Entity sets Vs Relationship sets
▪ Binary Vs n-ary Relationship sets
▪ Placement of Relationship attributes.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 59
Design Issues Cont.…
Use of Entity sets Vs Attributes
▪ The use of an entity set or attribute depends on the structure of the real-world enterprise that is being
modelled and the semantics associated with its attributes.
▪ The issue can be understood using some examples: Employee Entity want to use the attribute address in ER
diagram to store the address but it can be done in 2 ways:
▪ Capturing more than 1 address of an employee as multivalued attribute in employee entity.
▪ Recording the structure of the address in employee Entity

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 60
Design Issues Cont.…
Use of Entity sets Vs Attributes
▪ Second Example is the phone number details to be collected
for an Employee which can be implemented in below ways:
▪ Either it can be place as attribute in the Employee entity set
where it can accept more than one phone number (if
required).
▪ Another way is to treat phone number as an separate entity
and employee will participate in the relationship

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 61
Design Issues Cont.…
Use of Entity sets Vs Relationship sets
▪ The design issues w.r.t implementation of an object as entity set or
Relationship set can be understood using an scenario in bank
enterprise where Customer, Loan and Branch are participating in
relationship as shown in the ER Diagram.
▪ As a designer, this can be implemented in another way i.e. loan can be
declared as relationship between customer and Branch.
▪ The requirement can be taken in the below manner.
▪ If bank allows only one person i.e. customer associated with a branch can
take a loan, then we can consider loan as relationship.
▪ But if we take another requirement that is more than one customer can
jointly take a loan then for each holder there will be a relationship
defined. Then we might have to use the Loan number and amount as
descriptive attributes for the relationship.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 62
Design Issues Cont.…
Use of Entity sets Vs Relationship sets
Now let us understand the consequences of using this loan relationship in the design.
- The data will be stored in multiple places, wasting storage spaces.
- Updates potentially leave the data in an inconsistent state, where the values differ in two relationships for
attributes that are supposed to have the same value.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 63
Design Issues Cont.…
Use of Binary Vs n-Ary Relationship sets
▪ We all know that there are various types of relationships exist and often some of them are binary. But if we
can think in another way, it can be like non- binary relationships can be represented by several binary
relationships.
▪ Considering the example of Bank enterprise, where the entity sets customer, Account and Branch are
participating in ternary relationship but it can be represented in two different relationships customer and
Branch provide u a record for the customer who is holding a loan account at particular branch.
▪ Let us look into the generalized straight forward manner into N-Ary relationship sets. Even though we can
restrict E-R Model to use only Binary relationships sets, But this restriction is not always desirable.
▪ An identifying attribute can be created for the entity set to represent the relationship set. But this attribute along
with the extra relationship sets required and increases the complexity of the design.
▪ A N-ary relationship set shows more clearly that several entities participate in single relationship.
▪ There may not be a way to translate constraints on ternary relationship into constraints on the binary relationships.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 64
Design Issues Cont.…
Use of Binary Vs n-Ary Relationship sets
▪ Consider the below example where entities Employee, Branch and Job participate in the relationship
“Works_On”.
▪ If we closely observe on this ER Diagram, we cannot split “Works_On” into binary relationships between
employee and Branch. Also for Employee and Job.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 65
Design Issues Cont.…
▪ Placement of Relationship Attributes
▪ In a Bank enterprise, where Customer entity is participating in relationship “depositor” with Account which is
one to many relationship.
▪ In Detail, customer can have several accounts where as each account is held by only one customer. So, Access
Date as descriptive attribute which will specify the last accessed date by customer. Now let us understand
the scenario w.r.t placement of descriptive attribute in ER Diagram .

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 66
Design Issues Cont.…
Placement of Relationship Attributes
▪ One way a designer can mention the access date as an attribute for depositor itself because if the access
date is mapped to customer. Otherwise, access date w.r.t an account details will not be known.
▪ Another way is to place the access date in account entity, But if it is joint account it will be difficult to
know which customer has accessed the account.
▪ So, When a attribute is determined by the combination of
participating entity sets, then attributes must be associated
with many to many relationships set.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 67
Let’s work on the Course based Project!!!!

As we have already learnt ER- Diagram and Modelling

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 68
Conceptual Design with the ER Model
S.No Title S.NO Title
1 Faculty - Leave management system 15 Pay-tm
2 Hospital Management system 16 Insurance database
3 Music store 17 Training & Placement
4 Movies database 18 Fitness and health care
5 Projects domain & allocation 19 UBER / OLA Bookings and Travel
6 Student management system – Attendance & 20 Human Resource Management
Promotions
7 Student management system – grades & Internships 21 Inventory Management
8 Library management system 22 Sales and Marketing
9 Payroll management 23 Purchase
10 Railway ticketing 24 Finance and Accounting
11 Airport Management 25 Customer Relationship management
12 Bank database 26 Engineering Production
13 Metro Rail database 27 Supply Chain Management
14 Timetable management and room allotment 28 Work in Progress

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 69
Practice Questions

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 70
References
▪ TEXT BOOKS:
▪ Database System Concepts, Silberschatz, Korth, Sudarshan, Seventh Edition, McGraw-Hill.
▪ Introduction to Database Systems, C.J.Date, Pearson Education.

▪ REFERENCES:
▪ Database Management Systems, Raghu Ramakrishnan, Johannes Gehrke, Tata McGraw-Hill.
▪ Fundamentals of Database Systems, ElmasriNavathe Pearson Education.
▪ Database Systems Design, Implementation, and Management, Peter Rob & Carlos Coronel, 7thEdition, Cengage
Learning.

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 71
WIT and WIL Scenario
What I am Teaching? UNIT I Why am I Teaching?
What I am Learning? Why am I Learning?

Banking

Education
Defence Sector

Applications
of DBMS File Systems Vs DBMS

Hospital Railway
Management
System
Reservation
System Structure of DBMS

E-R Model Types of Users


THANK YOU

Department of Computer Science & Engineering, VNRVJIET, Hyderabad December 15, 2022 73

You might also like