CREATE TABLE has_pet (stuid VARCHAR(255), petid VARCHAR(255)); CREATE TABLE student (fname VARCHAR(255), age VARCHAR(255), stuid VARCHAR(255)); CREATE TABLE pets (petid VARCHAR(255), pettype VARCHAR(255))
Find the first name and age of students who have a dog but do not have a cat as a pet.
    
SQL: SELECT T1.fname, T1.age 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' AND NOT T1.stuid IN (SELECT T1.stuid 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')