Dbms Assignment4
Dbms Assignment4
2) Find the names and cities of residence of all employees who work for First Bank
Coorporation.
| emp_name | city |
|----------|-----------|
| Rajesh | Pune |
| Jack | Sydney |
3) Find the names, street addresses, and cities of residence of all employees who
work for First Bank Coorporation and earn more than $10000.
4) Find all employees in the database who lives in the same cities as tha companies
for which they work.
5) Find all employees in the database who lives in the same cities and on the same
streets as do their manager.
6) Find all employees in the database who do not work for First Bank Coorporation.
7) Find all employees in the database who earn more than each employee of Small
Bank
Coorporation.
| EMP_NAME |
|----------|
| Jack |
| John |
8) Assume that the company is may be located in several cities. Find all companies
located in every city in which Small Bank Coorporation is located.
SQL> SELECT comp_name FROM works WHERE city=(SELECT city FROM company WHERE
comp_name='SBC');
| comp_name |
|-----------|
| SBC |
9) Find all employees who earn more than the average salary of all employees of
their companies.
| comp_name | payroll |
|-----------|---------|
| FBC | 325000 |
12) Find those companies whose employees earn a higher salary, on average, than the
average salary at First Bank Coorporation.
| comp_name |
|-----------|
| SBC |
15) Delete all tuples in the "Works" relation for employees of "Small Bank
Coorporation".