Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

This is for MySQL adventure works 2017 database Use a temporary table to save the DepartmentID and the highest pay rate of each employee in

This is for MySQL adventure works 2017 database

Use a temporary table to save the DepartmentID and the highest pay rate of each employee in that department. This will use a subquery. Use the table HumanResources.EmployeePayHistory. Minimize the rows that will be added to the table by using DISTINCT. Make sure all columns in the temp table have a name.

image text in transcribed

image text in transcribed

Table Human Resources.EmployeePay History (316 rows) Employee pay history. Nullable Default PK, FK PK Column Data Type Identity BusinessEntityID int Employee identification number. Foreign key to Employee. BusinessEntityID. RateChangeDate Rectangular Ship datetime Date the change in pay is effective Rate money Salary hourly rate. PayFrequency tinyint 1 = Salary received monthly, 2 = Salary received biweekly ModifiedDate datetime Date and time the record was last updated. getdate() Table Human Resources. EmployeeDepartment History. (296 rows) Employee department transfers. Nullable Default Column Data Type Identity PK, FK Business EntityID int Employee identification number. Foreign key to Employee. BusinessEntityID. PK, FK DepartmentID smallint Department in which the employee worked including currently. Foreign key to Department. DepartmentID. PK, FK ShiftID tinyint Identifies which 8-hour shift the employee works. Foreign key to Shift. Shift.ID. PK StartDate date Date the employee started work in the department. EndDate date Date the employee left the department. NULL = Current department. ModifiedDate datetime Date and time the record was last updated. X getdate() Table Human Resources.EmployeePay History (316 rows) Employee pay history. Nullable Default PK, FK PK Column Data Type Identity BusinessEntityID int Employee identification number. Foreign key to Employee. BusinessEntityID. RateChangeDate Rectangular Ship datetime Date the change in pay is effective Rate money Salary hourly rate. PayFrequency tinyint 1 = Salary received monthly, 2 = Salary received biweekly ModifiedDate datetime Date and time the record was last updated. getdate() Table Human Resources. EmployeeDepartment History. (296 rows) Employee department transfers. Nullable Default Column Data Type Identity PK, FK Business EntityID int Employee identification number. Foreign key to Employee. BusinessEntityID. PK, FK DepartmentID smallint Department in which the employee worked including currently. Foreign key to Department. DepartmentID. PK, FK ShiftID tinyint Identifies which 8-hour shift the employee works. Foreign key to Shift. Shift.ID. PK StartDate date Date the employee started work in the department. EndDate date Date the employee left the department. NULL = Current department. ModifiedDate datetime Date and time the record was last updated. X getdate()

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions