158k views
4 votes
Find the average salary of those employees whose name starts with J in each department?

User Aokozlov
by
7.4k points

1 Answer

5 votes

Final answer:

To find the average salary of employees whose name starts with J in each department, you would first need to gather the data on salaries and employee names, as well as the departments they belong to. Once you have that data, you can filter out employees whose names do not start with J, group the remaining employees by department, and calculate the average salary for each department.

Step-by-step explanation:

To find the average salary of employees whose name starts with J in each department, you would first need to gather the data on salaries and employee names, as well as the departments they belong to. Once you have that data, you can follow these steps:

  1. Filter out the employees whose names do not start with J.
  2. Group the remaining employees by department.
  3. Calculate the average salary for each department.

For example, if you have the following data:

  • Employee 1: Name - John, Salary - $50,000, Department - Sales
  • Employee 2: Name - Jane, Salary - $60,000, Department - Marketing
  • Employee 3: Name - Jack, Salary - $70,000, Department - Sales
  • Employee 4: Name - Janet, Salary - $80,000, Department - Sales
  • Employee 5: Name - James, Salary - $90,000, Department - Marketing
  • Employee 6: Name - Jessica, Salary - $100,000, Department - Marketing

The average salary for employees whose names start with J in the Sales department would be ($50,000 + $70,000 + $80,000) / 3 = $66,667. The average salary for employees whose names start with J in the Marketing department would be ($60,000 + $90,000 + $100,000) / 3 = $83,333.

User Mike Atkins
by
8.0k points