Search ⌘K
F
Facebook

Interview Core Track · Easy · 15 min

10088 Liked Posts

SELECT COUNT(DISTINCT p.post_id) as n_posts_with_a_like FROM facebook_posts p JOIN facebook_reactions r ON p.post_id = r.post_id and r.reaction = 'like'

Interview Core Track
Easy
15 min
joins
aggregation
filtering

Company labels are directional practice context, not official interview guidance.

Timer 00:00
Back to practice

Objective

Practice joins through a Facebook-tagged business scenario.

Approach

Use this track to improve speed, edge-case handling, and accuracy under timed conditions.

Company context

Company labels are directional practice context, not official interview guidance.

Prereq: query basics
Prereq: filtering

SELECT COUNT(DISTINCT p.post_id) as n_posts_with_a_like FROM facebook_posts p JOIN facebook_reactions r ON p.post_id = r.post_id and r.reaction = 'like'

facebook_posts
post_id INTEGER PRIMARY KEY
poster INTEGER
post_text VARCHAR(500
facebook_reactions
reaction_id INTEGER PRIMARY KEY
poster INTEGER
friend_id INTEGER
reaction VARCHAR(50
Editor
SQL workspace

Run queries against the protected question data, then submit once the result shape looks right.

Sign in to run SQL

Create a free account or sign in before running queries against protected question data.