0% found this document useful (0 votes)
45 views5 pages

CS3481 Set 2

set2

Uploaded by

Benitta Mary
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views5 pages

CS3481 Set 2

set2

Uploaded by

Benitta Mary
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

B.E/B.Tech.

PRACTICAL END SEMESTER EXAMINATIONS, APRIL/MAY 2023


Fourth Semester
CS3481 - DATABASE MANAGEMENT SYSTEMS LABORATORY
(Regulations 2021)

Time: 3 Hours (Answer any one Question) (Max.Marks: 100)


Aim and
SQL Query Execution and
Procedure / E- Viva-voce Record Total
and Program Results
R Diagram
20 30 30 10 10 100

1. Consider the following schema for a Library Database:

BOOK (Book_id, Title, Publisher_Name, Pub_Year, No_of_copies)


BOOK_AUTHORS (Book_id, Author_Name)
PUBLISHER (Name, Address, Phone)

a) Retrieve details of all books in the Book_id, title, name of publisher, authors
b) Get the particulars of borrowers who have borrowed more than 3 books, but from Jan
2017 to Jun2017.
c) Delete a book in BOOK table. Update the contents of other tables to reflect this data
Manipulation operations.

d) Create a view of all books and its number of copies that are currently available in the
Library.
e) Write a Pl/SQL procedure to display the book details of particular author.

2. Create a table employee (S.No,Name,Desination,brach),

a) Alter the table by adding a column salary


b) Copy the table employee as Emp
c) Delete 2nd row from the table
d) Drop the table
e) Demonstrate the triggers for automatic updation.

3. Create a table called Employee (Emp_no Emp_name, Emp_dept,Job ,Mgr ,Sal)

a) By using the group by clause, display the Emp_name who belongs to


Emp_dept=”xxx” along with salary
b) Display lowest paid employee details under each department
c) List the employee names in descending order.
d) Rename the column of Employee table using alter command
e) Insert row in employee table using Triggers.

Page 1 of 5
4. Consider the following tables namely “DEPARTMENTS” and “EMPLOYEES” Departments (dept
_no , dept_ name , dept_location ),
Employees ( emp_id , emp_name , emp_salary,dept_no).

a) Develop a query to grant some privileges of employees table into departments table
b) Develop a query to revoke all privileges of employees table from departments table
c) Develop a query to revoke some privileges of employees table from departments table
d) Write a query to implement the save point.
e) Demonstrate the user defined procedure for the above employee database

5. Create the following tables,


Event (eventid, name, description,city) Participant
(playerid, name, eventid, gender, year) Prizes
(prizeid, prize-money, eventid, rank,year)
Winners (prizeid, playerid)
a) Choose appropriate primary keys and foreign keys for the tables.
b) Playerid should contain at least one digit character.
c) Retrieve the name of events where all prize winners are females
d) Create a non-updatable view to retrieve the names of all participants who won 1st prizes along
with their event names
e) Write a trigger to make sure that for every new event created, 3 prizes are created in prizes
table. (1st prize - 1500, 2nd - 1000, 3rd 500)

6. Consider the schema for Movie Database:

ACTOR (Act_id, Act_Name, Act_Gender) DIRECTOR


(Dir_id, Dir_Name, Dir_Phone)
MOVIES (Mov_id, Mov_Title, Mov_Year, Mov_Lang, Dir_id) MOVIE_CAST
(Act_id, Mov_id, Role)
a) List the titles of all movies directed by ‘XXXX’.
b) Find the movie names where one or more actors acted in two or more movies.
c) List all actors who acted in a movie before 2010 and also in a movie after 2015 (use JOIN
operation).
d) Create a view of movies with a particular actor with director.
e) Demonstrate the User defined function for the movie database.

Page 2 of 5
7. Consider the schema for College Database:
STUDENT (RegNo, StudName, Address, Phone, Gender) SUBJECT
(Subcode, Title, Sem, Credits)
MARKS (RegNo, Subcode, Test1, Test2, Test3, Finalmark)
a) Compute the total number of male and female students in each semester and in each
section.
b) Calculate the Finalmark (average of best two test marks) and update the
corresponding table for all students.
c) Categorize students based on the following criterion:
If Finalmark = 81 to 100 then CAT = ‘Outstanding’
If Finalmark = 51 to 80 then CAT = ‘Average’
If Finalmark < 51 then CAT = ‘Weak
d) Create a view of Test3 marks of particular student in all subjects.
e) Demonstrate the procedure for the above Database.

8. Create table as Bank ( S.No,Cust_Name, Acc_No, Balance, Branch),

a) Select with where clause.


b) Select with comparison operator.
c) Update the balance in the second row.
d) Select with between in the field balance.
e) Write a trigger when balance is below 1000.

9. Create a table Account (Account_No, Cust_Name, Branch_Name, Account_Balance, Account_Type)


Select an appropriate primary key.

a) Display the Cust_Name and Account_No of the customers of "Branch = XXXXX".


b) Display the names and account types of all the customers whose account balance is more than
10,000.
c) Add column Cust_Date_of Birth in the ACCOUNT table.
d) Display Account_No, Cust_Name and Branch of all the customers whose account balance is less
than 1,000.
e) Write a procedure for the above Database.

10. Create the tables CUSTOMER (C_ID, Name, Address, City, Mobile_No) and
ORDER (C_ID, P_ID, P_Name, P_COST),

a) List the names and addresses of all the customers who have ordered products of costmore
than 500.
b) List the names of all the products ordered whose cost is 1,000 or more.
c) List the product names which are ordered by customers of "City = Delhi".
d) Add column "Email_id" in the CUSTOMER table.
e) Demonstrate the user defined function for the above tables.
Page 3 of 5
11. Create the tables SALESMAN (Salesman_id, Name, City, Commission),
CUSTOMER (Customer_id, Cust_Name, City, Grade,Salesman_id),
ORDERS (Ord_No, Purchase_Amt, Ord_Date, Customer_id, Salesman_id)

a) Find the name and numbers of all salesmen who had more than one customer.
b) List all salesmen and indicate those who have and don’t have customers in
their cities (Use UNION operation.)
c) Create a view that finds the salesman who has the customer with the highest order of a day.
d) Perform the DELETE operation by removing salesman with id 1000. All his
orders must also be deleted.
e) Demonstrate the Triggers for the above table.

12. Develop a simple GUI based Inventory Management for a EMart Grocery Shop
database application and incorporate all the Database features.

13. Create an XML database for the student profile and validate it using XML schema.

14. Develop a simple GUI based Cop Friendly App – Eseva database application and incorporate all the
Database features.

15. Create a Employee database and write SQL Triggers for insert, delete, and update operations
in a database table.

16. Create a table Supplier (Sup_No, Sup_Name ,Item_Supplied , Item_Price , City)

a) Write sql query to display Suplier numbers and Supplier names whose name starts with ‘S’
b) Write sql query to add a new column called CONTACTNO.
c) Write sql query to display supplier numbers, Suplier names and item price for suppliers in
Chennai in the ascending order of item price.
d) Create a view on the table which displays only supplier numbers and supplier names.
e) Demonstrate the procedure for the supplier table.

17. Develop a simple GUI based Banking System and incorporate all the Database features.

Page 4 of 5
18. Develop a simple GUI based Employee Pay Roll System and incorporate all the Database features.

19. Develop a simple GUI based Movie Ticket Reservation System and incorporate all the Database
features.

20. Develop a simple GUI based Super Market Stock Maintenance System and incorporate all the
Database features.

Page 5 of 5

You might also like