`users` # SELECT COUNT(*) FROM `tweets` WHERE `tweets`.`user_id` = 1 # SELECT COUNT(*) FROM `tweets` WHERE `tweets`.`user_id` = 2 # SELECT COUNT(*) FROM `tweets` WHERE `tweets`.`user_id` = 3 # SELECT COUNT(*) FROM `tweets` WHERE `tweets`.`user_id` = 4 # SELECT COUNT(*) FROM `tweets` WHERE `tweets`.`user_id` = 5
`users` # SELECT COUNT(*) FROM `tweets` WHERE `tweets`.`user_id` = 1 # SELECT COUNT(*) FROM `tweets` WHERE `tweets`.`user_id` = 2 # SELECT COUNT(*) FROM `tweets` WHERE `tweets`.`user_id` = 3 # SELECT COUNT(*) FROM `tweets` WHERE `tweets`.`user_id` = 4 # SELECT COUNT(*) FROM `tweets` WHERE `tweets`.`user_id` = 5
`users` # SELECT COUNT(`tweets`.`user_id`), `tweets`.`user_id` FROM # `tweets` WHERE `tweets`.`user_id` IN (1, 2, 3, 4, 5) # GROUP BY `tweets`.`user_id`
t0_r0, `users`.`created_at` AS t0_r3, # `users`.`updated_at` AS t0_r4, COUNT(`tweets`.`id`) AS t1_r0 # FROM `users` LEFT OUTER JOIN `tweets` # ON `tweets`.`user_id` = `users`.`id` GROUP BY users.id