RDBMS - Muj

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 34

School of

Computer Science and Engineering


Department of CSE

ER Diagram
Entity-Relationship Diagram
Entity-Relationship Model

RDBMS DISCOVER . LEARN . EMPOWER


• E R Model map real world into database.

• ER Model consist of basic objects called


entities and relationship.

• ER Model is type of Data model, refer to set


ER Model: of conceptual tools that helps to define the
schema. So that layman can understand it.

• ER Model is best used for the conceptual


design of a database. 2
Symbols used in E-R Diagram
• Entity
• Entity is a real world object with an independent existence.
• Entity may be object with
• Physical Existence (E.g. Person/ Car/ Employee)
• Conceptual Existence (E.g. a Company/ University)
• Represented as Rectangle
Entity Type

• Entity Type (Entity Set)


• Define the collection of Entities that have same attributes. [Class]
• (Collection of Entity having same Entity type that share same properties) [Object]

3
• Attributes
• Attributes describes the properties of Entity.
• Represented by Ovel. Attribute

• For Example:
• Person is the Entity and the attributes are:
• Name | DoB | Address | Phone No. | Profession
• Value Set (Domain) of Attributes
• Set of values that may be assign to the attribute, E.g. :
• Name - String
• Age – number (b/w 18 to 65)
• Phone No. – digits ( 10 digits is constraint)
4
Types of Attributes . . .
• Simple attribute
• Simple attributes are atomic values, which cannot be divided further.
• For example, a student's phone number is an atomic value of 10 digits.
• Represented by Ovel Phone no.

• Composite attribute
• Composite attributes can be divided further.
• For example, a student's complete name may have first_name, middle_name
and last_name.
• Derived attribute
• Derived attributes are the attributes that is not stored.
• but their values are derived from other attributes present in the database.
• For example
• Age can be derived from data_of_birth.
• Average_salary in a department should not be saved directly in the database, instead it can be derived.
• Represented by Doted Ovel Phone no. 5
Types of Attributes . . .
• Single-Valued attribute
• Single-value attributes contain single value.
• For example - DoB, PAN Card No..

• Multi-Valued attribute
• Multi-value attributes may contain more than one values.
• For example, a person can have more than one phone no.
• Represented by Double Ovel
Phone
Attribute
No.

6
• Relationship
• Relationship is association among entities.
• For Example: Student study course
• Relationship represent by Diamond

Student Study Course

• Relationship Type (Relationship Set)


• Define the collection of similar relationship.
• (Collection of relation of having same Relationship type)

By: Pramod Vishwakarma (E9758) 7


By: Pramod Vishwakarma (E9758) 8
By: Pramod Vishwakarma (E9758) 9
Total/ Partial Participation Constraints
➔ Relationship Participation Constraints
➔ Minimum Cardinality Constraints
• Total Participation − (indicated by double line)
• Each entity is involved in the relationship.
• Partial participation − (indicated by single line)
• Not all entities are involved in the relationship.

10
Work
Employee Department
for

Student Admission University

Customer Borrow LOAN

11
Weak Entity Sets
• An entity set that does not have a primary key is referred to as a
weak entity set.
• The existence of a weak entity set depends on the existence of a
strong entity set.
• it must relate to the strong entity set via a total, one-to-many relationship
set from the identifying to the weak entity set
• Identifying relationship depicted using a double diamond
• The discriminator (or partial key) of a weak entity set is the set of
attributes that distinguishes among all the entities of a weak entity
set. Represented by dashed line.
• The primary key of a weak entity set is formed by the
primary key of the strong entity set Partial key of weak entity
on which the weak entity set is + (discriminator)
dependent
Weak Entity Sets (Cont.)
• We depict a weak entity set by double rectangles.
• We underline the discriminator of a weak entity set with a
dashed line.
• payment-number – discriminator of the payment entity set
• Primary key for payment – (loan-number, payment-number)
ER-Diagram with Composite, Multivalued and
Derived value

15
Summary of Symbols Used in E-R Notation
Steps for E R Modelling or E R Diagram

Step 1 – Identify the Entities

Step 2 – Identify the Attributes

Step 3 – Find the Relationship

