DBMS 2 3
DBMS 2 3
1. Explain the entity integrity and referential integrity constraints. Why is each considered
important. Give examples.
2. Discuss equijoin and natural join with suitable examples using relational algebra notation.
3. Given the schema
Passenger (pid. pname, pgender. peity)
Agency (aid, anme, acity)
Flight (fid, fdate, time, src, dest)
Booking (pid, aid, fid, fdate)
Give relation 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 paid 123 for flights to Chennai before
06/11/2020
III. Find the 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 hours
V. Find the details of all male passengers who are associated with jet agency.
A B C P Q R
10 a 5 10 b 6
15 b 8 25 C 3
25 a 6 10 B 5
1) T1 ⟕ T2 2) T1 ⟖ T2 3) T1 ⟗T2
11. Explain the relational algebra operations from Set theory with examples
12. Considered the COMPANY DATABASE
EMPLOYEE (Fname, Minit Lname, Ssn, Bdata, Address, Sex, Salary, SuperSsn, Dno).
DEPARTMENT (Dname, Dnumber, Mgr Ssn, Mgr Start_date)
DEPART LOCATIONS (Dnumber, DLocation)
PROJECT Prame, Pnumber, PLocation, Dnum) Ssn, Pno, Hours)
DEPENDENT (ESsn, Dependent Name, Sex, Bdate, Relationship).
Specify the following queries in SQL, on the database schema given above.
I. For every project located in 'Stafford', list the project number, the controlling
department number and the department managers last name, address and birth date.
II. Retrieve the birth date and address of the employees whose name is 'John B, Smith'.
III. Retrieve the name and address of all employees who work for the 'Research'
department.
IV. Retrieve the salary of every employee
13. Define the following:
I. Primary key
II. Super key
III. Foreign key
IV. Candidate key
Module -3