Conditional ORDER BY based on NULL values in the column
You could add a case when check to the order by to give the NULL's a lower priority and then filter on grades     

SELECT * 
FROM table 
ORDER BY CASE WHEN grades IS NULL 
THEN 2 ELSE 1 END ASC, grades ASC;


Since you are using integers you can also do this, which should be more performant

SELECT * 
FROM table
ORDER BY -grades DESC;


Source

DB&lt;>Fiddle