You are on page 1of 9

B.E. / B.Tech.

PRACTICAL END SEMESTER EXAMINATIONS, JUNE - 2022


Fourth Semester

CS8481 & DATABASE MANAGEMENT SYSTEMS LABORATORY

(Regulation 2017)

Time : 3 Hours Answer any one Question Max. Marks 100

Queries PL/SQL Output & Result Viva-Voce Record Total


programs
30 30 20 10 10 100

1. Create a table ‘Student’ with the following details (table level constraints)
1.
Rollno number(5) Primary key
Name varchar2(10)
Coursecode number(2) Foreign key (Reference ‘Course’ table)
Mark1 number(3) Check whether values range from 0 to 100
Mark2 number(3) Check whether values range from 0 to 100
2. Create a table ‘Course’ with the following details (table level constraints)
Ccode number(2) Primary key
Course varchar2(10)
A. Add the field total to table student
B. Insert 5 records into the table. Don’t input values for total field
C. List the student names and their course names
D. Write a PL/SQL block to find whether the given number is odd or even
E. Write a database trigger before delete for each row on table course, delete corresponding course
students from Student table
Query – 40 PL/SQL – 40

1. Create a table ‘Employee’ with the following details(Column level constraints)


2.
Empno Number(5) Primary key
Empname Varchar2(20) Designation Varchar2(10)
Date_of_join Date
Salary Number(9,2) NOT NULL
Depno Number(2) Foreign key(Reference ‘Department’ table)
2. Create another table called ‘Department’ with the following structure(Column level constraints)
Depno Number(2) Primary key
Depname Varchar2(15)
Deplocation Varchar2(10)
A. Display the number of employees in each department with the department numbers in descending
order
B. List the departments where there are employees functioning
C. List the employees whose depno is not equal to ‘01’
D. Write a PL/SQL block to find the factorial of a number
E. Write a PL/SQL procedure which accepts depno as input and increase the salary of the
corresponding department employees by 5% in the employee table
Query – 40 PL/SQL – 40

1. Create a table order_master with the following fields


3.
Orderno varchar2(5) Ordate date
Vencode varchar2(5)
Ordstatus char(1) (p-pending,d-delivered)
Del_date Date
2. Create a table order_detail with the following fields
Orderno varchar2(5) Itemcode varchar2(5)
Qty_ord number(5) Qty_deld number(5)
A. Display the information on orders being handled by a vendor whose Vencode is ‘V004’
according to the delivery date order
B. List the orders which have been placed after ’01-Jan-2006’ and before ’01-Jul-2006’
C. List out the pending orders
D. Write a PL/SQL block to find whether the given year is leap year or not
E. Write a PL/SQL block to display a particular order details. Display appropriate message if the
order is not found.

Query – 40 PL/SQL – 40

1. Create a table ‘Student’ with the following details (table level constraints)
4.
Rollno number(5) Primary key
Name varchar2(10)
Coursecode number(2) Foreign key (Reference ‘Course’ table)
Mark1 number(3) Check whether values range from 0 to 100
Mark2 number(3) Check whether values range from 0 to 100
2. Create a table ‘Course’ with the following details (table level constraints)
Ccode number(2) Primary key
Course varchar2(10)
A. Add the field total to table student
B. Insert 5 records into the table. Don’t input values for total field.
C. List the student name with the highest mark1
D. Write a PL/SQL function to find the factorial of a given number
E. Write a database trigger to display the total number of records after inserting a record
into the table
Query – 40 PL/SQL – 40

1. Create a table member with the following fields member code, member name, phoneno.
5.
2. Create a table book with the following fields bookcode, category code, bookname, cost.
3. Create a table issue with the following fields membercode, Book code, Issuedate, Returndate.
A. List all the members names who have taken the book on 8-10-2007.
B. List the member codes of the members who have taken books worth more than Rs. 400.00.
C. Write a PL/SQL block to generate the Fibonacci series
D. Write a PL/SQL block using cursor to display the contents of various tables based on the options
Query – 40 PL/SQL – 40

Create a table vendor_master with the following fields


6.
Vencode varchar2(5) Venname varchar2(15)
Venadd1 varchar2(30) Venadd2 varchar2(30)
Venadd3 varchar2(30)
A. Change the address of the vendor with Vendor code ‘V002’ in Vendor_master
B. Display the next occurrence of ‘Friday’ to the current date.
C. Find the total number of vendors.
D. List the vendor names start with the letter ‘A’.
E. Write a PL/SQL block to find whether the given number is odd or even
F. Write a PL/SQL block using cursor to display the total number of records and delete a record
Query – 40 PL/SQL – 40

