SQL- Practice Problem4
SQL- Practice Problem4
Question 1: Use the two relations given below to write the following queries in SQL:
EMP (SSN, FirstName, LastName, Title, Salary, DeptId, MgrId)
DEPT (Did, DepartmentName, TotalBudget)
1. Find the name, total budget of departments in which the total salary of all people working in that department
exceeds the total budget of the department.
2. Find the first and last name of employees whose salary is greater than the salary of their manager.
3. Find name of departments that does not have any employees with title ”Vice President” working in them.
Page 1 of 1