{
  "versions": {
    "postgres": "18.6",
    "pglite": "0.5.16",
    "sqlite": "3.54.1"
  },
  "exercises": [
    {
      "id": "sb-1",
      "unit": "First queries",
      "lesson": "select-basics",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "booleans"
    },
    {
      "id": "sb-2",
      "unit": "First queries",
      "lesson": "select-basics",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "sb-4",
      "unit": "First queries",
      "lesson": "select-basics",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "wh-1",
      "unit": "First queries",
      "lesson": "where",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "booleans"
    },
    {
      "id": "wh-2",
      "unit": "First queries",
      "lesson": "where",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "wh-5",
      "unit": "First queries",
      "lesson": "where",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "wh-4",
      "unit": "First queries",
      "lesson": "where",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ol-6",
      "unit": "First queries",
      "lesson": "order-limit",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "ol-1",
      "unit": "First queries",
      "lesson": "order-limit",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "ol-3",
      "unit": "First queries",
      "lesson": "order-limit",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ol-2",
      "unit": "First queries",
      "lesson": "order-limit",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "ol-5",
      "unit": "First queries",
      "lesson": "order-limit",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ol-7",
      "unit": "First queries",
      "lesson": "ties-and-pages",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ol-8",
      "unit": "First queries",
      "lesson": "ties-and-pages",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ao-1",
      "unit": "Sharper filters",
      "lesson": "and-or-in",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ao-6",
      "unit": "Sharper filters",
      "lesson": "and-or-in",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ao-4",
      "unit": "Sharper filters",
      "lesson": "and-or-in",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ao-2",
      "unit": "Sharper filters",
      "lesson": "and-or-in",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ao-5",
      "unit": "Sharper filters",
      "lesson": "and-or-in",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ln-1",
      "unit": "Sharper filters",
      "lesson": "like-null",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ln-4",
      "unit": "Sharper filters",
      "lesson": "like-null",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ln-6",
      "unit": "Sharper filters",
      "lesson": "like-null",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ln-2",
      "unit": "Sharper filters",
      "lesson": "like-null",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ln-5",
      "unit": "Sharper filters",
      "lesson": "like-null",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "sr-6",
      "unit": "Sharper filters",
      "lesson": "shape-results",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "sr-2",
      "unit": "Sharper filters",
      "lesson": "shape-results",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "sr-4",
      "unit": "Sharper filters",
      "lesson": "shape-results",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "sr-1",
      "unit": "Sharper filters",
      "lesson": "shape-results",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "sr-5",
      "unit": "Sharper filters",
      "lesson": "shape-results",
      "free": true,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ag-1",
      "unit": "Counting things",
      "lesson": "aggregates",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ag-6",
      "unit": "Counting things",
      "lesson": "aggregates",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ag-2",
      "unit": "Counting things",
      "lesson": "aggregates",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ag-7",
      "unit": "Counting things",
      "lesson": "aggregates",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ag-3",
      "unit": "Counting things",
      "lesson": "aggregates",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ag-8",
      "unit": "Counting things",
      "lesson": "aggregates",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ag-9",
      "unit": "Counting things",
      "lesson": "aggregates",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ag-5",
      "unit": "Counting things",
      "lesson": "aggregates",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "gb-1",
      "unit": "Counting things",
      "lesson": "group-by",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "gb-2",
      "unit": "Counting things",
      "lesson": "group-by",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "gb-3",
      "unit": "Counting things",
      "lesson": "group-by",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "gb-5",
      "unit": "Counting things",
      "lesson": "group-by",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "gb-6",
      "unit": "Counting things",
      "lesson": "group-by",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "gb-7",
      "unit": "Counting things",
      "lesson": "group-by",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "hv-1",
      "unit": "Counting things",
      "lesson": "having",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "hv-2",
      "unit": "Counting things",
      "lesson": "having",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "hv-4",
      "unit": "Counting things",
      "lesson": "having",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "ij-1",
      "unit": "Joining tables",
      "lesson": "inner-join",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ij-5",
      "unit": "Joining tables",
      "lesson": "inner-join",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ij-2",
      "unit": "Joining tables",
      "lesson": "inner-join",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ij-6",
      "unit": "Joining tables",
      "lesson": "inner-join",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ij-7",
      "unit": "Joining tables",
      "lesson": "inner-join",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "ij-4",
      "unit": "Joining tables",
      "lesson": "inner-join",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ij-8",
      "unit": "Joining tables",
      "lesson": "inner-join",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "lj-1",
      "unit": "Joining tables",
      "lesson": "left-join",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "lj-5",
      "unit": "Joining tables",
      "lesson": "left-join",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "lj-2",
      "unit": "Joining tables",
      "lesson": "left-join",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "lj-6",
      "unit": "Joining tables",
      "lesson": "left-join",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "lj-7",
      "unit": "Joining tables",
      "lesson": "left-join",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "lj-4",
      "unit": "Joining tables",
      "lesson": "left-join",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "lj-8",
      "unit": "Joining tables",
      "lesson": "left-join",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "ja-1",
      "unit": "Joining tables",
      "lesson": "join-aggregate",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "ja-5",
      "unit": "Joining tables",
      "lesson": "join-aggregate",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "ja-6",
      "unit": "Joining tables",
      "lesson": "join-aggregate",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ja-7",
      "unit": "Joining tables",
      "lesson": "join-aggregate",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "ja-2",
      "unit": "Joining tables",
      "lesson": "join-aggregate",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ja-8",
      "unit": "Joining tables",
      "lesson": "join-aggregate",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ja-4",
      "unit": "Joining tables",
      "lesson": "join-aggregate",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ja-9",
      "unit": "Joining tables",
      "lesson": "join-aggregate",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "un-1",
      "unit": "Combining results",
      "lesson": "set-operations",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "un-6",
      "unit": "Combining results",
      "lesson": "set-operations",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "un-3",
      "unit": "Combining results",
      "lesson": "set-operations",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "un-4",
      "unit": "Combining results",
      "lesson": "set-operations",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "un-8",
      "unit": "Combining results",
      "lesson": "set-operations",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "un-7",
      "unit": "Combining results",
      "lesson": "set-operations",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "un-5",
      "unit": "Combining results",
      "lesson": "set-operations",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "sj-1",
      "unit": "Combining results",
      "lesson": "self-joins",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "sj-2",
      "unit": "Combining results",
      "lesson": "self-joins",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "sj-3",
      "unit": "Combining results",
      "lesson": "self-joins",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "sj-6",
      "unit": "Combining results",
      "lesson": "self-joins",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "sj-5",
      "unit": "Combining results",
      "lesson": "self-joins",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "cj-1",
      "unit": "Combining results",
      "lesson": "cross-joins",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "cj-2",
      "unit": "Combining results",
      "lesson": "cross-joins",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "cj-4",
      "unit": "Combining results",
      "lesson": "cross-joins",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "tx-1",
      "unit": "Text and dates",
      "lesson": "text-functions",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "tx-6",
      "unit": "Text and dates",
      "lesson": "text-functions",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "tx-3",
      "unit": "Text and dates",
      "lesson": "text-functions",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "tx-2",
      "unit": "Text and dates",
      "lesson": "text-functions",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "tx-8",
      "unit": "Text and dates",
      "lesson": "text-functions",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "tx-9",
      "unit": "Text and dates",
      "lesson": "text-functions",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "tx-10",
      "unit": "Text and dates",
      "lesson": "text-functions",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "tx-11",
      "unit": "Text and dates",
      "lesson": "text-functions",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "tx-5",
      "unit": "Text and dates",
      "lesson": "text-functions",
      "free": false,
      "differentSql": true,
      "category": "text",
      "representation": "none",
      "postgres": "SELECT split_part(name, ' ', 1) AS first_name FROM customers;",
      "sqlite": "SELECT substr(name, 1, instr(name, ' ') - 1) AS first_name FROM customers;"
    },
    {
      "id": "dt-1",
      "unit": "Text and dates",
      "lesson": "dates",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "dt-5",
      "unit": "Text and dates",
      "lesson": "dates",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "dt-2",
      "unit": "Text and dates",
      "lesson": "dates",
      "free": false,
      "differentSql": true,
      "category": "dates",
      "representation": "numbers-as-text",
      "postgres": "SELECT name, EXTRACT(YEAR FROM arrived_on) AS arrival_year FROM pets;",
      "sqlite": "SELECT name, strftime('%Y', arrived_on) AS arrival_year FROM pets;"
    },
    {
      "id": "dt-6",
      "unit": "Text and dates",
      "lesson": "dates",
      "free": false,
      "differentSql": true,
      "category": "dates",
      "representation": "none",
      "postgres": "SELECT COUNT(*) FROM pets WHERE EXTRACT(YEAR FROM arrived_on) = 2025;",
      "sqlite": "SELECT COUNT(*) FROM pets WHERE strftime('%Y', arrived_on) = '2025';"
    },
    {
      "id": "dt-7",
      "unit": "Text and dates",
      "lesson": "dates",
      "free": false,
      "differentSql": true,
      "category": "dates",
      "representation": "none",
      "postgres": "SELECT name, to_char(arrived_on, 'YYYY-MM') AS arrival_month FROM pets;",
      "sqlite": "SELECT name, strftime('%Y-%m', arrived_on) AS arrival_month FROM pets;"
    },
    {
      "id": "dt-3",
      "unit": "Text and dates",
      "lesson": "dates",
      "free": false,
      "differentSql": true,
      "category": "dates",
      "representation": "none",
      "postgres": "SELECT to_char(arrived_on, 'YYYY-MM') AS month, COUNT(*) AS arrivals FROM pets GROUP BY month ORDER BY month;",
      "sqlite": "SELECT strftime('%Y-%m', arrived_on) AS month, COUNT(*) AS arrivals FROM pets GROUP BY month ORDER BY month;"
    },
    {
      "id": "dm-1",
      "unit": "Text and dates",
      "lesson": "date-math",
      "free": false,
      "differentSql": true,
      "category": "dates",
      "representation": "none",
      "postgres": "SELECT name, arrived_on + 14 AS checkup_on FROM pets;",
      "sqlite": "SELECT name, date(arrived_on, '+14 days') AS checkup_on FROM pets;"
    },
    {
      "id": "dm-6",
      "unit": "Text and dates",
      "lesson": "date-math",
      "free": false,
      "differentSql": true,
      "category": "dates",
      "representation": "none",
      "postgres": "SELECT name, DATE '2026-11-17' - arrived_on AS days_here FROM pets;",
      "sqlite": "SELECT name, julianday('2026-11-17') - julianday(arrived_on) AS days_here FROM pets;"
    },
    {
      "id": "dm-2",
      "unit": "Text and dates",
      "lesson": "date-math",
      "free": false,
      "differentSql": true,
      "category": "dates",
      "representation": "none",
      "postgres": "SELECT name, DATE '2026-11-17' - arrived_on AS days_waiting FROM pets WHERE adopted = false ORDER BY days_waiting DESC;",
      "sqlite": "SELECT name, julianday('2026-11-17') - julianday(arrived_on) AS days_waiting FROM pets WHERE adopted = false ORDER BY days_waiting DESC;"
    },
    {
      "id": "dm-7",
      "unit": "Text and dates",
      "lesson": "date-math",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "dm-8",
      "unit": "Text and dates",
      "lesson": "date-math",
      "free": false,
      "differentSql": true,
      "category": "dates",
      "representation": "none",
      "postgres": "SELECT name, ABS(DATE '2026-01-01' - arrived_on) AS days_apart FROM pets;",
      "sqlite": "SELECT name, ABS(julianday('2026-01-01') - julianday(arrived_on)) AS days_apart FROM pets;"
    },
    {
      "id": "dm-9",
      "unit": "Text and dates",
      "lesson": "date-math",
      "free": false,
      "differentSql": true,
      "category": "dates",
      "representation": "none",
      "postgres": "SELECT id, ordered_on FROM orders WHERE EXTRACT(DOW FROM ordered_on) = 0;",
      "sqlite": "SELECT id, ordered_on FROM orders WHERE strftime('%w', ordered_on) = '0';"
    },
    {
      "id": "dm-3",
      "unit": "Text and dates",
      "lesson": "date-math",
      "free": false,
      "differentSql": true,
      "category": "dates",
      "representation": "none",
      "postgres": "SELECT id, ordered_on FROM orders WHERE EXTRACT(DOW FROM ordered_on) IN (0, 6);",
      "sqlite": "SELECT id, ordered_on FROM orders WHERE strftime('%w', ordered_on) IN ('0', '6');"
    },
    {
      "id": "mv-1",
      "unit": "Cleaning messy data",
      "lesson": "missing-values",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "mv-5",
      "unit": "Cleaning messy data",
      "lesson": "missing-values",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "mv-2",
      "unit": "Cleaning messy data",
      "lesson": "missing-values",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "mv-4",
      "unit": "Cleaning messy data",
      "lesson": "missing-values",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "nz-6",
      "unit": "Cleaning messy data",
      "lesson": "normalizing",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "nz-2",
      "unit": "Cleaning messy data",
      "lesson": "normalizing",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "nz-1",
      "unit": "Cleaning messy data",
      "lesson": "normalizing",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "nz-7",
      "unit": "Cleaning messy data",
      "lesson": "normalizing",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "nz-3",
      "unit": "Cleaning messy data",
      "lesson": "normalizing",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "nz-5",
      "unit": "Cleaning messy data",
      "lesson": "normalizing",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "dp-1",
      "unit": "Cleaning messy data",
      "lesson": "duplicates",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "dp-2",
      "unit": "Cleaning messy data",
      "lesson": "duplicates",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "dp-4",
      "unit": "Cleaning messy data",
      "lesson": "duplicates",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "in-5",
      "unit": "Changing data",
      "lesson": "insert",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "booleans"
    },
    {
      "id": "in-1",
      "unit": "Changing data",
      "lesson": "insert",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "booleans"
    },
    {
      "id": "in-2",
      "unit": "Changing data",
      "lesson": "insert",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "booleans"
    },
    {
      "id": "in-4",
      "unit": "Changing data",
      "lesson": "insert",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ud-1",
      "unit": "Changing data",
      "lesson": "update-delete",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "booleans"
    },
    {
      "id": "ud-2",
      "unit": "Changing data",
      "lesson": "update-delete",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ud-5",
      "unit": "Changing data",
      "lesson": "update-delete",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ud-4",
      "unit": "Changing data",
      "lesson": "update-delete",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "up-2",
      "unit": "Changing data",
      "lesson": "upsert",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "up-1",
      "unit": "Changing data",
      "lesson": "upsert",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ddl-5",
      "unit": "Designing tables",
      "lesson": "create-table",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ddl-6",
      "unit": "Designing tables",
      "lesson": "create-table",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ddl-7",
      "unit": "Designing tables",
      "lesson": "create-table",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ddl-1",
      "unit": "Designing tables",
      "lesson": "create-table",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ddl-8",
      "unit": "Designing tables",
      "lesson": "create-table",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "booleans"
    },
    {
      "id": "ddl-2",
      "unit": "Designing tables",
      "lesson": "create-table",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ddl-4",
      "unit": "Designing tables",
      "lesson": "create-table",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ddl-9",
      "unit": "Designing tables",
      "lesson": "create-table",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "booleans"
    },
    {
      "id": "av-5",
      "unit": "Designing tables",
      "lesson": "alter-views",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "av-1",
      "unit": "Designing tables",
      "lesson": "alter-views",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "booleans"
    },
    {
      "id": "av-2",
      "unit": "Designing tables",
      "lesson": "alter-views",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "av-4",
      "unit": "Designing tables",
      "lesson": "alter-views",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "kr-4",
      "unit": "Designing tables",
      "lesson": "keys-relationships",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "kr-1",
      "unit": "Designing tables",
      "lesson": "keys-relationships",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "sq-1",
      "unit": "Queries inside queries",
      "lesson": "subqueries",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "sq-4",
      "unit": "Queries inside queries",
      "lesson": "subqueries",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "sq-2",
      "unit": "Queries inside queries",
      "lesson": "subqueries",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "sq-5",
      "unit": "Queries inside queries",
      "lesson": "subqueries",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "sq-6",
      "unit": "Queries inside queries",
      "lesson": "subqueries",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "sq-7",
      "unit": "Queries inside queries",
      "lesson": "subqueries",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "sq-8",
      "unit": "Queries inside queries",
      "lesson": "subqueries",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "sq-9",
      "unit": "Queries inside queries",
      "lesson": "subqueries",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "sq-10",
      "unit": "Queries inside queries",
      "lesson": "subqueries",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ct-7",
      "unit": "Queries inside queries",
      "lesson": "ctes",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ct-4",
      "unit": "Queries inside queries",
      "lesson": "ctes",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "ct-1",
      "unit": "Queries inside queries",
      "lesson": "ctes",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ct-5",
      "unit": "Queries inside queries",
      "lesson": "ctes",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ct-2",
      "unit": "Queries inside queries",
      "lesson": "ctes",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ct-6",
      "unit": "Queries inside queries",
      "lesson": "ctes",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ct-8",
      "unit": "Queries inside queries",
      "lesson": "ctes",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "rk-5",
      "unit": "Window functions",
      "lesson": "ranking",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "rk-6",
      "unit": "Window functions",
      "lesson": "ranking",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "rk-1",
      "unit": "Window functions",
      "lesson": "ranking",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "rk-9",
      "unit": "Window functions",
      "lesson": "ranking",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "rk-2",
      "unit": "Window functions",
      "lesson": "ranking",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "rk-7",
      "unit": "Window functions",
      "lesson": "ranking",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "rk-4",
      "unit": "Window functions",
      "lesson": "ranking",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "rk-8",
      "unit": "Window functions",
      "lesson": "ranking",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "rt-4",
      "unit": "Window functions",
      "lesson": "running-totals",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "rt-1",
      "unit": "Window functions",
      "lesson": "running-totals",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "rt-5",
      "unit": "Window functions",
      "lesson": "running-totals",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "rt-6",
      "unit": "Window functions",
      "lesson": "running-totals",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "rt-2",
      "unit": "Window functions",
      "lesson": "running-totals",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "rc-4",
      "unit": "Recursive queries",
      "lesson": "recursive-basics",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "rc-1",
      "unit": "Recursive queries",
      "lesson": "recursive-basics",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "rc-5",
      "unit": "Recursive queries",
      "lesson": "recursive-basics",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "rc-6",
      "unit": "Recursive queries",
      "lesson": "recursive-basics",
      "free": false,
      "differentSql": true,
      "category": "dates",
      "representation": "none",
      "postgres": "WITH RECURSIVE days(day) AS (SELECT DATE '2026-03-01' UNION ALL SELECT day + 1 FROM days WHERE day < DATE '2026-03-07') SELECT day FROM days;",
      "sqlite": "WITH RECURSIVE days(day) AS (SELECT '2026-03-01' UNION ALL SELECT date(day, '+1 day') FROM days WHERE day < '2026-03-07') SELECT day FROM days;"
    },
    {
      "id": "rc-2",
      "unit": "Recursive queries",
      "lesson": "recursive-basics",
      "free": false,
      "differentSql": true,
      "category": "dates",
      "representation": "none",
      "postgres": "WITH RECURSIVE days(day) AS (SELECT DATE '2026-03-01' UNION ALL SELECT day + 1 FROM days WHERE day < DATE '2026-03-31') SELECT d.day, COUNT(o.id) AS orders FROM days d LEFT JOIN orders o ON o.ordered_on = d.day GROUP BY d.day ORDER BY d.day;",
      "sqlite": "WITH RECURSIVE days(day) AS (SELECT '2026-03-01' UNION ALL SELECT date(day, '+1 day') FROM days WHERE day < '2026-03-31') SELECT d.day, COUNT(o.id) AS orders FROM days d LEFT JOIN orders o ON o.ordered_on = d.day GROUP BY d.day ORDER BY d.day;"
    },
    {
      "id": "hi-5",
      "unit": "Recursive queries",
      "lesson": "hierarchies",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "hi-1",
      "unit": "Recursive queries",
      "lesson": "hierarchies",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "hi-2",
      "unit": "Recursive queries",
      "lesson": "hierarchies",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "hi-6",
      "unit": "Recursive queries",
      "lesson": "hierarchies",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "hi-7",
      "unit": "Recursive queries",
      "lesson": "hierarchies",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "hi-3",
      "unit": "Recursive queries",
      "lesson": "hierarchies",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "wf-5",
      "unit": "Advanced windows",
      "lesson": "window-frames",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "decimals"
    },
    {
      "id": "wf-1",
      "unit": "Advanced windows",
      "lesson": "window-frames",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "wf-6",
      "unit": "Advanced windows",
      "lesson": "window-frames",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "wf-7",
      "unit": "Advanced windows",
      "lesson": "window-frames",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "decimals"
    },
    {
      "id": "wf-8",
      "unit": "Advanced windows",
      "lesson": "window-frames",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "wf-2",
      "unit": "Advanced windows",
      "lesson": "window-frames",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "wf-9",
      "unit": "Advanced windows",
      "lesson": "window-frames",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "wf-3",
      "unit": "Advanced windows",
      "lesson": "window-frames",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "wf-10",
      "unit": "Advanced windows",
      "lesson": "window-frames",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "bs-1",
      "unit": "Advanced windows",
      "lesson": "buckets-subtotals",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "bs-5",
      "unit": "Advanced windows",
      "lesson": "buckets-subtotals",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "bs-2",
      "unit": "Advanced windows",
      "lesson": "buckets-subtotals",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "bs-6",
      "unit": "Advanced windows",
      "lesson": "buckets-subtotals",
      "free": false,
      "differentSql": true,
      "category": "rollup",
      "representation": "order",
      "postgres": "SELECT status, COUNT(*) AS orders FROM orders GROUP BY ROLLUP(status);",
      "sqlite": "SELECT status, COUNT(*) AS orders FROM orders GROUP BY status UNION ALL SELECT NULL, COUNT(*) FROM orders;"
    },
    {
      "id": "bs-7",
      "unit": "Advanced windows",
      "lesson": "buckets-subtotals",
      "free": false,
      "differentSql": true,
      "category": "rollup",
      "representation": "several",
      "postgres": "SELECT category, vegetarian, COUNT(*) AS items FROM menu_items GROUP BY ROLLUP(category, vegetarian);",
      "sqlite": "SELECT category, vegetarian, COUNT(*) AS items FROM menu_items GROUP BY category, vegetarian UNION ALL SELECT category, NULL, COUNT(*) FROM menu_items GROUP BY category UNION ALL SELECT NULL, NULL, COUNT(*) FROM menu_items;"
    },
    {
      "id": "bs-3",
      "unit": "Advanced windows",
      "lesson": "buckets-subtotals",
      "free": false,
      "differentSql": true,
      "category": "rollup",
      "representation": "order",
      "postgres": "SELECT m.category, m.name AS item, SUM(oi.quantity * m.price) AS revenue FROM order_items oi JOIN menu_items m ON m.id = oi.item_id GROUP BY ROLLUP(m.category, m.name);",
      "sqlite": "WITH r AS (SELECT m.category, m.name AS item, oi.quantity * m.price AS amount FROM order_items oi JOIN menu_items m ON m.id = oi.item_id) SELECT category, item, SUM(amount) AS revenue FROM r GROUP BY category, item UNION ALL SELECT category, NULL, SUM(amount) FROM r GROUP BY category UNION ALL SELECT NULL, NULL, SUM(amount) FROM r;"
    },
    {
      "id": "ix-1",
      "unit": "Making queries fast",
      "lesson": "indexes",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ix-2",
      "unit": "Making queries fast",
      "lesson": "indexes",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "ix-5",
      "unit": "Making queries fast",
      "lesson": "indexes",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "sg-5",
      "unit": "Making queries fast",
      "lesson": "sargable",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "sg-1",
      "unit": "Making queries fast",
      "lesson": "sargable",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "sg-4",
      "unit": "Making queries fast",
      "lesson": "sargable",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "sg-2",
      "unit": "Making queries fast",
      "lesson": "sargable",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "am-1",
      "unit": "Analytics patterns",
      "lesson": "activity-metrics",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "am-5",
      "unit": "Analytics patterns",
      "lesson": "activity-metrics",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "am-6",
      "unit": "Analytics patterns",
      "lesson": "activity-metrics",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "am-7",
      "unit": "Analytics patterns",
      "lesson": "activity-metrics",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "am-9",
      "unit": "Analytics patterns",
      "lesson": "activity-metrics",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "am-8",
      "unit": "Analytics patterns",
      "lesson": "activity-metrics",
      "free": false,
      "differentSql": true,
      "category": "dates",
      "representation": "none",
      "postgres": "WITH m AS (SELECT to_char(played_on, 'YYYY-MM') AS month, COUNT(*) AS plays FROM plays GROUP BY month) SELECT month, plays, LAG(plays) OVER (ORDER BY month) AS previous_plays FROM m ORDER BY month;",
      "sqlite": "WITH m AS (SELECT strftime('%Y-%m', played_on) AS month, COUNT(*) AS plays FROM plays GROUP BY month) SELECT month, plays, LAG(plays) OVER (ORDER BY month) AS previous_plays FROM m ORDER BY month;"
    },
    {
      "id": "am-2",
      "unit": "Analytics patterns",
      "lesson": "activity-metrics",
      "free": false,
      "differentSql": true,
      "category": "dates",
      "representation": "none",
      "postgres": "WITH m AS (SELECT to_char(signed_up_on, 'YYYY-MM') AS month, COUNT(*) AS signups FROM users GROUP BY month) SELECT month, signups, ROUND(100.0 * (signups - LAG(signups) OVER (ORDER BY month)) / LAG(signups) OVER (ORDER BY month), 1) AS growth_pct FROM m ORDER BY month;",
      "sqlite": "WITH m AS (SELECT strftime('%Y-%m', signed_up_on) AS month, COUNT(*) AS signups FROM users GROUP BY month) SELECT month, signups, ROUND(100.0 * (signups - LAG(signups) OVER (ORDER BY month)) / LAG(signups) OVER (ORDER BY month), 1) AS growth_pct FROM m ORDER BY month;"
    },
    {
      "id": "am-3",
      "unit": "Analytics patterns",
      "lesson": "activity-metrics",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "fc-5",
      "unit": "Analytics patterns",
      "lesson": "funnels-conversion",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "fc-6",
      "unit": "Analytics patterns",
      "lesson": "funnels-conversion",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "fc-1",
      "unit": "Analytics patterns",
      "lesson": "funnels-conversion",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "fc-7",
      "unit": "Analytics patterns",
      "lesson": "funnels-conversion",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "fc-8",
      "unit": "Analytics patterns",
      "lesson": "funnels-conversion",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "fc-9",
      "unit": "Analytics patterns",
      "lesson": "funnels-conversion",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "fc-2",
      "unit": "Analytics patterns",
      "lesson": "funnels-conversion",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "fc-10",
      "unit": "Analytics patterns",
      "lesson": "funnels-conversion",
      "free": false,
      "differentSql": true,
      "category": "dates",
      "representation": "none",
      "postgres": "SELECT s.user_id, s.started_on - u.signed_up_on AS days_to_subscribe FROM users u JOIN subscriptions s ON s.user_id = u.id;",
      "sqlite": "SELECT s.user_id, julianday(s.started_on) - julianday(u.signed_up_on) AS days_to_subscribe FROM users u JOIN subscriptions s ON s.user_id = u.id;"
    },
    {
      "id": "fc-3",
      "unit": "Analytics patterns",
      "lesson": "funnels-conversion",
      "free": false,
      "differentSql": true,
      "category": "dates",
      "representation": "order",
      "postgres": "WITH f AS (SELECT u.source, MIN(p.played_on) - u.signed_up_on AS days FROM users u JOIN plays p ON p.user_id = u.id GROUP BY u.id, u.source, u.signed_up_on) SELECT source, AVG(days) AS avg_days FROM f GROUP BY source;",
      "sqlite": "WITH f AS (SELECT u.source, julianday(MIN(p.played_on)) - julianday(u.signed_up_on) AS days FROM users u JOIN plays p ON p.user_id = u.id GROUP BY u.id, u.source, u.signed_up_on) SELECT source, AVG(days) AS avg_days FROM f GROUP BY source;"
    },
    {
      "id": "cr-5",
      "unit": "Analytics patterns",
      "lesson": "cohorts-retention",
      "free": false,
      "differentSql": true,
      "category": "dates",
      "representation": "none",
      "postgres": "SELECT p.played_on, p.played_on - u.signed_up_on AS days_since_signup FROM users u JOIN plays p ON p.user_id = u.id WHERE u.id = 4 ORDER BY p.played_on;",
      "sqlite": "SELECT p.played_on, julianday(p.played_on) - julianday(u.signed_up_on) AS days_since_signup FROM users u JOIN plays p ON p.user_id = u.id WHERE u.id = 4 ORDER BY p.played_on;"
    },
    {
      "id": "cr-6",
      "unit": "Analytics patterns",
      "lesson": "cohorts-retention",
      "free": false,
      "differentSql": true,
      "category": "dates",
      "representation": "none",
      "postgres": "SELECT p.played_on, (p.played_on - u.signed_up_on) / 7 AS week FROM users u JOIN plays p ON p.user_id = u.id WHERE u.id = 6 ORDER BY p.played_on;",
      "sqlite": "SELECT p.played_on, CAST((julianday(p.played_on) - julianday(u.signed_up_on)) / 7 AS INTEGER) AS week FROM users u JOIN plays p ON p.user_id = u.id WHERE u.id = 6 ORDER BY p.played_on;"
    },
    {
      "id": "cr-1",
      "unit": "Analytics patterns",
      "lesson": "cohorts-retention",
      "free": false,
      "differentSql": true,
      "category": "dates",
      "representation": "none",
      "postgres": "SELECT (p.played_on - u.signed_up_on) / 7 AS week, COUNT(DISTINCT u.id) AS active_users FROM users u JOIN plays p ON p.user_id = u.id WHERE u.signed_up_on < '2026-02-01' AND (p.played_on - u.signed_up_on) / 7 <= 4 GROUP BY week ORDER BY week;",
      "sqlite": "SELECT CAST((julianday(p.played_on) - julianday(u.signed_up_on)) / 7 AS INTEGER) AS week, COUNT(DISTINCT u.id) AS active_users FROM users u JOIN plays p ON p.user_id = u.id WHERE u.signed_up_on < '2026-02-01' AND CAST((julianday(p.played_on) - julianday(u.signed_up_on)) / 7 AS INTEGER) <= 4 GROUP BY week ORDER BY week;"
    },
    {
      "id": "cr-2",
      "unit": "Analytics patterns",
      "lesson": "cohorts-retention",
      "free": false,
      "differentSql": true,
      "category": "dates",
      "representation": "none",
      "postgres": "SELECT ROUND(100.0 * COUNT(DISTINCT p.user_id) / (SELECT COUNT(*) FROM users WHERE signed_up_on < '2026-02-01'), 1) FROM users u JOIN plays p ON p.user_id = u.id WHERE u.signed_up_on < '2026-02-01' AND p.played_on - u.signed_up_on BETWEEN 7 AND 13;",
      "sqlite": "SELECT ROUND(100.0 * COUNT(DISTINCT p.user_id) / (SELECT COUNT(*) FROM users WHERE signed_up_on < '2026-02-01'), 1) FROM users u JOIN plays p ON p.user_id = u.id WHERE u.signed_up_on < '2026-02-01' AND julianday(p.played_on) - julianday(u.signed_up_on) BETWEEN 7 AND 13;"
    },
    {
      "id": "cr-3",
      "unit": "Analytics patterns",
      "lesson": "cohorts-retention",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "cr-7",
      "unit": "Analytics patterns",
      "lesson": "cohorts-retention",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "cr-8",
      "unit": "Analytics patterns",
      "lesson": "cohorts-retention",
      "free": false,
      "differentSql": true,
      "category": "dates",
      "representation": "none",
      "postgres": "WITH cohort AS (SELECT id, signed_up_on FROM users WHERE signed_up_on < '2026-02-01'), activity AS (SELECT c.id, (p.played_on - c.signed_up_on) / 7 AS week FROM cohort c JOIN plays p ON p.user_id = c.id) SELECT week, COUNT(DISTINCT id) AS active_users, ROUND(100.0 * COUNT(DISTINCT id) / (SELECT COUNT(*) FROM cohort), 1) AS retention_pct FROM activity WHERE week <= 4 GROUP BY week ORDER BY week;",
      "sqlite": "WITH cohort AS (SELECT id, signed_up_on FROM users WHERE signed_up_on < '2026-02-01'), activity AS (SELECT c.id, CAST((julianday(p.played_on) - julianday(c.signed_up_on)) / 7 AS INTEGER) AS week FROM cohort c JOIN plays p ON p.user_id = c.id) SELECT week, COUNT(DISTINCT id) AS active_users, ROUND(100.0 * COUNT(DISTINCT id) / (SELECT COUNT(*) FROM cohort), 1) AS retention_pct FROM activity WHERE week <= 4 GROUP BY week ORDER BY week;"
    },
    {
      "id": "iv-1",
      "unit": "Interview pack",
      "lesson": "interview-warmup",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "iv-2",
      "unit": "Interview pack",
      "lesson": "interview-warmup",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "iv-3",
      "unit": "Interview pack",
      "lesson": "interview-warmup",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "iv-4",
      "unit": "Interview pack",
      "lesson": "interview-warmup",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "iv-5",
      "unit": "Interview pack",
      "lesson": "interview-core",
      "free": false,
      "differentSql": true,
      "category": "dates",
      "representation": "order",
      "postgres": "SELECT c.name, MIN(o.ordered_on) AS first_order, MIN(o.ordered_on) - c.joined_on AS days_to_first_order FROM customers c JOIN orders o ON o.customer_id = c.id GROUP BY c.id, c.name, c.joined_on;",
      "sqlite": "SELECT c.name, MIN(o.ordered_on) AS first_order, CAST(julianday(MIN(o.ordered_on)) - julianday(c.joined_on) AS INTEGER) AS days_to_first_order FROM customers c JOIN orders o ON o.customer_id = c.id GROUP BY c.id, c.name, c.joined_on;"
    },
    {
      "id": "iv-6",
      "unit": "Interview pack",
      "lesson": "interview-core",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "iv-7",
      "unit": "Interview pack",
      "lesson": "interview-core",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "iv-8",
      "unit": "Interview pack",
      "lesson": "interview-core",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "order"
    },
    {
      "id": "iv-9",
      "unit": "Interview pack",
      "lesson": "interview-hard",
      "free": false,
      "differentSql": true,
      "category": "dates",
      "representation": "none",
      "postgres": "WITH d AS (SELECT DISTINCT ordered_on AS day FROM orders), g AS (SELECT day, day - CAST(ROW_NUMBER() OVER (ORDER BY day) AS INTEGER) AS grp FROM d) SELECT MIN(day) AS streak_start, MAX(day) AS streak_end, COUNT(*) AS days FROM g GROUP BY grp ORDER BY streak_start;",
      "sqlite": "WITH d AS (SELECT DISTINCT ordered_on AS day FROM orders), g AS (SELECT day, date(day, '-' || ROW_NUMBER() OVER (ORDER BY day) || ' days') AS grp FROM d) SELECT MIN(day) AS streak_start, MAX(day) AS streak_end, COUNT(*) AS days FROM g GROUP BY grp ORDER BY streak_start;"
    },
    {
      "id": "iv-10",
      "unit": "Interview pack",
      "lesson": "interview-hard",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "iv-11",
      "unit": "Interview pack",
      "lesson": "interview-hard",
      "free": false,
      "differentSql": false,
      "category": null,
      "representation": "none"
    },
    {
      "id": "iv-12",
      "unit": "Interview pack",
      "lesson": "interview-hard",
      "free": false,
      "differentSql": true,
      "category": "dates",
      "representation": "order",
      "postgres": "SELECT DISTINCT a.name FROM pets a JOIN pets b ON a.species = b.species AND a.id <> b.id AND ABS(a.arrived_on - b.arrived_on) <= 7;",
      "sqlite": "SELECT DISTINCT a.name FROM pets a JOIN pets b ON a.species = b.species AND a.id <> b.id AND ABS(julianday(a.arrived_on) - julianday(b.arrived_on)) <= 7;"
    }
  ],
  "learnCards": {
    "total": 146,
    "perDialect": 16
  },
  "guideExamples": {
    "total": 102,
    "perDialect": 13
  },
  "functions": [
    {
      "fn": "strftime",
      "label": "Year",
      "both": true,
      "same": true
    },
    {
      "fn": "strftime",
      "label": "Month, zero-padded",
      "both": true,
      "same": true
    },
    {
      "fn": "strftime",
      "label": "Day of week (0 = Sunday)",
      "both": true,
      "same": false
    },
    {
      "fn": "strftime",
      "label": "Day of the year",
      "both": true,
      "same": true
    },
    {
      "fn": "strftime",
      "label": "Week number (they count weeks differently)",
      "both": true,
      "same": false
    },
    {
      "fn": "strftime",
      "label": "Hours and minutes of a timestamp",
      "both": true,
      "same": true
    },
    {
      "fn": "strftime",
      "label": "Seconds since 1970",
      "both": true,
      "same": false
    },
    {
      "fn": "strftime",
      "label": "An impossible date",
      "both": true,
      "same": false
    },
    {
      "fn": "strftime",
      "label": "NULL",
      "both": true,
      "same": true
    },
    {
      "fn": "date",
      "label": "Plus 7 days",
      "both": true,
      "same": true
    },
    {
      "fn": "date",
      "label": "Plus 1 month from 31 January",
      "both": true,
      "same": false
    },
    {
      "fn": "date",
      "label": "Start of month",
      "both": true,
      "same": true
    },
    {
      "fn": "date",
      "label": "Last day of February 2024",
      "both": true,
      "same": true
    },
    {
      "fn": "date",
      "label": "Next Monday on or after",
      "both": false,
      "same": false
    },
    {
      "fn": "date",
      "label": "30 February",
      "both": true,
      "same": false
    },
    {
      "fn": "date",
      "label": "Text that isn't a date",
      "both": true,
      "same": false
    },
    {
      "fn": "date",
      "label": "A timestamp loses its time",
      "both": true,
      "same": true
    },
    {
      "fn": "date",
      "label": "SQLite's modifiers in PostgreSQL",
      "both": false,
      "same": false
    },
    {
      "fn": "julianday",
      "label": "A date",
      "both": true,
      "same": false
    },
    {
      "fn": "julianday",
      "label": "Days between two dates",
      "both": true,
      "same": true
    },
    {
      "fn": "julianday",
      "label": "Hours between two timestamps",
      "both": true,
      "same": false
    },
    {
      "fn": "julianday",
      "label": "Across a leap day",
      "both": true,
      "same": true
    },
    {
      "fn": "julianday",
      "label": "Text that isn't a date",
      "both": true,
      "same": false
    },
    {
      "fn": "julianday",
      "label": "NULL",
      "both": true,
      "same": true
    },
    {
      "fn": "string-agg",
      "label": "NULLs are skipped",
      "both": true,
      "same": true
    },
    {
      "fn": "string-agg",
      "label": "No rows at all",
      "both": true,
      "same": true
    },
    {
      "fn": "string-agg",
      "label": "Ordered inside the aggregate",
      "both": true,
      "same": true
    },
    {
      "fn": "string-agg",
      "label": "Numbers instead of text",
      "both": true,
      "same": false
    },
    {
      "fn": "string-agg",
      "label": "Numbers cast to text first",
      "both": true,
      "same": true
    },
    {
      "fn": "string-agg",
      "label": "DISTINCT with a separator",
      "both": true,
      "same": false
    },
    {
      "fn": "string-agg",
      "label": "group_concat",
      "both": true,
      "same": false
    },
    {
      "fn": "substr",
      "label": "From 1, three characters",
      "both": true,
      "same": true
    },
    {
      "fn": "substr",
      "label": "From 4 to the end",
      "both": true,
      "same": true
    },
    {
      "fn": "substr",
      "label": "Start at 0",
      "both": true,
      "same": true
    },
    {
      "fn": "substr",
      "label": "Negative start",
      "both": true,
      "same": false
    },
    {
      "fn": "substr",
      "label": "Negative length",
      "both": true,
      "same": false
    },
    {
      "fn": "substr",
      "label": "Past the end",
      "both": true,
      "same": true
    },
    {
      "fn": "substr",
      "label": "Accented letters count as one",
      "both": true,
      "same": true
    },
    {
      "fn": "substr",
      "label": "NULL",
      "both": true,
      "same": true
    },
    {
      "fn": "instr",
      "label": "Found",
      "both": true,
      "same": true
    },
    {
      "fn": "instr",
      "label": "Not found",
      "both": true,
      "same": true
    },
    {
      "fn": "instr",
      "label": "The first of several",
      "both": true,
      "same": true
    },
    {
      "fn": "instr",
      "label": "Case matters",
      "both": true,
      "same": true
    },
    {
      "fn": "instr",
      "label": "The standard POSITION syntax",
      "both": true,
      "same": false
    },
    {
      "fn": "instr",
      "label": "An empty search text",
      "both": true,
      "same": true
    },
    {
      "fn": "instr",
      "label": "NULL",
      "both": true,
      "same": true
    },
    {
      "fn": "printf",
      "label": "Two decimals",
      "both": true,
      "same": true
    },
    {
      "fn": "printf",
      "label": "Zero-padded to 5 digits",
      "both": true,
      "same": true
    },
    {
      "fn": "printf",
      "label": "Thousands separator",
      "both": true,
      "same": true
    },
    {
      "fn": "printf",
      "label": "Text placeholders",
      "both": true,
      "same": true
    },
    {
      "fn": "printf",
      "label": "A NULL value",
      "both": true,
      "same": true
    },
    {
      "fn": "printf",
      "label": "%d in PostgreSQL's format()",
      "both": false,
      "same": false
    },
    {
      "fn": "printf",
      "label": "format() as SQLite's other name for printf",
      "both": false,
      "same": false
    },
    {
      "fn": "coalesce",
      "label": "First non-NULL",
      "both": true,
      "same": true
    },
    {
      "fn": "coalesce",
      "label": "Several NULLs first",
      "both": true,
      "same": true
    },
    {
      "fn": "coalesce",
      "label": "An empty string isn't NULL",
      "both": true,
      "same": true
    },
    {
      "fn": "coalesce",
      "label": "All NULL",
      "both": true,
      "same": true
    },
    {
      "fn": "coalesce",
      "label": "Mixed types",
      "both": true,
      "same": false
    },
    {
      "fn": "coalesce",
      "label": "IFNULL",
      "both": true,
      "same": false
    },
    {
      "fn": "nullif",
      "label": "Equal: NULL",
      "both": true,
      "same": true
    },
    {
      "fn": "nullif",
      "label": "Not equal: the first value",
      "both": true,
      "same": true
    },
    {
      "fn": "nullif",
      "label": "Blank text",
      "both": true,
      "same": true
    },
    {
      "fn": "nullif",
      "label": "Dividing by NULLIF(0, 0)",
      "both": true,
      "same": true
    },
    {
      "fn": "nullif",
      "label": "Case matters",
      "both": true,
      "same": true
    },
    {
      "fn": "nullif",
      "label": "NULL first",
      "both": true,
      "same": true
    },
    {
      "fn": "nullif",
      "label": "Number vs text",
      "both": true,
      "same": false
    },
    {
      "fn": "cast",
      "label": "Clean number text",
      "both": true,
      "same": true
    },
    {
      "fn": "cast",
      "label": "Number followed by junk",
      "both": true,
      "same": false
    },
    {
      "fn": "cast",
      "label": "Decimal text to integer",
      "both": true,
      "same": false
    },
    {
      "fn": "cast",
      "label": "Decimal number to integer",
      "both": true,
      "same": false
    },
    {
      "fn": "cast",
      "label": "Date text to DATE",
      "both": true,
      "same": false
    },
    {
      "fn": "cast",
      "label": "Text with no number at all",
      "both": true,
      "same": false
    },
    {
      "fn": "cast",
      "label": "1 to boolean",
      "both": true,
      "same": false
    },
    {
      "fn": "cast",
      "label": "NULL",
      "both": true,
      "same": true
    },
    {
      "fn": "round",
      "label": "Two decimals",
      "both": true,
      "same": true
    },
    {
      "fn": "round",
      "label": "A half",
      "both": true,
      "same": true
    },
    {
      "fn": "round",
      "label": "A negative half",
      "both": true,
      "same": true
    },
    {
      "fn": "round",
      "label": "A tricky decimal",
      "both": true,
      "same": false
    },
    {
      "fn": "round",
      "label": "Negative digits",
      "both": true,
      "same": false
    },
    {
      "fn": "round",
      "label": "Integer division first",
      "both": true,
      "same": true
    },
    {
      "fn": "round",
      "label": "A double precision value with digits",
      "both": true,
      "same": false
    },
    {
      "fn": "round",
      "label": "NULL",
      "both": true,
      "same": true
    },
    {
      "fn": "replace",
      "label": "Every occurrence",
      "both": true,
      "same": true
    },
    {
      "fn": "replace",
      "label": "Case matters",
      "both": true,
      "same": true
    },
    {
      "fn": "replace",
      "label": "Overlapping matches",
      "both": true,
      "same": true
    },
    {
      "fn": "replace",
      "label": "Searching for an empty string",
      "both": true,
      "same": true
    },
    {
      "fn": "replace",
      "label": "Not found",
      "both": true,
      "same": true
    },
    {
      "fn": "replace",
      "label": "NULL replacement",
      "both": true,
      "same": true
    },
    {
      "fn": "replace",
      "label": "NULL text",
      "both": true,
      "same": true
    }
  ],
  "errors": [
    {
      "slug": "must-appear-in-group-by",
      "postgres": true,
      "sqlite": false
    },
    {
      "slug": "column-does-not-exist-double-quotes",
      "postgres": true,
      "sqlite": false
    },
    {
      "slug": "column-alias-in-where",
      "postgres": true,
      "sqlite": false
    },
    {
      "slug": "relation-does-not-exist",
      "postgres": true,
      "sqlite": true
    },
    {
      "slug": "column-reference-is-ambiguous",
      "postgres": true,
      "sqlite": true
    },
    {
      "slug": "aggregate-functions-not-allowed-in-where",
      "postgres": true,
      "sqlite": true
    },
    {
      "slug": "window-functions-not-allowed-in-where",
      "postgres": true,
      "sqlite": true
    },
    {
      "slug": "syntax-error-at-or-near",
      "postgres": true,
      "sqlite": true
    },
    {
      "slug": "operator-does-not-exist-integer-text",
      "postgres": true,
      "sqlite": false
    },
    {
      "slug": "invalid-input-syntax-for-type-integer",
      "postgres": true,
      "sqlite": false
    },
    {
      "slug": "division-by-zero",
      "postgres": true,
      "sqlite": false
    },
    {
      "slug": "more-than-one-row-returned-by-subquery",
      "postgres": true,
      "sqlite": false
    },
    {
      "slug": "union-same-number-of-columns",
      "postgres": true,
      "sqlite": true
    },
    {
      "slug": "missing-from-clause-entry",
      "postgres": true,
      "sqlite": true
    },
    {
      "slug": "duplicate-key-violates-unique-constraint",
      "postgres": true,
      "sqlite": true
    },
    {
      "slug": "null-value-violates-not-null-constraint",
      "postgres": true,
      "sqlite": true
    },
    {
      "slug": "violates-foreign-key-constraint",
      "postgres": true,
      "sqlite": true
    },
    {
      "slug": "aggregate-function-calls-cannot-be-nested",
      "postgres": true,
      "sqlite": true
    },
    {
      "slug": "column-does-not-exist",
      "postgres": true,
      "sqlite": true
    },
    {
      "slug": "function-does-not-exist",
      "postgres": true,
      "sqlite": true
    },
    {
      "slug": "insert-has-more-expressions-than-target-columns",
      "postgres": true,
      "sqlite": true
    },
    {
      "slug": "datatype-mismatch",
      "postgres": true,
      "sqlite": true
    },
    {
      "slug": "syntax-error-at-end-of-input",
      "postgres": true,
      "sqlite": true
    },
    {
      "slug": "unterminated-quoted-string",
      "postgres": true,
      "sqlite": true
    },
    {
      "slug": "invalid-union-order-by-clause",
      "postgres": true,
      "sqlite": true
    },
    {
      "slug": "subquery-has-too-many-columns",
      "postgres": true,
      "sqlite": true
    },
    {
      "slug": "argument-of-where-must-be-type-boolean",
      "postgres": true,
      "sqlite": false
    },
    {
      "slug": "union-types-cannot-be-matched",
      "postgres": true,
      "sqlite": false
    },
    {
      "slug": "window-function-requires-an-over-clause",
      "postgres": true,
      "sqlite": true
    },
    {
      "slug": "invalid-input-syntax-for-type-date",
      "postgres": true,
      "sqlite": false
    },
    {
      "slug": "select-distinct-order-by-must-appear-in-select-list",
      "postgres": true,
      "sqlite": false
    },
    {
      "slug": "invalid-reference-to-from-clause-entry",
      "postgres": true,
      "sqlite": true
    },
    {
      "slug": "order-by-position-not-in-select-list",
      "postgres": true,
      "sqlite": true
    },
    {
      "slug": "column-is-of-type-integer-but-expression-is-of-type-text",
      "postgres": true,
      "sqlite": false
    },
    {
      "slug": "value-too-long-for-type-character-varying",
      "postgres": true,
      "sqlite": false
    },
    {
      "slug": "no-unique-constraint-matching-on-conflict",
      "postgres": true,
      "sqlite": true
    },
    {
      "slug": "relation-already-exists",
      "postgres": true,
      "sqlite": true
    },
    {
      "slug": "having-clause-on-a-non-aggregate-query",
      "postgres": true,
      "sqlite": true
    },
    {
      "slug": "wrong-number-of-arguments-to-function",
      "postgres": true,
      "sqlite": true
    },
    {
      "slug": "limit-syntax-not-supported",
      "postgres": true,
      "sqlite": false
    },
    {
      "slug": "with-recursive-missing",
      "postgres": true,
      "sqlite": false
    },
    {
      "slug": "column-of-relation-does-not-exist",
      "postgres": true,
      "sqlite": true
    }
  ]
}
