SQL – TEST

SQL – TEST

Division (DID, dname, managerID)

Employee (empID, name, salary, DID)

Project (PID, pname, budget, DID)

Workon (PID, EmpID, hours)

 

1. List the name of employees who is not from ‘accounting’ division and work on project “web development”.

2. List the name of divisions that have more than 2 employees with salary greater than $30000.

3. For each division (DID), List the name of project that has highest budget in that division and list the total number of employees who work on it.

4. List the name of employee make more salary than the average salary of employee working on project “Web development”.

5. List the name of manager whose salary is below his/her divisional salary.

6. Among all projects ‘Accounting’ division has, list the name of project that has budget below company’s average project budget.

7. List the name of employees and his/her division name if her/his works for more than 2 projects and salary is below company average.

8. List the name of Division that has employee(s) who do not work on a project sponsored by his/her division.

9. List the name of employee whose salary is higher than all employees who work on the project “Wireless development”

10. Using update statement to decrease the budget of a project sponsored by marketing division by 10% if there are less than 3 people working