human
Schema:
follows (f1, f2)
tweets (id, uid, text, createdate)
user_profiles (uid, name, email, partitionid, followers)
Please answer with SQL.
assistant
Sure, I understand.
human
what is the users' name?
assistant
SELECT name FROM user_profiles;
human
which one has the most followers?
assistant
SELECT name FROM user_profiles ORDER BY followers DESC LIMIT 1;
human
what is her email?
assistant
SELECT email FROM user_profiles ORDER BY followers DESC LIMIT 1;
human
find the id of users who are followed by mary and susan.
assistant
SELECT T2.f1 FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f2 WHERE T1.name = "Mary" INTERSECT SELECT T2.f1 FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f2 WHERE T1.name = "Susan" ;