Sunteți pe pagina 1din 16

Format No. QSP/7.1/01.

F01 (B)
Issue No.04 Rev. No 4 Dated: June 7, 2014

_____________________________________________________________________________________________

UNIVERSITY OF PETROLEUM & ENERGY STUDIES


College of Engineering Studies
Dehradun
______________________________________________________

COURSE PLAN
Programme

: Btech(CSE) IBM All Courses

Course

: Database Management System

Subject Code

: CSEG215

No. of credits

:1

Semester

: III

Session

: Odd Semester(July14-Dec14)

Batch

: 2013-2017

Prepared by

: Ankit Khare

Email

: akhare@ddn.upes.ac.in

Approved By
_______________________
HOD

_______________________
Dean

UPES Campus

Tel : +91-135-2770137

Energy Acres

Fax : +91 135- 27760904

P.O. Bidholi, Via Prem Nagar

Website : www.upes.ac.in

COURSE PLAN
Subject: Database Management
System

Course:
Btech(CSE+All
IBM Courses)

Duration:July14-Dec14

Subject code:
CSEG215
One Session: 120 Minutes per batch

A. OBJECTIVES:
(a) The student should be able to design Simple query statements by the use of Oracle interface. The
student should be able to design queries with phrases like where, order by statements etc. The
student should be able to understand the use of views, and design them.
(b) The student should be able to understand the background working of Oracle, by learning Oracle
Architecture and its background processes. Overall the student should appreciate the use of DBMS
systems for effective data management.
B. COURSE OUTLINE
S.No Lab Exercise

Contents

1.

Lab. Exercise 1

DB2 installation

2.

Lab. Exercise 2

Data retrieval and DDL commands

3.

Lab. Exercise 3

DML commands with constraints

4.

Lab. Exercise 4

DDL commands with data Constraints

5.

Lab. Exercise 5

DDL commands with data Constraints

6.

Lab. Exercise 6

Use of Inbuilt functions and relational algebra operations part-I

7.

Lab. Exercise 7

Use of Inbuilt functions and relational algebra operations part-II

8.

Lab. Exercise 8

Nested Sql queries or subqueries part-I

9.

Lab. Exercise 9

Nested Sql queries or subqueries part-II

10.

Lab. Exercise 10

Group by and having clause

C. PEDAGOGY
Knowledge about the basic terminology used in structured query language, have a clear idea
about fundaments as well as Practical concept of database..
D. COURSE COMPLETION PLAN
S.no No. of
No. of
No .of
experiments
experiments internal lab
planned
completed
tests
planned
1
10
2
No. of lab classes per batch planned: 12
No. of lab classes per batch taken:
Percentage of experiment covered:

No .of
internal lab
tests
conducted

No. of
internal
viva
planned
2

No. of
internal
viva
conducted

E. EVALUATION & GRADING


Description

Weight age

Schedule

1.

Internal Examination

50%

Detailed Below

2.

External - Examination

50%

Academic Calendar

Internal Assessment: Marks 100(50% weightage)


Internal lab exam/Viva: Two internal lab exams are based on practical experiment &
logical questions and two internal viva based on theory syllabus will be held. First internal
lab exam and viva are conducted at least ten days before the Mid Term Examination and
another internal lab exam and viva at least ten days before the End Term Examination.

Note: Those who do not appear in Class test and quiz examinations shall lose their marks.
The marks obtained by the students will be displayed on ICOS a week before the start
of Mid Term and End Term Examinations respectively.
GENERAL DISCIPLINE: Based on students regularity, punctuality, sincerity, behavior and dress
code/sense in the lab.
The marks obtained by the students will be displayed on ICOS at the end of semester.

End -Sem Examination: 50% Weightage


External lab examination shall be of 2 hours duration. The lab examination will be based
on the lab classes and practical oriented problems.

F. DETAILED SESSION PLAN

Experiment 1
TITLE: DB2 Installation
Objective: To understand how to install DB2 on Laptop.
1. Install DB2 on laptop.

Experiment 2
TITLE: DDL (Data Definition Language) commands
Objective: To understand the concept of designing issue related to the database with creating,
Populating the tables.

1. Create the tables described below:


Table name: CLIENT_MASTER
Description: used to store client information.

Column name data type


CLIENTNO
NAME
ADDRESS 1
ADDRESS 2
CITY
PINCODE
STATE
BALDUE

Varchar
Varchar
Varchar
Varchar
Varchar
Integer
Varchar
decimal

