You are on page 1of 17

Database Management System L,T,P,J,C

Subject Code:
2,0,2,4,4
Preamble Database Management Systems course is intended to deliver students the elementary
concepts of a database management system and equips them to design and
implement a database application built over those concepts. It also introduces
advanced level areas like transaction processing, concurrency control and recovery
management. The current trend, unstructured data - NoSQL is unveiled too.
Objectives This course imparts the students with background to understand, design, implement,
and use database management systems. The course will highlight the significant
functions of database management system. This course is devised to learn and
explore

Advantages of using a DBMS rather than a file system.


Designing an Entity-Relationship model for a real life application.
Mapping a database schema from ER model.
Evaluating relational schemas for design qualities
Optimize a query.
Basic concepts on transaction processing, concurrency control and recovery.
Fundamental view on unstructured data and its management.
Storage of databases and techniques to access them using various
algorithms.

Expected Outcome At the completion of this course, students should be able to do the following:

Explain the role of a database management system in an organization.


Describe the structure and operation of the relational data model.
Construct database queries using Structured Query Language (SQL).
Design and implement a database project depending on the business
requirements, considering various design issues.
Implement the concept of a database transaction and related database
facilities, including concurrency control, backup and recovery.
Module Topics L Hrs SLO
1 DATABASE SYSTEMS CONCEPTS AND ARCHITECTURE
History and motivation for database systems characteristics of database
approach Actors on the scene Workers behind the scene Advantages of
using DBMS approach, Data Models, Schemas, and Instances, Three-Schema
5 2
Architecture and Data Independence, The Database System Environment,
Centralized and Client/Server Architectures for DBMSs, Classification of
database management systems

2 DATA MODELING
Entity Relationship Model : Types of Attributes, Relationship, Structural
Constraints Relational Model ,Relational model Constraints Mapping ER 4 5

model to a relational schema Integrity constraints

3 SCHEMA REFINEMENT
Guidelines for Relational Schema - Functional dependency; Normalization,
Boyce Codd Normal Form, Multi-valued dependency and Fourth Normal 6 5,7

form; Join dependency and Fifth Normal form.

4 QUERY PROCESSING AND TRANSACTION PROCESSING


Translating SQL Queries into Relational Algebra heuristic query
optimization Introduction to Transaction Processing Transaction and
System concepts - Desirable properties of Transactions Characterizing 5 1,7

schedules based on recoverability Characterizing schedules based on


serializability

5 CONCURRENCY CONTROL AND RECOVERY TECHNIQUES


Two-Phase Locking Techniques for Concurrency Control - Concurrency
Control based on timestamp - Recovery Concepts - Recovery based on
4 5,7
deferred update - Recovery techniques based on immediate update - Shadow
paging

6 PHYSICAL DATABASE DESIGN


Indexing: Single level indexing, multi-level indexing, dynamic multilevel 3 1
indexing

7 RECENT TRENDS - NOSQL DATABASE MANAGEMENT 3 2