1. Create a table ‘Student’ with the following details (table level constraints)
7.
Rollno number(5) Primary key
Name varchar2(10)
Coursecode number(2) Foreign key (Reference ‘Course’ table)
Mark1 number(3) Check whether values range from 0 to 100
Mark2 number(3) Check whether values range from 0 to 100
2. Create a table ‘Course’ with the following details (table level constraints)
Ccode number(2) Primary key
Course varchar2(10)
A. Add the field total to table student
B. List the student names starting with the letter ‘S’.
C. Update the total field by adding Mark1 and Mark2
D. Write a PL/SQL block to find whether the given year is leap year or not
E. Write a PL/SQL block using cursor to display the student names and their corresponding course
names.
Query – 40 PL/SQL – 40

1. Create a table ‘Employee’ with the following details(Column level constraints)


8.
Empno Number(5) Primary key
Empname Varchar2(20) Designation Varchar2(10)
Date_of_join Date
Salary Number(9,2) NOT NULL
Depno Number(2) Foreign key(Reference ‘Department’ table)
2. Create another table called ‘Department’ with the following structure(Column level constraints)
Depno Number(2) Primary key
Depname Varchar2(15)
Deplocation Varchar2(10)
A. Display the number of employees in each department with the department numbers in descending
order
B. Display designation, department no and total number of employees designation wise and
department wise.
C. List the Employee names and their department names.(Use Outer join)
D. Write a PL/SQL block to find whether the given number is odd or even
E. Write a database trigger before insert or update for each row on the table employee not allowing
to enter salary > 25,000
Query – 40 PL/SQL – 40

Create a table itemfile with the following fields


9.
Itemcode varchar2(5) Itemdesc varchar2(30)
P_category varchar2(30) (Spares, Accessories)
Qty_hand number(5) Re_level number(5)
Maxlevel number(5) Itemrate number(9,2)
A. Display the quantity required (maxlevel – Qtyhand) of each item under the category of spares to
reach the maximum level
B. Find the item with maximum rate in each product category
C. Find the items whose quantity in hand is less than the maximum level for the ‘spares’ category
D. Find the total number of items under ‘Accessories’ category.
E. Write a PL/SQL block to find whether the given year is leap year or not
F. Write a PL/SQL block to display a particular item details. Display appropriate message if the
item is not found
Query – 40 PL/SQL – 40

1. Create a table member with the following fields member code, member name, phoneno.
10.
2. Create a table book with the following fields bookcode, category code, bookname, cost.
3. Create a table issue with the following fields membercode, Book code, Issuedate, Returndate.
A. List all the members names who have taken the book on 8-10-2007.
B. Find the total cost of books category wise.
C. Write a PL/SQL block to find whether the given number is odd or even.
D. Write a PL/SQL block to display a particular book details. Display appropriate message if the
book is not found.
Query – 40 PL/SQL – 40

1. Create a table ‘Student’ with the following details (table level constraints)
11.
Rollno number(5) Primary key
Name varchar2(10)
Coursecode number(2) Foreign key (Reference ‘Course’ table)
Mark1 number(3) Check whether values range from 0 to 100
Mark2 number(3) Check whether values range from 0 to 100
2. Create a table ‘Course’ with the following details (table level constraints)
Ccode number(2) Primary key
Course varchar2(10)
A. Add the field total to table student
B. Insert 5 records into the table. Don’t input values for total field.
C. List the student names and their course names
D. Write a PL/SQL block to find the sum of ‘n’ natural numbers
E. Write a PL/SQL cursor to display the student details
Query – 40 PL/SQL – 40

1. Create a table ‘Student’ with the following details (table level constraints)
12.
Rollno number(5) Primary key
Name varchar2(10)
Coursecode number(2) Foreign key (Reference ‘Course’ table)
Mark1 number(3) Check whether values range from 0 to 100
Mark2 number(3) Check whether values range from 0 to 100
2. Create a table ‘Course’ with the following details (table level constraints)
Ccode number(2) Primary key
Course varchar2(10)

A. Add the field total to table student


B. Insert 5 records into the table. Don’t input values for total field
C. List the student names and their course names.
D. Write a database trigger to display the total number of records after inserting a
recordinto the table
E. Write a PL/SQL function to display the Fibonacci series.
Query – 40 PL/SQL – 40

Create a table vendor_master with the following fields


13.
Vencode varchar2(5) Venname varchar2(15)
Venadd1 varchar2(30) Venadd2 varchar2(30)
Venadd3 varchar2(30)
A. Modify the existing column Venname from varchar2(15) to varchar2(25)
B. Delete the table Vendor_master
C. Find the total number of vendors.
D. Display the vendor names in descending order.
E. Write a PL/SQL block using cursor to display the total number of records and delete a record.
F. Write a PL/SQL function to find the factorial of a given number.
Query – 40 PL/SQL – 40

1. Create a table order_master with the following fields


14.
Orderno varchar2(5) Ordate date
Vencode varchar2(5)
Ordstatus char(1) (p-pending,d-delivered)
Del_date Date
2. Create a table order_detail with the following fields
Orderno varchar2(5) Itemcode varchar2(5)
Qty_ord number(5) Qty_deld number(5)
A. Display the information on orders being handled by a vendor whose Vencode is ‘V004’
according to the delivery date order
B. List the orders which have been placed after ’01-Jan-2018’ and before ’01-Jul-2018’.
C. List out the pending orders
D. Write a PL/SQL block to find the sum of ‘n’ natural numbers
E. Write a PL/SQL block using cursor to display the contents of various tables based on the options
Query – 40 PL/SQL – 40

1. Create a table ‘Employee’ with the following details(Column level constraints)


15.
Empno Number(5) Primary key
Empname Varchar2(20) Designation Varchar2(10)
Date_of_join Date
Salary Number(9,2) NOT NULL
Depno Number(2) Foreign key(Reference ‘Department’ table)
2. Create another table called ‘Department’ with the following structure(Column level constraints)
Depno Number(2) Primary key
Depname Varchar2(15)
Deplocation Varchar2(10)

A. List the employees whose depno is not equal to ‘01’


B. Display designation, department no and total number of employees designation wise and
department wise
C. List the Employee names and their department names.(Use Outer join)
D. Write a PL/SQL block to find the factorial of a given number
E. Write a PL/SQL procedure which accepts depno as input and increase the salary of the
corresponding department employees by 10% in the employee table.
1. Create a table member with the following fields member code, member name, phoneno.
16.
2. Create a table book with the following fields bookcode, category code, bookname, cost.
3. Create a table issue with the following fields membercode, Book code, Issuedate, Returndate.
A. List all the members names who have taken the book on 8-10-2007.
B. List the member codes of the members who have taken books worth more than Rs. 400.00.
C. Write a PL/SQL block to generate the Fibonacci series
D. Write a database trigger to display the total number of members after inserting a record
into the member table

Create a table itemfile with the following fields


17.
Itemcode varchar2(5) Itemdesc varchar2(30)
P_category varchar2(30) (Spares, Accessories)
Qty_hand number(5) Re_level number(5)
Maxlevel number(5) Itemrate number(9,2)
A. Find the item with maximum rate in each product category
B. Find the items whose quantity in hand is less than the maximum level for the ‘spares’ category
C. List the accessories items having item rate greater than the minimum item rate of ‘spares’
category.
D. List the items that are available more than 100 in quantity.
E. Write a database trigger to display the total number of records after inserting a record
into the table
F. Write a PL/SQL function to display the Fibonacci series

1. Create a table order_master with the following fields


18.
Orderno varchar2(5) Ordate date
Vencode varchar2(5)
Ordstatus char(1) (p-pending,d-delivered)
Del_date Date
2. Create a table order_detail with the following fields
Orderno varchar2(5) Itemcode varchar2(5)
Qty_ord number(5) Qty_deld number(5)
A. Display the information on orders being handled by a vendor whose Vencode is ‘V004’
according to the delivery date order
B. List the orders which have been placed after ’01-Jan-2018’ and before ’01-Jul-2018’
C. Delete the orders having order status delivered.
D. Write a PL/SQL block to find whether the given year is leap year or not
E. Write a PL/SQL block using cursor to display the orders placed in a particular date.

