SQL formatter
SQL input
Formats as you type
Formatted SQL
Up to date
FAQ
SQL (Structured Query Language) is a standard programming language specifically designed for managing and manipulating relational databases. It is used to query, insert, update, and delete data, as well as to manage database schema and control access to the database.
SQL commands can be broadly categorized into the following types:
- DDL (Data Definition Language): Commands like
CREATE,ALTER,DROP, which define the structure of the database. - DML (Data Manipulation Language): Commands like
SELECT,INSERT,UPDATE,DELETE, which are used for data manipulation. - DCL (Data Control Language): Commands like
GRANT,REVOKE, which control access to the data. - TCL (Transaction Control Language): Commands like
COMMIT,ROLLBACK, which manage transactions in the database.
A primary key is a field in a table which uniquely identifies each row/record in that table. Primary keys must contain unique values, and cannot contain NULL values. A table can have only one primary key, which can consist of single or multiple columns (fields).
The SQLite database runs and stays in your browser. Save stores a database snapshot and query tabs in this browser; if you're signed in, saved sessions also sync to your account. Share query includes only query text, not database contents. If you choose Ask AI, your messages and included context are sent to the AI service. Inspect or exclude schema, SQL, and errors before sending: they can contain sensitive values. Row results are excluded unless you enable result sharing. Previously sent content remains in the conversation.
You can load a SQLite database file or import CSV and TSV files. CSV and TSV files are converted into a local SQLite table so you can query them immediately.
The playground uses SQLite. Most common SQL statements such as SELECT, JOIN, GROUP BY, INSERT, UPDATE, DELETE, CREATE TABLE, indexes, and transactions work, but database-specific features from MySQL, PostgreSQL, and SQL Server may differ.
Click Save to save the database, all query tabs, and the active tab as a session. Reopen it from the menu next to Save or from My space. Results and history are not saved, and later edits are not saved automatically. Share creates a link containing only the active query, not the database or results.
Yes, for saved sessions. When you're signed in, sessions you save (database snapshot and query tabs) sync to your account and appear on your other devices. Unsaved changes are not synced. Without sign-in, saves stay in this browser and browser cleanup can remove them. Export a ZIP backup from My space or download the database to keep a separate copy. Older query-only saves still restore just the query without replacing your database.
No AI tool changes your live database. Ask explains SQL without tools. Agent modes can run read-only queries locally, put the SQL in a query tab, and show rows in the playground Results panel. This works without sharing results with AI. Agent + review asks before drafting or replacing SQL; Agent applies those edits directly with Undo. Writes and schema changes still require you to review the SQL and press Run yourself. AI runs use a bounded, cancellable worker against a main-database snapshot. Selecting Query results in Context optionally sends rows back to AI; that permission resets when the database state changes.