I have a SQL Database with 3 tables:
table1: user
id | nickname
1 peter
2 tom
table2: posts
user_id | title | text
1 hmmm bla
1 yeah blub
2 blub dada
1 yuhu asdf
table3: messages
user_id | title | message
1 hello bla
2 hi blub
2 hey dada
2 huhu asdf
How do I count every entry from posts/messages for each user in one query?
Try this: