0% found this document useful (0 votes)
14 views1 page

Assignment - 3 Solutions

assignment -3 Solutions

Uploaded by

yatakonakiran2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views1 page

Assignment - 3 Solutions

assignment -3 Solutions

Uploaded by

yatakonakiran2
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 1

3. a. Find the names of all employees who work for “First Bank Corporation”.

Sol: select employee-name from works where company-name =’First Bank


Corporation’
b. Find all employees in the database who live in the same cities as the
Companies for which they work.
Sol: select e.employee_name from employee e, works w, company c
where e.employee_name = w.employee_name and e.city = c.city and
w.company_name = c.company_name
c. Find all employees in the database who live in the same cities and on the
same streets as do their managers.
Sol: select P.employee_name from employee P, employee R, manages M
where P.employee_name = M.employee_name and
M.manager_name = R.employee_name and P.street = R.street and
P.city = R.city
d. Find all employees who earn more than the average salary of all
employees of their company.
Sol: select employee_name from works T where salary > (select avg (salary)
from works S where T.company_name = S.company_name)
e. Find the company that has the smallest payroll.
Sol: select company_name from works group by company_name having
sum (salary) <= all (select sum (salary) from works group by
company_name)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy