Adbms Lab Manual
Adbms Lab Manual
F01 (B)
Issue No.04 Rev. No 4 Dated: June 7, 2014
_____________________________________________________________________________________________
COURSE PLAN
Programme :
Course
Subject Code
CSEG236 Lab
No. of credits
Semester
Session
Batch
III Semester
:
2016-2017
2015-19
Prepared by :
r.choudhary@ddn.upes.ac.in
Approved By
_______________________
_______________________
HOD
Dean
UPES Campus
Tel : +91-135-2770137
Energy Acres
Website : www.upes.ac.in
COURSE PLAN
Subject:
ADBM
Course: B.Tech
S LAB
Duration:
120 Minutes
A. OBJECTIVES:
Upon completion of this course the learners will be:
B. COURSE OUTLINE
S.No
1
Experiment No
Experiment-1
2
3
4
5
6
7
Experiment-2
Experiment-3
Experiment-4 and 5
Experiment-6
Experiment-7 & 8
Experiment-9
Contents
Working with Oracle 10g
Working with Views, Read only and
updatable views
Working with various forms Indexes
Working with Sequences
PL/SQL Core Programming
Working with Functions/Procedures
Working with Cursors
Working with Triggers
C. PEDAGOGY
Basic theoretical and practical knowledge on Database Management Systems
No.of Labs
Planned/taken
9
No.of experiments
planned/conducted
9
No.of Tests
planned/conducted
% syllabus
completed
01
2
3
Components of evaluation
a Viva voce / Quiz (50%) + Performance & Records (50%).
b Lab performance and record evaluation shall be a continuous process throughout the semester.
c Minimum three Viva voce/ Quiz based on practical sessions shall be conducted during the
semester.
Distribution of marks for the lab sessions and the methodology should be conveyed to the students at the
time of commencement of semester.
Final Grade Award Sheet needs to be submitted to SRE department before completion of End semester
examination.
EXPERIMENT-2
Title: Working with various Indexes
7. Create an index of name employee_idx on EMPLOYEES with column Last_Name, Department_id
.
8. Find the ROWID for the above table and create a unique index on employee_id column of the
EMPLOYEES.
9. Create a reverse index on employee_id column of the EMPLOYEES.
10.Create a unique and composite index on employee_id and check whether there is duplicity of
tuples or not.
11.Create Function-based indexes defined on the SQL functions UPPER(column_name) or
LOWER(column_name) to facilitate case-insensitive searches(on column Last_Name).
12.Drop the function based index on column Last_Name.
EXPERIMENT-3
Title: Working with Sequences
13.Create a sequence by name EMPID_SEQ starting with value 100 with an interval of 1.
14.Write a SQL for finding the current and the next status of EMPID_SEQ.
15.Change the Cache value of the sequence EMPID_SEQ to 20 and maxvalue to 1000.
16.Insert values in employees table using sequences for employee_id column.
17.Drop sequence EMPID_SEQ. Create a sequence called REVERSE to generate numbers in the
descending order from 10000 to 1000 with a decrement of 5.
EXPERIMENT-4 and 5
Title: PL/SQL Programming
18.Write a PLSQL code block to swap two numbers without taking third variable.
19.Write a PL/SQL code to accept the value of A,B & C display which is greater .
20.Using PL/SQL Statements create a simple loop that display message Welcome to PL/SQL
Programming 20 times.
21.Write a PLSQL code block to reverse the string.
22.Write a PL/SQL code block to find total and average of 6 subjects and display the grade.
23.Write a PL/SQL code block to check whether the given number is Armstrong number or not.
24.Write a PLSQL code block to accept table name and display number of rows in a table.
25.Write a PLSQL code block generate table of a given number and store result in two column
table.
26.Write a PLSQL code block to generate simple interest and store Principal, Interest rate, time
and simple Interest in a table.
27.Write a PL/SQL Code block program to accept a deptno and display who are working in that
dept?
28.Consider the following table to write PL/SQL code as specified under
Teacher (t_no, f_name, l_name, salary, supervisor, joiningdate, birthdate, title)
Class (class_no, t_no, room_no)
Payscale (Min_limit, Max_limit, grade)
Accept a range of salary and print the details of teachers from teacher table.
Calculate the bonus amount to be given to a teacher depending on the following conditions:
o if salary > 10000 then bonus is 10% of the salary.
o if salary is between 10000 and 20000 then bonus is 20% of the salary.
o if salary is between 20000 and 25000 then bonus is 25% of the salary.
o if salary exceeds 25000 then bonus is 30% of the salary.
Using a simple LOOP structure, list the first 10 records of the teachers table.
Accept the room number and display the teacher details like t_no, f_name, l_name,
37.Using explicit cursor Insert the records from EMPLOYEES table for the columns employee_id,
Last_Name and salary for those records whose salary exceeds 2500 into a new table
TEMP_EMP.
EXPERIMENT- 9
Title: Working with Triggers:
I
D
1
2
3
4
5
6
NAM
E
Ram
esh
Khila
n
Kaus
hik
Chait
ali
Hardi
k
Kom
al
A
GE
32
25
ADDRES
S
Ahmeda
bad
Delhi
23
Kota
25
Mumbai
27
Bhopal
22
MP
SALA
RY
2000.
00
1500.
00
2000.
00
6500.
00
8500.
00
4500.
00
38. The following program creates a row level trigger for the customers table that would fire for
INSERT or UPDATE or DELETE operations performed on the CUSTOMERS table. This trigger will
display the salary difference between the old values and new values:
39.First, create a new table named employees_audit to keep the changes of the employee table.
Next, create a BEFORE UPDATE trigger that is invoked before a change is made to the
employees table.
40.Scenario: We want to keep a log file containing data from rows that have been deleted from
the EMPLOYEES Table.
G:SUGGESTED READINGS:
SQL, PL/SQL: The Programming Language Of Oracle by Ivan Bayross, BPB Publications.
WEB RESOURCES:
http://bigDatauniversity.com
http://education.oracle.com
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 class room.
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