ADBMS Lab Manual Aug-Dec 2017 - ByMe
ADBMS Lab Manual Aug-Dec 2017 - ByMe
Approved By
A. PREREQUISITE:
a. Elementary knowledge of Database Management System
b. Basic knowledge of SQL.
C. COURSE OUTCOMES FOR ADBMS LAB: At the end of this course student should
be able to
D. PEDAGOGY
Power Point Presentation,
Experimental learning with continuous evaluation,
Lab performance and record evaluation shall be a continuous process throughout the
semester. Minimum three Viva voice/ Quiz based on practical sessions shall be
conducted during the semester. A student should attend at least two Viva voice/ Quiz
otherwise he/she will be failed.
F3. CLASS TESTS/QUIZZES: Two Class Tests based on descriptive type theoretical &
numerical questions and Two Quizzes based on objective type questions will be held;
one class test and one quiz at least ten days before the Mid Term Examination and
second class test and second quiz at least ten days before the End Term Examination.
Those who do not appear in Viva-Voce and quiz examinations shall lose their marks.
The marks obtained by the students will be displayed on LMS a week before the start of
Mid Term and End Term Examinations respectively.
F4. GENERAL DISCIPLINE: Based on student’s regularity, punctuality, sincerity and
participation in the interactions.
The marks obtained by the students will be displayed on LMS at the end of semester.
F6. GRADING:
The overall marks obtained at the end of the semester comprising all the above three
mentioned shall be converted to a grade.
G. COURSE DELIVERY PLAN
1. EXPERIMENT-1
Title: Working with Oracle, Working with Views, Read only and updatable views
1.1. Create the Tables STUDENT (sid, firstname, lastname, address, contact, courseid)
and COURSE(courseid, cname, cduration, instructor).
i. Design the tables with Referential and Domain constraints as applicable (like
primary key, not null , foreign key). Input some sample records into both the
tables.
ii. Delete Record 2 from COURSE table
iii. Delete Record 2 from STUDENT table
iv. Drop the COURSE Table
v. Drop the STUDENT table
****************************************************************
2. EXPERIMENT-2
****************************************************************
3. EXPERIMENT-3
3.1 Create a sequence by name EMPID_SEQ starting with value 100 with an interval of 1.
3.2 Write a SQL for finding the current and the next status of EMPID_SEQ.
3.3 Change the Cache value of the sequence EMPID_SEQ to 20 and maxvalue to 1000.
3.4 Insert values in employees table using sequences for employee_id column.
3.5 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
4.1 Write a PLSQL code block to swap two numbers without taking third variable.
4.2 Write a PL/SQL code to accept the value of A, B & C display which is greater .
4.3 Using PL/SQL Statements create a simple loop that display message “Welcome to
PL/SQL Programming” 20 times.
4.4 Write a PLSQL code block to reverse the string.
4.5 Write a PL/SQL code block to check whether the given number is Armstrong number
or not.
****************************************************************
EXPERIMENT-5
5.1 Write a PL/SQL code block to find total and average of 6 subjects and display the
grade.
5.2 Write a PLSQL code block to accept table name and display number of rows in a
table.
5.3 Write a PLSQL code block generate table of a given number and store result in two
column table.
5.4 Write a PLSQL code block to generate simple interest and store Principal, Interest
rate, time and simple Interest in a table.
5.5 Write a PL/SQL Code block program to accept a deptno and display who are working
in that dept?
5.6 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)
i. Accept a range of salary and print the details of teachers from teacher table.
ii. Calculate the bonus amount to be given to a teacher depending on the following
conditions:
a. if salary > 10000 then bonus is 10% of the salary.
b. if salary is between 10000 and 20000 then bonus is 20% of the salary.
c. if salary is between 20000 and 25000 then bonus is 25% of the salary.
d. if salary exceeds 25000 then bonus is 30% of the salary.
iii. Using a simple LOOP structure, list the first 10 records of the ‘teachers’ table.
iv. Accept the room number and display the teacher details like t_no, f_name,
l_name,
a. birthdate, title from table Teacher.
****************************************************************
EXPERIMENT- 6
6.1. Write a PL/SQL function that accepts 2 numbers and returns the addition of passed
values.
6.2. Write a PL/SQL function that accepts number and returns the reverse of that number.
6.3. Write a PL/SQL procedure to calculate the sum of first N number where N is passed as
parameter.
6.4. Write a PL/SQL function that accepts department number and returns the total salary
of the department. Use table EMPLOYEES(as given in Experiment 1- Q.6)
6.5. Write a PL/SQL procedure to display the average salary of each department. Use table
EMPLOYEES(as given in Experiment 1- Q.6)
****************************************************************
EXPERIMENT- 7
7.1. Using implicit cursor update the salary by an increase of 10% for all the records in
EMPLOYEES table, and finally display how many records have been updated. If no
records exist display the message None of the salaries were updated.
7.2. WAP to accept the employee_id and display all the details of employees.If employee
doesnot exist display the appreciate message
****************************************************************
EXPERIMENT- 8
8.1. Using explicit cursor fetch the employee name, employee_id and salary of all the
records from EMPLOYEES table.
8.2. 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
CUSTOMER Table:
9.1. 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:
9.2. 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.
9.3. Scenario: We want to keep a log file containing data from rows that have been deleted
from the EMPLOYEES Table.
****************************************************************
********************************************************************
**********************************************************************
H. SUGGESTED READINGS:
H1. TEXT BOOK:
1. SQL, PL/SQL: The Programming Language Of Oracle by Ivan Bayross, BPB
Publications.
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 online learning tool: 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 online learning tool. 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 online learning tool. Various research papers/reference
material will be mailed/uploaded on online learning platform 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.
Course outcome assessment: To assess the fulfilment of course outcomes two different
approaches have been decided. Degree of fulfillment of course outcomes will be assessed in
different ways through direct assessment and indirect assessment. In Direct Assessment, it is
measured through quizzes, tests, assignment, Mid-term and/or End-term examinations. It is
suggested that each examination is designed in such a way that it can address one or two
outcomes (depending upon the course completion). Indirect assessment is done through the
student survey which needs to be designed by the faculty (sample format is given below) and it
shall be conducted towards the end of course completion. The evaluation of the achievement
of the Course Outcomes shall be done by analyzing the inputs received through Direct and
Indirect Assessments and then corrective actions suggested for further improvement. Capping
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% and 40% of the highest marks in the
class applicable to the students admitted before July 2015 and onwards July 2015
respectively.
Passing Criterion for M. Tech: minimum 40% of the highest marks in the class
NAME:
ENROLLMENT NO:
SAP ID:
COURSE:
PROGRAM: