ชื่อของนักเรียนที่มีทั้งแมวและสุนัขเป็นสัตว์เลี้ยงคืออะไร?ไม่จำเป็นต้องใช้โต๊ะทั้งหมด
What are the students' first names who have both cats and dogs as pets?It is not neccessary to use all the tables.
 has_pet:  (stuid [ VARCHAR ] petid [ 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'