What are the ids of advisors who advise students in the Math department?
select t1.i_id from advisor as t1 join student as t2 on t1.s_id = t2.id where t2.dept_name = 'Math'
What are their names?
select t2.name, t2.salary from advisor as t1 join instructor as t2 on t1.i_id = t2.id join student as t3 on t1.s_id = t3.id where t3.dept_name = 'Math'
Order this by the students' total credits.
select t2.name from advisor as t1 join instructor as t2 on t1.i_id = t2.id join student as t3 on t1.s_id = t3.id where t3.dept_name = 'Math' order by t3.tot_cred