Question: Please write the SQL statements to answer the following questions (provide SQL code for the questions below) using the Table and columns in the above

Please write the SQL statements to answer the following questions (provide SQL code for the questions below) using the Table and columns in the above diagram.
4. Show all employees and the department to which they currently belong.
5. Show the employees who were in the engineering department as Of Jan. 1, 2005.
6. Find the most recent pay rate for employee NO. 4
7. List all employees' NationallDNumber, JobTitle, and HireDate for those who have ever worked in Department 7 (Use a sub-query instead of Join).
8. Find a list of employees whose highest pay rate is above the average pay rate of all employees.
9. Find the most current pay rate and change date for all employees.
10. Show the pay rate and the difference between the pay rate and the average rate Of the company for all employees.
Week 5 Exercise 1 This exercise is based on the tables shown in the figure from the Adventure Works2008 database. This table can be found on the SQL server via remote desktop. Department (Huma DepartmentID Name GroupName ModifiedDate Employee Department History (Hu 8 BusinessEntityID DepartmentID ShiftID StartDate EndDate ModifiedDate 8 EmployeePay History 7 Business EntityID RateChangeDate Rate PayFrequency ModifiedDate Employee (Human Resources) BusinessEntityID NationalIDNumber LoginID OrganizationNode OrganizationLevel Job Title BirthDate Marital Status Gender Hire Date
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
