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
How many followers does each user have?
assistant
SELECT count(*) FROM follows
human
Find the name and email of the user followed by the least number of people.
assistant
SELECT name , email FROM user_profiles ORDER BY followers LIMIT 1
human
List the names of 5 users followed by the largest number of other users.
assistant
SELECT name FROM user_profiles ORDER BY followers DESC LIMIT 5
human
How many users are there?
assistant
SELECT count(*) FROM user_profiles
human
Find the name and partition id for users who tweeted less than twice.
assistant
SELECT T1.name , T1.partitionid FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid HAVING count(*) < 2
human
What is the partition id of the user named 'Iron Man'.
assistant
SELECT partitionid FROM user_profiles WHERE name = "Iron Man" ;