Your question is SQL Join and Completion Rates. Start with the requirements and the three tables on the right.
Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.
Cengage wants a category-level view of learner progress across its digital learning products. Write a PostgreSQL query that joins users, enrollments, and courses to calculate enrollment and completion metrics by course category.
completed_at is not NULL.| Column | Type | Description |
|---|---|---|
| user_idPK | INT | Unique learner identifier |
| full_name | VARCHAR(255) | Learner's full name |
| VARCHAR(255) | Learner email address |
| Column | Type | Description |
|---|---|---|
| enrollment_idPK | INT | Unique enrollment identifier |
| user_id | INT | References users.user_id |
| course_id | INT | References courses.course_id |
| completed_at | TIMESTAMP | Timestamp when the learner completed the course |
| Column | Type | Description |
|---|---|---|
| course_idPK | INT | Unique course identifier |
| course_name | VARCHAR(255) | Course title |
| category | VARCHAR(100) | Course subject category |