SQL Explorer Demo Environment
This environment resets nightly. Any data or connections you add are public.

Recent Query Logs - Page 1

Run At Run By Database Connection Duration SQL Query ID Playground
11/21/2024 6:40 a.m. admin northwind.db ms SELECT sql, AVG(duration) AS average_duration FROM explorer_querylog GROUP BY sql ORDER BY average_duration DESC; Query 26 Open
11/21/2024 6:33 a.m. admin sqlite-sakila.db 4.61ms select 1 Query 60 Open
11/21/2024 6:30 a.m. admin northwind.db 5.07ms SELECT SupplierID, CompanyName, ContactName, ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax, HomePage FROM Suppliers; Query 22 Open
11/21/2024 6:29 a.m. admin sqlite-sakila.db ms select * from Orders o join "Order Details" od on o. = od.OrderID Query 127 Open
11/21/2024 6:29 a.m. admin northwind.db 3.35ms Select * from Customers; Query 159 Open
11/21/2024 6:29 a.m. admin northwind.db 6.90ms select * from Categories Query 27 Open
11/21/2024 6:28 a.m. admin northwind.db 3.72ms SELECT ProductID, ProductName, SupplierID, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued FROM Products LIMIT 100 Query 21 Open
11/21/2024 6:27 a.m. admin northwind.db 7.64ms SELECT * FROM Orders Query 192 Open
11/21/2024 6:26 a.m. admin northwind.db 23.43ms SELECT Orders.OrderID, "Order Details".Quantity, "Order Details".UnitPrice, "Order Details".Discount, ("Order Details".Quantity * "Order Details".UnitPrice) as OrderTotal, ("Order Details".Quantity * "Order Details".UnitPrice)-"Order Details".Discount as ToTalAfterDiscount, Customers.ContactName, Customers.Phone, Products.ProductName FROM Orders LEFT JOIN "Order Details" ON "Order Details".OrderID = Orders.OrderID LEFT JOIN Customers ON Customers.CustomerID = Orders.CustomerID LEFT JOIN Products ON Products.ProductID = "Order Details".ProductID limit 200 Query 96 Open
11/21/2024 6:26 a.m. admin northwind.db ms SELECT * FROM Orders LEFT JOIN [Order Details] od ON od.OrderID = Orders.OrderID Query 95 Open
11/21/2024 6:26 a.m. admin sqlite-sakila.db 2.91ms select 1 Query 60 Open
11/21/2024 6:26 a.m. admin northwind.db 3.46ms select * from customers limit 10 Query 291 Open
11/21/2024 6:26 a.m. admin northwind.db 262.44ms WITH EmployeeSales AS ( SELECT o.EmployeeID, SUM(od.UnitPrice * od.Quantity) AS TotalSales FROM Orders o JOIN "Order Details" od ON o.OrderID = od.OrderID GROUP BY o.EmployeeID ) SELECT e.EmployeeID, e.LastName, e.FirstName, e.Title, es.TotalSales FROM EmployeeSales es JOIN Employees e ON es.EmployeeID = e.EmployeeID ORDER BY es.TotalSales DESC; Query 24 Open
11/21/2024 6:26 a.m. admin northwind.db 533.59ms WITH SalesData AS ( SELECT o.OrderID, strftime('%Y', o.OrderDate) AS Year, (strftime('%m', o.OrderDate) - 1) / 3 + 1 AS Quarter, od.UnitPrice * od.Quantity AS SalesAmount FROM Orders o JOIN "Order Details" od ON o.OrderID = od.OrderID ) SELECT Year, Quarter, SUM(SalesAmount) AS TotalSales FROM SalesData GROUP BY Year, Quarter ORDER BY Year, Quarter; Query 14 Open
11/21/2024 6:26 a.m. admin northwind.db 3.31ms select * from Categories Query 97 Open
11/21/2024 6:26 a.m. admin sqlite-sakila.db ms WITH SalesData AS ( SELECT o.OrderID, strftime('%Y', o.OrderDate) AS Year, (strftime('%m', o.OrderDate) - 1) / 3 + 1 AS Quarter, od.ProductID, od.Quantity, od.UnitPrice * od.Quantity AS SalesAmount FROM Orders o JOIN "Order Details" od ON o.OrderID = od.OrderID ), RecentQuarter AS ( SELECT Year, Quarter FROM SalesData ORDER BY Year DESC, Quarter DESC LIMIT 1 ) SELECT sd.ProductID, p.ProductName, SUM(sd.Quantity) AS TotalQuantitySold, SUM(sd.SalesAmount) AS TotalSales FROM SalesData sd JOIN RecentQuarter rq ON sd.Year = rq.Year AND sd.Quarter = rq.Quarter JOIN Products p ON sd.ProductID = p.ProductID GROUP BY sd.ProductID, p.ProductName ORDER BY TotalQuantitySold DESC; Query 15 Open
11/21/2024 6:24 a.m. admin northwind.db ms WITH LengthStats AS ( SELECT AVG(LENGTH(prompt)) AS mean_length, AVG(LENGTH(prompt) * LENGTH(prompt)) - AVG(LENGTH(prompt)) * AVG(LENGTH(prompt)) AS variance FROM explorer_promptlog ) SELECT mean_length AS average_length, SQRT(variance) AS length_variability FROM LengthStats; Query 20 Open
11/21/2024 6:24 a.m. admin northwind.db 6.30ms select CustomerID from Customers Query 258 Open
11/21/2024 6:23 a.m. admin sqlite-sakila.db 3.64ms select * from staff; Query 19 Open
11/21/2024 6:23 a.m. admin northwind.db ms show table Query 226 Open