Size
6
20
30
30
15
15
10,2

Table Name: PRODUCT_MASTER


Description: used to store product information
Column name

data type

Size

PRODUCTNO
DESCRIPTION
PROFITPERCENT
UNIT MEASURE
QTYONHAND
REORDERL VL
SELLPRICE
COSTPRICE

Varchar
Varchar
Decimal
Varchar
Integer
Integer
Decimal
Decimal

6
15
4,2
10

8,2
8,2

Table Name: SALESMAN_MASTER


Description:

used to store salesman information working for the company.

Column name

data type

Size

SALESMANNO
SALESMANNAME
ADDRESS 1

Varchar
Varchar
Varchar

6
20
30

ADDRESS 2
CITY
PINCODE
STATE
SALAMT
TGTTOGET
YTDSALES
REMARKS

Varchar
Varchar
Integer
Varchar
Real
Decimal
Double
Varchar

30
20
20

6,2
60

2. Insert the following data into their respective tables:


a) Data for CLIENT_MASTER table:
Client no

Name

city

Pincode

state

BalDue

C00001
C00002

Ivan bayross
Mamta muzumdar

Mumbai
Madras

400054
780001

Maharashtra
Tamil nadu

15000
0

C00003
C00004
C00005
C00006

Chhaya bankar
Ashwini joshi
Hansel colaco
Deepak sharma

Mumbai
Bangalore
Mumbai
Mangalore

400057
560001
400060
560050

Maharashtra
Karnataka
Maharashtra
Karnataka

5000
0
2000
0

b) Data for PRODUCT_MASTER table:


ProductNo

Description

Unit
measure
Piece
Piece
Piece
Piece
Piece
Piece
Piece

Qtyonhand

RecorderLvl

SellPrice

CostPrice

T-Shirt
Shirts
Cotton jeans
Jeans
Trousers
Pull Overs
Denim jeans

Profit
percent
5
6
5
5
2
2.5
4

P00001
P0345
P06734
P07865
P07868
P07885
P07965

200
150
100
100
150
80
100

50
50
20
20
50
30
40

350
500
600
750
850
700
350

250
350
450
500
550
450
250

P07975
P08865

Lycra tops
Skirts

5
5

Piece
Piece

70
75

30
30

300
450

175
300

c) Data for SALESMAN_MASTER table:


SalesmanNo
S00001
S00002
S00003
S00004

Name
Aman
Omkar
Raj
Ashish

SalesmanNo
S00001
S00002
S00003
S00004

SalAmt
3000
3000
3000
3500

Address1
A/14
65
P-7
A/5

Address2
Worli
Nariman
Bandra
Juhu

TgtToGet
100
200
200
200

YtdSales
50
100
100
150

City
Mumbai
Mumbai
Mumbai
Mumbai

PinCode
400002
400001
400032
400044

