You are on page 1of 2

Bapuji Educational Association (Regd.

)
Bapuji Institute of Engineering and Technology, Davangere-577004
Department of Computer Science and Engineering

Subject: Database Management System Semester: 5


Subject Code: 21CS53 Section: A&B
Question Bank 2
(Module 2 part b and Module 3)
1.Consider the following table:
Works (Pname,Cname,Salary)
Lives (Pname,Street,City)
Located_in (Lname,City)
Manager (Pname,Mgrname)
Write the queries in relational algebra to
i.Find the names of all persons who live in the city “Mumbai”
ii.Retrieve the names of all persons of ‘infosys’ whose salary is between 30000 and 50000
iii.List the names of the people who work for ‘wipro’ along with the cities they live in
iv.Find the average salary of all ‘infosys’

2. Given relational schema:


Passenger (PID, pname, pgender, pcity)
Agency (aid, aname, acity)
Flight (fid, fdate, time, src, dest)
Booking (PID, aid, fid, fdate)
Construct relational algebra expression for the following:
(i)Get the complete details of all flights to new Delhi
(ii)Find only the flight numbers for passenger with pid 123 for flights to Chennai before
06/11/2020
(iii)Find the passenger names for those who do not have any booking in any flights
(iv)Get the details of flights that are scheduled on both dates 01/12/2020 and 02/12/2020 at 16:00
hours
(v)Find the details of all male passengers who are associated with the jet agency.

3. Discuss different types of JOIN with suitable example using relational algebra notation.

4 . Explain various Relational Operations with their notation and purpose.


5 .Explain the six clauses in the syntax of an SQL retrieval query. Show what type of construct
can be specified in each of the six clauses. Which of the six clauses are required and which are
optional.
6. What is Dynamic SQL? How it is different from Embedded SQL.
7. What is SQLJ? How it is different from JDBC.
8. With program segment, explain retrieving of tuples with embedded SQL in C.

9. Define Cursor, Explain with example.


10. Explain the JDBC Architecture.
11. Explain the following a) Stored procedures b) SQL/PSM
12. What are assertions and triggers in SQL? Construct a SQL program to create an assertion to
specify the constraint that the salary of an employee must not be greater than the salary of the
department. By considering COMPANY database.
13. How are views created and dropped? Explain how the views are implemented and updated.
14. Analyze the following relational schema
CUSTOMER (cid, cname, email, addr, phone)
ITEM (itemno, itemname, price, brand)
SALES (cid, itemno, #items, amount, saledate)
SUPPLIES (sid, sname, sphone, saddr)
SUPPLY (sid, itemno, supplydate, qty)
Develop the SQL queries for the following:
i) List the items purchased by customer ‘Abhishek’.
ii) Retrieve items supplied by all suppliers starting from 1st Jan 2024 to 31st Jan 2024.
iii) Get the details of customers whose total purchase of items worth more than 5000 rupees.
iv) List total sales amount, total items, average sale amount of all items.
v) Display customers who have not purchased any items

You might also like