Data with Baraa on YouTube · Open on YouTube
Core skills: SQL depth, statistics, Python and dashboards · Advanced beginner · Lesson 18 of 99 · 36 min video, then about 5 hours of practice
Conditional logic, dates and NULLs in SQL
After this you can bucket values with CASE, truncate and difference dates, and handle NULLs with COALESCE and NULLIF without silently dropping rows.
Why it matters
These are the unglamorous functions in nearly every real query. CASE turns raw values into business categories; date functions let you group by week or month and measure time between events; NULL handling decides whether a missing value is zero, unknown or excluded. The trap is NULL logic: a NULL is not equal to anything, including another NULL, so WHERE status <> 'cancelled' quietly drops every row where status is NULL.
How to use this resource
A visual explanation of CASE WHEN with the common analyst use cases (bucketing, flags and conditional aggregation). Pair it with the NULL video below.