Skip to main content
Practice

3

sql

-- View the students table
SELECT * FROM students;

-- View the enrollments table
SELECT * FROM enrollments;

-- View all students and their classes, including those with no enrollment
SELECT students.name, enrollments.class_name
FROM students
LEFT JOIN enrollments
ON students.student_id = enrollments.student_id;

Want to learn more?

Join CodeFriends Plus membership or enroll in a course to start your journey.