🙏 We need your help! SQLtest.online has no ads and lives only on donations. Even a small amount helps. Donate now →
SQL code copied to buffer
Task 16:

Final Grades for Section 1585

MariaDB
The semester is over, and the scores of section 1585 are in. The task runs on a small copy of the enrollments table (9 rows, two sections).
For the enrollments of section 1585 with the status enrolled and a filled final_score:
- set final_grade: A for 90 and above, B for 80 and above, C for 70 and above, D for 60 and above, F below 60;
- set status to completed for 60 and above, otherwise failed.
Rows without a score and the other section stay as they are.
Expected result Columns: 3 · Rows: 9
enrollment_id status final_grade

Sample rows open after wrong checks: 0 of 2

Write your query below and click "Check it!". Tables are described in the right pane.

Tutorial

By checking a query, you agree that it is stored without your account details and may be included in anonymized datasets, including for AI training. Learn more

The query result will appear here. Ctrl+Enter - Run query