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

single

bookChallenge: Find High Earners by Department

Scorri per mostrare il menu

Compito

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.

Soluzione

Switch to desktopCambia al desktop per esercitarti nel mondo realeContinua da dove ti trovi utilizzando una delle opzioni seguenti
Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 1. Capitolo 4
single

single

Chieda ad AI

expand

Chieda ad AI

ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

some-alt