DBMS Set 1
DBMS Set 1
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)
a) List the name of the customers who have taken loan for more than
Rs.50,000.
d) Create a procedure to print the Amount and Custid when the Loanid is given
as input. Handle Exceptions.
2. Create the following tables with given attributes having appropriate data type and
specify the necessary primary and foreign key constraints:
Employee (EmpId, Empname, Sal, Deptno)
b) List the employee name, department name and the salary of all the
employees.
c) Display the Employee name and the respective department manager name.
d) Create a function to return the salary of the employee when Empid is given
as input parameter. Handle Exceptions.
.
3. Create the following tables with given attributes having appropriate data type
and specify the necessary primary and foreign key constraints:
Voter (VoterId, Votername, Gender, Boothid,Checkvote)
a) (i)List the count of voters in each Booth (ii) List the count of Male voters
voted.
3.
b) Display the overall count of voters voted in the election.
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)
d) Write a PL/SQL program to print the details of the book when Bookid is
given as input. Handle appropriate exceptions.
5. Create the following tables with given attributes having appropriate data type and specify
the necessary primary and foreign key constraints:
Customer (Custid, Custname, Addr, phno,panno)
Loan (Loanid, Amount, Interest, Custid)
Account (Acctno, Accbal, Custid)
a. Display the Account balance amount of a particular customer “ARUN”
b. Update the interest with 1% when Accbal of the Custid >50% of Loan Amount
c. Create a View with Accbal and Loan Amount of all Customers
d. Create a trigger which checks for minimum balance in the account.
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)
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.
7. Create the following tables with given attributes having appropriate data type and specify the
necessary primary and foreign key constraints:
Product (Prodid, Prodesc, Price, Stock)
a) Add a column reorder in Product table having value 50 for all products.
8. Create the following tables with given attributes having appropriate data type and specify the
necessary primary and foreign key constraints:
Product (Prodid, Prodesc, Price, Stock)
a) Add a column reorder in Product table having value 50 for all products.
c) ER diagram
9. Design a Database for Library Management System using ER Diagram.
Create the following table with the given attributes having appropriate data type and specify the
necessary key constraints.
● BOOK(Bookcode,Name,Author,Price,Publish)
Design forms to
a) Login
10. Create an student contacts management Database. The application enables a faculty user to
login and search the details of a Student (Name, Address, Contact no, Email id, parent contact)
with his register number. Create necessary tables and Forms.
11. Create an Database for Quiz system. Create the necessary table(s) with attributes having
appropriate data type and specify the necessary key constraints.
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.
d) Write a PL/SQL program to display the report sheet of the students using cursors.
h. Write a PL/SQL program to find the details of the student when regno is given as
input. Handle Exceptions.
14. Create the following tables with the mapping given below.
(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 PL/SQL program to find the sum & average marks of all the student using
procedures.
15. Create the following tables with the mapping given below.
Employee (Empno, Ename, Job, MgrId, DoB, DoJ, Sal, Comm, Deptno)
(a) Display the Emp no, name, salary and experience of each employee ordered by salary
(highest to lowest)
(b) List the names of the employee working for “Marketing” Department.
(c) List the names of the employees born in the current month.
(d) Write a PL/SQL function to display the details of the employee when Employee no given as
input. Handle Exceptions.
17. (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 Datbase for Banking System. Design a ER diagram and create necessary tables
Create a table Employee (Id, Name, Basicpay, DOB,Dept).Obtain Employeeid as input from the
main program. (Basic pay +DA+HRA-TAX-DED). Assume the Allowances and Deduction %.
(b) Develop an Employee payroll processing System to add, delete, update employee particulars
and generate payslip with the employee table created in (a).
19. (a) Create a table Bank (acc_no, name, balance) and insert records into the table.
Write a PL/SQL program for the Bank table to notify the user if the account balance is less than
500. Obtain account no as input. Handle Exceptions.
(b) Develop an Database for inventory management System. Design a ER diagram and Create
necessary tables.
20. (a) Create the table Book (acc_no, username, bookno, days) and insert few records into the table.
Write a PL/SQL Program to calculate the fine for library book (Rs 5 /day). (Hint: fine =days*5).
Obtain account no as input. Handle Exceptions.
21. 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)
a) List the name of the customers who have taken loan for more than
Rs.50,000.
d) Create a procedure to print the Amount and Custid when the Loanid is given
as input. Handle Exceptions.
22. Create the following tables with given attributes having appropriate data type and
specify the necessary primary and foreign key constraints:
Employee (EmpId, Empname, Sal, Deptno)
c) Display the Employee name and the respective department manager name.
d) Create a function to return the salary of the employee when Empid is given
as input parameter. Handle Exceptions.
.
3. Create the following tables with given attributes having appropriate data type
and specify the necessary primary and foreign key constraints:
Voter (VoterId, Votername, Gender, Boothid,Checkvote)
a) (i)List the count of voters in each Booth (ii) List the count of Male voters
voted.
23.
b) Display the overall count of voters voted in the election.
24. 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)
a) List the name of the user who had accessed the costliest book.
d) Write a PL/SQL program to print the details of the book when Bookid is
given as input. Handle appropriate exceptions.
25. Create the following tables with given attributes having appropriate data type and specify
the necessary primary and foreign key constraints:
Customer (Custid, Custname, Addr, phno,panno)
Loan (Loanid, Amount, Interest, Custid)
Account (Acctno, Accbal, Custid)
a. Display the Account balance amount of a particular customer “ARUN”
b. Update the interest with 1% when Accbal of the Custid >50% of Loan Amount
c. Create a View with Accbal and Loan Amount of all Customers
d. Create a trigger which checks for minimum balance in the account.
26. 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)
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.
27. Create the following tables with given attributes having appropriate data type and specify the
necessary primary and foreign key constraints:
Product (Prodid, Prodesc, Price, Stock)
a) Add a column reorder in Product table having value 50 for all products.
28. Create the following tables with given attributes having appropriate data type and specify the
necessary primary and foreign key constraints:
Product (Prodid, Prodesc, Price, Stock)
a) Add a column reorder in Product table having value 50 for all products.
Create the following table with the given attributes having appropriate data type and specify the
necessary key constraints.
● BOOK(Bookcode,Name,Author,Price,Publish)
Design forms to
a) Login
30. Create an student contacts management Database. The application enables a faculty user to
login and search the details of a Student (Name, Address, Contact no, Email id, parent contact)
with his register number. Create necessary tables and Forms.
31. 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.
d) Write a PL/SQL program to display the report sheet of the students using cursors.
32. Create the following tables with the mapping given below.
(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 PL/SQL program to find the sum & average marks of all the student using
procedures.
33. (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 Datbase for Banking System. Design a ER diagram and create necessary tables
34. (a) Create a table Bank (acc_no, name, balance) and insert records into the table.
Write a PL/SQL program for the Bank table to notify the user if the account balance is less than
500. Obtain account no as input. Handle Exceptions.
(b) Develop an Database for inventory management System. Design a ER diagram and Create
necessary tables.