CJCoding With Joseph
15free / daySign inCreate account

Top Marks With Student Names

Show every grade of 90 or more together with the student who earned it. Return first_name, last_name and grade. A student with two such grades appears twice. Sort by grade from highest to lowest, then by last_name to settle the ties at 94 and 90.

Expected result:

+------------+-----------+-------+
| first_name | last_name | grade |
+------------+-----------+-------+
| Sophia     | Rossi     |    99 |
| Evelyn     | Park      |    97 |
| Grace      | Lee       |    96 |
| Evelyn     | Park      |    95 |
| Mia        | Haddad    |    94 |
| Emily      | Zhang     |    94 |
| Grace      | Lee       |    93 |
| Ava        | Patel     |    92 |
| Emily      | Zhang     |    91 |
| Charlotte  | Dubois    |    90 |
+------------+-----------+-------+
(showing 10 of 11 rows)
Hints3 available
Topics:
Joins
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.