03 Company DB
03 Company DB
2. Show the resulting salaries if every employee working on the “IoT” project is given a 10 percent raise.
3. 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.
SELECT NAME
FROM EMPLOYEE E
WHERE NOT EXISTS ((SELECT PNO FROM
PROJECT WHERE DNO=5)MINUS (SELECT PNO FROM WORKS_ON W
WHERE
E.SSN=W.SSN));
5. Create a view Dept_info that gives details of department name, Number of employees and total salary of
each department.
CREATE VIEW DEPT_INFO AS
SELECT D.DNAME, COUNT(E.DNO) AS EMPLOYEE_COUNT, SUM(SALARY) AS TOTAL_SAL
FROM DEPARTMENT D, EMPLOYEE E
WHERE D.DNUM=E.DNO GROUP BY(E.DNO);