SQL interview question: Completion Rate as a Percentage
Course Completion Percentage
The education platform wants to calculate what percentage of enrolled students actually completed each course.
Calculate the completion rate as: (completed / enrolled) × 100
Return course_name and completion_rate. Round to 1 decimal place. Order by completion rate descending.
Skills: division, percentage calculation, and ROUND
Tables
course_enrollment 5 rows
- course_id integer PK
- course_name text
- enrolled integer
- completed integer
| course_id | course_name | enrolled | completed |
|---|---|---|---|
| 1 | SQL Mastery | 150 | 120 |
| 2 | Python Basics | 200 | 180 |
| 3 | Data Science | 100 | 65 |