CS8481 - Set 2 - Annauniv
CS8481 - Set 2 - Annauniv
CS8481 - Set 2 - Annauniv
(Regulation 2017)
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
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
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 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)
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
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