Course Content
Intermediate SQL
4. DDL and DML in SQL
Intermediate SQL
Table Join Practice
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.
Just a reminder, we're working with two tables:
courses
:
course_id | course_name | description |
---|---|---|
1 | Introduction to Programming | Learn the basics of programming using Python. |
2 | Data Structures and Algorithms | In-depth study of data structures and algorithms. |
3 | Web Development | Learn how to build web applications using HTML, CSS, and JavaScript. |
4 | Database Management | Understand database concepts and SQL. |
... | ... | ... |
11 | DevOps Fundamentals | Learn the principles and practices of DevOps. |
enrollments
:
enrollment_id | student_name | course_id | enrollment_date |
---|---|---|---|
1 | Alice Johnson | 1 | 2023-01-15T00:00:00Z |
2 | Bob Brown | 2 | 2023-01-20T00:00:00Z |
3 | Charlie Davis | 1 | 2023-01-25T00:00:00Z |
4 | David Evans | 2023-02-01T00:00:00Z | |
... | ... | ... | ... |
20 | Tina Upton | 7 | 2023-05-01T00:00:00Z |
Task
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:
As you can see, there are no aliases here, so do not use them to ensure the task is correctly evaluated.
Everything was clear?
Course Content
Intermediate SQL
4. DDL and DML in SQL
Intermediate SQL
Table Join Practice
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.
Just a reminder, we're working with two tables:
courses
:
course_id | course_name | description |
---|---|---|
1 | Introduction to Programming | Learn the basics of programming using Python. |
2 | Data Structures and Algorithms | In-depth study of data structures and algorithms. |
3 | Web Development | Learn how to build web applications using HTML, CSS, and JavaScript. |
4 | Database Management | Understand database concepts and SQL. |
... | ... | ... |
11 | DevOps Fundamentals | Learn the principles and practices of DevOps. |
enrollments
:
enrollment_id | student_name | course_id | enrollment_date |
---|---|---|---|
1 | Alice Johnson | 1 | 2023-01-15T00:00:00Z |
2 | Bob Brown | 2 | 2023-01-20T00:00:00Z |
3 | Charlie Davis | 1 | 2023-01-25T00:00:00Z |
4 | David Evans | 2023-02-01T00:00:00Z | |
... | ... | ... | ... |
20 | Tina Upton | 7 | 2023-05-01T00:00:00Z |
Task
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:
As you can see, there are no aliases here, so do not use them to ensure the task is correctly evaluated.
Everything was clear?