Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help creating a query for all employees: Employee ID First and Last Name Department Name Current Salary Last Raise Date We kindly ask

I need help creating a query for all employees:
Employee ID
First and Last Name
Department Name
Current Salary
Last Raise Date
We kindly ask that you provide us with this report by May 17 th,2023 so that we can review and analyze the data.
dbo.ErrorLog
HumanResources. Department
Columns
DepartmentID (PK, smallint,
SQLQuery3.sql - SHI...(SHIELAlshiel (55))*+ SQLQuery2.sql - not connected
SQLQuery1.sql - not connected
player_db.sql - not connected
SELECT E.HumanResources.EmployeePayHistory, E.HumanResources.Department,
E.Name, E.BusinessEntityID AS EmployeeID, E.DepartmentID, E.SalariedFlat, E.RateChangeDate AS RC.Rate AS CurrentSalary, MD.ModifiedDate AS LastRaiseDate FROM EmployeePayHistory AS E, Department AS H INNER JOIN Departments d ON e.DepartmentID = d.DepartmentID
WHERE LastRaiseDate DATEADD(month,-12, GETDATE()) OR LastRaiseDate IS NULL ORDER BY
e.Name;
Name (Name(nvarchar(50)),
G GroupName (Name(nvarcha
ModifiedDate (datetime, no
HumanResources.Employee
HumanResources.EmployeeDep
HumanResources.EmployeePay
E Columns
BusinessEntityID (PK, FK, int
100%
Messages
Msg 102, Level 15, State 1, Line 1
Incorrect syntax near '.
RateChangeDate (PK, dateti
Rate (money, not null)
PayFrequency (tinyint, not n
B ModifiedDate (datetime, no
Completion time: 2024-05-1021:20:12.1115254-05:00
Please include the following features in your report.
Include our company logo.
Include a title of the report named Employee Salary History.
Flag any employee who has not had a raise in over 12 months. You can either color code the output or create a widget indicator.
Include all the information mentioned above.
Make the report sortable by the employee's last name.
We would also like an export of the report in Excel format to share with our coworkers. I have to filter out employees who have not had a raise in 12 months or more.
le Edit View Query Project Tools Window Help
Execute
SQLQuery4.sql - SHI...(SHIELAlshiel (77))
SQLQuery3.sql - SHI...(SHIELAIshiel (70))* SQLQuery1.sql - not connected ?K
File Tables
External Tables
Graph Tables
dbo.AWBuildVersion
dbo.DatabaseLog
(Ibo.ErrorLog
HumanResources.Department
Columns
DepartmentID (PK, smallini
Name (Name(nvarchar(50))
GroupName (Name(nvarch GELECT E.BusinessEntityID AS EmployeeID,
E.Name,
D.Name AS DepartmentName, EPH.Rate AS CurrentSalary, EPH. RateChangeDate AS LastRaiseDate, CASE
WHEN EPH. RateChangeDate IS NULL OR EPH. RateChangeDate DATEADD(month,-12, GETDATE()) THEN 'No Raise in 12+ Months'
ELSE 'OK'
END AS RaiseStatus
FROM HumanResources.EmployeePayHistory EPH
JOIN HumanResources.Employee E ON EPH.BusinessEntityID=E.BusinessEntityID
JOIN HumanResources.EmployeeDepartmentHisotry EDH ON E. BusinessEntityID=EDH. BusinessEntityID
JOIN HumanResources.Department D ON EDH.DepartmentID=D.DepartmentID
WHERE EDH. EndDate IS NULL
ORDER BY
E.Name;
ModifiedDate (datetime,n,
Keys
Constraints
Triggers
Indexes
Statistics
HumanResources.Employee
HumanResources.EmployeeDe|
HumanResources.EmployeePa)
Columns
BusinessEntityID (PK, FK, in
RateChangeDate (PK, date
Rate (money, not null)
PayFrequency (tinyint, not
ModifiedDate (datetime, ns
100%
Messages
Msg 208, Level 16, State 1, Line 1
Invalid object name 'HumanResources.EmployeePayHistory'.
Completion time: 2024-05-11T21:15:26.5237385-05:00
Query completed with errors.
SHIELAISQLDEVELOPER (16.0 RTM) SHIELAlshiel (70) master
This is what i have but it will not work & keeps giving me an error.
image text in transcribed

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions