DBMS LAB University
DBMS LAB University
(Regulation - 2019)
Viva 10 marks
Total 100
Viva 10 marks
Total 100
3. Create the following tables with the mapping given below.
a. stu_details (reg_no, stu_name, DOB, address, city)
b. mark_details (reg_no, mark1, mark2, mark3, total)
(i). Display only those rows whose total ranges between 250 and 300.
(ii). Drop the table mark_details.
(iii). Delete the row whose reg_no=161.
(iv). Display all details whose names begins with 'a'.
(v) Write PL/SQl program for sum of digits
Marks:
Table creation and Data Insertion (20) marks
Total 100
10. Create the following tables with the mapping given below. emp_details
(emp_no, emp_name, DOB, address, doj, mobile_no, salary).
(i)Add a column dept_no(department number).
(ii)Drop the column salary by altering the table.
(iii)Rename the table as’Employee’.
(iv) Write a PL/SQL program to find the greatest of 3 numbers.
(v) Design Employee Details using MS Access.
Marks:
Table creation and Data Insertion (20) marks
Appropriate Constraints and Data Type (10) marks
Queries (i-iv) (10 x 4=40) marks
PL/SQL program(II) /DB (20) marks
Viva (10 marks)
Total 100 marks
Marks:
Table creation and Data Insertion (20) marks
Appropriate Constraints and Data Type (10) marks
Queries (i-iv) (10 x 4=40) marks
PL/SQL program(II) (20) marks
Viva (10 marks)
Total 100 marks
14. a. Consider the following relations for order processing database application in a company.
CUSTOMER(custno, cname, city) ORDER(orderno, odate, custno, ord_amt ) ORDER_ITEM(orderno, itemno,
quantity) ITEM(itemno, unitprice) SHIPMENT(orderno, warehouseno, ship_date) WAREHOUSE(warehouseno,
city)
i. Create the above tables by properly specifying the primary keys and foreign keys and enter at least five tuples for
each relation.
ii. Produce a listing: custname , No_of_orders , Avg_order_amount , where the middle column is the total number
of orders by the customer and the last column is the average order amount for that customer.
iii. List the orderno for orders that were shipped from all the warehouses that the company has in a specific city.
iv. Demonstrate the deletion of an item from the ITEM table and demonstrate a method of handling the rows in the
ORDER_ITEM table that contains this particular item.
b.i. Write a PL/SQL to handle divide by zero exception.
Marks:
Table creation and Data Insertion (20) marks
Appropriate Constraints and Data Type (10) marks
Queries (i-iv) (10 x 4=40) marks
PL/SQL program(II) (20) marks
Viva (10 marks)
Total 100 marks
16. a. Consider the following database of student enrollment in courses and books adopted for that course.
STUDENT(regno, name, major, bdate) COURSE(courseno, cname, dept) ENROLL(regno, courseno, sem, marks)
BOOK_ADOPTION(courseno, sem, book_isbn) TEXT(book_isbn,book_title,publisher, author)
i. Create the above tables by properly specifying the primary keys and foreign keys and enter at least five tuples for
each relation.
ii. Add a new text book to the database and make this book to be adopted by some department.
iii. Produce a list of text books ( includes courseno , book_isbn , book_title ) in the alphabetical order for courses
offered by the 'CS' department that use more than two books. (
iv. List any department that has all its books published by a specific publisher. (
ii. Write a trigger to implement its use.
Marks:
Table creation and Data Insertion (20) marks
Appropriate Constraints and Data Type (10) marks
Queries (i-iv) (10 x 4=40) marks
PL/SQL program(II) (20) marks
Viva (10 marks)
Total 100 marks
i. Create the above tables by properly specifying the primary keys and foreign keys and enter at least five tuples for
each relation.
ii. List the employees of employee table in descending order of their salaries.
iii. List the details of highest paid employee in ‘SALES’ department.
iv. Write a query using aggregate function.
v. Develop a program to implement triggers using PL/SQL
Marks:
Table creation and Data Insertion (20) marks
Appropriate Constraints and Data Type (10) marks
Queries (i-iv) (10 x 4=40) marks
PL/SQL program(II) (20) marks
Viva (10 marks)
Total 100 marks
i. Create the above tables by properly specifying the primary keys and foreign keys and enter at least five tuples for
each relation.
ii. List customer names of all customer who have taken a loan > 3,00,000.
iii. List customer names of all customer who have the same account type as customer ‘jones simon’.
iv. List customer names of all customer who do not have a fixed deposit.
b.Write a PL/SQL to handle ‘exception.
Marks:
Table creation and Data Insertion (20) marks
Appropriate Constraints and Data Type (10) marks
Queries (i-iv) (10 x 4=40) marks
PL/SQL program(II) (20) marks
Viva (10 marks)
Total 100 marks
i. Create the above tables by properly specifying the primary keys and foreign keys and enter at least five tuples for
each relation.
ii. Display all item name along with the quantity sold.
iii. iv. Display invoices, customer name and item names together (use join).
iv. Find the customers who are not from “Chennai” (use set operator).
b.Write a PL/SQL to calculate and print employee pay slip using procedure.
Marks:
Table creation and Data Insertion (20) marks
Appropriate Constraints and Data Type (10) marks
Queries (i-iv) (10 x 4=40) marks
PL/SQL program(II) (20) marks
Viva (10 marks)
Total 100 marks
i. Create the above tables by properly specifying the primary keys and foreign keys and enter at least five tuples for
each relation.
ii. Display all the customers who were depositor and borrower.
iii. Display all the customer name who are only depositor.
iv. Display all branch name whose assets are greater than assets of branches located in “Coimbatore” city.
ii. Write a PL/SQL to find the sum of the first n natural numbers.
Marks:
Table creation and Data Insertion (20) marks
Appropriate Constraints and Data Type (10) marks
Queries (i-iv) (10 x 4=40) marks
PL/SQL program(II) (20) marks
Viva (10 marks)
Total 100 marks
i. Create the above tables by properly specifying the primary keys and foreign keys and Enter at least five tuples for
each relation.
ii. List the employees who annual salary is between 22000 and 25000
iii. List the employees names along with their manager names.
iv. List the dept who employees maximum no of ‘CLERK’s.
b.i. Write a procedure program using PL/SQL.
Marks:
Table creation and Data Insertion (20) marks
Appropriate Constraints and Data Type (10) marks
Queries (i-iv) (10 x 4=40) marks
PL/SQL program(II) (20) marks
Viva (10 marks)
Total 100 marks
i. Create the above tables by properly specifying the primary keys and foreign keys and enter at least five tuples for
each relation.
ii. List the department number and the number of employees in each department.
iii. List the details of employees who have worked in more than three projects on a day.
iv. Develop a view that will keep track of the department number, the number of employees in the department and
the total basic pay expenditure for each department.
ii. Write a PL/SQL to check factorial of the given number .
Marks:
Table creation and Data Insertion (20) marks
Appropriate Constraints and Data Type (10) marks
Queries (i-iv) (10 x 4=40) marks
PL/SQL program(II) (20) marks
Viva (10 marks)
Total 100 marks
29. a. Consider the following employee and department tables.
EMPLOYEE(empno, ename, designation, manager, hiredate, salary, commission,
deptno)
DEPARTMENT(deptno, dname, location)
i. Create the above tables by properly specifying the primary keys and foreign keys and enter at least five tuples for
each relation. (
ii. List the employees whose salary is greater than at least one of the employees of deptno 30
iii. List the name, job, salary of employees in the department with the highest average salary.
iv. List the employees who are working either as manager or analyst with salary ranging from
2000 and 5000
b. i. Write a procedure to demonstrate its use
Marks:
Table creation and Data Insertion (20) marks
Appropriate Constraints and Data Type (10) marks
Queries (i-iv) (10 x 4=40) marks
PL/SQL program(II) (20) marks
Viva (10 marks)
Total 100 marks
30. Create the following table with the mapping given below.