DBMS Unit1
DBMS Unit1
Systems
PL/SQL Concepts: PL/SQL Functions and Procedures, Cursors, Database Triggers.Complex Data Types: Semi
structure data: XML, Document Type Definitions (DTDs), XML Schemas, XPATH, XSL, XSLT
Unstructured data: JSON, Data types, Application of DBMS
ACID properties, transactions, schedules and concurrent execution of transactions, serializability: View, Conflict.
Concurrency control lock based protocol (simple, 2 phase: Rigorous 2 phase, Strict 2 phase), Cascade-less Schedule,
Recoverable Schedule,
Deadlocks: Prevention Techniques (Wait Die, Wound Wait), Detection Techniques, Database Recovery: Failure
classification Recovery and atomicity: Log-based recovery, Shadow paging.
CET2002B Database Management Systems
Course Objectives:
1. Knowledge
i. Understand the fundamental concepts of database management System
ii. To provide a strong formal foundation in database concepts, DBMS architectures recent
technologies and best industry practices.
2. Skills
i. To learn the SQL database system.
ii. To program PL/SQL including stored procedures, stored functions, cursors and packages.
3. Attitude
i. To design the database system for real world applications.
ii. To access, modify, program and authenticate the database system..
Course Outcomes:
Upon completion of the course, the students will be able to:
1. Understand the different data models
2. Implement relational database design from any data model.
3. Create database system for real world applications
4. Handle the transaction management system.
• Centralized
• Client-Server Systems
• Parallel Systems
• Distributed Systems
16
Centralized Systems
• Run on a single computer system and do
not interact with other computer
systems.
• General-purpose computer system: one
to a few CPUs and a number of device
controllers that are connected through a
common bus that provides access to
shared memory.
• Single-user system (e.g., personal
computer or workstation): desk-top unit,
single user, usually has only one CPU
and one or two hard disks; the OS may
support only one user.
• Multi-user system: more disks, more
memory, multiple CPUs, and a multi-
user OS. Serve a large number of users
who are connected to the system vie
terminals. Often called server systems.
17
Client-Server
Systems
• Server systems satisfy requests
generated at m client systems,
whose general structure is
shown in the dig.
• Database functionality can be
divided into:
• Back-end: manages access
structures, query evaluation
and optimization,
concurrency control and
recovery.
• Front-end: consists of tools
such as forms, report-writers,
and graphical user interface
facilities.
• The interface between the front-
end and the back-end is through
SQL or through an application
program interface.
Parallel Systems
• Parallel database systems
consist of multiple processors
and multiple disks connected by
a fast interconnection network.
• A coarse-grain parallel machine
consists of a small number of
powerful processors
• A massively parallel or fine
grain parallel machine utilizes
thousands of smaller processors.
• Two main performance
measures:
• throughput --- the number of
tasks that can be completed in a
given time interval
• response time --- the amount of
time it takes to complete a single
task from the time it is submitted
19
Distributed
Systems
• Data spread over multiple machines (also
referred to as sites or nodes).
• Network interconnects the machines
• Data shared by users on multiple machines
• Homogeneous distributed databases
• Same software/schema on all sites, data
may be partitioned among sites
• Goal: provide a view of a single
database, hiding details of distribution
• Heterogeneous distributed databases
• Different software/schema on different
sites
• Goal: integrate existing databases to
provide useful functionality
• Differentiate between local and global
transactions
• A local transaction accesses data in the
single site at which the transaction was
initiated.
• A global transaction either accesses data
in a site different from the one at which the
transaction was initiated or accesses data in
several different sites.
20
Levels of Data Abstraction in Database System
▪ Logical Data Independence : the ability to change the conceptual scheme without
changing
⮚External views
⮚External API or programs
⮚Any change made will be absorbed by the mapping between external and
conceptual levels.
⮚When compared to Physical Data independence, it is challenging to achieve
logical data independence.
DATABASE MANAGEMENT SYSTEMS 23
Examples of Physical and Logical Data independence
Important Components of
Database System :
⮚Database Users
⮚Query Processing
⮚Storage Management
⮚Transaction Management
⮚Naive Users
⮚Application Programmers
⮚Sophisticated Users
⮚Database Administrators
Query Processing
Steps :
1.Parsing and
Translation
2.Optimization
3.Evaluation
▪ Attribute types
⮚ Simple and composite attributes. ▪ An entity is represented by a set of
⮚ Single-valued and multivalued attributes. attributes, that is descriptive properties
Example: multivalued attribute: possessed by all members of an entity set.
phone_numbers ◦ Example:
⮚ Derived attributes instructor = (ID, name, street, city,
Can be computed from other attributes
salary )
Example: age, given date_of_birth
course= (course_id, title, credits)
Roles
⮚ Entity sets of a relationship need not be distinct.
⮚Each occurrence of an entity set plays a “role” in the relationship.
The labels “course_id” and “prereq_id” are called roles.
Cardinality Constraints
⮚We express cardinality constraints by drawing either a directed line (→), signifying “one,” or
an undirected line (—), signifying “many,” between the relationship set and the entity set.
1. One-to-One Relationship
one-to-one relationship between an
instructor and a student
◦ an instructor is associated with at
most one student via advisor
◦ and a student is associated with at
most one instructor via advisor
b. One-to-Many Relationship
A one-to-many relationship between an instructor and a student
⮚a an instructor is associated with several (including 0) students via advisor
⮚student is associated with at most one instructor via advisor
c. Many-to-One Relationship
In a many-to-one relationship between an instructor and a student,
⮚an instructor is associated with at most one student via advisor,
⮚and a student is associated with several (including 0) instructors via advisor
d. Many-to Many Relationship
⮚An instructor is associated with several (possibly 0) students via advisor
⮚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
identifying entity set
◦ It must relate to the identifying entity set via a total, one-to-
set
many relationship set from the identifying to the weak entity
◦ Identifying relationship depicted using a double diamond ▪ We underline the discriminator of a
weak entity set with a dashed line.
⮚The discriminator (or partial key) of a weak entity set is the set ▪ We put the identifying relationship
of attributes that distinguishes among all the entities of a weak of a weak entity in a double
entity set.
diamond.
The primary key of a weak entity set is formed by the primary key ▪ Primary key for section –
of the strong entity set on which the weak entity set is existence (course_id, sec_id, semester, year)
dependent, plus the weak entity set’s discriminator.
DATABASE MANAGEMENT SYSTEMS 46
Example of Strong and Weak Entity
Strong Entity :
Professor(ID,Name,City,Salary)
Weak Entity :
Dependent(Name,DOB,Relation)
The Dependent Entity will share the ID
attribute of Professor.
Resultant Schema :
Dependent(ID,Name,DOB,Relation)
The primary key for Weak Entity Dependent
will be ID + Name as Name is the
discriminator attribute.
Email
Has Books
First
NAme
Model
_no
Flight_ Arrival_Dat
Capacity
No e_Time
From Departure
_Date_Ti
me
DATABASE MANAGEMENT SYSTEMS 49
Extended ER Features :
⮚ Specialization
⮚ Generalization
⮚ Aggregation
⮚Top-down design process; we designate subgroupings within an entity set that are distinctive from
other entities in the set.
⮚These subgroupings become lower-level entity sets that have attributes or participate in relationships
that do not apply to the higher-level entity set.
⮚Depicted by a triangle component labeled IS A (E.g., instructor “is a” person).
⮚Attribute inheritance – a lower-level entity set inherits all the attributes and relationship
participation of the higher-level entity set to which it is linked.
Example: Instead of creating a schema for relationship set inst_dept, add an attribute
dept_name to the schema arising from entity set instructor
N Faculty
Faculty School
1
Program
Divided
into Lecturer
Course
1 N 1
School offers Program Student
1
Full-time_
Lecturer
Employe
contains
e Part-
time_Lecturer
M N
M N Lect_Course
Lecturer teaches Course enrolls (Associative
N Entity due to
IS M:M)
A
enrolls Student_Course(
Contact Associative Entity
Full-Time Part-time N due to M:M)
Lecturer DATABAS MANAGEMENT SYSTEMS
Lecturer N 50
E Student
References
Text Books:
• Abraham Silberschatz, Henry F. Korth and S. Sudarshan, Database System Concepts 6th
Ed, McGraw Hill, 2010.
• Elmasi, R. and Navathe, S.B., “Fundamentals of Database Systems”, 4th
• Ed., Pearson Education.
Reference Books :
• Ramakrishnan, R. and Gherke, J., “Database Management Systems”, 3rd Ed., McGraw-
Hill.
• Connally T, Begg C.,”Database Systems”,Pearson Education