CREATE TABLE student (fname VARCHAR(255), stuid VARCHAR(255)); CREATE TABLE has_pet (stuid VARCHAR(255), petid VARCHAR(255)); CREATE TABLE pets (petid VARCHAR(255), pettype VARCHAR(255))
Find the first name of students who have both cat and dog pets .
    
SQL: SELECT t1.fname FROM student AS t1 JOIN has_pet AS t2 ON t1.stuid = t2.stuid JOIN pets AS t3 ON t3.petid = t2.petid WHERE t3.pettype = 'cat' INTERSECT SELECT t1.fname FROM student AS t1 JOIN has_pet AS t2 ON t1.stuid = t2.stuid JOIN pets AS t3 ON t3.petid = t2.petid WHERE t3.pettype = 'dog'