Exercise: Sort by Combined
Sort by marks minus age.
Solution
sql
1SELECT name, marks, age, marks - age AS diff
2FROM students
3ORDER BY marks - age DESC;
Sort by marks minus age.
1SELECT name, marks, age, marks - age AS diff
2FROM students
3ORDER BY marks - age DESC;