Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Non-tech Department Employees | Nested Subqueries
Intermediate SQL
course content

Kursusindhold

Intermediate SQL

Intermediate SQL

1. Grouping
2. Nested Subqueries
3. Joining Tables
4. DDL and DML in SQL

book
Challenge: Non-tech Department Employees

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

Opgave

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.

Løsning

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 2. Kapitel 2
toggle bottom row

book
Challenge: Non-tech Department Employees

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

Opgave

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.

Løsning

Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Var alt klart?

Hvordan kan vi forbedre det?

Tak for dine kommentarer!

Sektion 2. Kapitel 2
Switch to desktopSkift til skrivebord for at øve i den virkelige verdenFortsæt der, hvor du er, med en af nedenstående muligheder
Vi beklager, at noget gik galt. Hvad skete der?
some-alt