🙏 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 8:

GPA Summary of All Students

MariaDB
The registrar needs one summary line about the students table. New students have no GPA yet: their gpa is empty.
Output the columns:
- total_students: the number of all students;
- with_gpa: the number of students who have a GPA;
- avg_gpa: the average GPA, rounded to 2 decimal places;
- max_gpa: the highest GPA.
Expected result Columns: 4 · Rows: 1
total_students with_gpa avg_gpa max_gpa

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