State
Maharashtra
Maharashtra
Maharashtra
Maharashtr(a

Remarks
Good
Good
Good
Good

*****************************************************************************

Experiment 3
Title: DML commands with constraints
Objective: - To understand the concept of different DML commands.
1. Exercise on retrieving records from a table.
a. Find out the names of all the clients.
b. Retrieve the entire contents of the Client_Master table.
c. Retrieve the list of names,city and the state of all the clients.
d. List the various products available from the Product_Master table.
e. List all the clients who are located in Mumbai.
f. Find the names of salesman who have a salary equal to Rs.3000.
2. Exercise on updating records in a table
a. Change the city of ClientNo C00005 to Bangalore.
b. Change the BalDue of ClientNo C00001 to Rs.1000.
c. Change the cost price of Trousers to rs.950.00.
d. Change the city of the salesman to Pune.

3. Exercise on deleting records in a table


a. Delete all salesman from the Salesman_Master whose salaries are equal to Rs.3500.

b.
c.

Delete all products from Product_Master where the quantity on hand is equal to 100.
Delete from Client_Master where the column state holds the value Tamil Nadu.

4. Exercise on altering the table structure


a. Add a column called Telephone of data type integer to the Client_Master table.
b. Change the size off SellPrice column in Product _Master to 10, 2.

5. Exercise on deleting the table structure along with the data


a. Destroy the table Client_Master along with its data.

6. Exercise on renaming the table


a. Change the name of the Salesman_Master to sman_mast.

***************************************************************
EXPERIMENT-4
TITLE: DDL (Data Definition Language) commands with Data Constraints
Objective: To understand the concept of data constraints which are enforced on data being stored in
the table. Focus on Primary Key and The Foreign Key

3. Create the tables described below:


Table name: CLIENT_MASTER_1
Description: used to store client information.
Column name data type
CLIENTNO
NAME
ADDRESS 1
ADDRESS 2
CITY
PINCODE
STATE
BALDUE

Varchar
Varchar
Varchar
Varchar
Varchar
Integer
Varchar
Decimal

Size

Constraints

6
20
30
30
15
8
15
10,2

Primary key / first letter must start with C


Not Null

Table Name: PRODUCT_MASTER_1


Description: used to store product information
Column name

data type

Size

Attributes

PRODUCTNO
DESCRIPTION
PROFITPERCENT
UNIT MEASURE
QTYONHAND
REORDERL VL
SELLPRICE
COSTPRICE

Varchar
Varchar
Decimal
Varchar
Integer
Integer
Decimal
Decimal

6
15
4,2
10
8
8
8,2
8,2

Primary Key/ first letter must start with P


Not Null
Not Null
Not Null
Not Null
Not Null
Not Null
Not Null

Table Name: SALESMAN_MASTER _1


Description:

used to store salesman information working for the company.

Column name

data type

Size

Attributes

SALESMANNO
SALESMANNAME
ADDRESS 1
ADDRESS 2
CITY
PINCODE
STATE
SALAMT
TGTTOGET
YTDSALES
REMARKS

Varchar
Varchar
Varchar
Varchar
Varchar
Integer
Varchar
Real
Decimal
Double
Varchar

6
20
30
30
20
8
20
8,2
6,2
6,2
60

Primary Key/ first letter must start with S


Not Null
Not Null

Not Null , Cannot be 0


Not Null , Cannot be 0
Not Null

4. Reinsert the data in these two tables based upon Lab 2.


5. Display the contents of each table.
*******************************************************************************

EXPERIMENT-5
TITLE: DDL (Data Definition Language) commands with Data Constraints
Objective: To understand the concept of data constraints which are enforced on data being stored in
the table. Focus on Primary Key , The Foreign Key and constraints.
Review this diagram

1. Create table AUTHOR = {Author_ID , Lastname, Firstname, Email, City, Country}


Where:
Author_ID text data type, 5 characters, primary key
Lastname text data type, 15 characters, not null
Firstname text data type, 15 characters, not null
Email text data type, 40 characters,
City text data type, 15 characters,
Country text data type, 15 characters,

2. Create Table BOOK={ Book_ID, Book_Title, Copies)


Where :
Book_ID text data type, 5 characters Primary Key Start With Character B
Book_Title - Text data Type Not Null
Copies- No.of copies Data Type int always greater the 2

3. Create table AUTHOR_LIST = {Author_ID , Book_ID , Role}

Where:
Author_ID text data type, 5 characters, referenced by Author_ID from AUTHOR
table
Book_ID text data type, 5 characters
Role text data type, 15 characters
and primary key is: Author_ID, Book_ID

4. Add four records in each tables AUTHOR, BOOK, BOOK_LIST.


5. Alter structure of table AUTHOR_LIST add the field Publisher data type of 30 Character.

***************************************************************
EXPERIMENT- 6,7
Title: Use of Inbuilt functions and relational algebra operation
Objective: To understand the use of inbuilt function and relational algebra with sql query.
1. Consider the following table structure and attempt.
Supplier-(scode,sname,scity,turnover)
Part-(pcode,weigh,color,cost,sellingprice)
Supplier_Part-(scode,pcode,qty)

a) create tables
b) populate the table.

2. Write appropriate SQL Statement for the following:


1. Get the supplier number and part number in ascending order of supplier number.
2. Get the details of supplier who operate from Bombay with turnover 50.
3. Get the total number of supplier.

4. Get the part number weighing between 25 and 35.


5. Get the supplier number whose turnover is null.
6. Get the part number that cost 20, 30 or 40 rupees.
7. Get the total quantity of part 2 that is supplied.
8. Get the name of supplier who supply part 2.
9. Get the part number whose cost is greater than the average cost.
10. Get the supplier number and turnover in descending order of turnover.

EXPERIMENT-8,9
TITLE: Nested sql queries or Subquries
Objective: To understand the use SQL Subquery

1.Create the following two tables (EMP and DEPT)


EMP TABLE
EMPNO

ENAME

JOB

