You're an analyst at Brightpath, an online school. The database has three tables: students — one row per student; student_profiles — exactly one profile per student (a one-to-one relationship); and enrollments — course enrollments, of which a student may have several or none (a one-to-many relationship). The student advisor needs a report showing each student's plan and how many courses they're enrolled in. Make sure joining the profile doesn't duplicate student rows and that students without enrollments aren't excluded from the report.
Return these columns:
- full_name — student's name;
- plan — plan from the profile;
- courses_cnt — number of course enrollments (integer; 0 if there are none).
Sort the result by courses_cnt in descending order, then by full_name in ascending order. Students without course enrollments must appear in the result with a count of 0.
full_nameplancourses_cntShowing the first 3 rows of the sample — the full sample comes with Premium
Sign in to see submission history
Sign inSign in to use AI Mentor
Sign in