Consider the schema for Company Database:
- EMPLOYEE(SSN, Name, Address, Sex, Salary, SuperSSN, DNo)
- DEPARTMENT(DNo, DName, MgrSSN, MgrStartDate)
- DLOCATION(DNo,DLoc)
- PROJECT(PNo, PName, PLocation, DNo)
- WORKS_ON(SSN, PNo, Hours)
Write SQL queries to
- Make a list of all project numbers for projects that involve an employee whose last name is ‘Scott’, either as a worker or as a manager of the department that controls the project.
- Show the resulting salaries if every employee working on the ‘IoT’ project is given a 10 percent raise.
- Find the sum of the salaries of all employees of the ‘Accounts’ department, as well as the maximum salary, the minimum salary, and the average salary in this department
- Retrieve the name of each employee who works on all the projects controlledby department number 5 (use NOT EXISTS operator).
- For each department that has more than five employees, retrieve the department number and the number of its employees who are making more than Rs. 6,00,000.