CJCoding With Joseph
15free / daySign inCreate account

Who Earned an A in What

List every A grade on record with the student's name and the course code. Return first_name, last_name, code and grade, one row per A, where letter is 'A'. Sort by last_name, first_name, then code.

Expected result:

+------------+-----------+---------+-------+
| first_name | last_name | code    | grade |
+------------+-----------+---------+-------+
| Charlotte  | Dubois    | BUS150  |    88 |
| Charlotte  | Dubois    | CS101   |    85 |
| Charlotte  | Dubois    | MATH110 |    90 |
| Mia        | Haddad    | ENG101  |    94 |
| Scarlett   | Johnson   | ENG101  |    90 |
| Grace      | Lee       | CS101   |    93 |
| Grace      | Lee       | CS310   |    96 |
| Grace      | Lee       | MATH110 |    88 |
| Ella       | Murphy    | ENG101  |    88 |
| Evelyn     | Park      | MATH110 |    97 |
+------------+-----------+---------+-------+
(showing 10 of 19 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.