<< 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 Duration SQL Query ID Playground
06/12/2024 3:49 p.m. admin@example.com 2.16ms select id, duration from explorer_promptlog; Playground Open
06/12/2024 3:47 p.m. admin@example.com ms SELECT SupplierID, CompanyName, ContactName, ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax, HomePage FROM Suppliers; Playground Open
06/12/2024 3:45 p.m. admin@example.com 2.37ms SELECT app, COUNT(*) AS num_migrations FROM django_migrations GROUP BY app ORDER BY num_migrations ASC; Query 4 Open
06/12/2024 3:43 p.m. admin@example.com 45.27ms WITH rental_counts AS ( SELECT f.film_id, f.title, fc.category_id, COUNT(r.rental_id) AS rental_count FROM rental r JOIN inventory i ON r.inventory_id = i.inventory_id JOIN film f ON i.film_id = f.film_id JOIN film_category fc ON f.film_id = fc.film_id GROUP BY f.film_id, fc.category_id ), popular_films AS ( SELECT film_id, title, category_id, rental_count, ROW_NUMBER() OVER (PARTITION BY category_id ORDER BY rental_count DESC) AS rn FROM rental_counts ) SELECT film_id, title FROM popular_films WHERE rn <= 3 -- Limit to the most popular few films per category ORDER BY RANDOM() -- Randomly select 3 films LIMIT 3; Playground Open
06/12/2024 3:39 p.m. admin@example.com 1.72ms select 1 Playground Open
06/12/2024 3:39 p.m. admin@example.com 36.18ms WITH rental_info AS ( SELECT r.rental_id, fc.category_id FROM rental r JOIN inventory i ON r.inventory_id = i.inventory_id JOIN film_category fc ON i.film_id = fc.film_id ) SELECT c.name AS category_name, COUNT(ri.rental_id) AS rental_count FROM rental_info ri JOIN category c ON ri.category_id = c.category_id GROUP BY c.name ORDER BY rental_count DESC; Playground Open
06/12/2024 3:38 p.m. admin@example.com 3.66ms SELECT sql, AVG(duration) AS average_duration FROM explorer_querylog GROUP BY sql ORDER BY average_duration DESC; Query 26 Open
06/12/2024 3:37 p.m. admin@example.com 3.68ms select * from explorer_promptlog Query 25 Open
06/12/2024 3:36 p.m. admin@example.com ms 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
06/12/2024 3:35 p.m. admin@example.com ms SELECT cust.CustomerID, cust.CompanyName, cd.CustomerTypeID, cd.CustomerDesc FROM CustomerCustomerDemo ccd JOIN CustomerDemographics cd ON ccd.CustomerTypeID = cd.CustomerTypeID JOIN Customers cust ON ccd.CustomerID = cust.CustomerID; Query 23 Open
06/12/2024 3:35 p.m. admin@example.com ms SELECT SupplierID, CompanyName, ContactName, ContactTitle, Address, City, Region, PostalCode, Country, Phone, Fax, HomePage FROM Suppliers; Query 22 Open
06/12/2024 3:34 p.m. admin@example.com ms SELECT ProductID, ProductName, SupplierID, CategoryID, QuantityPerUnit, UnitPrice, UnitsInStock, UnitsOnOrder, ReorderLevel, Discontinued FROM Products; Query 21 Open
06/12/2024 3:33 p.m. admin@example.com 4.32ms 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
06/12/2024 3:31 p.m. admin@example.com 48.07ms WITH rental_counts AS ( SELECT f.film_id, f.title, fc.category_id, COUNT(r.rental_id) AS rental_count FROM rental r JOIN inventory i ON r.inventory_id = i.inventory_id JOIN film f ON i.film_id = f.film_id JOIN film_category fc ON f.film_id = fc.film_id GROUP BY f.film_id, fc.category_id ), popular_films AS ( SELECT film_id, title, category_id, rental_count, ROW_NUMBER() OVER (PARTITION BY category_id ORDER BY rental_count DESC) AS rn FROM rental_counts ) SELECT film_id, title FROM popular_films WHERE rn <= 3 -- Limit to the most popular few films per category ORDER BY RANDOM() -- Randomly select 3 films LIMIT 3; Playground Open
06/12/2024 3:27 p.m. admin@example.com 48.63ms WITH rental_counts AS ( SELECT f.film_id, f.title, fc.category_id, COUNT(r.rental_id) AS rental_count FROM rental r JOIN inventory i ON r.inventory_id = i.inventory_id JOIN film f ON i.film_id = f.film_id JOIN film_category fc ON f.film_id = fc.film_id GROUP BY f.film_id, fc.category_id ), popular_films AS ( SELECT film_id, title, category_id, rental_count, ROW_NUMBER() OVER (PARTITION BY category_id ORDER BY rental_count DESC) AS rn FROM rental_counts ) SELECT film_id, title FROM popular_films WHERE rn <= 3 -- Limit to the most popular few films per category ORDER BY RANDOM() -- Randomly select 3 films LIMIT 3; Playground Open
06/12/2024 3:26 p.m. admin@example.com 1.81ms select id, duration from explorer_promptlog; Playground Open
06/12/2024 3:25 p.m. admin@example.com 13.33ms WITH actor_category_count AS ( SELECT fa.actor_id, a.first_name, a.last_name, COUNT(DISTINCT fc.category_id) AS category_count FROM film_actor fa JOIN actor a ON fa.actor_id = a.actor_id JOIN film_category fc ON fa.film_id = fc.film_id GROUP BY fa.actor_id, a.first_name, a.last_name ) SELECT actor_id, first_name, last_name, category_count FROM actor_category_count WHERE category_count = (SELECT MAX(category_count) FROM actor_category_count); Playground Open
06/12/2024 3:21 p.m. admin@example.com 2.85ms 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; Playground Open
06/12/2024 3:19 p.m. admin@example.com 1.77ms select id, duration from explorer_promptlog; Playground Open
06/12/2024 3:17 p.m. admin@example.com 2.08ms SELECT * FROM explorer_query Playground Open