Guides
Practical SQL guides for local file analysis
Learn how to query CSV, JSON, and Parquet files with SQL in the browser. These guides focus on real file-analysis workflows, privacy-aware usage, DuckDB WASM, and reusable SQL examples.
SQL concepts explained
SQL CASE WHEN Explained: Conditional Logic, Buckets, and Conditional Aggregation
CASE WHEN is SQL's if/else. Use it to label rows, build ranges, translate codes, and turn one grouped query into a compact pivot-style report.
Read guideSQL Subqueries vs CTEs: When to Use WITH, IN, EXISTS, and Correlated Subqueries
Subqueries nest one question inside another; CTEs give each step a name. Learn which form to use, and the NULL trap that makes NOT IN return nothing.
Read guideSQL UNION, INTERSECT, and EXCEPT Explained: Combine and Compare Query Results
Set operations stack or compare whole query results. They are the quickest way to merge yearly exports or find rows that appear in one list but not the other.
Read guideSQL String Functions for Cleaning Text: TRIM, LOWER, SPLIT_PART, and REGEXP_REPLACE
Exported text is messy. A handful of SQL string functions fix most of it: trim and lowercase values, join fields safely, split out parts, and strip characters with regex.
Read guideIntroduction to SQL: SELECT, Columns, Aliases, and Sorting Results
Your first SQL queries do not need to be complicated. Start with SELECT, choose the columns you need, name results clearly, and sort rows intentionally.
Read guideSQL WHERE Clause Explained: Filtering Rows with AND, OR, and LIKE
Filtering is where SQL starts to feel useful: keep only the rows that answer your question, then combine conditions as your questions get sharper.
Read guideSQL Aggregate Functions: COUNT, SUM, MIN, MAX, and AVG Explained
Aggregate functions turn many rows into useful summary values, which is the foundation of reporting, dashboards, and quick data checks.
Read guideSQL DISTINCT, GROUP BY, and HAVING: From Unique Values to Grouped Reports
DISTINCT cleans up repeated values, GROUP BY creates summaries per category, and HAVING filters those summaries after aggregation.
Read guideSQL Date Queries: Date Ranges, EXTRACT, and DATE_DIFF Explained
Date queries become much easier when you filter with clear ranges, extract useful parts, and calculate durations directly in SQL.
Read guideSQL JOINs Explained: INNER, LEFT, FULL OUTER, SELF, and CROSS JOIN
JOINs bring related tables back together: matched rows, missing matches, hierarchies, and all-combination grids all use different JOIN patterns.
Read guideSQL Window Functions Explained: OVER, PARTITION BY, Running Totals, and LAG
Window functions add context beside each row: totals, group totals, ranks, running totals, and previous values without losing detail.
Read guideSQL Execution Order Explained: Why WHERE, GROUP BY, HAVING, SELECT, and LIMIT Behave Differently
SQL is written in one order but understood in another; learning the logical order explains many beginner surprises.
Read guideDatabase Normalization Explained: Why Clean Tables Need Keys, JOINs, and Normal Forms
Normalization keeps each fact in the right place, reducing duplicated data and making updates, inserts, and deletes safer.
Read guideSQL GROUPING SETS, ROLLUP, and CUBE Explained for Subtotals and Grand Totals
GROUPING SETS, ROLLUP, and CUBE help you build subtotal reports without stitching together many UNION ALL queries.
Read guideDuckDB SQL UNNEST Explained: Lists, Structs, Recursive Flattening, and max_depth
UNNEST is the bridge from nested data to queryable rows and columns, especially when working with JSON-like lists and structs.
Read guideDuckDB Array Lambda Functions: list_transform, list_filter, and list_reduce Explained
DuckDB list lambdas let you map, filter, and reduce arrays inside SQL, creating compact pipelines for nested list data.
Read guideWhat Is a Database Table? Rows, Columns, and the Mental Model Behind SQL
Before SQL feels natural, you need one simple mental model: tables are structured collections of records with predictable columns.
Read guideSQL Data Types Explained: Text, Numbers, Dates, and Better Questions
Data types are the reason SQL knows the difference between a name, a salary, and a hire date — and that difference shapes every query you write.
Read guideSQL NULL Explained: How Missing Values Work and Why They Matter
NULL is SQL's way of saying a value is missing or unknown — and it behaves differently from almost every other value beginners expect.
Read guide