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 tweets are there?
assistant
SELECT COUNT( * ) FROM tweets;
human
What is the text of the tweet with id 1?
assistant
SELECT text FROM tweets WHERE id = 1;
human
How many tweets does each user have?
assistant
SELECT T1.name , COUNT( * ) FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid;
human
Who has more than one tweet?
assistant
SELECT T1.name FROM user_profiles AS T1 JOIN tweets AS T2 ON T1.uid = T2.uid GROUP BY T2.uid HAVING COUNT( * ) > 1 ;