What are the ids of all instructors who are advisors?
select i_id from advisor as t1 join student as t2 on t1.s_id = t2.id
Of these, which advise students in the History department?
select i_id from advisor as t1 join student as t2 on t1.s_id = t2.id where t2.dept_name = 'History'
What are their names and salaries?
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 = 'History'