SQL Fundamentals

Lesson 6 of 6

Final Project: Query a Mini Course Catalog

Time to combine everything into a set of real queries against a small schema of your own design, with tables like students(id, name, xp), courses(id, title), and enrollments(student_id, course_id).

Requirements

  1. Write a SELECT with a WHERE clause that lists all students above a given XP threshold.
  2. Write a query that JOINs students and enrollments (and courses) to show which courses each student is taking.
  3. Write a query using GROUP BY and COUNT to show how many students are enrolled in each course.
  4. Write an UPDATE statement that safely modifies a specific row, with a WHERE clause.
  5. Write an INSERT statement that adds a new student.

Stretch goals

  • Use a LEFT JOIN to find students with zero enrollments.
  • Use HAVING to find courses with more than a set number of students.
  • Add a DELETE statement (with a safe WHERE clause!) for removing a dropped enrollment.

Submit a link to your schema and queries (e.g. a repo or gist) below when you are done, an instructor will review it before you can mark this lesson complete. Good luck! 🚀

This lesson ends in a project. Build it on your own machine, there's nowhere to submit it here, but the brief above is everything you need.