Step 4 – Find Key attributes of every Entity


18
Example: A hospital Case

By: Pramod Vishwakarma (E9758) 19


Example: A hospital Case

By: Pramod Vishwakarma (E9758) 20


Example: Football Club

By: Pramod Vishwakarma (E9758) 21


Example: Football Club

By: Pramod Vishwakarma (E9758) 22


DBMS Architecture

• The DBMS design depends upon its architecture.

• The basic client/ server architecture is used to deal with a large


number of PCs, web servers, database servers, and other components
that are connected with networks.

• DBMS architecture depends upon how users are connected to the


database to get their requests done.

23
Type of Architectures

24
1-Tier Architecture
• In this architecture, the database is directly available to the user. It means
the user can directly sit on the DBMS and use it.

• Any changes done here will directly be done on the database itself. It
doesn't provide a handy tool for end-users.

• The 1-Tier architecture is used for the development of the local


application, where programmers can directly communicate with the
database for the quick response.

25
2-Tier Architecture
• 2-Tier architecture is the same as the basic client-server. In the
two-tier architecture, applications on the client end can directly
communicate with the database at the server-side. For this
interaction, API's like ODBC, JDBC are used.
• The user interfaces and application programs are run on the client-
side.
• The server side is responsible to provide the functionalities like query
processing and transaction management.
• To communicate with the DBMS, the client-side application
establishes a connection with the server-side.
26
3-Tier Architecture
• The 3-Tier architecture contains another layer between the client and
the server. In this architecture, the client can't directly communicate
with the server.
• The application on the client-end interacts with an application
server which further communicates with the database system.
• End-user has no idea about the existence of the database beyond the
application server.
• The database also has no idea about any other user beyond the
application.
• The 3-Tier architecture is used in case of the large web applications.
27
Three schema Architecture
• The three schema architecture is also called three-level
architecture.

• This framework is used to describe the structure of a specific database


system.

• The three schema architecture contains three-levels. It breaks the


database down into three different categories or three-levels.

28
3 - Schema/ Views of Data
• Physical Level: (Internal Level)
• Describe the way how data is organized in the storage device.
• It describe the physical storage structure of database.

• Logical Level: (Conceptual Level)


• This level hide the details of physical storage structure.
• Concentrate on describing entities, data type, relationship, user operation
and constraints.
• Independent to OS, Hardware and Software.

• External Level: (View Level)


• Describes the part of database for with user is interested and hide the rest of
database from the user.
29
The process of transforming requests and results between layers are called
Mapping.
30
Data Independence

• It is the property of the database which tries to ensure that if

we make any change in any level of schema of the database,

the schema immediately above it would require minimal or

no need of change.

35
Types of Data Independence
Data independence can be classified into the following two types:
1. Physical Data Independence
2. Logical Data Independence

Physical Data Independence:


• This means that for any change made in the physical schema, the need to
change the logical schema is minimal. This is practically easier to achieve.

Logical Data Independence:


• This means that for any change made in the logical schema, the need to
change the external schema is minimal. As we shall see, this is a little
difficult to achieve.
36
Summary

• The DBMS design depends upon its architecture. The basic


client/server architecture is used to deal with a large number of PCs,
web servers, database servers, and other components that are
connected with networks
• Level of Data Independence gives the ability to modify a schema
definition in one level without affecting a schema definition in the next
higher level.

37
FAQs

• What is Data Independence?


• What are three level of independence?
• What is 3- level architecture?
• What is internal level independence?
• What is conceptual level independence?
• What is external level independence?
References
• RamezElmasri and Shamkant B. Navathe, “Fundamentals of Database
System”, The Benjamin / Cummings Publishing Co.
• Korth and Silberschatz Abraham, “Database System Concepts”,
McGraw Hall.
• C.J.Date, “An Introduction to Database Systems”, Addison Wesley.
• Thomas M. Connolly, Carolyn & E. Begg, “Database Systems: A Practical
Approach to Design, Implementation and Management”, 5/E,
University of Paisley, Addison-Wesley.

39
THANK YOU

For queries
Email: amit.garg@jaipur.manipal.edu

40

You might also like