SQL Explorer
Demo Environment
This environment resets nightly. Any data or connections you add are public.
SQL Explorer
New Query
Playground
Connections
Logs
Favorites
Most popular products this quarter
Title
default
northwind.db
sqlite-sakila.db
job_skills_1.db
job_postings_1.db
job_summary_1.db
tq
transactions_1.db
history_1390634-1970-01-01-MAX_1.db
IMDbMovies-Clean_1.db
179146-Activity_2024-07-12_07-47_101208779_1.db
vehicles_1.db
Connection
fix
Description
SQL
WITH SalesData AS (SELECT o.OrderID, strftime('%Y', o.OrderDate) AS YEAR, (CAST(strftime('%m', o.OrderDate) AS INTEGER) + 2) / 3 AS QUARTER, od.ProductID, od.Quantity, od.UnitPrice * od.Quantity AS SalesAmount FROM Orders o JOIN "Order Details" od ON o.OrderID = od.OrderID) SELECT OrderID, SUM(SalesAmount) AS TotalSalesAmount FROM SalesData GROUP BY OrderID ORDER BY TotalSalesAmount DESC LIMIT 1;
Save & Run
Save Only
Download...
CSV
JSON
Show Schema
Hide Schema
Format
SQL Assistant
Assistant prompt
"Ask Assistant" to try and automatically fix the issue. The assistant is already aware of error messages & context.
Select All
(?)
Search tables
Ask Assistant
Loading...
Preview
Pivot
  Execution time: 237.36 ms
Showing
of 1 total rows.
OrderID
TotalSalesAmount
Sum
13460.0
Avg
13460.0
Min
13460.0
Max
13460.0
NUL
0.0
0
13460
73431.42
Link to this
Download CSV
Avg. execution: 396.313ms. Query created by admin on 2024-05-15.
History