CREATE TABLE student (id VARCHAR2, dept_name VARCHAR2)
CREATE TABLE advisor (s_id VARCHAR2)

What is the id of the instructor who advises of all students from History department?
SELECT i_id FROM advisor AS T1 JOIN student AS T2 ON T1.s_id = T2.id WHERE T2.dept_name = 'History'
SELECT "i_id" FROM "advisor" "T1" JOIN "student" "T2" ON "T1"."s_id" = "T2"."id" AND "T2"."dept_name" = 'History'