Introduction, Need of NoSQL, CAP Theorem, different NoSQL data models:
Key-value stores, Column families, Document databases, Graph databases
Lab (Indicative List of Experiments (in the areas of ) 14,17

Solve the problem using the following:


1. DDL: Creating Schema
2. DDL : Altering the schema
3. Constraint creation
4. DML : Populating the relations
5. DML: update, deletion
6. DDL: Drop relation
7. Subquery
8. Single row function and aggregate functions
9. Joins : Cartesian product, Inner Join, Left outer join,Right outer join,Full outer join
PL/SQL
10. Control structures
11. Cursors: Implicit and Explicit cursor :
12. Iterations
13. Functions
14. Procedure
15. Exceptions:
16. Trigger
DBA concepts
17. Backup
18. Recovery
XML Schema
19.XML,DTD,XQuery
SAMPLE PROBLEMS
1. Consider the following relations containing airline flight information:
Flights(flno: integer, from: string, to: string,distance: integer, departs: time, arrives: time)
Aircraft(aid: integer, aname: string, cruisingrange: integer)
Certified(eid: integer, aid: integer)
Employees(eid: integer, ename: string, salary: integer)
Note that the Employees relation describes pilots and other kinds of employees as well
every pilot is certified for some aircraft (otherwise, he or she would not qualify as a
pilot), and only pilots are certified to fly.
Write the following queries in SQL
1. Find the eids of pilots certified for some Boeing aircraft.
2. Find the names of pilots certified for some Boeing aircraft.
3. Find the aids of all aircraft that can be used on non-stop flights from Bonn to Madras.
4. Identify the flights that can be piloted by every pilot whose salary is more than $100,000.
5. Find the names of pilots who can operate planes with a range greater than 3,000 miles but
are not certified on any Boeing aircraft.
2. SAILORS (SID:INTEGER, SNAME:STRING, RATING:INTEGER, AGE:REAL)
BOATS (BID:INTEGER, BNAME:STRING, COLOR:STRING)
RESERVES (SID:INTEGER, BID:INTEGER, DAY:DATE)
1. Display names & ages of all sailors.
2. Find all sailors with a rating above 7.
3. Display all the names & colors of the boats.
4. Find all the boats with Red color.
5. Find the names of sailors who have reserved boat number 123.
6. Find SIDs of sailors who have reserved Pink Boat;
7. Find the color of the boats reserved by Rajesh.
8. Find names of the sailors who have reserved at least one boat.
9. Find the names of sailors who have reserved a red or a green boat.
10. Find the names of sailors who have reserved boat 103.
11. Find the names of sailors who have not reserved boat 103.
12. Find sailors whose rating is better than some sailor called Rajesh.
13. Find the sailor's with the highest rating using ALL.
14. To count number SIDs of sailors in Sailors table
15. To count numbers of boats booked in Reserves table.
16. To count number of Boats in Boats table.
17. To find age of Oldest Sailor.
18. To find age of Youngest Sailor.
19. Find the average age of sailors with a rating of 10.
20. Count the number of different sailor names.
21. Find the name and age of the oldest sailor.
22. Count the number of Sailors.
23. Find the names of sailors who are older than the oldest sailor with a rating
of 10.
24. Display all the sailors according to their ages.
25. To display names of sailors according to alphabetical order.

2. Design the data base for a wholesale furniture company. The database has to
allow to analyze the companys situation at least with respect to the Furniture,
Customers and Time. Moreover, the company needs to analyze:
the furniture with respect to its type (chair, table, wardrobe, cabinet. . . ),
category (kitchen, living room, bedroom, bathroom, office. . . ) and material
(wood, marble. . . )
the customers with respect to their spatial location, by considering at least
cities, regions and states The company is interested in learning at least the
quantity, income and discount of its sales.
3. Simple script to backup all SQL server database
Create a database table with the following fields:
Field name Data type
Ship_id Number -- This is the ID of a particular Ship
Date_expected Date --The date at which the goods are expected to arrive
Qty_expected Number --The quantity that is supposed to arrive
Description Varchar2 --The description of the items
Color Varchar2 --The color of the items
Qty_hand Number The quantity on hand for these items
Itemrate NumberPrice of each item.

Write a PL/SQL program that uses implicit cursor to display the data expected, quantity
expected, item description, color and quantity on hand for any particular Ship ID number.

3. Consider an application in which the results of football games are to be represented in


XML,DTD and Xquery. For each game, we want to be able to represent the two teams
involved, which one was playing at home, which players scored goals (some of which
may have been penalties) and the time when each was scored, and which players were
shown yellow or red cards. You might use some attributes. You can check your solutions
with the online demo of the Zorba XQuery engine4 .
4. Backup
Create a transparent audit system for a table Client_master (client_no, name, address,
Bal_due). The system must keep track of the records that are being deleted or
updated. The functionality being when a record is deleted or modified, the original
record details and the date of operation are stored in the auditclient(client_no, name,
bal_due, operation, userid, update) table, then the delete or update is allowed to go
through.
5. Recovery
Using the supplier and parts database, write an cursor program to read and print all parts in
part number, deleting every tenth one as you go, and begin a new transaction after every
tenth row. You can use the foreign key delete CASCADE rule from parts,commit,rollback
and savepoint .
6. Assuming a patient should not receive both treatment and prescription from
the same doctor, write a program to find out all the doctor who provide both
treatment and prescription to the same patient. In addition, raise and display
an exception if this situation occurs.
7. Write a PL/SQL block which includes a procedure getCleanerDetails which
accepts a cleaner number and returns the cleaners name and salary. Create a
stored function called getCleanersLocation. This function takes as input a
cleaners number and returns the cleaners depot address. Call the function
from within an SQL statement to select the cleaners name and location for a
particular cleaner.
8. Write a PL/SQL block which includes a procedure getCleanerDetails which accepts a
cleaner number and returns the cleaners name and salary. The main block should call
the procedure with cleaner number 113 and output this cleaners details including
the salary which has been increased by 10%.
9. Create a Trigger that raises an User Defined Error Message and does not
allow the update and Insert operation in the database
10. Join Queries : Assume necessary database schema
Display the name of each employee with his department name.
Display a list of all departments with the employees in each department.
Display all the departments with the manager for that department.
Display the names of each employee with the name of his/her boss.
Display the names of each employee with the name of his/her boss with a blank for
the boss of the president.
Display the employee number and name of each employee who manages other
employees with the number of people he or she manages.
Repeat the display for the last question, but this time display the rows in descending
order of the number of employees managed.

Students are advised to complete a project work which involves the following database steps 60 [Non 1,5,7,17
(Whichever is essential). Contact
1. Choose an real world scenario and write abstract hrs]

2. Model the ER Diagram for a specific application


3. Convert the ER model into relational model.
4. Establish the relationship between relations.
5. Apply the normalization techniques.
6. Use any DBMS software and create the relations.
7. Create GUI using any front end tool.
8. Establish Connection between front end and back end.
9. Querying the database and Generating Report
Sample Projects
1. Design a tool to measure the performance of database by considering the following
Factors
a) Throughput
A system's throughput defines its overall capability to process data. DBMS throughput is measured in
queries per second, transactions per second, or average response times.
b) Contention
Contention is the condition in which two or more components of the workload attempt to use the system
in a conflicting way for example, multiple queries that try to update the same piece of data at the
same time or multiple large workloads that compete for system resources. As contention increases,
throughput decreases.
c) optimization
DBMS optimizations can affect the overall system performance. SQL formulation, database
configuration parameters, table design, data distribution, and so on enable the database query
planner and optimizer to create the most efficient access plans.
2. Optimistic concurrency control and compare its performance to the basic
concurrency control scheme of a simple database
More specifically, OCC transactions involve these phases:
Begin: Record a timestamp marking the transaction's beginning.
Modify: Read database values, and tentatively write changes.
Validate: Check whether other transactions have modified data that this transaction has used (read or
written). This includes transactions that completed after this transaction's start time, and optionally, transactions
that are still active at validation time.
Commit/Rollback: If there is no conflict, make all changes take effect. If there is a conflict, resolve it,
typically by aborting the transaction, although other resolution schemes are possible.
3. Twitter data filtering, aggregating, analyzing and extracting valuable information.
4. Implement the performance improvement of the database in client side and offload
work from the server, example use HTML browsers (including WebKit, used by
Safari and Chrome), include a client-side SQL API in JavaScript
5. Social Network data Analysis using NoSQL ( social networking sites like Facebook,
LinkedIn, Twitter, MySpace, Foursquare, Flickr and Friendfeed)
6. Healthcare organization database system: usage of the following data base
repositories is preferable
http://www.ehdp.com/vitalnet/datasets.htm,https://data.medicare.gov/data/hospital-
compare, http://www.hscic.gov.uk/datasets
7. Create a DTD for a small XML data set about world countries. This data can be adapted
from the Mondial 3.0 database. Each country has a name, population, and area (in sq. km).
Some countries also list languages (with percentages of the population that speaks each
language) and/or cities (with names and populations).Analyse the XML schema using
necessary Xquery and create a report that describe the insight of data
Text Books
1. R. Elmasri & S. B. Navathe, Fundamentals of Database Systems, Addison Wesley, 7 th Edition, 2015
2. Raghu Ramakrishnan,Database Management Systems,Mcgraw-Hill,4th edition,2015
Reference Book
3. A. Silberschatz, H. F. Korth & S. Sudershan, Database System Concepts, McGraw Hill, 6 th Edition 2010
4. Thomas Connolly, Carolyn Begg, Database Systems : A Practical Approach to Design, Implementation
and Management,6th Edition,2012
5. Pramod J. Sadalage and Marin Fowler, NoSQL Distilled: A brief guide to merging world of Polyglot
persistence, Addison Wesley, 2012.
6. Shashank Tiwari ,Professional NoSql,Wiley ,2011

