CS8481
CS8481
CS8481
1. Create the following tables with given attributes having appropriate data type and specify the
necessary primary and foreign key constraints:
Customer (Custid, Custname, Age, phone)
Loan (Loanid, Amount, Custid, EMI)
a) List the name of the customers who have taken loan for more than Rs.50,000.
b) List the Customer id of those who have no loan.
c) List the total count of loan availed.
d) Create a procedure to print the Amount and Custid when the Loanid is given as input. Handle
Exceptions.
4. Create the following tables with given attributes having appropriate data type and specify the
necessary primary and foreign key constraints:
User (Userid, Name, Dept, Bookid, Accdate)
Book (Bookid, Book_name, Author, Publication, Price)
a) List the name of the user who had accessed the costliest book.
b) List the userid and count of books accessed by the user.
c) List the books published by Wiley publisher.
d) Write a Procedure to print the details of the book when Bookid is given as input. Handle
appropriate exceptions.
6. Create the following tables with given attributes having appropriate data type and specify the
necessary primary and foreign key constraints:
Customer (Custid, Custname, phno,pan,DOB) HomeLoan (HLoanid, Amount, Custid)
VehicleLoan (VLoanid, Amount, Custid)
a) List the Custid of the customers who have both homeloan and vehicle loan.
b) List the Custid of the customers who donot have any loan.
c) Create a view with customerid, Customer name and total loan amount (HomeLoan and
VehicleLoan)
d) Write a trigger which displays the Homeloan details whenever the values are inserted in the
respective table.
12. Create the following tables with given attributes having appropriate data type and specify the
necessary primary and foreign key constraints:
Marks(Regno,Name , Dept, Subj1,Subj2,Subj3)
a) Add a column Total in student table and update the Total field with the sum of 3
subject Marks.
b) Find the second maximum total in the table.
c) Display the name of the student with maximum total.
d) Write a Procedure to display the report sheet of the students using cursors.
14. Create the following tables with the mapping given below.
stu_details (reg_no, stu_name, DOB, address, city)
mark_details (reg_no, mark1, mark2, mark3, total)
(a) Alter the table mark_details to add a column average with data type as long.
(b) Display the months between the DOB and till date.
(c) Using alter command drop the column address from the table stu_details.
(d) Write a Procedure to find the sum & average marks of all the student using procedures.
16. (a) Create a table Student (Regno, name , Mark) and insert records. Write a PL/SQL function to
print the grade of the Student. Obtain student mark as input from the main program. Check for the
following condition: if the input mark ranges 91-100 then Grade A, 81-90 then Grade B, 71-80
then Grade C, 60-70 then Grade D and <60 Grade E.
(b) Develop an application for Banking System. Design a Database schema and create necessary
tables and forms.
Table creation with Appropriate Constraints and Data Type (10)
Data Insertion (10)
Procedure (20)
Application Development
Database Design (10)
Front end (10)
Database connectivity and output (20)
Viva-Voce (10) marks
Record (10) marks
Total (100) marks
20. (a) Create the table Book (acc_no, username, bookno, days) and insert few records into the table.
Write a Procedure to calculate the fine for library book (Rs 5 /day). (Hint: fine =days*5). Obtain
account no as input. Handle Exceptions.
(b). Design a Database schema for Library management System. Develop an application for
managing book details in Library management System .
Table creation with Appropriate Constraints and Data Type (10)
Data Insertion (10)
Procedure (20)
Application Development
Database Design (15)
Front end (10)
Database connectivity and output (15)
Viva-Voce (10) marks
Record (10) marks
Total (100) marks