Description The Employee table holds all employees including their managers. Every employee has an Id, and there is also a column for the manager Id. +-- | Id | Name | Salary | ManagerId | | ----+ | 1 | Joe | 70000 | 80000 | 2 | Henry | 3 | Sam | 4 | Max +- Given the Employee table, write a SQL query that finds out employees who earn more than their managers. For the above table, Joe is the only employee who earns more than his manager. + | Employee | +- | Joe +- | 3 | 4 | 60000 | NULL | 90000 | NULL I

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter9: Working With Text Functions And Creating Custom Formats
Section: Chapter Questions
Problem 3RA
icon
Related questions
Question
Description
The Employee table holds all employees including their managers. Every employee
has an Id, and there is also a column for the manager Id.
+---
| Id | Name | Salary | ManagerId |
+----
| 1
| 2
| 3
| 4
+----
| Joe | 70000 | 3
| Henry | 80000 | 4
| Sam
| Max
Given the Employee table, write a SQL query that finds out employees who earn
more than their managers. For the above table, Joe is the only employee who
earns more than his manager.
+
| Employee |
+
| Joe
+
| 60000 | NULL
| 90000 | NULL
I
Transcribed Image Text:Description The Employee table holds all employees including their managers. Every employee has an Id, and there is also a column for the manager Id. +--- | Id | Name | Salary | ManagerId | +---- | 1 | 2 | 3 | 4 +---- | Joe | 70000 | 3 | Henry | 80000 | 4 | Sam | Max Given the Employee table, write a SQL query that finds out employees who earn more than their managers. For the above table, Joe is the only employee who earns more than his manager. + | Employee | + | Joe + | 60000 | NULL | 90000 | NULL I
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Knowledge Booster
Table
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage