HR Analytic Project

You must execute the code again to save those values in the database.
team_idteam_name
1plan_A
6plan_B

employee_idfirst_namelast_nameemailhire_dateteam_id
1WardeRemon[email protected]1-Jun-231
2OrlandoGroneway[email protected]22-Jun-231
3AmalitaShorland[email protected]25-Mar-231
4ReinwaldPickersail[email protected]24-Jun-231
5IlarioAnfrey[email protected]2-Jan-231
6DaveyFrowen[email protected]3-Mar-236
7LeighaRandlesome[email protected]15-Oct-226
8JuniaYakovliv[email protected]31-Jul-236
9RochellWaggatt[email protected]15-Apr-236
10MoisesArdley[email protected]21-Jun-236

employee_idrolesalary
1Sales40153
2Marketing46670
3Legal71983
4Sales15857
5Software Engineer95174
6Sales27819
7Legal75323
8Software Engineer90525
9Tax Accountant85946
10Marketing56575

Section
Q1: Query each employees first, last name, email address, date of employment, title, and salary.

first_namelast_nameemailhire_daterolesalary
WardeRemon[email protected]1-Jun-23Sales40153
OrlandoGroneway[email protected]22-Jun-23Marketing46670
AmalitaShorland[email protected]25-Mar-23Legal71983
ReinwaldPickersail[email protected]24-Jun-23Sales15857
IlarioAnfrey[email protected]2-Jan-23Software Engineer95174
DaveyFrowen[email protected]3-Mar-23Sales27819
LeighaRandlesome[email protected]15-Oct-22Legal75323
JuniaYakovliv[email protected]31-Jul-23Software Engineer90525
RochellWaggatt[email protected]15-Apr-23Tax Accountant85946
MoisesArdley[email protected]21-Jun-23Marketing56575

Section
Q2: Who are the three most recently hired employees? What team are they on? and What day do they come to work? [Show Team ID]

team_idfirst_namelast_nameemailhire_datehire_date_rank
1WardeRemon[email protected]1-Jun-231
6RochellWaggatt[email protected]15-Apr-232
6LeighaRandlesome[email protected]15-Oct-223

Section
Q2: Who are the three most recently hired employees? What team are they on? and What day do they come to work? [Show Team Name]

team_namefirst_namelast_nameemailhire_datehire_date_rank
plan_AWardeRemon[email protected]1-Jun-231
plan_BRochellWaggatt[email protected]15-Apr-232
plan_BLeighaRandlesome[email protected]15-Oct-223

Section
Q3.1: find the average salary of employees in each position.

roleaverage_salary
Legal73653.0
Marketing51622.5
Sales27943.0
Software Engineer92849.5
Tax Accountant85946.0

Section
Q3.2 Find the salary of each position as a proportion of the total employee salary. [Pattern 1]

roleproportion
Legal0.243069180314343
Marketing0.17036425890021
Sales0.138325976651128
Software Engineer0.306421352254445
Tax Accountant0.141819231879873

Section
Q3.2 Find the salary of each position as a proportion of the total employee salary. [Pattern 2]

roleproportion
Legal0.243069180314343
Marketing0.17036425890021
Sales0.138325976651128
Software Engineer0.306421352254445
Tax Accountant0.141819231879873

Section
Q4: Employees with a salary higher than 75,000 are called Managers, salaries from 45,000 to 75,000 are called Seniors, and those with salaries less than that are called Staff.

employee_idfirst_namelast_namesalaryemployee_category
1WardeRemon40153Staff
2OrlandoGroneway46670Senior
3AmalitaShorland71983Senior
4ReinwaldPickersail15857Staff
5IlarioAnfrey95174Manager
6DaveyFrowen27819Staff
7LeighaRandlesome75323Manager
8JuniaYakovliv90525Manager
9RochellWaggatt85946Manager
10MoisesArdley56575Senior

Section
Q5: If an employee comes on 14-Oct-23 for the Marketing position with a salary of 45,000 baht, what will the latest average salary for the Marketing position?

roleaverage_salary
Marketing51622.5