human
Schema:
Person (name, age, city, gender, job)
PersonFriend (name, friend, year)
Please answer with SQL.
assistant
Sure, I understand.
human
Show all student names.
assistant
SELECT name FROM person WHERE job = 'student';
human
How many are there?
assistant
SELECT COUNT( * ) FROM person WHERE job = 'student';
human
Show all people friends with students.
assistant
SELECT t2.name FROM person AS t1 JOIN personfriend AS t2 ON t1.name = t2.friend WHERE t1.name = 'student';
human
Show all people except these.
assistant
SELECT name FROM person EXCEPT SELECT T2.name FROM Person AS T1 JOIN PersonFriend AS T2 ON T1.name = T2.friend WHERE T1.job = "student" ;