Multiple Tables with Reddit SQL Project Task 5

THIS IS THE TASK IN QUESTION

Now let’s join the data from the different tables to find out some more information.

Use a LEFT JOIN with the users and posts tables to find out how many posts each user has made. Have the users table as the left table and order the data by the number of posts in descending order.

THIS IS THE HINT

SELECT users.username, COUNT() AS ‘posts_made’
FROM users
LEFT JOIN ___
ON users.
= posts.___
GROUP BY users.id
ORDER BY 2 DESC;

CAN SOMEONE WRITE THE CORRECT QUERRY SO I CAN FIGURE OUT WHAT IM DOING WRONG. THANK YOU IN ADVANCE

Could you please add a link to this specific lesson. There is some great advice about this and how best to set-up your question in general in the following FAQ-

What have you tried so far? With only two tables mentioned the JOIN clause should be fairly obvious and as for ON you’re looking for your foreign key, a column shared between these two datasets. Have you checked the columns available to these two tables and determined if there are any foreign keys?

This topic was automatically closed 41 days after the last reply. New replies are no longer allowed.