title: Convert the students marks into respective grades
body: <p>Need a query to print the <code>ID</code> and <code>letter_grade</code> associated with a student's <code>max_grade</code> for each record in the <code>Student</code> table. The output must be ordered by ascending ID and should follow the below format :</p>
  
  <pre><code>Student 1 has grade: A
  
  Student 2 has grade: C
  
  Student 3 has grade: B
  
  Student 4 has grade: F
  
  But I'm not sure how to pass "id" value into the then clause.
  
  Below is the code I have implemented :
  
  select CASE 
  WHEN max_grade &lt; 20 then "Student id has grade: F"
  WHEN (max_grade &gt;=20 AND max_grade &lt;40) then "Student id has grade: D"
  WHEN (max_grade &gt;=40 AND max_grade &lt;60) then "Student id has grade: C"
  WHEN (max_grade &gt;=60 AND max_grade &lt;80) then "Student id has grade: B"
  ELSE "Student id has grade: A"
  END AS Grade_details from students order by id;
  
  </code></pre>