ค้นหาชื่อนักเรียนที่มีสัตว์เลี้ยงทั้งแมวและสุนัข ไม่จำเป็นต้องใช้ทุกโต๊ะ
Find the first name of students who have both cat and dog pets .It is not neccessary to use all the tables.
 student:  (fname [ VARCHAR ] stuid [ VARCHAR) ]
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'