# Employee Hierarchy — SQL interview question

Aced (formerly Exponent) publishes a public search API over its indexed pages; the guide is at https://www.aced.io/agents/agent-access.

Source: https://www.aced.io/questions/3041/employee-hierarchy
Source observed: 2026-11-04T21:34:46.574Z
Last checked: 2026-11-04T21:34:46.574+00:00
Indexed: 2026-11-05T03:08:47.443+00:00

---

# Employee Hierarchy

We provide this **Hard** SQL interview question for Data Engineer, Data Scientist, and Data Analyst preparation. It is categorized under **Coding** and **SQL**. The page includes a question editor, output and test-results panels, and a sign-up option to run code.

## Scenario

You have been hired by company XYZ as a Data Analyst. Management provides employee and salary data and asks you to draw conclusions from it.

## Data

### Table 1: `tbl_Employee`

| Emp_ID | First_Name | Middle_Name | Last_Name | Manager_ID | Date_Of_Joining | Country |
| --- | --- | --- | --- | --- | --- | --- |
| 1 | Tim | Shea | Murray | 10 | 01-01-2000 | Ireland |
| 2 | Paul | David | Desmond | 11 | 30-01-2021 | Ireland |
| 3 | James | Donald | Obrien | 12 | 04-03-1998 | India |
| -- | -- | -- | -- | -- | -- | -- |

### Table 2: `tbl_EmployeeSalary`

| Emp_ID | Project | Salary | Designation |
| --- | --- | --- | --- |
| 1 | Proj_1 | 2000 | Project Manager |
| 2 | Proj_2 | 2333 | Senior Software Developer |

## Task

Paul Desmond, whose `emp_id` is 2, has joined the organization as a senior software engineer. Find his reporting hierarchy through level 3 and calculate the salary difference between Paul and the reporting manager at each level.

Print the full name of every reporting manager and the salary difference. Salaries in `tbl_EmployeeSalary` are in each employee’s local currency. Convert all salaries to US dollars before calculating and presenting the differences:

- Irish currency: multiply the salary by `1.09`.
- Indian currency: multiply the salary by `0.012`.

## Desired output

| Reporting Manager Name | Level | Salary Difference |
| --- | ---: | ---: |
| James O Brien | 1 | 2000 |
| Tom O Mahony | 2 | 3000 |
| Mark Forde | 3 | 3000 |

No community answers are currently contributed. The page records 4 interviews, is marked as having been asked a year ago, and offers a locked Solution tab alongside the Question and Community tabs.

## Related question

- [Employee Earnings.](https://www.aced.io/questions/3960/employee-earnings)

## Related courses

### [Data Analyst Interview Prep](https://www.aced.io/courses/data-analytics)

![Data Analyst Interview Prep](https://images.ctfassets.net/x78yjrjc11pq/72OTqij57b2TklhaD2vrdV/be0dae6242904970d1696e5a4d858e18/AdobeStock_1357126576.jpeg?w=800&h=800&fm=webp&q=75)

We help candidates prepare for data analyst interviews across product, marketing, and business analyst roles through real take-home case studies, technical and dashboarding practice, and strategies from interviewers at technology companies and startups.

### [Data Science Interview Prep](https://www.aced.io/courses/data-science)

![Data Science Interview Prep](https://images.ctfassets.net/x78yjrjc11pq/3U4C5C0OkDR0UeGch4AmlE/7ad489430b676a088cb973307fe77884/Data_Science_Interview_Prep_Course.jpeg?w=800&h=800&fm=webp&q=75)

We help candidates prepare for data science roles at Google, Amazon, Microsoft, Meta, Apple, and other companies with mock interviews, frameworks, and advice from senior candidates. Topics include statistics, experimentation, coding, SQL, machine learning, and behavioral interviews.

## Access

- [All Questions](https://www.aced.io/questions)
- [Upgrade for detailed company statistics](https://www.aced.io/upgrade?src=questions)
- [Sign up to run code](https://www.aced.io/signup?src=lesson)

---

[Read this page’s summary](https://www.aced.io/agents/api/public/v1/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F3041%2Femployee-hierarchy&trace=t_679ff9ab98f3)

## Ask a follow-up about this page

Need a more specific answer? Ask the exact question you have. It returns a fresh, cited answer from Aced (formerly Exponent)’s knowledge base. No account or API key required.

Open this URL with your own question, URL-encoded. Include your question in q. All research inputs are optional; no account or setup.

`GET https://www.aced.io/agents/agent/faq?q={question}&trace=t_679ff9ab98f3`

[Tool guide and examples](https://www.aced.io/agents/agent-access) · [OpenAPI](https://www.aced.io/agents/api/public/v1/openapi.json) · [Page TLDR form](https://www.aced.io/agents/agent-tools/page-tldr?url=https%3A%2F%2Fwww.aced.io%2Fquestions%2F3041%2Femployee-hierarchy). Opening a form does not execute a tool.