Search ⌘K
F
Facebook

Foundations Track · Easy · 15 min

10. Difference between BETWEEN and IN operators

BETWEEN is used to select rows that match a range of values, whereas the IN operator checks for values in a specified list of values. For example, to find ca...

Foundations Track
Easy
15 min
filtering

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

Timer 00:00
Back to practice

Objective

Practice filtering through a Facebook-tagged business scenario.

Approach

Use this track to lock in clean query structure, basic filtering logic, and confidence with grouped output.

Company context

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

Prereq: query basics

BETWEEN is used to select rows that match a range of values, whereas the IN operator checks for values in a specified list of values. For example, to find campaigns with between 500 and 10k in spend, you could use BETWEEN: SELECT * FROM pinterest_ad_campaigns WHERE spend BETWEEN 500 AND 10000; To find ad campaigns that were run on Facebook and Google's Display Network, you could use IN: SELECT * FROM pinterest_ad_campaigns WHERE ad_platform IN ("fb", "google_display"); ---

pinterest_ad_campaigns
campaign_id INT PRIMARY KEY
campaign_name VARCHAR(100
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.