{
  "browser": "147.0.7727.15",
  "scope": "Actual PgPadApp and product PgPad Worker; actual SQL-dojo Worker/adapter/WASM via QA bridge, not full SQL-dojo UI or Next/DB/production",
  "postgresVersion": "PostgreSQL 17.5 on wasm32-unknown-linux-gnu, compiled by emcc (Emscripten gcc/clang-like replacement + linker emulating GNU ld) 3.1.74 (1092ec30a3fb1d46b1782ff1b4db5094d3d06ae5), 32-bit",
  "sqliteVersion": "3.49.1",
  "widths": [
    320,
    768,
    1440
  ],
  "guideDoesNotStartDb": true,
  "editsClearOnlyResults": true,
  "dataRetainedAcrossEditsSamplesAndGuide": true,
  "results": [
    {
      "id": "division",
      "sql": "SELECT 5 / 2 AS integer_division,\n       5.0 / 2 AS decimal_division;",
      "postgres": {
        "error": null,
        "columns": [
          "integer_division",
          "decimal_division"
        ],
        "rows": [
          [
            "2",
            "2.5000000000000000"
          ]
        ]
      },
      "sqlite": {
        "columns": [
          "integer_division",
          "decimal_division"
        ],
        "values": [
          [
            2,
            2.5
          ]
        ],
        "rowCount": 1
      },
      "types": {
        "postgresSQL": "SELECT pg_typeof(5 / 2)::text AS integer_type,\n       pg_typeof(5.0 / 2)::text AS decimal_type;",
        "sqliteSQL": "SELECT typeof(5 / 2) AS integer_type,\n       typeof(5.0 / 2) AS decimal_type;",
        "postgres": {
          "error": null,
          "columns": [
            "integer_type",
            "decimal_type"
          ],
          "rows": [
            [
              "integer",
              "numeric"
            ]
          ]
        },
        "sqlite": {
          "columns": [
            "integer_type",
            "decimal_type"
          ],
          "values": [
            [
              "integer",
              "real"
            ]
          ],
          "rowCount": 1
        }
      }
    },
    {
      "id": "text",
      "sql": "WITH sample(value) AS (VALUES ('2'), ('oops'))\nSELECT value, value + 1 AS incremented\nFROM sample ORDER BY value;",
      "postgres": {
        "error": "error: operator does not exist: text + integer",
        "columns": [],
        "rows": []
      },
      "sqlite": {
        "columns": [
          "value",
          "incremented"
        ],
        "values": [
          [
            "2",
            3
          ],
          [
            "oops",
            1
          ]
        ],
        "rowCount": 2
      },
      "alternative": {
        "sql": "WITH sample(value) AS (VALUES ('2'), ('oops'))\nSELECT value,\n       CASE WHEN value = '2' THEN CAST(value AS INTEGER) + 1\n            ELSE NULL END AS incremented\nFROM sample ORDER BY value;",
        "postgres": {
          "error": null,
          "columns": [
            "value",
            "incremented"
          ],
          "rows": [
            [
              "2",
              "3"
            ],
            [
              "oops",
              "∅"
            ]
          ]
        },
        "sqlite": {
          "columns": [
            "value",
            "incremented"
          ],
          "values": [
            [
              "2",
              3
            ],
            [
              "oops",
              null
            ]
          ],
          "rowCount": 2
        }
      }
    },
    {
      "id": "null",
      "sql": "WITH sample(value) AS (VALUES (1), (NULL), (3))\nSELECT COUNT(*) AS total_rows, COUNT(value) AS nonnull_rows,\n       SUM(CASE WHEN value = NULL THEN 1 ELSE 0 END) AS equals_null,\n       SUM(CASE WHEN value IS NULL THEN 1 ELSE 0 END) AS is_null\nFROM sample;",
      "postgres": {
        "error": null,
        "columns": [
          "total_rows",
          "nonnull_rows",
          "equals_null",
          "is_null"
        ],
        "rows": [
          [
            "3",
            "2",
            "0",
            "1"
          ]
        ]
      },
      "sqlite": {
        "columns": [
          "total_rows",
          "nonnull_rows",
          "equals_null",
          "is_null"
        ],
        "values": [
          [
            3,
            2,
            0,
            1
          ]
        ],
        "rowCount": 1
      }
    },
    {
      "id": "function",
      "sql": "SELECT ifnull(NULL, 'fallback') AS filled;",
      "postgres": {
        "error": "error: function ifnull(unknown, unknown) does not exist",
        "columns": [],
        "rows": []
      },
      "sqlite": {
        "columns": [
          "filled"
        ],
        "values": [
          [
            "fallback"
          ]
        ],
        "rowCount": 1
      },
      "alternative": {
        "sql": "SELECT COALESCE(NULL, 'fallback') AS filled;",
        "postgres": {
          "error": null,
          "columns": [
            "filled"
          ],
          "rows": [
            [
              "fallback"
            ]
          ]
        },
        "sqlite": {
          "columns": [
            "filled"
          ],
          "values": [
            [
              "fallback"
            ]
          ],
          "rowCount": 1
        }
      }
    }
  ]
}