QueryPilotv9 · Enterprise + Learn Hub · offline · free
FREE · OFFLINE
0 queries 0m 📋 5 tables 0 saved 📊 Standard Tip: press ? for shortcuts
Ask anything about your data
Type a question in plain English and get a complete SQL query. 45+ patterns including dates, aggregates, JOINs, CTEs, window functions, pivot, year-over-year, cohort, rolling averages and more.
Built by Adewale Samson Adeagbo · HMG Concepts · Lagos, Nigeria ·
🔨 Visual Query Builder
Build a complete SQL query step by step using dropdowns and forms. Every field has a tooltip. Column data types are shown. No SQL knowledge required. The SQL preview updates live at every step.
1
Choose Table
The data source your query reads from
SELECT FROM TABLE
All other options update automatically when you select a table.
2
Choose Columns
Click to toggle; data type shown below each name
COLUMNS — click to include or exclude
The data type of each column is shown in small text. This helps you choose the right aggregate and filter operators.
Select a table first
AGGREGATE FUNCTION — optional
Computes a summary value from many rows instead of returning individual rows. COUNT counts, SUM adds, AVG averages, MAX/MIN find extremes.
3
Add Filters (WHERE)
Narrow down which rows are returned
Each filter condition narrows the rows included. All conditions are combined with AND logic — a row must satisfy every condition to appear in results.
4
Group & HAVING
Group rows; filter groups after aggregation
GROUP BY
Collapses rows with the same value into one group. Each group produces one output row. Use with COUNT, SUM, AVG etc.
HAVING
Filters groups after aggregation. Unlike WHERE which filters rows, HAVING filters the grouped result. Example: COUNT(*) > 5 keeps only groups with more than 5 rows.
5
Sort, Limit & Offset
Control order and result count
ORDER BY
Sorts results by this column. Without ORDER BY, row order is never guaranteed.
DIRECTION
DESC = highest first. ASC = lowest first.
LIMIT
Maximum rows to return.
OFFSET
Skip this many rows. Used with LIMIT for pagination. Page 2 = OFFSET 10 if LIMIT is 10.
Live SQL Preview
Updates automatically as you configure above
✓ Copied!
🔗 JOIN Builder
A JOIN combines rows from two tables based on a shared column value. The visual diagram updates as you configure. ON columns are auto-detected when both tables share the same column name. Supports all 5 standard join types.
1
Pick Tables & Join Type
LEFT TABLE — main source
JOIN TYPE
RIGHT TABLE — joined table
Table A
--
JOIN
Table B
--
2
Match Columns (ON clause)
The shared key linking both tables
The ON clause defines which column values must match. Typically a foreign key (orders.customer_id) linked to a primary key (customers.id). Auto-detected when column names match.
LEFT COLUMN
=
RIGHT COLUMN
3
Output Columns
Click pills to include or exclude from SELECT
Pick tables first
4
Filter, Sort & Limit
WHERE CONDITION
ORDER BY
LIMIT
Generated JOIN Query
✓ Copied!
⊕ Subquery Builder
A subquery is a SELECT nested inside another SELECT. The inner query runs first and produces a temporary result. The outer query then reads that result and applies its own filters, sort and limit. Used for advanced multi-step data transformations.
1
Inner Query — runs first, produces the data
Write any valid SELECT query here. It can include GROUP BY, aggregates and WHERE. The outer query will read its results like a table.
ALIAS — name used by the outer query
The outer query references the inner result by this alias, just like a table name.
2
Outer Query — reads from inner result
SELECT COLUMNS
Which columns from the inner result to return. Use * for all columns.
WHERE CONDITION
Filter the inner result. e.g. total_spent > 1000
ORDER BY
LIMIT
Generated Subquery
✓ Copied!
⇄ Compare SQL Queries
Paste two versions of a SQL query to see exactly what changed line by line. Lines added appear in green with a + prefix. Lines removed appear in red with strikethrough. The summary shows total lines changed and the change percentage. Useful for reviewing edits before applying them.
A
Original Query
B
Revised Query
Differences
▮ Added   ▮ Removed
-- Paste two queries above to compare --
i
Change Summary
Fill in both queries above.
🔧 SQL Tools
Six specialist tools for everyday SQL work. All tools run entirely offline in your browser. Zero cost. No API. Detailed explanations are shown for each tool below.
✎ SQL Formatter
What it does: Takes any messy, compressed or poorly-indented SQL and reformats it into clean, consistently-structured code with each clause on its own line.
How to use: Paste your SQL in the box below and click Format SQL. The result appears with syntax highlighting.
Why it helps: Formatted SQL is easier to read, debug, and share. It is also easier to spot missing clauses and logic errors when the structure is clear.
🚫 SQL Error Explainer
What it does: Paste a database error message and get a plain-English explanation of what went wrong, why it happened, and how to fix it.
How to use: Copy the full error text from your database client (MySQL Workbench, DBeaver, pgAdmin, etc.) and paste it below. Click Explain Error.
Why it helps: Database error messages are often technical and cryptic. This tool translates 14 common error patterns into plain actionable language that non-technical users can act on.
⏱ Query Complexity Estimator
What it does: Analyses any SQL query and produces a complexity score with a risk level and breakdown of what makes the query heavy or light.
How to use: Paste a SQL query and click Estimate. The tool counts JOINs, subqueries, aggregates, LIKE patterns, DISTINCT, window functions and UNION operations to produce a score from 0 to 100+.
Why it helps: Helps non-technical users understand whether a query is safe to run on a live production database or should be tested and optimised first. Green = safe, Yellow = test first, Red = optimise before running.
📈 Schema Diagram Viewer
What it does: Reads your schema and generates an ASCII diagram showing all tables, their columns with inferred data types, and relationship lines between tables that share column names (indicating foreign key relationships).
How to use: Make sure your schema is entered in the Schema sidebar panel, then click Generate Diagram.
Why it helps: Gives a visual bird's-eye view of how your database is structured. Useful for documentation, onboarding new team members, and deciding which tables can be JOINed.
📄 Stored Procedure Template Generator
What it does: Generates a stored procedure skeleton for your chosen table and operation type. Produces the correct syntax for your selected SQL dialect (MySQL, PostgreSQL, SQL Server, Oracle).
How to use: Select a table from your schema, choose the procedure type (SELECT all, GET by ID, INSERT, UPDATE, DELETE), then click Generate Template.
Why it helps: Stored procedure syntax varies significantly between MySQL, PostgreSQL, SQL Server and Oracle. This generates the correct boilerplate so you only need to fill in the business logic.
TABLE
PROCEDURE TYPE
📥 IN-Clause Builder
What it does: Takes a list of values (one per line or comma-separated) and formats them into a properly-quoted SQL IN clause ready to paste into any WHERE condition.
How to use: Enter the column name, select whether the values are text (gets single quotes) or numbers (no quotes), paste your list of values, and the result updates automatically.
Why it helps: Manually quoting dozens of values is tedious and error-prone. This formats them instantly and correctly regardless of the list size.
COLUMN NAME
VALUE TYPE
🏫 Learn SQL
17 interactive lessons from beginner SELECT to advanced window functions and CTEs. Each lesson has a plain-English explanation of the concept, a real working SQL example with syntax highlighting, a description of what the output would look like, and a Try It button that sends the example to the chat so you can run it and experiment immediately.
📤 Export & Share
Export your saved queries and schema in multiple formats. All exports run entirely offline and produce files you can open in Excel, Notion, any SQL client, or share with your team. A built-in print function lets you save a PDF of your query library.
📄 Export Saved Queries as .sql File
Downloads all your saved queries as a single .sql file with each query separated by a comment label showing its title and tags. Ready to paste directly into MySQL Workbench, DBeaver, pgAdmin, SQLite Browser, or any database client.
📋 Export as Markdown Report (.md)
Creates a .md documentation file with all saved queries formatted as SQL code blocks with titles, tags and save times. Paste into Notion, GitHub README, Obsidian, or any Markdown viewer. Ideal for creating a shareable query library document for your team.
📊 Export as JSON
Exports all saved queries as structured .json including title, SQL, tags, dialect and save time. Useful for importing into other tools, building APIs on top of your query library, or programmatic query management.
📋 Export as CSV Summary
Exports a .csv file listing all saved queries with title, tags, first SQL line and save time. Open directly in Microsoft Excel or Google Sheets to manage your query library as a spreadsheet.
🖨 Print Query Library as PDF
Opens your browser print dialog with all saved queries formatted in a clean print layout. Use your browser's built-in Save as PDF option. Works in Chrome, Firefox, Edge and Safari. No third-party tool needed.
🏠 Generate CREATE TABLE Statements (DDL)
Reads your schema definition and generates CREATE TABLE SQL with intelligently inferred column types: AUTOINCREMENT for id, DECIMAL(10,2) for price/salary/amount, DATETIME for date columns, VARCHAR(100) for name/status/category, VARCHAR(255) for email, INTEGER for count/stock. Use this to document your database structure or bootstrap a new environment.
📈 Session Summary
A complete report of your activity in this browser session.
⊞ Multi-Table JOIN Builder
Chain three or more tables in a single query. Add a row for each additional table; QueryPilot auto-detects ON columns from your schema (matching id โ†” {table}_id conventions). Use this when you need to combine data from many tables: e.g. customers + orders + products + invoices.
1
Base Table
The first table in the FROM clause
All other tables are joined on top of this one.
2
Joined Tables
Add as many as needed
3
Filter, Sort, Limit
Optional
Generated SQL
Updates live
Copied!
Loading curriculum...
๐Ÿข
Loading Enterprise Console...
25 enterprise features being prepared.
Press Enter to send · Shift+Enter for new line · Esc to clear · Ctrl+F to search results
📱 Install QueryPilot as an app for offline use
⚡ QueryPilot v9 โ€” Quick Reference
QueryPilot turns plain English into SQL. 100% offline, no API, no cost. v8 adds 25 enterprise features (workspaces, RBAC, governance, PII scanner, vault, compliance โ€” reference). v9 adds a 118-lesson Data Science Learning Hub taking you from zero to expert โ€” curriculum reference โ†’
Modes (11)
💬 Ask in English
Type plain English and get SQL. 45+ patterns: dates, status, count, sum, avg, max, min, rank, percentage, CTE, LIKE, NULL, BETWEEN, window functions, duplicates, overdue, year-over-year, rolling avg, pivot, cohort.
🔨 Visual Builder
5-step form with tooltips. Column data types shown. HAVING, OFFSET, COUNT DISTINCT, live preview.
🔗 JOIN Builder
Two-table visual JOIN. ON columns auto-detected. INNER, LEFT, RIGHT, FULL OUTER, CROSS.
⊕ Subquery Builder
Inner-outer SELECT generator with proper nesting.
⊞ Multi-JOIN NEW
Chain 3+ tables in one query. Visual chain editor with auto ON detection.
⇄ Compare SQL
Line-by-line diff with change percentage.
🔧 SQL Tools (8)
Formatter, Error Explainer, Complexity, Schema Diagram (ASCII + SVG ER), Stored Proc, IN-Builder, plus Performance Tips and Index Suggester (NEW).
🏫 Learn SQL
17 interactive lessons from SELECT to CTEs and window functions.
📤 Export (8 options)
.sql, .md, .json, .csv, per-query Markdown (NEW), Print PDF, DDL generator, session summary.
🔍 Search Results
Ctrl+F searches across all SQL result cards.
🏦 4 Themes NEW
Dark, Light, High Contrast, Solarized. Cycle with the moon button.
📱 PWA Install NEW
Install as a desktop/mobile app. Works fully offline after first load.
⭐ Save with Tags
Tag saved queries; filter saved by tag.
📈 Mock Preview
Sample output table for every result.
📚 Deep Explain
Clause-by-clause plain English breakdown.
✓ SQL Validator
10 checks (v7) including ambiguous JOIN, semicolon, dangerous DML.
💾 Snippet Library NEW
Save and reuse common SQL fragments.
📁 Your Templates NEW
Save your own queries as templates.
🔗 Share by URL NEW
Encode your schema + last query in a URL.
⬇ Import schema NEW
Import schema from .sql (CREATE TABLE) or .json.
🏫 Learning Hub v9
Complete data science curriculum: 9 modules, 118 lessons, ~24 weeks. From "what is data?" to deployed ML. Quizzes, projects, printable certificate at 80% completion.
๐Ÿข Enterprise Console v8
25 enterprise features: workspaces, RBAC, governance, audit log, PII scanner, approval workflow, lineage, linter, migrations, test data, cost estimator, versions, schedules, bridge, backup, compliance, comments, vault, dashboard, health, glossary, tour, doc pack, multi-tab sync.
Keyboard Shortcuts
Send queryEnter
New line in inputShift + Enter
Clear inputEsc
Search all resultsCtrl + F
Open shortcuts overlay?
Open settingsCtrl + ,
Toggle sidebarCtrl + B
Cycle themeCtrl + Shift + T
Save query⭐ on result card
Copy SQLCopy btn on card
Toggle word wrapWrap btn on card