Session Ready
Exercise

A CTE for high-paid IT-positions

In the previous exercise, you created a CTE to find IT positions. Now, you will combine these results with another CTE on the salary table. You will use multiple CTE definitions in a single query. Notice that a comma is used to separate the CTE query definitions. The salary table contains some more information about the ID and salary of employees. Your task is to create a second CTE named ITsalary and JOIN both CTE tables on the employees ID. The JOIN should select only records having matching values in both tables. Finally, the task is to find only employees earning more than 3000.

Instructions
100 XP
  • Define the second CTE, ITsalary, with the fields ID and Salary.
  • Find salaries above 3000.
  • Combine the two CTEs by using a JOIN of matching IDs and select the name, the salary, and the position of the selected employees.