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)
Question 1: Make A List of Project Numbers For Projects That Involve An Employee Whose Last Name Is Smith', Either As A Worker or As A Manager of The Department That Controls The Project