Follow rows through execution stages, relational operations, transactions, algebra, and logical query plans.
Learn a concept → visualize its SQL → practice a quiz → review mistakes.
SQL Editor
Concept help:
Ctrl/Cmd+Enter run · Alt+←/→ stepStep 1 of 4
Transaction Control
Transaction State
INACTIVE
Savepoints
None
Pending changes
0
Committed state
No custom tables
Working state
No custom tables
Timeline
No transaction operations yet.
SQLFlow Academic Project
Learn
Learn SQL with logical execution
Conventional SQL teaching often describes the conceptual order as FROM → JOIN → WHERE → GROUP BY → HAVING → SELECT → DISTINCT → ORDER BY → LIMIT. SQLFlow's displayed stages follow its actual executor: FROM → JOIN → WHERE → GROUP BY → SELECT / AGGREGATE → HAVING → DISTINCT → ORDER BY → LIMIT. Only stages used by a query appear. SQLFlow calculates grouped projections before filtering those groups with HAVING; the final rows still reflect the HAVING condition.
JOIN video tutorial
Joins in SQL — Neso Academy. If the player is blocked by browser or YouTube restrictions, use the exact Watch on YouTube link below.
The JOIN video is an external instructional lesson. A student-made project demonstration recording is not included.
References
Explore verified database textbooks, SQL research, PostgreSQL documentation, and official GATE resources. Research on physical query optimizers is background reading, not an SQLFlow implementation claim.
Interactive SQLFlow Manual
Quick-start checklist
Choose a built-in table or create/import custom data.
Write SQL or select a built-in example.
Run the query with Run Query or Ctrl/Cmd + Enter.
Inspect stages with Previous, Next, or Auto Play.
Open Explanation, Relational Algebra, or Query Tree.
Download the execution report.
Supported input
Enter one supported statement at a time: SELECT, INSERT, UPDATE, DELETE, BEGIN, COMMIT, ROLLBACK, SAVEPOINT, or ROLLBACK TO. SELECT supports FROM, INNER/LEFT JOIN with equality ON, WHERE with comparisons and AND/OR/parentheses, GROUP BY, HAVING, DISTINCT, ORDER BY, LIMIT, and COUNT/SUM/AVG/MIN/MAX. Data changes apply to custom tables.
Current limits
SQLFlow does not implement subqueries, CTEs, window functions, RIGHT/FULL OUTER JOIN, physical plans, index simulation, cost-based optimization, or concurrency/locking. The public GitHub Pages site stores quiz history in this browser only; the optional PostgreSQL backend runs locally and is not part of the public site.
Input and examples
SQLFlow accepts supported SELECT, DML, and transaction statements. Pick an example, edit it in the SQL editor, then run one statement at a time.
Execution navigation
Previous and Next select intermediate datasets. Auto Play advances automatically. Final Result shows the completed output.
Reading visualizations
Execution tables show rows after each operation. JOIN view highlights compared keys. Algebra summarizes operators, Query Tree shows the logical plan, and Explanation narrates measured results.
Transactions
BEGIN opens a working copy; COMMIT persists it; ROLLBACK discards it. SAVEPOINT and ROLLBACK TO manage checkpoints.
Custom data and reset
Create typed tables or import CSV in Database Explorer. Reset Demo restores the default query and preserves custom tables unless Clear Custom Data is explicitly confirmed.
Presentation and reports
Presentation Mode emphasizes teaching views. Open Execution Report shows the report with separate Download TXT Report and Print / Save as PDF actions.
Competitive Exam and AI Tutor
Browse 75 original solved practice questions, filter by topic, difficulty or exam style, then take a practice or test attempt. Public-site scores and answers stay in this browser; the optional local backend can also save them to PostgreSQL. AI Tutor is unavailable on the public site and never changes verified grading.
Keyboard shortcuts
Ctrl/Cmd+Enter runs SQL, Alt+Right/Left changes stage, and Escape closes an open panel or Presentation Mode.
References and further reading
Verified sources for database concepts and general background. SQLFlow illustrates logical operations; it does not implement the physical optimization methods in the research papers.
Project overview
Problem Statement
Students can execute SQL queries but often cannot see how rows change through each logical operation.
Objective
Build an interactive browser-based system that visualizes SQL execution step-by-step and connects SQL syntax with relational operations and intermediate results.
Area
Core Database Systems / Database Management Systems
simulation.js replays executor instrumentation; help.js controls the searchable manual and guided tutorials; quiz-bank.js contains authored questions and isolated fixtures; quiz-engine.js handles grading and persistence; quiz.js renders attempts and reviews. The separate competitive-bank.js and competitive.js provide original exam-style practice; references.js lists verified further reading, and the optional AI Tutor uses a local FastAPI proxy when explicitly configured.
Working methodology
The user enters one supported SQL statement.
The token-aware parser validates syntax and creates a structured AST.
The executor reads SQLFlow's in-browser tables and records rows, columns, and operation metadata at each supported logical stage.
The visualizer shows intermediate relations and measured row-count changes.
The same structured result feeds Final Result, deterministic Explanation, and the downloadable execution report. SELECT queries also produce relational algebra and a logical query tree.
INSERT, UPDATE, DELETE, and transaction controls use the working-copy and snapshot mechanism for pending changes, savepoints, commit, and rollback.
Testing and reliability
SQLFlow Version 1.4 passed 1,497 browser regressions and 412 complete Chrome interaction checks before release. Coverage includes the SQL engine, transactions, reports, safe rendering, quiz fixture keys and grading, action replay, state cleanup, and learning navigation. The dependency-free Chrome suite exercises actual buttons, tutorials, downloads, and responsive dialogs.
Creative features
Intermediate datasets, JOIN comparison highlighting, synchronized query trees, deterministic English explanations, relational algebra, custom tables and CSV, transaction snapshots and savepoints, Presentation Mode, keyboard navigation, and extensive browser testing extend SQLFlow beyond a basic query executor.
Challenges and solutions
A token-aware parser handles supported SQL without a backend dependency.
Qualified row provenance preserves aliases and JOIN correctness.
Immutable stage metadata synchronizes tables, trees, algebra, explanations, and reports.
Transaction snapshots make rollback and savepoints deterministic.
Safe DOM APIs prevent table values and SQL text from becoming executable HTML.
Future enhancements
Subqueries, CTEs, window functions, RIGHT/FULL JOIN, physical plans, index simulation, cost estimation, backend connections, richer exports, and drag/zoom trees remain future work.
Conclusion
SQLFlow demonstrates how SQL statements transform data through logical stages, helping bridge the gap between SQL syntax and internal database operations.