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'
Temukan nama depan siswa yang memiliki hewan peliharaan kucing dan anjing.
CREATE TABLE student (fname VARCHAR, stuid VARCHAR); CREATE TABLE has_pet (stuid VARCHAR, petid VARCHAR); CREATE TABLE pets (petid VARCHAR, pettype VARCHAR)