| Student | Grade | Course |
|---|---|---|
| JOHN | 10 | Algebra |
| JOHN | 7 | Computer science |
| ANNA | 10 | Algebra |
| ANNA | 10 | Data structures |
| JACOB | 10 | Data structures |
| GEORGE | 6 | Computer science |
| GEORGE | 10 | Algebra |
| GEORGE | 9 | Data structures |
I have the above table and what I want to do is to order the students by their highest course grade (a student with 10 & 10 comes first compared to someone with a 10 or 10 & 9 or even someone with 10 & 9 & 9) and then order the courses by grade for each student. The result should look like the table below:
| Student | Grade | Course |
|---|---|---|
| ANNA | 10 | Data structures |
| ANNA | 10 | Computer science |
| GEORGE | 10 | Algebra |
| GEORGE | 9 | Data structures |
| GEORGE | 6 | Algebra |
| JOHN | 10 | Algebra |
| JOHN | 7 | Computer science |
| JACOB | 10 | Data structures |
Is there a way to achieve this result?