Master the foundational syntax of PostgreSQL and Standard SQL. From filtering active subscriptions with WHERE and handling three-valued boolean logic with NULLs, to multi-condition ORDER BY and conditional CASE WHEN categorization.
Key patterns and rules practiced in this track.
In SQL, NULL represents an unknown state, not false or empty string. Comparisons with = NULL always evaluate to UNKNOWN. Use IS NULL or IS NOT NULL.
WHERE column IS NOT NULL AND column != 'unknown'SELECT * FROM leads WHERE acquisition_channel IS NOT NULL AND acquisition_channel != 'unknown';
Allows row-by-row branching logic inside queries without mutating database tables. Evaluates conditions sequentially from top to bottom.
CASE WHEN condition THEN result ELSE fallback ENDSELECT company_name, CASE WHEN mrr >= 5000 THEN 'Tier 1' WHEN mrr >= 1000 THEN 'Tier 2' ELSE 'Tier 3' END AS customer_tier FROM accounts;
Use % to match any sequence of characters and _ to match a single character. ILIKE is PostgreSQL specific for case-insensitive matching.
WHERE column ILIKE 'pattern%'SELECT sku, product_name FROM catalog WHERE product_name ILIKE '%bluetooth%';
Click any problem to open the interactive editor.
A table with subscription_id, company_name, plan_tier, and mrr sorted by highest MRR first.
Unique list of acquisition_channel and country_code with no null or unknown values, alphabetically sorted.
List of waiting emergency patients under Resuscitation or Emergent triage, sorted chronologically.
Express delivery orders >= $250 still pending or processing, sorted by price descending.
High-performing engineers earning under $160k, sorted by rating descending and salary ascending.
High-risk non-US wire transfers between $10k and $50k, sorted by highest risk score first.
Online top-rated XL and Black tier drivers eligible for surge dispatch.
Paid tier accounts missing payment provider credentials, sorted by creation date.
Budget wireless and Bluetooth audio products sorted by price ascending.
Customer profiles with computed loyalty tier labels sorted by lifetime spend.
Inpatients in clinical distress requiring ICU escalation, sorted by lowest oxygen saturation.
Dispute tickets classified by escalation priority and sorted by disputed amount.
Run queries directly in your browser against realistic tables.