How many users tweeted less than twice?
select count(*) from (select count(*) from user_profiles as t1 join tweets as t2 on t1.uid = t2.uid group by t2.uid having count(*) < 2)
Show their names.
select t1.name from user_profiles as t1 join tweets as t2 on t1.uid = t2.uid group by t2.uid having count(*) < 2
Please also show their partition id
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