You are on page 1of 2

Assignment 2

DBMS
1.Explain the characteristics of Relations in detail.
2.Explain Nested queries in detail with example.
3. Explain Correlated nested queries in detail with example.
4. Consider the following PURCHASE database.
CUSTOMER(CID,CNAME,EMAIL,ADDR,PHONE)
ITEM(ITEM_NO,ITEM_NAME,PRICE,BRAND)
SALES(CID,ITEM_NO,#ITEMS,AMOUNT,SALES_DATE)
SUPPLIER(SID,SNAME,SPHONE,SADDR)
SUPPLY(SID,ITEM_NO,SUPPLY_DATE,QTY)
Create SQL Queries for the following:
i) List the items purchased by customer “ Parth”
ii) Retrieve items supplied by all suppliers starting from 1 Jan 2019 to 30 Jan
2019
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
Display customers who have not purchased any items.

5. Consider the following COMPANY database.


EMP(Name, SSN,SALARY,SUPERSSSN,DNO)
DEPT(DNUM,DNAME,MGRSSN,DNO)
DEPENDENT(ESSN,DEP_NAME,GENDER)
WORKS_ON(ESSN,PNO,HOURS)
PROJECT(PNAME,PNUMBER,PLOCATION,DNUM)
Write SQL queries for the following
i) Retrieve the name of employee who works with same department as Ravi
ii) Retrieve the number of dependents for an employee Ravi
iii) Retrieve the names of managers working in location “ DELHI who has no
female defendants
iv) List female employees from DNO=20 earning more than 50000
List CSE department details.
6. Explain the different types of join operations with syntax and examples.
7. Explain unary operations in relation algebra.
8. Given the schema:
Passenger(pid,pname,pgender,pcity)
Agency(aid,aname,acity)
Flight(fid,fdate,time,src,dest)
Booking(pid,aid,fid,fdate)
Give 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 passenger names for those who do not have any bookings 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 hrs
v) Find the details of all male passengers who are associated with Jet agency.

9.Consider the schema


Sailors(Sid,Sname,rating,age)
Boats(bid,bame,color)
Reserves(sid,bid,day)
Write relational algebraic queries for the following:
i) Find names of sailors who reserved boat #103
ii) Find names of sailors who reserved red boat
iii) Find names of sailors who have reserved red or green boat
Find names of sailors who have reserved all boats.

10.Explain PROJECT ,SELECT FUNCTIONS In detail


11. Explain aggregate function in detail.
12.Explain using examples all JOIN functions.

You might also like