CJCoding With Joseph
15free / daySign inCreate account

Students Above the Average GPA

List the students whose gpa is above the college-wide average gpa. Return first_name, last_name and gpa, sorted by gpa from highest to lowest, then last_name. Students with no gpa yet cannot be compared and are left out automatically.

Expected result:

+------------+-----------+------+
| first_name | last_name |  gpa |
+------------+-----------+------+
| Evelyn     | Park      | 3.98 |
| Sophia     | Rossi     | 3.92 |
| Grace      | Lee       | 3.88 |
| Mia        | Haddad    |  3.8 |
| Ava        | Patel     |  3.8 |
| Emily      | Zhang     | 3.72 |
| Charlotte  | Dubois    | 3.67 |
| Scarlett   | Johnson   |  3.6 |
| Harper     | Singh     | 3.55 |
| Zoe        | Campbell  |  3.5 |
+------------+-----------+------+
(showing 10 of 14 rows)
Hints3 available
Topics:
Subqueries
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (sel, ins, desc)

Results

Run your SQL to see every statement's output here, then how it compares with the expected answer.

Not sure what is in a table? SHOW TABLES lists them and DESCRIBE students shows the columns — or open the database browser on the left.