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
Who has the least number of followers?
assistant
SELECT Name FROM user_profiles ORDER BY followers LIMIT 1;
human
How many users have more than one follower?
assistant
SELECT COUNT( * ) FROM ( SELECT T1.name FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f1 GROUP BY T2.f1 HAVING COUNT( * ) > 1 );
human
Show their names and emails.
assistant
SELECT T1.name , T1.email FROM user_profiles AS T1 JOIN follows AS T2 ON T1.uid = T2.f1 GROUP BY T2.f1 HAVING COUNT( * ) > 1 ;