Question: SQL question: write a SQL query that gets the top 3 students with the highest grades for both genders in the class. An example of
SQL question:
write a SQL query that gets the top 3 students with the highest grades for both genders in the class.
An example of the original table should look like this (table name is "t1"):

The expected result should look like this:

Thank you!
ID grade gender 1 78 male 2 56 male 3 89 female 4 93 male 5 99 female 6 77 female 7 100 female 8 54 female 9 90 female 10 90 male 11 88 male 12 87 male 13 96 female 14 97 male 15 34 female 16 23 male 17 72 male 18 98 female 19 68 female 66 male 21 87 male 77 male 23 78 female 24 96 male 25 96 female 26 42 male 27 47 female 28 85 female 29 88 male 30 94 male 20 ID grade gender 7 100 female 5 99 female 18 98 female 14 97 male 24. 96 male 30 94 male
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
