Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Challenge: Find High Earners by Department | Nested Subqueries in the WHERE section
Practice
Projects
Quizzes & Challenges
Вікторини
Challenges
/
Generate Nested Subqueries in SQL
Секція 1. Розділ 4
single

single

bookChallenge: Find High Earners by Department

Свайпніть щоб показати меню

Завдання

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.

Рішення

Switch to desktopПерейдіть на комп'ютер для реальної практикиПродовжуйте з того місця, де ви зупинились, використовуючи один з наведених нижче варіантів
Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 4
single

single

Запитати АІ

expand

Запитати АІ

ChatGPT

Запитайте про що завгодно або спробуйте одне із запропонованих запитань, щоб почати наш чат

some-alt