Tool workspace

SQL Playground (SQLite)

Test SQL queries against a local sample SQLite database with no server required.

Runs locally in your browser. SQL text is not sent to servers.

Runs locally in your browser with SQLite (sql.js). Queries are never sent to our servers.

Ctrl/Cmd + Enter to run

SQLite

Results

Run a query to see output rows. Example: SELECT * FROM employees;

Schema explorer

    Examples

    Console

    No console output.

    Use in code

    The playground runs SQLite in-browser for learning. These examples show equivalent patterns in app code and call out which database each snippet targets.

    In-browser SQLite with sql.js

    TypeScript

    Primary API

    db.exec(query)

    Browser-side, in-memory SQLite execution similar to this playground.

    External dependencyLibrary: sql.jsPackage: sql.js

    Install

    npm install sql.js
    import initSqlJs from "sql.js/dist/sql-wasm.js";
    
    const SQL = await initSqlJs({ locateFile: () => "/sqljs/sql-wasm.wasm" });
    const db = new SQL.Database();
    db.run("CREATE TABLE employees (id INTEGER PRIMARY KEY, name TEXT, salary REAL);");
    db.run("INSERT INTO employees(name, salary) VALUES (?, ?)", ["Ava", 118000]);
    
    const result = db.exec("SELECT name, salary FROM employees WHERE salary > 90000");
    console.log(result);
    

    Reference: sql.js documentation

    How to use

    1. Write a SQLite query in the editor.
    2. Click Run query or press Ctrl/Cmd + Enter.
    3. Review results, row count, and execution time.

    Use cases

    • Practice SQL syntax with realistic sample tables.
    • Validate SQL produced from LINQ drafts.
    • Teach joins, grouping, and CTEs without provisioning a database.

    Limitations and caveats

    • Targets SQLite syntax only for this version.
    • Output rows are capped for browser performance.

    Related tools