Professional Documents
Culture Documents
Question Bank
Second IA (Module 2)
1. Explain ER to relational mapping algorithm with suitable example for each. (10M)
2. Consider the two tables:
T1 T2
P Q R A B C
10 a 5 10 b 6
15 b 8 25 c 3
25 a 6 10 b 5
EMP(Name,SSN,Salary,SuperSSN,Gender,Dno)
DEPT(DNum,Dname,MgrSSN,Dno)
DEPT_LOC(Dnum,Dlocation)
DEPENDENT(ESSN,Dep_name,Sex)
WORKS_ON(ESSN,Pno,Hours)
PROJECT(Pname,Pnumber,Plocation,Dnum)
Department of Computer Science & Engineering
(i) Retrieve the name, address, salary of employees who work for the Research
department.
(ii) find the names of employees who work on all projects controlled by
department number4.
(iii) Retrieve the SSN of all employees who either in department no :4 or directly
supervise an employee who work in department number :4
(iv) Retrieve the names of employees who have no dependents
(v) Retrieve each department number, the number of employees in the department
and their average salary.
16. Consider the following relation schema (10 M)
Works(Pname,Cname,salary)
Lives(Pname,Street,City)
Manager(Pname,Mgrname)
i) Find the names of all persons who live in the city Bangalore.
ii) Retrieve the names of all person of "Infosys" whose salary is between
Rs .50000
iii) Find the names of all persons who lives and work in the same city
iv) List the names of the people who work for “Tech M” along with the cities they
live in.
v) Find the average salary of “Infosys” persons
17. Consider the following COMPANY database( 10 marks)
EMP(Name,SSN,Salary,SuperSSN,Dno)
DEPT(DNum,Dname,MgrSSN,Dno)
Department of Computer Science & Engineering
DEPT_LOC(Dnum,Dlocation)
DEPENDENT(ESSN,Dep_name,Sex)
WORKS_ON(ESSN,Pno,Hours)
PROJECT(Pname,Pnumber,Plocation,Dnum)
i) Retrieve the name of the employee who works with same department as ravi
ii) Retrieve the number of dependents for an employee “Ravi”
iii) Retrieve the name of the managers working in location “DELHI”who has no
female dependents
iv) List female employees from Dno=20 earning more than 50000
v) List “CSE” department details
18. Consider the following scheme
Sailors (Sid, Sname, Rating, age)
Boats (Bid, Bname, Color)
Reserves (Sid, Bid, Day)
I. Find the name of sailors who have reserved boat no. #103.
II. Find the name of sailors who have reserved red boat.
III. Find the name of sailors who have reserved red or green boat.
IV. Find the name of sailors who have reserved all boat.
V. Count the number of Red boats.
19. Explain unary relation operations with an example. (6 M)
Module 3
3. Illustrate insert, delete, alter, drop and update statements in SQL with examples. (10
M)
4. How are assertions and triggers defined in SQL? Explain with examples. (10 M)
5. Explain correlated nested queries with examples. (5 M)
6. Consider the following COMPANY database( 10 marks)
EMP(Name,SSN,Salary,SuperSSN,Dno)
DEPT(DNum,Dname,MgrSSN,Dno)
DEPT_LOC(Dnum,Dlocation)
DEPENDENT(ESSN,Dep_name,Sex)
WORKS_ON(ESSN,Pno,Hours)
PROJECT(Pname,Pnumber,Plocation,Dnum)
i) Retrieve the name of the employee who works with same department as ravi
ii) Retrieve the number of dependents for an employee “Ravi”
iii) Retrieve the name of the managers working in location “DELHI”who has no
female dependents
iv) List female employees from Dno=20 earning more than 50000
v) List “CSE” department details
7. Consider the following relational schema
MEMBERS (MEM_ID, NAME, DESIGNATION, AGE)
BOOKS (BID, BTITLE, BAUTHORS, BPUBL, BPRICE)
RESERVES (MEM_ID, BID, DATE)
a. Find the names of members who are professors older than 45 years.
b. List the titles of books reserved by professors.
c. Find the ids of members who have not reserved books that costs more than Rs
500.
d. Find the authors and titles of the books reserved on 07-May-2007.
Department of Computer Science & Engineering
e. Find the names of members who have reserved all the books.