Search your topic here

Employee (SSN, name, age, dno)

Q. Let the following relational schema be given-
Employee (SSN, name, age, dno)
Salary (SSN, salary)
Works_on (Projects#, SSN)
Project (Projects#, project_name, location)
For each of the following queries give an expression in SQL-
(i) Display the names of projects at “Delhi”.
(ii) Find the project_name of employee whose salary is greater than 10000.
(iii) Retrieve the name and SSN of employee working on project# A 100.

(i) Select project_name from Project where location = “Delhi”;

(ii) select project_name from Project where Projects# in (select Projects# from Works_on, Salary where Works_on.SSN = Salary.SSN having Salary > 10000)

(iii) select name, SSN from Employee, where SSN in (select SSN from Works_on where Projects# = A 100);