Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Вивчайте Знайти Співробітників Нетехнічних Відділів Челендж | Вкладені Запити
Розширений Рівень SQL

book
Знайти Співробітників Нетехнічних Відділів Челендж

In this chapter, you will work with the employees and department tables.

Завдання

Swipe to start coding

Your task is to retrieve the first name, last name, and salary of those employees who work in non-technical departments.

To do this, use an inner query where you write the filtering using a WHERE clause.

You also need to sort the results by salary, from highest to lowest. Use the ORDER BY clause to accomplish this subtask.

Brief Instructions

  • Retrieve the first_name, last_name, and salary columns from the employees table.
  • In the WHERE clause, use a nested query with the syntax WHERE department IN.
  • In the nested query, select the name column from the department table.
  • In the nested query, use the WHERE clause to set type = 'non-tech'.
  • Sort the results by salary in descending order.

Рішення

SELECT first_name, last_name, salary
FROM employees
WHERE department IN (
SELECT name
FROM department
WHERE type = 'non-tech'
)
ORDER BY salary DESC
Все було зрозуміло?

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

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

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

single


Query ResultQuery Result
No query executed yet...

Запитати АІ

expand

Запитати АІ

ChatGPT

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

We use cookies to make your experience better!
some-alt