----------

----------

---------

MGR

HIREDATE

SAL

COMM

----------

--------- ---------- ---------- ----------

DEPTNO

7369

SMITH

CLERK

7902

17-DEC-80

800

20

7499

ALLEN

SALESMAN

7698

20-FEB-81

1600

300

30

7521

WARD

SALESMAN

7698

22-FEB-81

1250

500

30

7566

JONES

MANAGER

7839

02-APR-81

2975

7654

MARTIN

SALESMAN

7698

28-SEP-81

1250

7698

BLAKE

MANAGER

7839

01-MAY-81

2850

20
1400

30
30

7782

CLARK

MANAGER

7788

SCOTT

ANALYST

7839

KING

PRESIDENT

7844

TURNER

SALESMAN

7876

ADAMS

7900

7839

09-JUN-81

7566

2450

10

09-DEC-82

3000

20

17-NOV-81

5000

10

7698

08-SEP-81

1500

CLERK

7788

12-JAN-83

1100

20

JAMES

CLERK

7698

03-DEC-81

950

30

7902

FORD

ANALYST

7566

03-DEC-81

3000

20

7934

MILLER

CLERK

7782

23-JAN-82

1300

10

30

DEPT TABLE
DEPTNO

DNAME

----------

--------------

LOC
-------------

10

ACCOUNTING

NEW YORK

20

RESEARCH

DALLAS

30

SALES

CHICAGO

40

OPERATIONS

BOSTON

Write the Nested Queries for the following queries.

1. List the details of the emps whose Salaries more than the employee BLAKE.
2. List the emps whose Jobs are same as ALLEN.
3. List the Emps whose Sal is same as FORD or SMITH in desc order of Sal.
4. List the emps Whose Jobs are same as MILLER or Sal is more than ALLEN.
5. Find the highest paid employee of sales department.

6. List the employees who are senior to most recently hired employee working under
king.
7. List the names of the emps who are getting the highest sal dept wise.
8. List the emps whose sal is equal to the average of max and minimum
9. List the emps who joined in the company on the same date.
10. Find out the emps who joined in the company before their Managers.

****************************************************************
EXPERIMENT-10
TITLE: Group by & having clause
Objective: To understand the use of group by and having clause.

Write the SQL Queries for the following queries (use EMP and DEPT table of Exp 8).

1.

List the Deptno where there are no emps.

2. List the No.of emps and Avg salary within each department for each job.

3. Find the maximum average salary drawn for each job except for President.
4. List the department details where at least two emps are working.
5. List the no. of emps in each department where the no. is more than 3.
6. List the names of the emps who are getting the highest sal dept wise.

7.

List the Deptno and their average salaries for dept with the average salary less than the
averages for all department.

F. SUGGESTED READINGS:

Ref. 1: SQL, PL/SQL, The programming language of Oracle by Ivan Bayross, BPB
Publication.
Ref. 2: Introduction to Oracle SQL-Volume 1

F-1: VIDEO RESOURCES (URL LINK) AND NPTEL LECTURES:


Link 1: http://www.youtube.com/watch?v=64szTfLNu3o&list=PL52484DF04A264E59&index=5
Link 2:
http://www.youtube.com/watch?v=TB5T2O8Hwm8&list=PL52484DF04A264E59&index=6

GUIDELINES

Cell Phones and other Electronic Communication Devices: Cell phones and other electronic
communication devices (such as Blackberries/Laptops) are not permitted in classes during
Tests or the Mid/Final Examination. Such devices MUST be turned off in the lab classes
E-Mail and LMS: Each student in the class should have an e-mail id and a pass word to
access the LMS system regularly. Regularly, important information Date of conducting
class tests, guest lectures, via LMS. The best way to arrange meetings with us or ask specific
questions is by email and prior appointment. All the assignments preferably should be
uploaded on LMS. Various research papers/reference material will be mailed/uploaded on
LMS time to time.
Attendance: Students are required to have minimum attendance of 75% in each subject.
Students with less than said percentage shall NOT be allowed to appear in the end semester
examination.

Passing criterion: Student has to secure minimum 30%/40% marks of the highest marks in
the class scored by a student in that subject (in that class/group class) individually in both the
End-Semester examination and Total Marks in order to pass in that paper.

Passing Criterion for B. Tech: minimum 30% of the highest marks in the class

Passing Criterion for M. Tech: minimum 40% of the highest marks in the class

S-ar putea să vă placă și