Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Leer Challenge: Find High Earners by Department | Nested Subqueries in the WHERE section
Practice
Projects
Quizzes & Challenges
Quizzen
Challenges
/
Generate Nested Subqueries in SQL
Sectie 1. Hoofdstuk 4
single

single

bookChallenge: Find High Earners by Department

Veeg om het menu te tonen

Taak

Swipe to start coding

Write a SQL query to list all employees whose salary is higher than the average salary of their department. Use a correlated subquery in the WHERE clause to compare each employee's salary to the average salary for their department.

  • Select the employee_id, first_name, last_name, salary, and department_id columns from the employees table.
  • For each employee, use a correlated subquery in the WHERE clause to calculate the average salary for their department.
  • Include only those employees whose salary is greater than the average salary of their department.

Oplossing

Switch to desktopSchakel over naar desktop voor praktijkervaringGa verder vanaf waar je bent met een van de onderstaande opties
Was alles duidelijk?

Hoe kunnen we het verbeteren?

Bedankt voor je feedback!

Sectie 1. Hoofdstuk 4
single

single

Vraag AI

expand

Vraag AI

ChatGPT

Vraag wat u wilt of probeer een van de voorgestelde vragen om onze chat te starten.

some-alt