You are on page 1of 1

BCSE302 –DBMS Lab

Experiment 7: Set Operations and View

1. Consider the following relations/tables


Customer(Acno,Cid, Name, Address, DoB, MobileNo)
Deposit(Dno,Cid, Amount)
Loan(Lno,Cid, Amount)

Write SQL Query for the following,


1. Insert appropriate number of rows/tuples (at least 5 rows) in these
relations
2. Display CId of the customers those who have both deposit and loan
3. Display Cid of the customers those who have only deposit
4. Display Cid of the customers those who have only loan
5. Display Cid and Name of the customers those who have both deposit
and loan
6. Display Cid and Name of the customers those who have only deposit
7. Display Cid and Name of the customers those who have only loan

2. Write the SQL Query to create view


1. Create a view called Vname that consists of all the customer’s name
and account number
2. Create a view that consists of Cid and Name of the customers those who
have both deposit and loan
3. Create a view that consists of Cid and Name of the customers those who
have only deposit
4. Create a view that consists of Cid and Name of the customers those who
have only loan
5. Check insert/update/delete operations with Vname view
6. Delete the view Vname
7. Check insert/update/delete operations with the views created by using
set operations
8. Create a view using join operation
9. Check insert/update/delete operations with the views created by using
join operation

You might also like