SQLite query builder
Form-driven SQL generator for SQLite. Build SELECT / JOIN / GROUP BY queries, CREATE TABLE and INDEX statements, INSERT / UPDATE / UPSERT mutations, plus PRAGMA introspection and EXPLAIN QUERY PLAN wrappers. Quoting handled automatically. Browser-only — no database access required.
⚠ Disclaimer
This tool is provided as-is, for educational and planning purposes only. Generated SQL is a starting point — always review for correctness, use parameterised statements in application code, and back up your database before running mutations (UPDATE / DELETE / UPSERT). The Tech Space makes no warranty and accepts no liability. Full disclaimer →
Filtered SELECT
Read rows from a table with WHERE filters, ORDER BY, and LIMIT.
Inputs
Generated SQL
SQLite
Notes & tips
SQLite quick reference
Type affinities (not strict types)
INTEGER— 1, 2, 4, 6, or 8 byte signed integerREAL— 8-byte IEEE floating pointTEXT— UTF-8, UTF-16BE, UTF-16LEBLOB— raw bytesNUMERIC— integer when possible, real otherwise
Important
Type affinity ≠ strict typing.
INTEGER columns will happily accept text unless you use STRICT tables (3.37+). Add STRICT after the closing paren of CREATE TABLE for actual type enforcement.
Date storage formats
TEXT— ISO 8601:'2026-05-18 14:30:00'INTEGER— Unix epoch seconds:1747577400REAL— Julian day numbers:2460849.10417
Common date functions
date('now')— today, ISO datedatetime('now', 'localtime')— now, local TZstrftime('%Y-%m', col)— format date columnunixepoch(col)— convert ISO/Julian to epoch (3.38+)datetime(epoch_col, 'unixepoch')— convert epoch to ISO
JSON1 functions (built-in 3.38+)
json_extract(col, '$.path')— extract value at pathcol ->> '$.path'— shorthand (returns SQL type)col -> '$.path'— shorthand (returns JSON type)json_array_length(col, '$.list')— count array itemsjson_each(col)— explode into rows (table-valued)
PRAGMAs worth knowing
PRAGMA foreign_keys = ON;— required per connection, default OFFPRAGMA journal_mode = WAL;— better concurrent read/writePRAGMA table_info(t);— describe a table's columnsPRAGMA foreign_key_list(t);— list FK constraintsPRAGMA index_list(t);— list indexes on a tablePRAGMA integrity_check;— scan for corruption
Gotchas to remember
- Foreign keys are OFF by default — run
PRAGMA foreign_keys = ON;at the start of every connection - ALTER TABLE is limited — you can rename/add/drop columns but not change types. For complex changes, copy to a new table
- Identifiers are case-insensitive but the convention is snake_case
- String literals use single quotes:
'value'. Double quotes are interpreted as identifiers if a matching column exists, else as strings (legacy behaviour, error-prone) - NULL ordering:
ORDER BY colputs NULLs first; useORDER BY col NULLS LASTif you want them at the end INTEGER PRIMARY KEYaliases ROWID — gets auto-assigned;WITHOUT ROWIDtables behave differently