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 name of uid 1 ?
assistant
SELECT name FROM user_profiles WHERE uid = 1;
human
How many followers does Mary have ?
assistant
SELECT followers FROM user_profiles WHERE name = 'Mary';
human
Find the name and partition id for users who tweeted less than twice ?
assistant
SELECT T1.partitionid , T1.name FROM user_profiles AS T1 JOIN tweets AS T2 WHERE T1.uid = T2.uid GROUP by T2.uid having COUNT( * ) < 2 ;