Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lære Challenge: Table Join | Joining Tables
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: Table Join

In this task, you'll need to use a different type of JOIN, or you can use the same one you used in the previous chapter, as long as you get the correct result.

Opgave

Swipe to start coding

Write a query to retrieve a list of all students and the courses they are enrolled in, including students who are not enrolled in any course.

Use an appropriate type of JOIN and use the columns in the following order:

bash

As you can see, there are no aliases here, so do not use them to ensure the task is correctly evaluated.

Brief Instructions

  • Retrieve the necessary columns from the courses table.
  • Use a RIGHT JOIN to join the enrollments table.
  • The common column for both tables is enrollments.course_id = courses.course_id.

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 3. Kapitel 6
toggle bottom row

book
Challenge: Table Join

In this task, you'll need to use a different type of JOIN, or you can use the same one you used in the previous chapter, as long as you get the correct result.

Opgave

Swipe to start coding

Write a query to retrieve a list of all students and the courses they are enrolled in, including students who are not enrolled in any course.

Use an appropriate type of JOIN and use the columns in the following order:

bash

As you can see, there are no aliases here, so do not use them to ensure the task is correctly evaluated.

Brief Instructions

  • Retrieve the necessary columns from the courses table.
  • Use a RIGHT JOIN to join the enrollments table.
  • The common column for both tables is enrollments.course_id = courses.course_id.

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 3. Kapitel 6
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