Skip to content
cosmodev ~/tools/sql-playground

SQL 플레이그라운드

Data & DevOps

샘플 데이터셋 또는 직접 만든 스키마에서 실제 SQL을 브라우저 안에서 실행하세요. 쿼리를 작성하고, 포맷된 결과를 즉시 확인하고, 내보내거나 공유할 수 있습니다. sql.js(SQLite WASM) 기반, 100% 클라이언트 동작.

예시
The SQLite engine loads in your browser. Nothing is sent anywhere.
⌘/Ctrl + ↵
쿼리를 실행하면 결과가 나타나요.

(문서는 영어)

What it does

The SQL Playground lets you write and run real SQL queries directly in your browser - no installs, no sign-ups, no data leaving your machine. It ships with a ready-to-query sample database (users + orders) so you can start exploring joins, aggregates, and filters the moment the page loads. Swap in your own schema at any time and the database rebuilds live.

It’s powered by sql.js, a full SQLite engine compiled to WebAssembly. That means you get real SQL behavior - transactions, constraints, aggregates, subqueries - running 100% client-side. Results render in a clean table with row counts and timing, and you can export them as CSV, JSON, or Markdown with one click.

How to use it

  1. The Schema panel on the left is pre-loaded with a sample users + orders database. Edit it freely - the database rebuilds automatically when you stop typing, and a green “applied” badge confirms it worked.
  2. Write your SQL in the Query panel on the right - both editors highlight SQL syntax as you type - or click one of the example query chips (Select all, Filter, Aggregate, Join, Sort + limit, CTE, Subquery, Having, Like + order, Union) to load a pre-built query.
  3. Click Run (or press ⌘/Ctrl + Enter) to execute.
  4. Read the Results table below - it shows column headers, typed values (NULLs are styled distinctly), a row count, a read-only badge for SELECT queries, and the elapsed time in milliseconds.
  5. Use the CSV / JSON / Markdown toggle + Copy results to export the output in your preferred format.
  6. Click Copy share link to encode your current schema and query into the URL - anyone who opens the link sees your exact setup.

Examples

Join two tables and aggregate

SELECT u.name, u.role, COUNT(o.id) AS orders, SUM(o.amount) AS total
FROM users u
LEFT JOIN orders o ON o.user_id = u.id
GROUP BY u.id
ORDER BY total DESC;

Returns each user with their order count and spend total, sorted highest first. Users with no orders appear with 0 / NULL.

Filter with a subquery

SELECT name, email FROM users
WHERE id IN (SELECT user_id FROM orders WHERE amount > 20);

Returns only users who have placed an order over $20.

Inspect table structure

PRAGMA table_info(users);

Returns column index, name, type, nullability, and default value for every column in the users table - useful for exploring unfamiliar schemas.

Good to know

  • 100% client-side. Your SQL and data never leave the browser - everything runs locally via sql.js (SQLite compiled to WebAssembly). Safe for sensitive schemas.
  • Live schema editing. Change the Schema panel and the database rebuilds automatically (debounced). Errors are shown inline - queries stay disabled until the schema is valid again.
  • SQLite dialect. This is real SQLite - you get window functions, CTEs, JSON functions, and most of the SQLite feature set. A few things (stored procedures, MySQL/Postgres-specific syntax) aren’t supported.
  • Shareable. Your schema and query are encoded in the URL, so a shared link reproduces your exact playground state.
  • Related tools: Regex Tester, JSON Formatter.
소스 코드14개 언어