1. Create a table ‘Student’ with the following details (table level constraints)
19.
Rollno number(5) Primary key
Name varchar2(10)
Coursecode number(2) Foreign key (Reference ‘Course’ table)
Mark1 number(3) Check whether values range from 0 to 100
Mark2 number(3) Check whether values range from 0 to 100
2. Create a table ‘Course’ with the following details (table level constraints)
Ccode number(2) Primary key
Course varchar2(10)
A. Add the field total to table student
B. Insert 5 records into the table. Don’t input values for total field
C. List the student names and their course names.
D. Write a PL/SQL block to display the Fibonacci series
E. Write a PL/SQL block using cursor to update the total field
1. Create a table ‘Employee’ with the following details(Column level constraints)
20.
Empno Number(5) Primary key
Empname Varchar2(20) Designation Varchar2(10)
Date_of_join Date
Salary Number(9,2) NOT NULL
Depno Number(2) Foreign key(Reference ‘Department’ table)
2. Create another table called ‘Department’ with the following structure(Column level constraints)
Depno Number(2) Primary key
Depname Varchar2(15)
Deplocation Varchar2(10)
A. Display the number of employees in each department with the department numbers in descending
order
B. List the departments where there are employees functioning
C. Display the employee names and their years of service
D. Write a PL/SQL procedure which accepts depno as input and increase the salary of the
corresponding department employees by 10% in the employee table.
E. Write a PL/SQL function to count the number of employees in a particular department

1. Create a table ‘Student’ with the following details (table level constraints)
21
Rollno number(5) Primary key
Name varchar2(10)
Coursecode number(2) Foreign key (Reference ‘Course’ table)
Mark1 number(3) Check whether values range from 0 to 100
Mark2 number(3) Check whether values range from 0 to 100
2. Create a table ‘Course’ with the following details (table level constraints)
Ccode number(2) Primary key
Course varchar2(10)
A. Add the field total to table student
B. Insert 5 records into the table. Don’t input values for total field
C. List the student names and their course names
D. Write a PL/SQL block to find whether the given number is odd or even
E. Write a database trigger before delete for each row on table course, delete corresponding course
students from Student table
Query – 40 PL/SQL – 40

1. Create a table ‘Employee’ with the following details(Column level constraints)


22
Empno Number(5) Primary key
Empname Varchar2(20) Designation Varchar2(10)
Date_of_join Date
Salary Number(9,2) NOT NULL
Depno Number(2) Foreign key(Reference ‘Department’ table)
2. Create another table called ‘Department’ with the following structure(Column level constraints)
Depno Number(2) Primary key
Depname Varchar2(15)
Deplocation Varchar2(10)
A. Display the number of employees in each department with the department numbers in descending
order
B. List the departments where there are employees functioning
C. List the employees whose depno is not equal to ‘01’
D. Write a PL/SQL block to find the factorial of a number
E. Write a PL/SQL procedure which accepts depno as input and increase the salary of the
corresponding department employees by 5% in the employee table
Query – 40 PL/SQL – 40
1. Create a table order_master with the following fields
23
Orderno varchar2(5) Ordate date
Vencode varchar2(5)
Ordstatus char(1) (p-pending,d-delivered)
Del_date Date
2. Create a table order_detail with the following fields
Orderno varchar2(5) Itemcode varchar2(5)
Qty_ord number(5) Qty_deld number(5)

A. Display the information on orders being handled by a vendor whose Vencode is ‘V004’
according to the delivery date order
B. List the orders which have been placed after ’01-Jan-2006’ and before ’01-Jul-2006’
C. List out the pending orders
D. Write a PL/SQL block to find whether the given year is leap year or not
E. Write a PL/SQL block to display a particular order details. Display appropriate message if the
order is not found.

Query – 40 PL/SQL – 40

1. Create a table ‘Student’ with the following details (table level constraints)
24
Rollno number(5) Primary key
Name varchar2(10)
Coursecode number(2) Foreign key (Reference ‘Course’ table)
Mark1 number(3) Check whether values range from 0 to 100
Mark2 number(3) Check whether values range from 0 to 100
2. Create a table ‘Course’ with the following details (table level constraints)
Ccode number(2) Primary key
Course varchar2(10)
A. Add the field total to table student
B. Insert 5 records into the table. Don’t input values for total field.
C. List the student name with the highest mark1
D. Write a PL/SQL function to find the factorial of a given number
E. Write a database trigger to display the total number of records after inserting a record
into the table
Query – 40 PL/SQL – 40

1. Create a table ‘Student’ with the following details (table level constraints)
25
Rollno number(5) Primary key
Name varchar2(10)
Coursecode number(2) Foreign key (Reference ‘Course’ table)
Mark1 number(3) Check whether values range from 0 to 100
Mark2 number(3) Check whether values range from 0 to 100
2. Create a table ‘Course’ with the following details (table level constraints)
Ccode number(2) Primary key
Course varchar2(10)
A. Add the field total to table student
B. Insert 5 records into the table. Don’t input values for total field
C. List the student names and their course names
D. Write a PL/SQL block to find whether the given number is odd or even
E. Write a database trigger before delete for each row on table course, delete corresponding course
students from Student table
Query – 40 PL/SQL – 40

You might also like