Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Challenge: Employees With More Than Average Salary | Section
Intermediate SQL
セクション 1.  12
single

single

bookChallenge: Employees With More Than Average Salary

メニューを表示するにはスワイプしてください

When a subquery is written in the WHERE section, we can use the IN operator and comparison operators:

SELECT column1, ...
FROM table
WHERE column1 > (SELECT AGG(column2) FROM table)
タスク

スワイプしてコーディングを開始

Find employees whose salary is above the average salary of all employees using a subquery in the WHERE section.

The resulting table should have 3 columns: first_name, last_name, and salary. Then, sort the result by salary from highest to lowest using ORDER BY.

This syntax can be used as a great alternative to the HAVING clause.

Brief Instructions

  • Retrieve the first_name, last_name, and salary columns from the employees table.
  • In the WHERE clause, use an inner query with the syntax salary > [inner query].
  • In the inner query, get the average value of the salary column from the employees table.
  • Sort the results by salary in descending order.

解答

Switch to desktop実践的な練習のためにデスクトップに切り替える下記のオプションのいずれかを利用して、現在の場所から続行する
すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 1.  12
single

single

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

some-alt