You are on page 1of 4

IFET COLLEGE OF ENGINEERING (AN AUTONOMOUS INSTITUTION), Villupuram.

B.E/B.Tech PRACTICAL END SEMESTER EXAMINATIONS, NOV/DEC 2022


19UCSLC301 DATABASE MANAGEMENT SYSTEMS LABORATORY
Regulations 2019
(COMPUTER SCIENCE ENGINEERING &
INFORMATION TECHNOLOGY – III Semester)
SET – 1
Time: 3 Hours Maximum Marks: 100
Aim Procedure/ Output Results Viva-voce Total
Program/Syntax

20 30 30 10 10 100

1. (A) Create the following tables with the mapping given below. [50]
stu_details (reg_no, stu_name, DOB, address, city)
mark_details (reg_no, mark1, mark2, mark3, total)
(i) Alter the table mark_details to add a column average with data type as long.
(ii) Display the months between the DOB and till date.
(iii) Using alter command drop the column address from the table stu_details.
(B) Write a SQL program to find the sum & average marks of all the student using procedures. [40]

2. (A) Create the following tables with the mapping given below. [50]
emp_details (emp_no, emp_name, DOB, address, doj, mobile_no, dept_no, salary)
dept_details (dept_no, dept_name, location)
(i) Select dept_no from dept_details and not in emp_details using both the tables.
(ii) Create a table named as student and insert values into the table.
(B) Write a SQL program to increment the salary of a particular employee using functions. [40]

3. (A) Consider the following relations for a transport management system application: [50]
BUS (ROUTENO, SOURCE, DESTINATION)
DRIVER (DID, DNAME, DOB, GENDER)
ASSIGN_ROUTE (DID, ROUTENO, JOURNEY_DATE)
(i) Create the above mentioned tables and populate the tables.
(ii) Include constraints that the RouteNo starts with letter 'R' and gender of driver is always 'Male'.
(iii) Develop a SQL query to list the details of drivers who have traveled more than three
times on the same route.
(iv)Create a sequence named Driver_Sequence that will get incremented by 1. Use the created
sequence while inserting DID into Driver table.
(v) Create a view that displays the DID, DNAME assigned for RouteNo 'R5'.
(B) Write a PL/SQL program to create a customer details using Cursors. [40]
4. (A) Create the following table with the mapping given below. [50]
book (book_name, author_name, price, quantity).
(i) Write a query to update the quantity by double in the table book.
(ii) List all the book_name whose price is greater than Rs.400.
(iii) Retrieve the list of author_name whose first letter is ’a’ along with the book_name and
price.
(B) Consider a relation SupplierProducts that stores the relationships between the table suppliers and
products. Each supplier may provide many products and each product can be provided by many
suppliers. Create a stored procedure that
(i) Inserts product id and supplier id into the SupplierProducts table.
(ii) Implement an exit handler that terminates the stored procedure whenever a duplicate key
occurs. [40]

5. (A) Create the following tables with the mapping given below. [50]
stu_details (reg_no, stu_name, DOB, address, city)
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'.
(B) Implement Join Queries on the relation stu_details and mark_details. [40]

6. (A) Create the following tables with the mapping given below. [50]
emp_details (emp_no, emp_name, DOB, address, mobile_no, dept_no, salary)
dept_details (dept_no, dept_name, location)
(i) Select dept_no from dept_details and not in emp_details using both the tables.
(ii) Create a table named as student and insert values into the table.
(B) Write a trigger to avoid the entry of age less than 25. [40]

7. (A) Create the following table with the mapping given below. [50]
emp_details (emp_ID, emp_name, age, address,mobile_no,salary)
Write a SQL program to demonstrate stored function to update the salary of employee.
(B) Write a program to implement Dynamic SQL using python code. [40]

8. (A) Implement Join Queries on the relation Emp_details and Dept_details. [40]
(B) Implement a program to parse word document into table by using MySQL. [50]

9. (A) Write SQL Commands for Simple, Nested and Sub Queries. [40]
(B) Write a program to implement Microsoft Excel to access information from a MySQL database using
Connector/ODBC. [50]
10. (A) Consider the following employee and department tables. [50]
EMPLOYEE(empno, ename, designation, manager, salary,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)Write a procedure to update the salaries in given department by 2000.
(B) Write a program to implement Microsoft word to access information from a MySQL
database. [40]

11. (A) Create the following table with the mapping given below. [50]
book (book_name, author_name, price, quantity)
(i) Write a query to update the quantity by double in the table book.
(ii) List all the book_namewhose price is greater than Rs.400.
(iii) Retrieve the list of author_name whose first letter is ’a’ along with the book_name and
price.
(B) Implement library management system application and database connectivity using Front End
Tools. [40]

12. (A) Consider the following relations for an order-processing database application in a [50]
company:
CUSTOMER (CUSTOMERNO VARCHAR2 (5), CNAME VARCHAR2 (30), CITY
VARCHAR2 (30))
CUST_ORDER (ORDERNO VARCHAR2 (5), ODATE DATE, CUSTOMERNO
REFERENCES CUSTOMER, ORD_AMT NUMBER (8))
ITEM (ITEMNO VARCHAR2 (5), ITEM_NAME VARCHAR2 (30), UNIT_PRICE
NUMBER (5))
ORDER_ITEM (ORDERNO REFERENCES CUST_ORDER, ITEMNO REFERENCES
ITEM, QTY NUMBER (3))
SHIPMENT (ORDERNO REFERENCES CUST_ORDER, ITEMNO REFERENCES ITEM,
SHIP_DATE DATE)
Here, ORD_AMT refers to total amount of an order (ORD_AMT is a derived attribute);
ODATE is the date the order was placed; SHIP_DATE is the date an order is shipped.
(i) Create the above mentioned tables and populate the tables.
(ii) Develop a SQL query to list the order number and number of items in each order.
(iii) Create a synonym on for CUST_ORDER table.
(iv)Create a view that will keep track of the details of each customer and the number of orders
placed by each customer.
(B) Write a SQL program to find and display the sum of first n natural numbers using functions. [40]
13. (A) Create the following table with the mapping given below. [50]
emp_details (emp_ID, emp_name, age, address,mobile_no,salary)
Write a SQL program to demonstrate stored function to update the salary of employee.
(B) Write a SQL program to handle ‘zero divide’ predefined exception. [40]

14. (A) Create the following tables with the mapping given below. [50]
Customer (Cust_id, Cust_name, Addr, ph_no,pan_no)
Loan (Loan_id, Amount, Interest, Cust_id)
(i) Display the Cust_name having both Loan and Account.
(ii) Display number of Loans, the sum of Loan Amount of a ParticularCustname(“LEEMA”).
(iii) Display the Custname doesn’t hold any Account nor taken any Loan.
(iv)Add a column nol(number of loans).
(B) Write a program to generate Fibonacci series using functions. [40]

15. (A) Consider the following relational schema for a Product Sales database application: [50]
Product (Prodid, Prodesc, Price, Stock)
Purchase (Purid, Proid, qty, supplierName)
Sales (Saleid, Proid, qty, custname)
(i) Create the above mentioned tables and populate the tables.
(ii) Include the constraint on Saleid that it starts with letter ‘S’.
(iii) Display the ProdID and the sum of quantity purchased for each product.
(iv)Create a sequence named Product_Sequence that gets incremented by 10 and use it for
inserting Prodid values in Product table.
(B) Implement implicit and explicit cursors in SQL. [40]

You might also like