Database Management System


Knowledge Areas that contain topics and learning outcomes covered in the course

Knowledge Area Total Hours of Coverage


Information Management (CS:IM) / 28
Database System (CE:DBS)

Algorithms and complexity (CS:AL)/ 2


Algorithms(CE-ALG)
Body of Knowledge coverage

KA Knowledge ACM Topics Topics Covered in this course Hours


Unit

CS: IM Database CS:IM Identifying the need of Database Systems 5


Systems File systems vs. DBMS
CE:DBS0 Indicate some important characteristics of database approach
Approaches to and
CE:DBS1 evolution of DBMS Illustrate the importance of DBMS approaches
Core DBMS functions and Categories of data models, Schemas, and Instances
system components Internal Schema, Conceptual Schema, External Schema architecture
DBMS user, designer, Logical data independence and physical data dependence
application developer,
administrator
DBMS Component Modules
Components of database Basic and Two Tier Client/Server Architecture,
systems Introduction to Distributed, Homogeneous, Heterogeneous and Federated
Database architecture and DBMS
data independence
CE:DBS0
Indicate some reasons for
studying database systems
Highlight some people that
influenced or contributed to
the area of database systems
Indicate some important
topic areas such as
information systems,
database systems and, data
modeling
Contrast the meanings
between data, information,
and knowledge
Describe a database system
and its components
Explore some additional
resources associated with
database systems
Explain the purpose and
role of database systems in
computer engineering
CE:DBS1
Components of database
systems
Database management
system (DBMS) functions
Database architectures

