0% found this document useful (0 votes)
156 views3 pages

DBMS Lab Practice Questions

The document contains a comprehensive list of practice questions for a Database Management System (DBMS) lab, covering various operations such as creating tables, altering structures, performing queries, and implementing triggers and procedures across different database schemas. It includes tasks related to library, employee, college, banking, customer, sales, and reservation databases, among others. Each section presents specific requirements for data manipulation, retrieval, and management using SQL and PL/SQL.

Uploaded by

antoniyajeswin
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)
156 views3 pages

DBMS Lab Practice Questions

The document contains a comprehensive list of practice questions for a Database Management System (DBMS) lab, covering various operations such as creating tables, altering structures, performing queries, and implementing triggers and procedures across different database schemas. It includes tasks related to library, employee, college, banking, customer, sales, and reservation databases, among others. Each section presents specific requirements for data manipulation, retrieval, and management using SQL and PL/SQL.

Uploaded by

antoniyajeswin
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/ 3

DBMS Lab Practice Questions

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) 100 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.
4. Consider the following tables namely “DEPARTMENTS” and “EMPLOYEES” _no ,
Departments ( 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.
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.
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. a) Create a bank database table, add constraints (primary key, check), insert rows, update
and delete rows using DDL and DML commands. b) Create a PL SQL program that uses the
where clause and having clause to retrieve above 10 lakhs depositor details.
13. a) Create a set of tables for cargo service database, add foreign key constraints and
incorporate referential integrity. b) Create PL SQL triggers for cargo booking and cancellation
system.
14. a) Create a query that uses a where clause to provide all information about books linked to
"Distributed Database." b) Write a procedure to insert books details in library management
system after purchasing books.
15. a) Create a Product, Sales and purchase table using DDL and DML commands b) Create a
procedure to add 20 records to each table in the database mentioned above.
16. a) Using DDL and DML commands, create the employee_personal, Salary, and Department
tables. In addition, determine the minimum, maximum, total, and average salaries in the
database mentioned above. b) Create a user-defined function to update an employee's salary
when they receive incentives.
17. a) Create an online purchase database using DDL and DML commands. Use sub queries to
present the information about the items you've purchased. b) Write PL SQL Triggers to display
available items after a successful purchase and also display the available items before
purchasing.
18. a) Create Omni bus reservation database using DDL and DML commands and also display
the results after applying join operation. b) Write a procedure to avail reduction in booking of
Omni bus.
19. Create a database for a scooter manufacturing company and use the having clause to
display the scooter models based on price. b) Write a procedure to insert and update the
records in the above database.
20. a) Create and insert records in the flight and passenger tables, and then use various join
operations to display the records. b) Write a procedure to display month name while passing the
month as number parameter. (Example: if pass parameter as 1 it should display as January.)
21. a) Create a student database table, add constraints (primary key, check), insert rows,
update and delete rows using DDL and DML commands. b) Create a PL SQL program that uses
the where clause to apply the moderation strategy to those who all have more than 30 marks.
22. a) Create a set of tables for Bus reservation database, add foreign key constraints and
incorporate referential integrity. b) Create PL SQL triggers for bus reservation system
cancellation and reservation actions.
23. a) Create a query that uses a where clause to provide all information about books linked to
"Machine Learning." b) Write a procedure to update books details in library management system
after purchasing books.
24. a) Create a Product, Sales and purchase table using DDL and DML commands b) Create a
procedure to add 20 records to each table in the database mentioned above.
25. a) Using DDL and DML commands, create the employee_personal, Salary, and Department
tables. In addition, determine the minimum, maximum, total, and average salaries in the
database mentioned above. b) Create a user-defined function to update an employee's salary
when they receive incentives.
26. a) Create an online shopping database using DDL and DML commands. Use sub queries to
present the information about the items you've purchased. b) Write PL SQL Triggers to display
available items after a successful purchase and also display the available items before
purchasing.
27. a) Create wedding hall reservation database using DDL and DML commands and also
display the results after applying join operation. b) Write a procedure to avail reduction in
booking of wedding hall.
28. Create a database for a car manufacturing company and use the having clause to display
the car models based on price. b) Write a procedure to insert and update the records in the
above database.
29. Create and insert records in the student and course tables, and then use various join
operations to display the records. b) Write a procedure to display day name while passing the
day as number parameter. (Example: if pass parameter as 1 it should display as Sunday.)

You might also like