Focus: Practice JOINs step-by-step
Time: 15-20 minutes
SELECT name, major
FROM Students
WHERE major = 'Computer Science'
ORDER BY name;
Key Points: Only one table needed, use WHERE to filter, ORDER BY to sort.
Hint: You need to JOIN Students with Enrollments, then Enrollments with Courses
SELECT s.name, c.course_name
FROM Students s
JOIN Enrollments e ON s.student_id = e.student_id
JOIN Courses c ON e.course_id = c.course_id;
How it works:
Hint: Use COUNT and GROUP BY
SELECT c.course_name, COUNT(*) as student_count
FROM Courses c
JOIN Enrollments e ON c.course_id = e.course_id
GROUP BY c.course_id, c.course_name;
How it works: