Challenge: Use Joins to Combine Rows
Explore how to use SQL joins to merge rows from different tables and solve real-world problems like counting student enrollments per course. Understand how left joins and subqueries help include all records, even those without matches, to produce comprehensive datasets.
We'll cover the following...
We'll cover the following...
Problem statement
- How many students are enrolled in each course?
- There are five students, but only four are currently registered in any courses. Write a query to show this information.
The students sample table is below:
+----+--------+---------------------+----------------------+
| id | name | address | date_of_registration |
+----+--------+---------------------+----------------------+
| 1 | John | ...