b) Consider the employee data. Give an expression in SQL for the following query:
Employee (employeeName, street, city)
Works (employeeName, companyName, salary)
Company (companyName, city)
Manages (employeeName, managerName)
i)Find the name and cities of residence of all employees who work for Bangladesh Bank.
ii)Find all employee in the database who do not work for Bangladesh Bank.
iii) Find all employee in the database who earn more than every employee of UCB bank.
i)select employee.employeeName, employee.city from employee,
works where employee.employeeName=works.employeeName
and companyName = 'Bangladesh Bank';
ii) select employee.employeeName, employee.city from employee,
works where employee.employeeName=works.employeeName
and companyName <> 'Bangladesh Bank';
iii)
select employeeName from works where salary > all
(select salary from works where companyName = 'UCB bank')
Comments
Leave a comment