CS: IM Data Modeling CS: IM Entity Relationship Model : 4


Conceptual models (e.g., Simple vs composite attributes
CE:DBS2/ & Relational
entity-relationship)
CE:DBS3 Databases Single valued vs multi-valued attributes
Relational data models
Mapping conceptual Derived attribute, Key attribute
schema to a relational Degree of relationship, Recursive relationship
schema One to One relationship, One to many relationship, Many to many
Entity and referential relationship
integrity
Multiplicity for complex relationship
CE:DBS2
Data modeling: Cardinality and participation constraints
Basic concepts: to include Relational data Model:
key, foreign key, record, Characteristics of relations
relation Relational model notations
Conceptual models Relational model Constraints:
Relational data model
Implicit constraints, Explicit constraints, Semantics constraints
CE:DS3
Mapping ER model to a relational schema
Concepts of conceptual
schema and relational ER to Relational Mapping Algorithm
schema: Integrity constraints :
Entity integrity constraint Null constraints, Entity constraints, Referential constraints, General
and referential integrity constraints
constraint
CS: IM/ Relational CS: IM Guidelines for Relational Schema 6
Databases/ Mapping conceptual Functional dependency:
CE:DBS5 Relational database schema to a relational Definition, Inference Rules for functional dependency
design schema Equivalence of set of Functional dependencies
Entity and referential Minimal sets of functional dependencies
integrity Normalization:
Relational Database design
Functional dependency First Normal Form, Second Normal Form, Third Normal form, Boyce
Decomposition of a Codd Normal Form
schema; lossless-join and Multi-valued dependency and Fourth Normal form:
dependency-preservation Definition of Multi-values dependency
properties of a Inference Rule for Multi-values dependency
decomposition Fourth Normal Form
Candidate keys, superkeys, Join dependency and Fifth Normal form
and closure of a set of
attributes
Normal forms (BCNF)
Multi-valued dependency
(4NF)
Join dependency (PJNF,
5NF)
Representation theory
CE:DBS5
Database design
The concept of functional
dependency
Normal forms: first, second,
third and Boyce-Codd
normal forms; motivation
for each of these,
applicability; mechanisms
for producing these normal
forms
Multi-valued dependency:
fourth normal form; join
dependency; fifth normal
form
Representation theory
Not covered
Relational algebra and
Relational calculus

CS: IM/ Relation Database/ CS:IM Introduction to relational algebra: selection, projection, Join Operation. 5
Transaction Relational algebra and
CE:DBS3/ Processing Heuristics optimization (query tree, Converting query tree into query
Relational calculus
CE:DBS6 execution plans)
Transactions
CS:AL/ Failure and recovery Transactions, read and write operations, and DBMS buffers
Concurrency control Need of concurrency: Lost of update problem, Temporary update
CE-ALG3 Interaction of transaction problem, incorrect summary problem
management with storage, Need of Recovery : Types of failures
especially buffering
Transaction states, System log, Commit point of a transaction
CE:DBS6
Transactions: Atomicity, Consistency preservation, Isolation, Durability or permanency
Failure and recovery Characterizing schedules based on Recoverability
CE:DS3 Serial, non-serial and conflict serializable schedules
Relational algebra and
relational calculus
Relational algebra
operations from
mathematical set theory
Query processing
strategies; query
optimization
CS:AL: Indexing,searching
CE-ALG3 : search
algorithms,Heuristics
approach

CS: IM Transaction CS:IM Types of locks and system lock tables 4


Processing Failure and recovery
CE:DS6 Concurrency control Serializability by two phase locking
CE:DS6 Basic Timestamping ordering
Transactions: Thomass write Rule
Failure and recovery Recovery based in deferred update in a single user environment
Concurrency control Recovery update with concurrent execution in a multiuser environment
UNDO/REDO recovery algorithm
Shadow paging

CS: IM Physical CS:IM Single level indexing: 3


CE:DBS8 Database Design Storage and file structure Primary, Clustering, Secondary index
Indexed files Multi-level indexing upto two level primary index
Hashed files Dynamic multilevel indexing: B tree, B+ tree
Signature files
B-trees
Files with dense index
Files with variable length
records
CE-DBS8
Records and record
types
Files of different kinds
and file structures
B-trees

CS: IM Database Need of NoSQL 3


Systems Approaches for managing CAP Theorem
large volumes of data (e.g.,
Different NoSQL data models:
noSQL database systems, use
o Key-value stores, Column families, Document databases, Graph
of MapReduce)
databases.
Where does the course fit in the curriculum?

This course is a Core Course.


Suitable from 4th semester onwards

What is covered in the course?


Part 1: Introduction to DBMS, Data models

It introduces about the generalized perspective of ER models, Relational model, Types of constraints,
DBMS architecture, Normalization techniques, the ways to speed up the retrieval of records in response
to certain search conditions using indexing

Part II : Query Processing Transaction Processing


This sector elaborates about devising an optimized way of executing a query using heuristics approach. It
also covers scheduling and serializability of the transactions. This segment encompasses a number of
concurrency control techniques that are used to ensure the isolation property of the concurrently executing
transactions and techniques used for recovery of the database from failures

Part III : NoSQL Database Management

This portion wraps the basics of CAP theorem and need of NOSQL and its different data models

What is the format of the course?

This Course is designed with 100 minutes of in-classroom sessions per week, 100 minutes of lab hours
per week, as well as 200 minutes of non-contact time spent on implementing course related project.
Generally this course should have the combination of lectures, in-class discussion, case studies, guest-
lectures, mandatory off-class reading material, assignment.

How are students assessed?

Students are assessed on a combination of group activities, classroom discussion, projects and
continuous, final assessment tests.
Submission of Technical Report( Assignment) on managing large volumes of data example
NoSQL database systems
Additional weightage will be given based on their rank in crowd sourced projects/ Kaggle like
competitions, project handling with large database
Students can earn additional weightage based on certificate of completion of a related MOOC
course.

Additional topics

NoSQL Database Management


Session wise plan
S.NO Class Lab Topic Covered levels of Text/ Remarks
Hour Hour mastery Reference
Book
1 1 Introduction to the course Familiarity 1
2 1 Data Models, Schemas and Familiarity 2
Instances
3 2 Three-Schema Architecture Familiarity 1
and Data Independence ,The
Database System Environment
4 1 Centralized and Client/Server Familiarity 2
Architectures for DBMSs,
Classification of database
management systems
5 2 ER Model Usage 1
6 1 Relational Model and Integrity Usage 1
Constraints
7 1 ER to Relational Model Usage 1
8 3 Functional Dependency and Assessment 2
Normal Forms
9 1 BCNF, Multi-valued Assessment 2
Dependency
10 2 Join Dependency, Fifth Assessment 2
Normal Form
11 1 Relational Algebra Usage 1
12 1 Heuristic Query Optimization Usage 1
13 1 Transaction and System Usage 1
concepts
14 1 Desirable properties of Usage 1
Transactions Characterizing
schedules based on
recoverability
15 1 Characterizing schedules Usage 1
based on serializability
16 1 Two-Phase Locking Familiarity 2
Techniques for Concurrency
Control
17 1 Concurrency Control based on Familiarity 2
timestamp
18 1 Recovery Concepts - Recovery Familiarity 2
based on deferred update
19 1 Recovery techniques based on Familiarity 2
immediate update - Shadow
paging
20 1 Introduction to NoSQL and Familiarity 5
need of NoSQL
21 1 Single level indexing Assessment 1
22 2 multi-level indexing, dynamic Assessment 1
multilevel indexing
23 2 CAP Theorem, different Familiarity 5
NoSQL data models: : Key-
value stores, Column families,
Document databases, Graph
databases.
1 4 Usage 1,2,4 LAB
DDL and DML
Component

2 2 Single row and aggregate Usage 1,2,4 LAB


functions Component

3 4 Joins and subqueries Usage 1,2,4 LAB


Component
4 2 Anonymous blocks and control Usage 1,2,4 LAB
structures Component

5 2 Iterations Usage 1,2,4 LAB


Component
6 4 Usage 1,2,4 LAB
Cursors
Component

7 2 Functions and procedures Usage 1,2,4 LAB


Component
8 4 Exception handling and Usage 1,2,4 LAB
triggers Component

9 4 DBA concepts Usage 1,2,4 LAB


Component
10 2 XML, DTD , XQuery Usage 1,2,4 LAB
Representation Component

30 30
Hours Hours
(2 Credit (2 Credit
hours hours /
/week week )
15
Weeks
schedule
)

You might also like