Meta Growth Analytics wants a Friday engagement cut for the AARRR funnel across Instagram Reels, Facebook Groups, and Instagram Save-related posts. Write a PostgreSQL query that calculates how many likes each user received on a Friday.
Requirements
- Return every user, including users who received no Friday likes.
- Count likes received through the user's posts, using
EXTRACT(ISODOW FROM liked_at) = 5 to identify Fridays.
- Include the username and Friday like count, ordered by count descending and then
user_id ascending.
- Ignore likes with a missing timestamp or missing post relationship.