0 |
70189 |
SELECT location, COUNT(*) as job_count
FROM jobs
GROUP BY location; |
Sept. 10, 2024, 1:54 p.m. |
3 |
1 |
None |
|
no such table: jobs |
False |
59 |
1 |
906 |
select * from employees |
July 4, 2024, 9:07 a.m. |
None |
1 |
None |
northwind.dbs |
None |
True |
None |
2 |
675 |
select * from explorer_explorervalue |
July 3, 2024, 1:19 p.m. |
None |
1 |
1.1532306671142578 |
default |
None |
True |
223 |
3 |
70190 |
SELECT *
FROM hello_greeting
ORDER BY "when" ASC
LIMIT 1; |
Sept. 10, 2024, 2:12 p.m. |
159 |
1 |
2.183675765991211 |
|
None |
True |
223 |
4 |
70192 |
WITH FilmDetails AS
(SELECT f.film_id,
f.title,
f.description,
f.release_year,
f.rating,
a.actor_id,
a.first_name || ' ' || a.last_name AS actor_name
FROM film f
JOIN film_actor fa ON f.film_id = fa.film_id
JOIN actor a ON fa.actor_id = a.actor_id),
FilmPayments AS
(SELECT f.film_id,
SUM(p.amount) AS total_payment_amount,
COUNT(p.payment_id) AS payment_count
FROM film f
JOIN inventory i ON f.film_id = i.film_id
JOIN rental r ON i.inventory_id = r.inventory_id
JOIN payment p ON r.rental_id = p.rental_id
GROUP BY f.film_id)
SELECT fd.title,
fd.description,
fd.release_year,
fd.rating,
fd.actor_name,
fp.total_payment_amount,
fp.payment_count
FROM FilmDetails fd
LEFT JOIN FilmPayments fp ON fd.film_id = fp.film_id
ORDER BY fd.title; |
Sept. 10, 2024, 2:13 p.m. |
54 |
1 |
252.9752254486084 |
|
None |
True |
24 |
5 |
70193 |
select sqlite_version(); |
Sept. 10, 2024, 2:20 p.m. |
56 |
1 |
2.978801727294922 |
|
None |
True |
24 |
6 |
70194 |
select count(*)
from Products
where UnitsInStock > '10' |
Sept. 10, 2024, 2:21 p.m. |
192 |
1 |
3.603696823120117 |
|
None |
True |
23 |
7 |
617 |
SELECT COUNT(id) as total_migrations FROM django_migrations; |
July 3, 2024, 8:11 a.m. |
None |
1 |
2.1975040435791016 |
default |
None |
True |
223 |
8 |
70191 |
SELECT *
FROM hello_greeting
ORDER BY "when" ASC
LIMIT 1; |
Sept. 10, 2024, 2:12 p.m. |
159 |
1 |
2.0101070404052734 |
|
None |
True |
223 |
9 |
909 |
select * from employees |
July 4, 2024, 9:18 a.m. |
None |
1 |
None |
northwind.dbs |
None |
True |
None |
10 |
1610 |
select 1 |
July 5, 2024, 3:24 a.m. |
None |
1 |
1.2774467468261719 |
default |
None |
True |
223 |
11 |
70195 |
SELECT *
FROM hello_greeting
ORDER BY "when" ASC
LIMIT 1; |
Sept. 10, 2024, 3:01 p.m. |
159 |
1 |
1.9648075103759766 |
|
None |
True |
223 |
12 |
1259 |
select * from suppliers |
July 4, 2024, 9:03 p.m. |
None |
1 |
None |
alt |
None |
True |
None |
13 |
70196 |
SELECT COUNT(*)
FROM explorer_databaseconnection; |
Sept. 10, 2024, 3:09 p.m. |
291 |
1 |
2.129077911376953 |
|
None |
True |
223 |
14 |
1853 |
select * from employees |
July 5, 2024, 7:32 a.m. |
None |
1 |
None |
northwind.dbs |
None |
True |
None |
15 |
7328 |
select * from suppliers |
July 7, 2024, 12:41 a.m. |
None |
1 |
None |
alt |
None |
True |
None |
16 |
70197 |
SELECT *
FROM hello_greeting
ORDER BY "when" ASC
LIMIT 1; |
Sept. 10, 2024, 3:26 p.m. |
159 |
1 |
6.532192230224609 |
|
None |
True |
223 |
17 |
70198 |
SELECT *
FROM DATA d
where d.Writer = 'David Scarpa'
LIMIT 10 |
Sept. 10, 2024, 3:28 p.m. |
51 |
1 |
3.9472579956054688 |
|
None |
True |
25 |
18 |
70199 |
select * from country |
Sept. 10, 2024, 3:28 p.m. |
57 |
1 |
3.835439682006836 |
|
None |
True |
24 |
19 |
836 |
select * from employees |
July 4, 2024, 5:08 a.m. |
None |
1 |
None |
northwind.dbs |
None |
True |
None |
20 |
70200 |
select * from  data |
Sept. 10, 2024, 4:02 p.m. |
35 |
1 |
None |
|
no such table: Â data |
False |
25 |
21 |
70201 |
SELECT * FROM greeting; |
Sept. 10, 2024, 4:45 p.m. |
96 |
1 |
None |
|
relation "greeting" does not exist
LINE 1: SELECT * FROM greeting;
^ |
False |
223 |
22 |
751 |
select * from CustomerCustomerDemo |
July 4, 2024, 12:16 a.m. |
None |
1 |
None |
alt |
None |
True |
None |
23 |
70202 |
SELECT *
FROM data
WHERE Director = 'Clint Eastwood'; |
Sept. 10, 2024, 5:41 p.m. |
49 |
1 |
15.339374542236328 |
|
None |
True |
25 |
24 |
70204 |
SELECT
Products.ProductID,
Products.ProductName,
Products.SupplierID,
Products.CategoryID,
Products.QuantityPerUnit,
Products.UnitPrice,
Products.UnitsInStock,
Products.ProductName,
Products.UnitsOnOrder,
Products.ReorderLevel,
Products.Discontinued,
Employees.Address AS EmployeeAddress,
prod.ReorderLevel
FROM
Products prod
JOIN
Employees ON Products.SupplierID = Employees.EmployeeID
group BY
Products.CategoryID,Products.ProductName
ORDER BY
Products.ProductName |
Sept. 10, 2024, 5:47 p.m. |
None |
1 |
None |
|
no such column: Products.ProductID |
False |
23 |
25 |
70203 |
WITH StoreRentals AS (
SELECT
i.store_id,
COUNT(r.rental_id) AS rental_count
FROM
rental r
INNER JOIN inventory i ON r.inventory_id = i.inventory_id
GROUP BY
i.store_id
)
SELECT
s.store_id,
s.manager_staff_id,
s.address_id,
sr.rental_count
FROM
StoreRentals sr
INNER JOIN store s ON sr.store_id = s.store_id
ORDER BY
sr.rental_count DESC; |
Sept. 10, 2024, 5:43 p.m. |
18 |
1 |
338.8831615447998 |
|
None |
True |
24 |
26 |
32916 |
select 12; |
July 13, 2024, 8:10 a.m. |
None |
1 |
5.800008773803711 |
default |
None |
True |
223 |
27 |
70205 |
select * from actor; |
Sept. 10, 2024, 5:52 p.m. |
67 |
1 |
5.263805389404297 |
|
None |
True |
24 |
28 |
70206 |
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; |
Sept. 10, 2024, 5:52 p.m. |
17 |
1 |
64.70179557800293 |
|
None |
True |
24 |
29 |
70207 |
select * from actor; |
Sept. 10, 2024, 5:53 p.m. |
67 |
1 |
3.5583972930908203 |
|
None |
True |
24 |
30 |
690 |
select * from CustomerCustomerDemo |
July 3, 2024, 4:05 p.m. |
None |
1 |
None |
alt |
None |
True |
None |
31 |
687 |
SELECT COUNT(id) as total_migrations FROM django_migrations; |
July 3, 2024, 4:05 p.m. |
None |
1 |
1.5344619750976562 |
default |
None |
True |
223 |
32 |
70208 |
SELECT *
FROM DATA
WHERE data.Title = "Matrix: Resurrections" |
Sept. 10, 2024, 6:21 p.m. |
22 |
1 |
4.91786003112793 |
|
None |
True |
25 |
33 |
70209 |
select * from Customers c where c.CompanyName like '%a%'; |
Sept. 10, 2024, 6:52 p.m. |
19 |
1 |
4.717111587524414 |
|
None |
True |
23 |
34 |
70210 |
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; |
Sept. 10, 2024, 6:53 p.m. |
17 |
1 |
55.6638240814209 |
|
None |
True |
24 |
35 |
691 |
select * from CustomerCustomerDemo |
July 3, 2024, 4:15 p.m. |
None |
1 |
None |
alt |
None |
True |
None |
36 |
1448 |
select * from suppliers |
July 5, 2024, 12:14 a.m. |
None |
1 |
None |
alt |
None |
True |
None |
37 |
645 |
select * from explorer_explorervalue |
July 3, 2024, 9:08 a.m. |
None |
1 |
1.7614364624023438 |
default |
None |
True |
223 |
38 |
70211 |
SELECT *
FROM data |
Sept. 10, 2024, 7:01 p.m. |
59 |
1 |
3.10516357421875 |
|
None |
True |
25 |
39 |
692 |
select * from suppliers |
July 3, 2024, 4:21 p.m. |
None |
1 |
None |
alt |
None |
True |
None |
40 |
761 |
select * from CustomerCustomerDemo |
July 4, 2024, 12:48 a.m. |
None |
1 |
None |
northwind.dbs |
None |
True |
None |
41 |
1289 |
select * from CustomerCustomerDemo |
July 4, 2024, 9:43 p.m. |
None |
1 |
None |
alt |
None |
True |
None |
42 |
577 |
SELECT app,
COUNT(*) AS num_migrations
FROM django_migrations
GROUP BY app
ORDER BY num_migrations ASC; |
July 3, 2024, 6:41 a.m. |
None |
1 |
2.3429393768310547 |
default |
None |
True |
223 |
43 |
762 |
select * from explorer_query |
July 4, 2024, 12:48 a.m. |
None |
1 |
1.5366077423095703 |
default |
None |
True |
223 |
44 |
765 |
SELECT app,
COUNT(*) AS num_migrations
FROM django_migrations
GROUP BY app
ORDER BY num_migrations ASC; |
July 4, 2024, 12:55 a.m. |
None |
1 |
1.4352798461914062 |
default |
None |
True |
223 |
45 |
1290 |
select 1; |
July 4, 2024, 9:44 p.m. |
None |
1 |
1.0874271392822266 |
default |
None |
True |
223 |
46 |
70212 |
SELECT *
FROM data
WHERE Director = 'Clint Eastwood'; |
Sept. 10, 2024, 7:02 p.m. |
49 |
1 |
3.0574798583984375 |
|
None |
True |
25 |
47 |
693 |
select * from suppliers |
July 3, 2024, 4:25 p.m. |
None |
1 |
None |
alt |
None |
True |
None |
48 |
764 |
select id, duration from explorer_promptlog; |
July 4, 2024, 12:55 a.m. |
3 |
1 |
1.1146068572998047 |
default |
None |
True |
223 |
49 |
70213 |
SELECT "Main Genres" AS genre,
"Release Year" AS YEAR,
COUNT(*) AS total_movies
FROM DATA
GROUP BY genre,
YEAR
ORDER BY genre,
YEAR |
Sept. 10, 2024, 8:02 p.m. |
32 |
1 |
8.761167526245117 |
|
None |
True |
25 |
50 |
854 |
SELECT
material_type,
AVG(speed) AS average_speed
FROM
data
WHERE
material_type IN ('Wood', 'Steel')
GROUP BY
material_type;
|
July 4, 2024, 6:17 a.m. |
None |
1 |
None |
roller_coasters.db |
None |
True |
None |
51 |
70214 |
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; |
Sept. 10, 2024, 8:27 p.m. |
17 |
1 |
31.92758560180664 |
|
None |
True |
24 |
52 |
70215 |
SELECT movie_id,
title,
score
FROM movies
WHERE score >= 8
ORDER BY score DESC; |
Sept. 10, 2024, 9:21 p.m. |
62 |
1 |
None |
|
relation "movies" does not exist
LINE 4: FROM movies
^ |
False |
223 |
53 |
70216 |
SELECT "Main Genres" AS genre,
"Release Year" AS YEAR,
COUNT(*) AS total_movies
FROM DATA
GROUP BY genre,
YEAR
ORDER BY genre,
YEAR |
Sept. 10, 2024, 9:26 p.m. |
32 |
1 |
10.503530502319336 |
|
None |
True |
25 |
54 |
658 |
select * from explorer_explorervalue |
July 3, 2024, 11:04 a.m. |
None |
1 |
2.5682449340820312 |
default |
None |
True |
223 |
55 |
70217 |
select * from country |
Sept. 10, 2024, 10:02 p.m. |
57 |
1 |
4.3239593505859375 |
|
None |
True |
24 |
56 |
1455 |
select * from employees |
July 5, 2024, 12:19 a.m. |
None |
1 |
None |
northwind.dbs |
None |
True |
None |
57 |
70218 |
WITH RankedHorrorMovies AS
(SELECT title,
`Release Year`,
ROW_NUMBER() OVER (PARTITION BY release_year) AS rank
FROM DATA
WHERE genre = 'Horror')
SELECT title,
release_year
FROM RankedHorrorMovies
WHERE rank <= 15; |
Sept. 10, 2024, 10:02 p.m. |
26 |
1 |
None |
|
no such column: release_year |
False |
25 |
58 |
70219 |
SELECT *
FROM data
WHERE Director = 'Clint Eastwood'; |
Sept. 10, 2024, 11:09 p.m. |
49 |
1 |
3.1287670135498047 |
|
None |
True |
25 |
59 |
70221 |
SELECT "Main Genres" AS genre,
"Release Year" AS YEAR,
COUNT(*) AS total_movies
FROM DATA
GROUP BY genre,
YEAR
ORDER BY genre,
YEAR |
Sept. 10, 2024, 11:09 p.m. |
32 |
1 |
8.829832077026367 |
|
None |
True |
25 |
60 |
70222 |
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 ASC; |
Sept. 10, 2024, 11:09 p.m. |
24 |
1 |
None |
|
no such table: Orders |
False |
60 |
61 |
773 |
select * from Customers |
July 4, 2024, 1:34 a.m. |
None |
1 |
None |
northwind.dbs |
None |
True |
None |
62 |
70220 |
SELECT "Main Genres" AS genre,
"Release Year" AS YEAR,
COUNT(*) AS total_movies
FROM DATA
GROUP BY genre,
YEAR
ORDER BY genre,
YEAR |
Sept. 10, 2024, 11:09 p.m. |
32 |
1 |
8.643627166748047 |
|
None |
True |
25 |
63 |
70223 |
select * from Customers c where c.CompanyName like '%a%'; |
Sept. 10, 2024, 11:10 p.m. |
19 |
1 |
3.766298294067383 |
|
None |
True |
23 |
64 |
70224 |
SELECT Title,
Summary,
Director,
Writer,
"Main Genres",
"Motion Picture Rating",
"Release Year",
"Runtime (Minutes)",
"Rating (Out of 10)",
"Number of Ratings (in thousands)",
"Budget (in millions)",
"Gross in US & Canada (in millions)",
"Gross worldwide (in millions)",
"Opening Weekend in US & Canada",
"Gross Opening Weekend (in millions)"
FROM data
ORDER BY LENGTH(Title) DESC
LIMIT 1; |
Sept. 10, 2024, 11:10 p.m. |
72 |
1 |
6.408452987670898 |
|
None |
True |
25 |
65 |
70225 |
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; |
Sept. 10, 2024, 11:10 p.m. |
17 |
1 |
32.41419792175293 |
|
None |
True |
24 |
66 |
32919 |
select 12; |
July 13, 2024, 8:10 a.m. |
None |
1 |
1.7673969268798828 |
default |
None |
True |
223 |
67 |
70226 |
select count(*)
from user
where names like '%hotmail.com' |
Sept. 11, 2024, 12:12 a.m. |
76 |
1 |
None |
|
column "names" does not exist
LINE 3: where names like '%hotmail.com'
^ |
False |
223 |
68 |
70227 |
SELECT *
FROM DATA d
where d.Writer = 'David Scarpa'
LIMIT 10 |
Sept. 11, 2024, 12:12 a.m. |
51 |
1 |
3.5851001739501953 |
|
None |
True |
25 |
69 |
775 |
select * from employees |
July 4, 2024, 1:41 a.m. |
None |
1 |
None |
1 |
None |
True |
None |
70 |
1169 |
SELECT COUNT(*) AS num_migrations
FROM django_migrations;
|
July 4, 2024, 7:22 p.m. |
None |
1 |
1.463174819946289 |
default |
None |
True |
223 |
71 |
70228 |
SELECT *
FROM data |
Sept. 11, 2024, 12:13 a.m. |
59 |
1 |
3.0944347381591797 |
|
None |
True |
25 |
72 |
70229 |
SELECT *
FROM hello_greeting
ORDER BY "when" ASC
LIMIT 1; |
Sept. 11, 2024, 12:26 a.m. |
159 |
1 |
2.0744800567626953 |
|
None |
True |
223 |
73 |
777 |
select * from employees |
July 4, 2024, 1:54 a.m. |
None |
1 |
None |
northwind.dbs |
None |
True |
None |
74 |
778 |
select * from employees |
July 4, 2024, 1:55 a.m. |
None |
1 |
None |
northwind.dbs |
None |
True |
None |
75 |
1474 |
SELECT
material_type,
AVG(speed) AS average_speed
FROM
data
WHERE
material_type IN ('Wood', 'Steel')
GROUP BY
material_type;
|
July 5, 2024, 12:36 a.m. |
None |
1 |
None |
roller_coasters.db |
None |
True |
None |
76 |
70230 |
SELECT *
FROM hello_greeting
ORDER BY "when" ASC
LIMIT 1; |
Sept. 11, 2024, 12:37 a.m. |
159 |
1 |
1.9669532775878906 |
|
None |
True |
223 |
77 |
779 |
select * from employees |
July 4, 2024, 2:01 a.m. |
None |
1 |
None |
northwind.dbs |
None |
True |
None |
78 |
1476 |
select * from suppliers |
July 5, 2024, 12:39 a.m. |
None |
1 |
None |
alt |
None |
True |
None |
79 |
70231 |
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 ASC; |
Sept. 11, 2024, 1:30 a.m. |
None |
1 |
None |
|
no such table: Orders |
False |
60 |
80 |
946 |
select * from actor |
July 4, 2024, 11:51 a.m. |
None |
1 |
3.3745765686035156 |
sqlite-sakila.db |
None |
True |
24 |
81 |
70232 |
select *
from data
limit 10 |
Sept. 11, 2024, 1:57 a.m. |
46 |
1 |
2.93731689453125 |
|
None |
True |
25 |
82 |
781 |
select * from employees |
July 4, 2024, 2:17 a.m. |
None |
1 |
None |
northwind.dbs |
None |
True |
None |
83 |
782 |
select * from employees |
July 4, 2024, 2:19 a.m. |
None |
1 |
None |
northwind.dbs |
None |
True |
None |
84 |
70233 |
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; |
Sept. 11, 2024, 2:37 a.m. |
17 |
1 |
39.01028633117676 |
|
None |
True |
24 |
85 |
70234 |
select * from country |
Sept. 11, 2024, 2:43 a.m. |
57 |
1 |
3.6857128143310547 |
|
None |
True |
24 |
86 |
783 |
select * from employees |
July 4, 2024, 2:24 a.m. |
None |
1 |
None |
northwind.dbs |
None |
True |
None |
87 |
1320 |
select * from suppliers |
July 4, 2024, 10:12 p.m. |
None |
1 |
None |
alt |
None |
True |
None |
88 |
784 |
select * from employees |
July 4, 2024, 2:31 a.m. |
None |
1 |
None |
northwind.dbs |
None |
True |
None |
89 |
70235 |
select *
from data
limit 10 |
Sept. 11, 2024, 2:55 a.m. |
46 |
1 |
3.2002925872802734 |
|
None |
True |
25 |
90 |
70236 |
SELECT name
FROM sqlite_master
WHERE type = 'table'; |
Sept. 11, 2024, 4:12 a.m. |
43 |
1 |
11.320114135742188 |
|
None |
True |
58 |
91 |
786 |
select * from employees |
July 4, 2024, 2:34 a.m. |
None |
1 |
None |
northwind.dbs |
None |
True |
None |
92 |
70237 |
PRAGMA table_info(your_table_name); |
Sept. 11, 2024, 4:16 a.m. |
42 |
1 |
2.9103755950927734 |
|
None |
True |
58 |
93 |
1325 |
select * from suppliers |
July 4, 2024, 10:17 p.m. |
None |
1 |
None |
alt |
None |
True |
None |
94 |
70238 |
SELECT * FROM data; |
Sept. 11, 2024, 4:43 a.m. |
73 |
1 |
3.6170482635498047 |
|
None |
True |
58 |
95 |
70242 |
select *
from data
limit 10 |
Sept. 11, 2024, 4:50 a.m. |
46 |
1 |
3.0698776245117188 |
|
None |
True |
25 |
96 |
70239 |
SELECT *
FROM DATA d
where d.Writer = 'David Scarpa'
LIMIT 10 |
Sept. 11, 2024, 4:45 a.m. |
51 |
1 |
3.5729408264160156 |
|
None |
True |
25 |
97 |
70240 |
SELECT 'film_actor' AS table_name, COUNT(*) AS row_count FROM film_actor
UNION ALL
SELECT 'actor' AS table_name, COUNT(*) AS row_count FROM actor
UNION ALL
SELECT 'film' AS table_name, COUNT(*) AS row_count FROM film
ORDER BY row_count DESC; |
Sept. 11, 2024, 4:47 a.m. |
27 |
1 |
10.522842407226562 |
|
None |
True |
24 |
98 |
70241 |
SELECT *
FROM data
WHERE Director = 'Clint Eastwood'; |
Sept. 11, 2024, 4:48 a.m. |
49 |
1 |
2.9754638671875 |
|
None |
True |
25 |
99 |
1194 |
select * from CustomerCustomerDemo |
July 4, 2024, 7:44 p.m. |
None |
1 |
None |
alt |
None |
True |
None |
100 |
791 |
select * from employees |
July 4, 2024, 2:57 a.m. |
None |
1 |
None |
1 |
None |
True |
None |
101 |
70243 |
Select Customers.CompanyName, Customers.ContactName
from Customers |
Sept. 11, 2024, 4:51 a.m. |
45 |
1 |
4.971027374267578 |
|
None |
True |
23 |
102 |
70244 |
SELECT *
FROM DATA d
where d.Writer = 'David Scarpa'
LIMIT 10 |
Sept. 11, 2024, 4:56 a.m. |
51 |
1 |
3.0400753021240234 |
|
None |
True |
25 |
103 |
70245 |
SELECT *
FROM data
WHERE Director = 'Clint Eastwood'; |
Sept. 11, 2024, 4:57 a.m. |
49 |
1 |
5.769968032836914 |
|
None |
True |
25 |
104 |
1078 |
select * from explorer_promptlog |
July 4, 2024, 5:01 p.m. |
None |
1 |
1.9953250885009766 |
default |
None |
True |
223 |
105 |
792 |
select * from employees |
July 4, 2024, 3:04 a.m. |
None |
1 |
None |
northwind.dbs |
None |
True |
None |
106 |
70246 |
select *
from data
limit 10 |
Sept. 11, 2024, 4:57 a.m. |
46 |
1 |
3.057718276977539 |
|
None |
True |
25 |
107 |
1204 |
select * from employees |
July 4, 2024, 7:55 p.m. |
None |
1 |
None |
northwind.dbs |
None |
True |
None |
108 |
70247 |
Select Customers.CompanyName, Customers.ContactName
from Customers |
Sept. 11, 2024, 4:58 a.m. |
45 |
1 |
3.719329833984375 |
|
None |
True |
23 |
109 |
70248 |
SELECT * FROM data
--WHERE when =
--FORMAT |
Sept. 11, 2024, 4:59 a.m. |
40 |
1 |
3.1304359436035156 |
|
None |
True |
25 |
110 |
70250 |
SELECT * FROM hello_greeting |
Sept. 11, 2024, 5:01 a.m. |
39 |
1 |
1.947164535522461 |
|
None |
True |
223 |
111 |
70251 |
select * from django_session |
Sept. 11, 2024, 5:01 a.m. |
37 |
1 |
829.9274444580078 |
|
None |
True |
223 |
112 |
70253 |
select * from user; |
Sept. 11, 2024, 5:02 a.m. |
33 |
1 |
1.9388198852539062 |
|
None |
True |
223 |
113 |
70255 |
SELECT "Main Genres" AS genre,
"Release Year" AS YEAR,
COUNT(*) AS total_movies
FROM DATA
GROUP BY genre,
YEAR
ORDER BY genre,
YEAR |
Sept. 11, 2024, 5:03 a.m. |
32 |
1 |
9.341955184936523 |
|
None |
True |
25 |
114 |
70257 |
SELECT job_link, job_summary, LENGTH(job_summary) as summary_length
FROM data
ORDER BY summary_length DESC
LIMIT 1; |
Sept. 11, 2024, 5:04 a.m. |
75 |
1 |
282.8793525695801 |
|
None |
True |
60 |
115 |
70261 |
SELECT *
FROM explorer_databaseconnection |
Sept. 11, 2024, 5:07 a.m. |
50 |
1 |
1.9207000732421875 |
|
None |
True |
223 |
116 |
20651 |
select 1; |
July 11, 2024, 2:43 p.m. |
None |
1 |
2.702951431274414 |
default |
None |
True |
223 |
117 |
70249 |
SELECT *
FROM django_migrations
WHERE django_migrations.app = '' |
Sept. 11, 2024, 5 a.m. |
13 |
1 |
1.8925666809082031 |
|
None |
True |
223 |
118 |
797 |
-- SELECT
-- material_type,
-- AVG(speed) AS average_speed
-- FROM
-- data
-- WHERE
-- material_type IN ('Wood', 'Steel')
-- GROUP BY
-- material_type;
select * from data |
July 4, 2024, 3:19 a.m. |
None |
1 |
None |
roller_coasters.db |
None |
True |
None |
119 |
70252 |
select * from actor |
Sept. 11, 2024, 5:02 a.m. |
36 |
1 |
4.431009292602539 |
|
None |
True |
24 |
120 |
70254 |
SELECT 'film_actor' AS table_name, COUNT(*) AS row_count FROM film_actor
UNION ALL
SELECT 'actor' AS table_name, COUNT(*) AS row_count FROM actor
UNION ALL
SELECT 'film' AS table_name, COUNT(*) AS row_count FROM film
ORDER BY row_count DESC; |
Sept. 11, 2024, 5:02 a.m. |
27 |
1 |
3.6132335662841797 |
|
None |
True |
24 |
121 |
70256 |
PRAGMA table_info('data'); |
Sept. 11, 2024, 5:04 a.m. |
44 |
1 |
2.98309326171875 |
|
None |
True |
58 |
122 |
70258 |
select * from actor; |
Sept. 11, 2024, 5:05 a.m. |
74 |
1 |
3.6878585815429688 |
|
None |
True |
24 |
123 |
70259 |
SELECT name
FROM sqlite_master
WHERE type = 'table'; |
Sept. 11, 2024, 5:06 a.m. |
43 |
1 |
3.0210018157958984 |
|
None |
True |
58 |
124 |
70260 |
select * from country |
Sept. 11, 2024, 5:07 a.m. |
57 |
1 |
3.7202835083007812 |
|
None |
True |
24 |
125 |
70262 |
PRAGMA table_info(your_table_name); |
Sept. 11, 2024, 5:07 a.m. |
42 |
1 |
3.1232833862304688 |
|
None |
True |
58 |
126 |
70263 |
select * from Customers c where c.CompanyName like '%a%'; |
Sept. 11, 2024, 5:21 a.m. |
19 |
1 |
3.5600662231445312 |
|
None |
True |
23 |
127 |
1208 |
select * from employees |
July 4, 2024, 7:59 p.m. |
None |
1 |
None |
northwind.dbs |
None |
True |
None |
128 |
70264 |
SELECT
Products.ProductID,
Products.ProductName,
Products.SupplierID,
Products.CategoryID,
Products.QuantityPerUnit,
Products.UnitPrice,
Products.UnitsInStock,
Products.ProductName,
Products.UnitsOnOrder,
Products.ReorderLevel,
Products.Discontinued,
Employees.Address AS EmployeeAddress,
prod.ReorderLevel
FROM
Products prod
JOIN
Employees ON Products.SupplierID = Employees.EmployeeID
group BY
Products.CategoryID,Products.ProductName
ORDER BY
Products.ProductName |
Sept. 11, 2024, 5:28 a.m. |
21 |
1 |
None |
|
no such column: Products.ProductID |
False |
23 |
129 |
1344 |
SELECT
material_type,
AVG(speed) AS average_speed
FROM
data
WHERE
material_type IN ('Wood', 'Steel')
GROUP BY
material_type;
|
July 4, 2024, 10:43 p.m. |
None |
1 |
None |
roller_coasters.db |
None |
True |
None |
130 |
1708 |
select * from suppliers |
July 5, 2024, 4:40 a.m. |
None |
1 |
None |
alt |
None |
True |
None |
131 |
729 |
select * from CustomerCustomerDemo |
July 3, 2024, 9:37 p.m. |
None |
1 |
None |
alt |
None |
True |
None |
132 |
70265 |
WITH StoreRentals AS (
SELECT
i.store_id,
COUNT(r.rental_id) AS rental_count
FROM
rental r
INNER JOIN inventory i ON r.inventory_id = i.inventory_id
GROUP BY
i.store_id
)
SELECT
s.store_id,
s.manager_staff_id,
s.address_id,
sr.rental_count
FROM
StoreRentals sr
INNER JOIN store s ON sr.store_id = s.store_id
ORDER BY
sr.rental_count DESC; |
Sept. 11, 2024, 5:34 a.m. |
18 |
1 |
72.65496253967285 |
|
None |
True |
24 |
133 |
1088 |
select * from CustomerCustomerDemo |
July 4, 2024, 5:22 p.m. |
None |
1 |
None |
alt |
None |
True |
None |
134 |
70266 |
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; |
Sept. 11, 2024, 5:40 a.m. |
20 |
1 |
8.867502212524414 |
|
None |
True |
223 |
135 |
810 |
SELECT
material_type,
AVG(speed) AS average_speed
FROM
data
WHERE
material_type IN ('Wooden', 'Steel')
GROUP BY
material_type;
|
July 4, 2024, 3:58 a.m. |
None |
1 |
None |
roller_coasters.db |
None |
True |
None |
136 |
70267 |
SELECT job_link as jl
FROM data
WHERE job_location = 'Knoxville, TN'; |
Sept. 11, 2024, 5:46 a.m. |
61 |
1 |
6.389379501342773 |
|
None |
True |
59 |
137 |
70268 |
select *
from django_session |
Sept. 11, 2024, 5:49 a.m. |
16 |
1 |
1284.0003967285156 |
|
None |
True |
223 |
138 |
731 |
select * from CustomerCustomerDemo |
July 3, 2024, 9:59 p.m. |
None |
1 |
None |
alt |
None |
True |
None |
139 |
70269 |
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, salesamount
FROM SalesData |
Sept. 11, 2024, 5:51 a.m. |
14 |
1 |
79.91218566894531 |
|
None |
True |
23 |
140 |
70270 |
SELECT job_link as jl
FROM data
WHERE job_location = 'Knoxville, TN'; |
Sept. 11, 2024, 6:02 a.m. |
61 |
1 |
5.541324615478516 |
|
None |
True |
59 |
141 |
70271 |
SELECT Title, "Runtime (Minutes)"
FROM data
WHERE "Runtime (Minutes)" > 100; |
Sept. 11, 2024, 6:02 a.m. |
357 |
1 |
3.3380985260009766 |
|
None |
True |
25 |
142 |
70272 |
SELECT * FROM actors |
Sept. 11, 2024, 7:28 a.m. |
38 |
1 |
None |
|
no such table: actors |
False |
25 |
143 |
733 |
SELECT COUNT(*) AS num_migrations
FROM django_migrations;
|
July 3, 2024, 10:18 p.m. |
None |
1 |
1.3091564178466797 |
default |
None |
True |
223 |
144 |
814 |
SELECT COUNT(id) as total_migrations FROM django_migrations; |
July 4, 2024, 4:04 a.m. |
None |
1 |
1.384735107421875 |
default |
None |
True |
223 |
145 |
1004 |
SELECT app,
COUNT(*) AS num_migrations
FROM django_migrations
GROUP BY app
ORDER BY num_migrations ASC; |
July 4, 2024, 1:15 p.m. |
None |
1 |
1.8284320831298828 |
default |
None |
True |
223 |
146 |
1728 |
select 1 |
July 5, 2024, 5:21 a.m. |
None |
1 |
1.5246868133544922 |
default |
None |
True |
223 |
147 |
70273 |
WITH FilmDetails AS
(SELECT f.film_id,
f.title,
f.description,
f.release_year,
f.rating,
a.actor_id,
a.first_name || ' ' || a.last_name AS actor_name
FROM film f
JOIN film_actor fa ON f.film_id = fa.film_id
JOIN actor a ON fa.actor_id = a.actor_id),
FilmPayments AS
(SELECT f.film_id,
SUM(p.amount) AS total_payment_amount,
COUNT(p.payment_id) AS payment_count
FROM film f
JOIN inventory i ON f.film_id = i.film_id
JOIN rental r ON i.inventory_id = r.inventory_id
JOIN payment p ON r.rental_id = p.rental_id
GROUP BY f.film_id)
SELECT fd.title,
fd.description,
fd.release_year,
fd.rating,
fd.actor_name,
fp.total_payment_amount,
fp.payment_count
FROM FilmDetails fd
LEFT JOIN FilmPayments fp ON fd.film_id = fp.film_id
ORDER BY fd.title; |
Sept. 11, 2024, 7:28 a.m. |
54 |
1 |
94.08426284790039 |
|
None |
True |
24 |
148 |
70274 |
SELECT name
FROM sqlite_master
WHERE type = 'table'; |
Sept. 11, 2024, 7:29 a.m. |
43 |
1 |
2.9366016387939453 |
|
None |
True |
58 |
149 |
904 |
SELECT
material_type,
AVG(speed) AS average_speed
FROM
data
WHERE
material_type IN ('Wooden', 'Steel')
GROUP BY
material_type;
|
July 4, 2024, 9:05 a.m. |
None |
1 |
None |
roller_coasters.db |
None |
True |
None |
150 |
70275 |
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; |
Sept. 11, 2024, 8:26 a.m. |
17 |
1 |
32.38821029663086 |
|
None |
True |
24 |
151 |
737 |
SELECT app,
COUNT(*) AS num_migrations
FROM django_migrations
GROUP BY app
ORDER BY num_migrations ASC; |
July 3, 2024, 10:34 p.m. |
None |
1 |
1.6548633575439453 |
default |
None |
True |
223 |
152 |
70276 |
SELECT Title,
Summary,
Director,
Writer,
"Main Genres",
"Motion Picture Rating",
"Release Year",
"Runtime (Minutes)",
"Rating (Out of 10)",
"Number of Ratings (in thousands)",
"Budget (in millions)",
"Gross in US & Canada (in millions)",
"Gross worldwide (in millions)",
"Opening Weekend in US & Canada",
"Gross Opening Weekend (in millions)"
FROM data
ORDER BY LENGTH(Title) DESC
LIMIT 1; |
Sept. 11, 2024, 8:42 a.m. |
72 |
1 |
5.110740661621094 |
|
None |
True |
25 |
153 |
1008 |
select * from explorer_explorervalue |
July 4, 2024, 1:33 p.m. |
None |
1 |
6.287336349487305 |
default |
None |
True |
223 |
154 |
70277 |
SELECT action_time,
content_type_id
FROM django_admin_log; |
Sept. 11, 2024, 8:46 a.m. |
71 |
1 |
None |
|
no such table: django_admin_log |
False |
23 |
155 |
70278 |
SELECT Title, [Release Year]
FROM data |
Sept. 11, 2024, 8:51 a.m. |
68 |
1 |
3.042936325073242 |
|
None |
True |
25 |
156 |
1734 |
SELECT
material_type,
AVG(speed) AS average_speed
FROM
data
WHERE
material_type IN ('Wood', 'Steel')
GROUP BY
material_type;
|
July 5, 2024, 5:34 a.m. |
None |
1 |
None |
roller_coasters.db |
None |
True |
None |
157 |
70279 |
SELECT job_link as jl
FROM data
WHERE job_location = 'Knoxville, TN'; |
Sept. 11, 2024, 8:55 a.m. |
61 |
1 |
3.6029815673828125 |
|
None |
True |
59 |
158 |
70282 |
SELECT session_key AS test,
session_data AS DATA,
expire_date
FROM django_session
WHERE expire_date > CURRENT_TIMESTAMP; |
Sept. 11, 2024, 8:59 a.m. |
55 |
1 |
None |
|
no such table: django_session |
False |
24 |
159 |
1534 |
select * from suppliers |
July 5, 2024, 1:57 a.m. |
None |
1 |
None |
alt |
None |
True |
None |
160 |
70280 |
WITH customer_city AS
(SELECT c.customer_id,
a.city_id
FROM customer c
JOIN address a ON c.address_id = a.address_id),
city_customer_count AS
(SELECT cc.city_id,
ci.city,
COUNT(cc.customer_id) AS customer_count
FROM customer_city cc
JOIN city ci ON cc.city_id = ci.city_id
GROUP BY cc.city_id,
ci.city)
SELECT city,
customer_count
FROM city_customer_count
ORDER BY customer_count DESC
LIMIT 1; |
Sept. 11, 2024, 8:57 a.m. |
60 |
1 |
15.533924102783203 |
|
None |
True |
24 |
161 |
70281 |
select * from actor; |
Sept. 11, 2024, 8:59 a.m. |
67 |
1 |
4.517078399658203 |
|
None |
True |
24 |
162 |
70283 |
SELECT job_link, job_summary, LENGTH(job_summary) as summary_length
FROM data
ORDER BY summary_length DESC
LIMIT 1; |
Sept. 11, 2024, 8:59 a.m. |
75 |
1 |
273.7717628479004 |
|
None |
True |
60 |
163 |
70284 |
SELECT job_link, job_summary, LENGTH(job_summary) as summary_length
FROM data
ORDER BY summary_length DESC
LIMIT 1; |
Sept. 11, 2024, 9 a.m. |
75 |
1 |
52.81639099121094 |
|
None |
True |
60 |
164 |
70285 |
select * from job_link; |
Sept. 11, 2024, 9 a.m. |
75 |
1 |
None |
|
no such table: job_link |
False |
60 |
165 |
1363 |
select * from employees |
July 4, 2024, 11:05 p.m. |
None |
1 |
None |
northwind.dbs |
None |
True |
None |
166 |
70286 |
.schema |
Sept. 11, 2024, 9:01 a.m. |
75 |
1 |
None |
|
near ".": syntax error |
False |
60 |
167 |
70289 |
select count(*) from data; |
Sept. 11, 2024, 9:02 a.m. |
75 |
1 |
16.05057716369629 |
|
None |
True |
60 |
168 |
70287 |
SELECT * FROM django_migrations;
select * from django_admin_log; |
Sept. 11, 2024, 9:01 a.m. |
66 |
1 |
3.1125545501708984 |
|
None |
True |
223 |
169 |
70288 |
select * from data; |
Sept. 11, 2024, 9:01 a.m. |
75 |
1 |
3.1104087829589844 |
|
None |
True |
60 |
170 |
70290 |
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 ASC; |
Sept. 11, 2024, 9:03 a.m. |
24 |
1 |
None |
|
no such table: Orders |
False |
60 |
171 |
70291 |
select 12; |
Sept. 11, 2024, 9:04 a.m. |
65 |
1 |
1.4395713806152344 |
|
None |
True |
223 |
172 |
70292 |
SELECT location, COUNT(*) as job_count
FROM jobs
GROUP BY location; |
Sept. 11, 2024, 9:26 a.m. |
3 |
1 |
None |
|
no such table: jobs |
False |
59 |
173 |
70293 |
SELECT * FROM "maestro-v3.0.0_1" WHERE canonical_composer = "Alban Berg"; |
Sept. 11, 2024, 10 a.m. |
162 |
1 |
None |
|
no such table: maestro-v3.0.0_1 |
False |
124 |
174 |
1550 |
SELECT COUNT(*) AS TotalMigrations
FROM django_migrations;
|
July 5, 2024, 2:09 a.m. |
None |
1 |
2.2885799407958984 |
default |
None |
True |
223 |
175 |
70294 |
select * from django_session |
Sept. 11, 2024, 10:06 a.m. |
37 |
1 |
198.33803176879883 |
|
None |
True |
223 |
176 |
70295 |
SELECT * from django_session; |
Sept. 11, 2024, 10:10 a.m. |
78 |
1 |
256.87456130981445 |
|
None |
True |
223 |
177 |
70299 |
SELECT movie_id,
title,
score
FROM movies
WHERE score >= 8
ORDER BY score DESC; |
Sept. 11, 2024, 10:15 a.m. |
62 |
1 |
None |
|
relation "movies" does not exist
LINE 4: FROM movies
^ |
False |
223 |
178 |
70296 |
SELECT job_link as jl
FROM data
WHERE job_location = 'Knoxville, TN'; |
Sept. 11, 2024, 10:13 a.m. |
61 |
1 |
5.326271057128906 |
|
None |
True |
59 |
179 |
70297 |
SELECT *
FROM data
WHERE Director = 'Clint Eastwood'; |
Sept. 11, 2024, 10:14 a.m. |
49 |
1 |
4.39143180847168 |
|
None |
True |
25 |
180 |
70298 |
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; |
Sept. 11, 2024, 10:14 a.m. |
17 |
1 |
85.03317832946777 |
|
None |
True |
24 |
181 |
70300 |
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; |
Sept. 11, 2024, 10:52 a.m. |
17 |
1 |
33.52022171020508 |
|
None |
True |
24 |
182 |
1561 |
select * from CustomerCustomerDemo |
July 5, 2024, 2:23 a.m. |
None |
1 |
None |
alt |
None |
True |
None |
183 |
1774 |
select 1; |
July 5, 2024, 6:07 a.m. |
None |
1 |
1.4672279357910156 |
default |
None |
True |
223 |
184 |
70301 |
select * from tq |
Sept. 11, 2024, 10:52 a.m. |
52 |
1 |
None |
|
no such table: tq |
False |
62 |
185 |
1385 |
select * from employees |
July 4, 2024, 11:27 p.m. |
None |
1 |
None |
northwind.dbs |
None |
True |
None |
186 |
70302 |
SELECT
Products.ProductID,
Products.ProductName,
Products.SupplierID,
Products.CategoryID,
Products.QuantityPerUnit,
Products.UnitPrice,
Products.UnitsInStock,
Products.ProductName,
Products.UnitsOnOrder,
Products.ReorderLevel,
Products.Discontinued,
Employees.Address AS EmployeeAddress,
prod.ReorderLevel
FROM
Products prod
JOIN
Employees ON Products.SupplierID = Employees.EmployeeID
group BY
Products.CategoryID,Products.ProductName
ORDER BY
Products.ProductName |
Sept. 11, 2024, 11:09 a.m. |
21 |
1 |
None |
|
no such column: Products.ProductID |
False |
23 |
187 |
70303 |
SELECT Title,
Summary,
Director,
Writer,
"Main Genres",
"Motion Picture Rating",
"Release Year",
"Runtime (Minutes)",
"Rating (Out of 10)",
"Number of Ratings (in thousands)",
"Budget (in millions)",
"Gross in US & Canada (in millions)",
"Gross worldwide (in millions)",
"Opening Weekend in US & Canada",
"Gross Opening Weekend (in millions)"
FROM data
ORDER BY LENGTH(Title) DESC
LIMIT 1; |
Sept. 11, 2024, 11:21 a.m. |
72 |
1 |
5.146503448486328 |
|
None |
True |
25 |
188 |
1388 |
select * from explorer_explorervalue |
July 4, 2024, 11:30 p.m. |
None |
1 |
1.9383430480957031 |
default |
None |
True |
223 |
189 |
70304 |
SELECT *
FROM data
WHERE Director = 'Clint Eastwood'; |
Sept. 11, 2024, 11:26 a.m. |
49 |
1 |
3.9107799530029297 |
|
None |
True |
25 |
190 |
1915 |
select * from employees |
July 5, 2024, 8:27 a.m. |
None |
1 |
None |
northwind.dbs |
None |
True |
None |
191 |
70305 |
SELECT *
FROM DATA d
where d.Writer = 'David Scarpa'
LIMIT 10 |
Sept. 11, 2024, 11:28 a.m. |
51 |
1 |
2.991199493408203 |
|
None |
True |
25 |
192 |
70306 |
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; |
Sept. 11, 2024, 11:30 a.m. |
17 |
1 |
39.9935245513916 |
|
None |
True |
24 |
193 |
70307 |
SELECT *
FROM DATA d
where d.Writer = 'David Scarpa'
LIMIT 10 |
Sept. 11, 2024, 11:33 a.m. |
51 |
1 |
2.9375553131103516 |
|
None |
True |
25 |
194 |
70308 |
WITH customer_city AS
(SELECT c.customer_id,
a.city_id
FROM customer c
JOIN address a ON c.address_id = a.address_id),
city_customer_count AS
(SELECT cc.city_id,
ci.city,
COUNT(cc.customer_id) AS customer_count
FROM customer_city cc
JOIN city ci ON cc.city_id = ci.city_id
GROUP BY cc.city_id,
ci.city)
SELECT city,
customer_count
FROM city_customer_count
ORDER BY customer_count DESC
LIMIT 1; |
Sept. 11, 2024, 11:34 a.m. |
60 |
1 |
41.26906394958496 |
|
None |
True |
24 |
195 |
1577 |
select 1; |
July 5, 2024, 2:43 a.m. |
None |
1 |
6.015539169311523 |
default |
None |
True |
223 |
196 |
70309 |
SELECT action_time,
content_type_id
FROM django_admin_log; |
Sept. 11, 2024, 11:40 a.m. |
71 |
1 |
None |
|
no such table: django_admin_log |
False |
23 |
197 |
1583 |
select * from employees |
July 5, 2024, 2:50 a.m. |
None |
1 |
None |
northwind.dbs |
None |
True |
None |
198 |
70310 |
select * from actor; |
Sept. 11, 2024, 11:47 a.m. |
67 |
1 |
3.626108169555664 |
|
None |
True |
24 |
199 |
1404 |
select * from explorer_promptlog |
July 4, 2024, 11:43 p.m. |
None |
1 |
3.0891895294189453 |
default |
None |
True |
223 |
200 |
1585 |
SELECT app,
COUNT(*) AS num_migrations
FROM django_migrations
GROUP BY app
ORDER BY num_migrations ASC; |
July 5, 2024, 2:51 a.m. |
None |
1 |
2.173185348510742 |
default |
None |
True |
223 |
201 |
1586 |
SELECT app,
COUNT(*) AS num_migrations
FROM django_migrations
GROUP BY app
ORDER BY num_migrations ASC; |
July 5, 2024, 2:52 a.m. |
None |
1 |
1.4815330505371094 |
default |
None |
True |
223 |
202 |
1588 |
select * from explorer_promptlog |
July 5, 2024, 2:55 a.m. |
None |
1 |
2.8429031372070312 |
default |
None |
True |
223 |
203 |
70311 |
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; |
Sept. 11, 2024, 11:49 a.m. |
17 |
1 |
32.7606201171875 |
|
None |
True |
24 |
204 |
70312 |
select * from country |
Sept. 11, 2024, 12:27 p.m. |
57 |
1 |
3.412961959838867 |
|
None |
True |
24 |
205 |
70313 |
SELECT Title,
Summary,
Director,
Writer,
"Main Genres",
"Motion Picture Rating",
"Release Year",
"Runtime (Minutes)",
"Rating (Out of 10)",
"Number of Ratings (in thousands)",
"Budget (in millions)",
"Gross in US & Canada (in millions)",
"Gross worldwide (in millions)",
"Opening Weekend in US & Canada",
"Gross Opening Weekend (in millions)"
FROM data
ORDER BY LENGTH(Title) DESC
LIMIT 1; |
Sept. 11, 2024, 12:28 p.m. |
72 |
1 |
5.1364898681640625 |
|
None |
True |
25 |
206 |
1409 |
select * from django_migrations where django_migrations.app = '' |
July 4, 2024, 11:47 p.m. |
None |
1 |
2.076864242553711 |
default |
None |
True |
223 |
207 |
70314 |
select * from actor |
Sept. 11, 2024, 12:34 p.m. |
36 |
1 |
3.4551620483398438 |
|
None |
True |
24 |
208 |
70315 |
select *
from django_session |
Sept. 11, 2024, 12:43 p.m. |
16 |
1 |
186.18011474609375 |
|
None |
True |
223 |
209 |
70316 |
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, salesamount
FROM SalesData |
Sept. 11, 2024, 12:48 p.m. |
14 |
1 |
9.72747802734375 |
|
None |
True |
23 |
210 |
1599 |
SELECT app,
COUNT(*) AS num_migrations
FROM django_migrations
GROUP BY app
ORDER BY num_migrations ASC; |
July 5, 2024, 3:10 a.m. |
None |
1 |
2.419710159301758 |
default |
None |
True |
223 |
211 |
70317 |
SELECT *
FROM DATA d
where d.Writer = 'David Scarpa'
LIMIT 10 |
Sept. 11, 2024, 12:58 p.m. |
51 |
1 |
3.3566951751708984 |
|
None |
True |
25 |
212 |
70318 |
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; |
Sept. 11, 2024, 1:40 p.m. |
15 |
1 |
1163.996696472168 |
|
None |
True |
23 |
213 |
1814 |
SELECT COUNT(*) AS num_migrations
FROM django_migrations;
|
July 5, 2024, 6:46 a.m. |
None |
1 |
1.9202232360839844 |
default |
None |
True |
223 |
214 |
1816 |
select * from explorer_promptlog |
July 5, 2024, 6:49 a.m. |
None |
1 |
3.317117691040039 |
default |
None |
True |
223 |
215 |
1947 |
select * from django_migrations where django_migrations.app = '' |
July 5, 2024, 9:02 a.m. |
None |
1 |
1.6667842864990234 |
default |
None |
True |
223 |
216 |
1817 |
select * from explorer_querylog |
July 5, 2024, 6:50 a.m. |
None |
1 |
5.171060562133789 |
default |
None |
True |
223 |
217 |
1821 |
select 1; |
July 5, 2024, 6:53 a.m. |
None |
1 |
1.546621322631836 |
default |
None |
True |
223 |
218 |
70319 |
SELECT *
FROM DATA d
where d.Writer = 'David Scarpa'
LIMIT 10 |
Sept. 11, 2024, 2:20 p.m. |
51 |
1 |
3.652811050415039 |
|
None |
True |
25 |
219 |
1815 |
select 1; |
July 5, 2024, 6:47 a.m. |
None |
1 |
1.3232231140136719 |
default |
None |
True |
223 |
220 |
70320 |
select * from data; |
Sept. 11, 2024, 2:20 p.m. |
161 |
1 |
4.485130310058594 |
|
None |
True |
59 |
221 |
70321 |
SELECT * FROM data; |
Sept. 11, 2024, 2:21 p.m. |
73 |
1 |
3.360748291015625 |
|
None |
True |
58 |
222 |
70322 |
SELECT COUNT(*)
FROM explorer_databaseconnection; |
Sept. 11, 2024, 3:18 p.m. |
291 |
1 |
2.003908157348633 |
|
None |
True |
223 |
223 |
1824 |
SELECT COUNT(*) AS num_migrations
FROM django_migrations;
|
July 5, 2024, 7:02 a.m. |
None |
1 |
2.1424293518066406 |
default |
None |
True |
223 |
224 |
1827 |
select * from explorer_promptlog |
July 5, 2024, 7:06 a.m. |
None |
1 |
2.8052330017089844 |
default |
None |
True |
223 |
225 |
1959 |
SELECT app,
COUNT(*) AS num_migrations
FROM django_migrations
GROUP BY app
ORDER BY num_migrations ASC; |
July 5, 2024, 9:22 a.m. |
None |
1 |
2.2292137145996094 |
default |
None |
True |
223 |
226 |
70323 |
select *
from django_session |
Sept. 11, 2024, 3:21 p.m. |
16 |
1 |
271.00110054016113 |
|
None |
True |
223 |
227 |
2297 |
select * from explorer_querylog |
July 5, 2024, 12:15 p.m. |
None |
1 |
5.366086959838867 |
default |
None |
True |
223 |
228 |
70324 |
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; |
Sept. 11, 2024, 3:22 p.m. |
17 |
1 |
33.19549560546875 |
|
None |
True |
24 |
229 |
6525 |
select * from employees |
July 6, 2024, 9:08 a.m. |
None |
1 |
None |
northwind.dbs |
None |
True |
None |
230 |
6526 |
select * from employees |
July 6, 2024, 9:09 a.m. |
None |
1 |
None |
northwind.dbs |
None |
True |
None |
231 |
70325 |
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; |
Sept. 11, 2024, 3:34 p.m. |
17 |
1 |
31.94141387939453 |
|
None |
True |
24 |
232 |
70326 |
select * from actor; |
Sept. 11, 2024, 3:35 p.m. |
67 |
1 |
5.790472030639648 |
|
None |
True |
24 |
233 |
70327 |
SELECT * FROM hello_greeting |
Sept. 11, 2024, 3:35 p.m. |
39 |
1 |
1.8792152404785156 |
|
None |
True |
223 |
234 |
6527 |
select * from employees |
July 6, 2024, 9:10 a.m. |
None |
1 |
None |
northwind.dbs |
None |
True |
None |
235 |
70328 |
SELECT * FROM django_migrations;
select * from django_admin_log; |
Sept. 11, 2024, 3:41 p.m. |
66 |
1 |
2.1872520446777344 |
|
None |
True |
223 |
236 |
70329 |
select 12; |
Sept. 11, 2024, 3:47 p.m. |
65 |
1 |
1.7237663269042969 |
|
None |
True |
223 |
237 |
2322 |
select * from django_migrations where django_migrations.app = '' |
July 5, 2024, 12:18 p.m. |
13 |
1 |
1.7867088317871094 |
default |
None |
True |
223 |
238 |
70330 |
select * from country |
Sept. 11, 2024, 3:51 p.m. |
57 |
1 |
3.5293102264404297 |
|
None |
True |
24 |
239 |
70331 |
select sqlite_version(); |
Sept. 11, 2024, 3:53 p.m. |
56 |
1 |
3.656625747680664 |
|
None |
True |
24 |
240 |
70332 |
PRAGMA table_info(your_table_name); |
Sept. 11, 2024, 4:12 p.m. |
42 |
1 |
3.1876564025878906 |
|
None |
True |
58 |
241 |
70333 |
SELECT 'film_actor' AS table_name, COUNT(*) AS row_count FROM film_actor
UNION ALL
SELECT 'actor' AS table_name, COUNT(*) AS row_count FROM actor
UNION ALL
SELECT 'film' AS table_name, COUNT(*) AS row_count FROM film
ORDER BY row_count DESC; |
Sept. 11, 2024, 4:12 p.m. |
27 |
1 |
4.477977752685547 |
|
None |
True |
24 |
242 |
70337 |
select * from payment; |
Sept. 11, 2024, 4:20 p.m. |
93 |
1 |
4.436254501342773 |
|
None |
True |
24 |
243 |
11340 |
select 12; |
July 9, 2024, 2:49 p.m. |
65 |
1 |
1.0366439819335938 |
default |
None |
True |
223 |
244 |
70334 |
SELECT job_link as jl
FROM data
WHERE job_location = 'Knoxville, TN'; |
Sept. 11, 2024, 4:13 p.m. |
61 |
1 |
3.455638885498047 |
|
None |
True |
59 |
245 |
70335 |
SELECT *
FROM explorer_databaseconnection |
Sept. 11, 2024, 4:13 p.m. |
50 |
1 |
1.7821788787841797 |
|
None |
True |
223 |
246 |
70336 |
SELECT job_link as jl
FROM data
WHERE job_location = 'Knoxville, TN'; |
Sept. 11, 2024, 4:15 p.m. |
61 |
1 |
3.27301025390625 |
|
None |
True |
59 |
247 |
70338 |
select * from actor; |
Sept. 11, 2024, 4:23 p.m. |
67 |
1 |
3.468751907348633 |
|
None |
True |
24 |
248 |
70339 |
SELECT * FROM hello_greeting |
Sept. 11, 2024, 4:25 p.m. |
39 |
1 |
1.8422603607177734 |
|
None |
True |
223 |
249 |
70341 |
select * from django_session |
Sept. 11, 2024, 4:25 p.m. |
37 |
1 |
209.54537391662598 |
|
None |
True |
223 |
250 |
70340 |
SELECT Customers.CustomerID, Customers.CompanyName
FROM Customers
WHERE Customers.Country = 'Austria'; |
Sept. 11, 2024, 4:25 p.m. |
226 |
1 |
3.750324249267578 |
|
None |
True |
23 |
251 |
70342 |
SELECT * FROM data
--WHERE when =
--FORMAT |
Sept. 11, 2024, 4:26 p.m. |
40 |
1 |
3.177642822265625 |
|
None |
True |
25 |
252 |
70343 |
select * from data; |
Sept. 11, 2024, 4:26 p.m. |
161 |
1 |
3.0517578125 |
|
None |
True |
59 |
253 |
70345 |
select * from Customers c where c.CompanyName like '%a%'; |
Sept. 11, 2024, 4:29 p.m. |
19 |
1 |
3.627777099609375 |
|
None |
True |
23 |
254 |
70346 |
select * from user; |
Sept. 11, 2024, 4:31 p.m. |
33 |
1 |
1.8243789672851562 |
|
None |
True |
223 |
255 |
70344 |
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; |
Sept. 11, 2024, 4:29 p.m. |
20 |
1 |
9.172677993774414 |
|
None |
True |
223 |
256 |
70347 |
select *
from django_session |
Sept. 11, 2024, 4:32 p.m. |
16 |
1 |
208.97364616394043 |
|
None |
True |
223 |
257 |
70348 |
SELECT Title,
Summary,
Director,
Writer,
"Main Genres",
"Motion Picture Rating",
"Release Year",
"Runtime (Minutes)",
"Rating (Out of 10)",
"Number of Ratings (in thousands)",
"Budget (in millions)",
"Gross in US & Canada (in millions)",
"Gross worldwide (in millions)",
"Opening Weekend in US & Canada",
"Gross Opening Weekend (in millions)"
FROM data
ORDER BY LENGTH(Title) DESC
LIMIT 1; |
Sept. 11, 2024, 4:38 p.m. |
72 |
1 |
5.357980728149414 |
|
None |
True |
25 |
258 |
70349 |
select * from country |
Sept. 11, 2024, 4:41 p.m. |
57 |
1 |
3.849506378173828 |
|
None |
True |
24 |
259 |
2005 |
select * from explorer_promptlog |
July 5, 2024, 10:33 a.m. |
None |
1 |
3.264904022216797 |
default |
None |
True |
223 |
260 |
70350 |
SELECT *
FROM "hello_greeting" |
Sept. 11, 2024, 4:43 p.m. |
94 |
1 |
2.048969268798828 |
|
None |
True |
223 |
261 |
25893 |
SELECT *
from Customers; |
July 12, 2024, 12:06 p.m. |
19 |
1 |
3.169536590576172 |
northwind.db |
None |
True |
23 |
262 |
70351 |
Select Customers.CompanyName, Customers.ContactName
from Customers |
Sept. 11, 2024, 4:47 p.m. |
45 |
1 |
3.5905838012695312 |
|
None |
True |
23 |
263 |
70352 |
SELECT app,
COUNT(*) AS num_migrations
FROM django_migrations
GROUP BY app
ORDER BY num_migrations ASC; |
Sept. 11, 2024, 4:51 p.m. |
4 |
1 |
2.7968883514404297 |
|
None |
True |
223 |
264 |
70353 |
SELECT location, COUNT(*) as job_count
FROM jobs
GROUP BY location; |
Sept. 11, 2024, 5:05 p.m. |
3 |
1 |
None |
|
no such table: jobs |
False |
59 |
265 |
20794 |
select 1 |
July 11, 2024, 3:06 p.m. |
None |
1 |
1.4472007751464844 |
default |
None |
True |
223 |
266 |
70354 |
SELECT *
FROM DATA
WHERE data.Title = "Matrix: Resurrections" |
Sept. 11, 2024, 5:20 p.m. |
22 |
1 |
6.5097808837890625 |
|
None |
True |
25 |
267 |
70356 |
with RECURSIVE r as (
SELECT
0 as len
, cidr '0.0.0.0/0' as parent
, child.child as child
, case when child.child = (cidr '0.0.0.0/1') then 7000 else 3000 end :: float as views
, case when child.child = (cidr '0.0.0.0/1') then 230 else 20 end :: float as sales
, floor(random() * 10) / 10 as next_split
, floor(random() * 10) / 10 as next_sales_split
, row_number() over () as row
from (
select set_masklen('0.0.0.0/0', 1) as child
union
select set_masklen(broadcast(set_masklen('0.0.0.0/0', 1)) + 1, 1)::cidr
) child
UNION
SELECT len + 1 as len
, r.child :: cidr as parent
, cs.child :: cidr as child
, round(case
when row_number() over (partition by r.child order by cs) = 1
then r.views * r.next_split
else r.views * (1 - r.next_split) end) as views
, round(case
when row_number() over (partition by r.child order by cs) = 1
then r.sales * r.next_sales_split
else r.sales * (1 - r.next_sales_split) end) as sales
, floor(random() * (case when len >= 2 then 5 else 10 end)) / (case when len >= 2 then 5 else 10 end) as next_split
, floor(random() * (case when len >= 2 then 5 else 10 end)) / (case when len >= 2 then 5 else 10 end) as next_sales_split
, row_number() over (partition by r.child order by cs.child) as row
from r
join lateral (
select set_masklen(r.child, masklen(r.child) + 1) as child
union
select set_masklen(broadcast(set_masklen(r.child, masklen(r.child) + 1)) + 1, masklen(r.child) +1)::cidr
) cs on true
WHERE len < 5
)
-- select * from r
, s as (
SELECT len, parent, array_agg(child) as children
, sum(views) as views
, sum(sales) as sales
-- '"' || parent || '" -- ' || '"' || child || '"'
from r
group by len, parent
order by len, parent
)
select * from r |
Sept. 11, 2024, 5:21 p.m. |
30 |
1 |
None |
|
near "as": syntax error |
False |
25 |
268 |
70355 |
PRAGMA table_info('data'); |
Sept. 11, 2024, 5:20 p.m. |
44 |
1 |
3.079652786254883 |
|
None |
True |
58 |
269 |
70357 |
SELECT *
FROM DATA d
where d.Writer = 'David Scarpa'
LIMIT 10 |
Sept. 11, 2024, 5:41 p.m. |
51 |
1 |
2.9363632202148438 |
|
None |
True |
25 |
270 |
70358 |
WITH FilmDetails AS
(SELECT f.film_id,
f.title,
f.description,
f.release_year,
f.rating,
a.actor_id,
a.first_name || ' ' || a.last_name AS actor_name
FROM film f
JOIN film_actor fa ON f.film_id = fa.film_id
JOIN actor a ON fa.actor_id = a.actor_id),
FilmPayments AS
(SELECT f.film_id,
SUM(p.amount) AS total_payment_amount,
COUNT(p.payment_id) AS payment_count
FROM film f
JOIN inventory i ON f.film_id = i.film_id
JOIN rental r ON i.inventory_id = r.inventory_id
JOIN payment p ON r.rental_id = p.rental_id
GROUP BY f.film_id)
SELECT fd.title,
fd.description,
fd.release_year,
fd.rating,
fd.actor_name,
fp.total_payment_amount,
fp.payment_count
FROM FilmDetails fd
LEFT JOIN FilmPayments fp ON fd.film_id = fp.film_id
ORDER BY fd.title; |
Sept. 11, 2024, 5:42 p.m. |
54 |
1 |
43.241024017333984 |
|
None |
True |
24 |
271 |
70359 |
SELECT 'film_actor' AS table_name, COUNT(*) AS row_count FROM film_actor
UNION ALL
SELECT 'actor' AS table_name, COUNT(*) AS row_count FROM actor
UNION ALL
SELECT 'film' AS table_name, COUNT(*) AS row_count FROM film
ORDER BY row_count DESC; |
Sept. 11, 2024, 5:42 p.m. |
27 |
1 |
4.189252853393555 |
|
None |
True |
24 |
272 |
70360 |
select * from actor |
Sept. 11, 2024, 5:58 p.m. |
None |
1 |
4.288196563720703 |
|
None |
True |
24 |
273 |
70361 |
SELECT session_key AS test,
session_data AS DATA,
expire_date
FROM django_session
WHERE expire_date > CURRENT_TIMESTAMP; |
Sept. 11, 2024, 6:15 p.m. |
55 |
1 |
None |
|
no such table: django_session |
False |
24 |
274 |
70363 |
select * from actor |
Sept. 11, 2024, 6:17 p.m. |
36 |
1 |
6.256103515625 |
|
None |
True |
24 |
275 |
2936 |
SELECT app,
COUNT(*) AS num_migrations
FROM django_migrations
GROUP BY app
ORDER BY num_migrations ASC; |
July 5, 2024, 2:31 p.m. |
4 |
1 |
1.2700557708740234 |
default |
None |
True |
223 |
276 |
2941 |
SELECT app,
COUNT(*) AS num_migrations
FROM django_migrations
GROUP BY app
ORDER BY num_migrations ASC; |
July 5, 2024, 2:32 p.m. |
4 |
1 |
7.851123809814453 |
default |
None |
True |
223 |
277 |
70362 |
select * from Customers c where c.CompanyName like '%a%'; |
Sept. 11, 2024, 6:15 p.m. |
19 |
1 |
3.5295486450195312 |
|
None |
True |
23 |
278 |
70364 |
SELECT location, COUNT(*) as job_count
FROM jobs
GROUP BY location; |
Sept. 11, 2024, 6:17 p.m. |
3 |
1 |
None |
|
no such table: jobs |
False |
59 |
279 |
70365 |
select * from actor; |
Sept. 11, 2024, 6:40 p.m. |
67 |
1 |
3.7484169006347656 |
|
None |
True |
24 |
280 |
70367 |
SELECT job_link as jl
FROM data
WHERE job_location = 'Knoxville, TN'; |
Sept. 11, 2024, 6:41 p.m. |
61 |
1 |
5.501031875610352 |
|
None |
True |
59 |
281 |
70369 |
SELECT *
FROM DATA
WHERE `Runtime (Minutes)` < 90; |
Sept. 11, 2024, 6:41 p.m. |
69 |
1 |
3.269195556640625 |
|
None |
True |
25 |
282 |
19775 |
SELECT COUNT(id) as total_migrations FROM django_migrations; |
July 11, 2024, 12:11 p.m. |
None |
1 |
1.6951560974121094 |
default |
None |
True |
223 |
283 |
70366 |
select *
from data
limit 10 |
Sept. 11, 2024, 6:40 p.m. |
46 |
1 |
3.54766845703125 |
|
None |
True |
25 |
284 |
2089 |
select * from employees |
July 5, 2024, 11:41 a.m. |
None |
1 |
None |
northwind.dbs |
None |
True |
None |
285 |
70368 |
WITH FilmDetails AS
(SELECT f.film_id,
f.title,
f.description,
f.release_year,
f.rating,
a.actor_id,
a.first_name || ' ' || a.last_name AS actor_name
FROM film f
JOIN film_actor fa ON f.film_id = fa.film_id
JOIN actor a ON fa.actor_id = a.actor_id),
FilmPayments AS
(SELECT f.film_id,
SUM(p.amount) AS total_payment_amount,
COUNT(p.payment_id) AS payment_count
FROM film f
JOIN inventory i ON f.film_id = i.film_id
JOIN rental r ON i.inventory_id = r.inventory_id
JOIN payment p ON r.rental_id = p.rental_id
GROUP BY f.film_id)
SELECT fd.title,
fd.description,
fd.release_year,
fd.rating,
fd.actor_name,
fp.total_payment_amount,
fp.payment_count
FROM FilmDetails fd
LEFT JOIN FilmPayments fp ON fd.film_id = fp.film_id
ORDER BY fd.title; |
Sept. 11, 2024, 6:41 p.m. |
54 |
1 |
40.956974029541016 |
|
None |
True |
24 |
286 |
70370 |
select * from Categories; |
Sept. 11, 2024, 6:42 p.m. |
95 |
1 |
3.804922103881836 |
|
None |
True |
23 |
287 |
2090 |
select * from explorer_querylog |
July 5, 2024, 11:41 a.m. |
None |
1 |
4.705667495727539 |
default |
None |
True |
223 |
288 |
70371 |
SELECT job_link as jl
FROM data
WHERE job_location = 'Knoxville, TN'; |
Sept. 11, 2024, 6:45 p.m. |
61 |
1 |
3.735780715942383 |
|
None |
True |
59 |
289 |
70372 |
SELECT *
FROM django_migrations
WHERE django_migrations.app = '' |
Sept. 11, 2024, 6:45 p.m. |
13 |
1 |
2.389669418334961 |
|
None |
True |
223 |
290 |
70374 |
select * from got_summary |
Sept. 11, 2024, 6:46 p.m. |
70 |
1 |
None |
|
no such table: got_summary |
False |
59 |
291 |
70373 |
SELECT * FROM data; |
Sept. 11, 2024, 6:46 p.m. |
73 |
1 |
3.921031951904297 |
|
None |
True |
58 |
292 |
70375 |
SELECT * FROM hello_greeting |
Sept. 11, 2024, 6:46 p.m. |
39 |
1 |
2.008676528930664 |
|
None |
True |
223 |
293 |
70376 |
SELECT *
FROM DATA d
where d.Writer = 'David Scarpa'
LIMIT 10 |
Sept. 11, 2024, 6:46 p.m. |
51 |
1 |
3.0837059020996094 |
|
None |
True |
25 |
294 |
70377 |
select * from actor |
Sept. 11, 2024, 6:54 p.m. |
36 |
1 |
3.8988590240478516 |
|
None |
True |
24 |
295 |
70378 |
select * from country |
Sept. 11, 2024, 6:55 p.m. |
57 |
1 |
3.910064697265625 |
|
None |
True |
24 |
296 |
70379 |
SELECT * from django_session; |
Sept. 11, 2024, 6:57 p.m. |
78 |
1 |
225.877046585083 |
|
None |
True |
223 |
297 |
70380 |
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; |
Sept. 11, 2024, 6:57 p.m. |
15 |
1 |
243.6075210571289 |
|
None |
True |
23 |
298 |
70381 |
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; |
Sept. 11, 2024, 7:06 p.m. |
17 |
1 |
35.64643859863281 |
|
None |
True |
24 |
299 |
70382 |
PRAGMA table_info('data'); |
Sept. 11, 2024, 7:06 p.m. |
44 |
1 |
3.113269805908203 |
|
None |
True |
58 |
300 |
70383 |
select * from payment; |
Sept. 11, 2024, 7:07 p.m. |
93 |
1 |
3.6878585815429688 |
|
None |
True |
24 |
301 |
70384 |
SELECT *
FROM django_migrations
WHERE django_migrations.app = '' |
Sept. 11, 2024, 7:13 p.m. |
13 |
1 |
2.0499229431152344 |
|
None |
True |
223 |
302 |
70386 |
SELECT Title,
Summary,
Director,
Writer,
"Main Genres",
"Motion Picture Rating",
"Release Year",
"Runtime (Minutes)",
"Rating (Out of 10)",
"Number of Ratings (in thousands)",
"Budget (in millions)",
"Gross in US & Canada (in millions)",
"Gross worldwide (in millions)",
"Opening Weekend in US & Canada",
"Gross Opening Weekend (in millions)"
FROM data
ORDER BY LENGTH(Title) DESC
LIMIT 1; |
Sept. 11, 2024, 7:14 p.m. |
72 |
1 |
5.409002304077148 |
|
None |
True |
25 |
303 |
70385 |
select * from Categories; |
Sept. 11, 2024, 7:14 p.m. |
95 |
1 |
4.436969757080078 |
|
None |
True |
23 |
304 |
70387 |
PRAGMA table_info(your_table_name); |
Sept. 11, 2024, 7:32 p.m. |
42 |
1 |
3.377199172973633 |
|
None |
True |
58 |
305 |
70388 |
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, salesamount
FROM SalesData |
Sept. 11, 2024, 7:34 p.m. |
14 |
1 |
3.5452842712402344 |
|
None |
True |
23 |
306 |
70389 |
SELECT job_link as jl
FROM data
WHERE job_location = 'Knoxville, TN'; |
Sept. 11, 2024, 7:42 p.m. |
61 |
1 |
57.95097351074219 |
|
None |
True |
59 |
307 |
70390 |
select * from  data |
Sept. 11, 2024, 7:46 p.m. |
35 |
1 |
None |
|
no such table: Â data |
False |
25 |
308 |
70391 |
select * from MainGenres; |
Sept. 11, 2024, 7:50 p.m. |
47 |
1 |
None |
|
no such table: MainGenres |
False |
25 |
309 |
2493 |
select * from django_session |
July 5, 2024, 12:47 p.m. |
None |
1 |
129.90641593933105 |
default |
None |
True |
223 |
310 |
70392 |
select * from tq |
Sept. 11, 2024, 7:58 p.m. |
52 |
1 |
None |
|
no such table: tq |
False |
62 |
311 |
70393 |
SELECT * FROM "maestro-v3.0.0_1" WHERE canonical_composer = "Alban Berg"; |
Sept. 11, 2024, 7:59 p.m. |
162 |
1 |
None |
|
no such table: maestro-v3.0.0_1 |
False |
124 |
312 |
70394 |
select 12; |
Sept. 11, 2024, 8:15 p.m. |
65 |
1 |
1.4414787292480469 |
|
None |
True |
223 |
313 |
70395 |
SELECT table_name
FROM information_schema.tables
WHERE table_schema = 'public'; |
Sept. 11, 2024, 8:21 p.m. |
423 |
1 |
16.632795333862305 |
|
None |
True |
223 |
314 |
70396 |
SELECT *
FROM data
WHERE Director = 'Clint Eastwood'; |
Sept. 11, 2024, 8:21 p.m. |
49 |
1 |
46.80776596069336 |
|
None |
True |
25 |
315 |
70398 |
select * from actor; |
Sept. 11, 2024, 8:22 p.m. |
74 |
1 |
5.702972412109375 |
|
None |
True |
24 |
316 |
70397 |
SELECT Title, [Release Year]
FROM data |
Sept. 11, 2024, 8:21 p.m. |
68 |
1 |
3.1290054321289062 |
|
None |
True |
25 |
317 |
70399 |
WITH FilmDetails AS
(SELECT f.film_id,
f.title,
f.description,
f.release_year,
f.rating,
a.actor_id,
a.first_name || ' ' || a.last_name AS actor_name
FROM film f
JOIN film_actor fa ON f.film_id = fa.film_id
JOIN actor a ON fa.actor_id = a.actor_id),
FilmPayments AS
(SELECT f.film_id,
SUM(p.amount) AS total_payment_amount,
COUNT(p.payment_id) AS payment_count
FROM film f
JOIN inventory i ON f.film_id = i.film_id
JOIN rental r ON i.inventory_id = r.inventory_id
JOIN payment p ON r.rental_id = p.rental_id
GROUP BY f.film_id)
SELECT fd.title,
fd.description,
fd.release_year,
fd.rating,
fd.actor_name,
fp.total_payment_amount,
fp.payment_count
FROM FilmDetails fd
LEFT JOIN FilmPayments fp ON fd.film_id = fp.film_id
ORDER BY fd.title; |
Sept. 11, 2024, 8:22 p.m. |
54 |
1 |
153.93352508544922 |
|
None |
True |
24 |
318 |
70400 |
select count(*)
from user
where names like '%hotmail.com' |
Sept. 11, 2024, 8:24 p.m. |
76 |
1 |
None |
|
column "names" does not exist
LINE 3: where names like '%hotmail.com'
^ |
False |
223 |
319 |
70401 |
WITH FilmDetails AS
(SELECT f.film_id,
f.title,
f.description,
f.release_year,
f.rating,
a.actor_id,
a.first_name || ' ' || a.last_name AS actor_name
FROM film f
JOIN film_actor fa ON f.film_id = fa.film_id
JOIN actor a ON fa.actor_id = a.actor_id),
FilmPayments AS
(SELECT f.film_id,
SUM(p.amount) AS total_payment_amount,
COUNT(p.payment_id) AS payment_count
FROM film f
JOIN inventory i ON f.film_id = i.film_id
JOIN rental r ON i.inventory_id = r.inventory_id
JOIN payment p ON r.rental_id = p.rental_id
GROUP BY f.film_id)
SELECT fd.title,
fd.description,
fd.release_year,
fd.rating,
fd.actor_name,
fp.total_payment_amount,
fp.payment_count
FROM FilmDetails fd
LEFT JOIN FilmPayments fp ON fd.film_id = fp.film_id
ORDER BY fd.title; |
Sept. 11, 2024, 8:26 p.m. |
54 |
1 |
39.96539115905762 |
|
None |
True |
24 |
320 |
70402 |
SELECT * FROM greeting; |
Sept. 11, 2024, 8:30 p.m. |
96 |
1 |
None |
|
relation "greeting" does not exist
LINE 1: SELECT * FROM greeting;
^ |
False |
223 |
321 |
70403 |
WITH FilmDetails AS
(SELECT f.film_id,
f.title,
f.description,
f.release_year,
f.rating,
a.actor_id,
a.first_name || ' ' || a.last_name AS actor_name
FROM film f
JOIN film_actor fa ON f.film_id = fa.film_id
JOIN actor a ON fa.actor_id = a.actor_id),
FilmPayments AS
(SELECT f.film_id,
SUM(p.amount) AS total_payment_amount,
COUNT(p.payment_id) AS payment_count
FROM film f
JOIN inventory i ON f.film_id = i.film_id
JOIN rental r ON i.inventory_id = r.inventory_id
JOIN payment p ON r.rental_id = p.rental_id
GROUP BY f.film_id)
SELECT fd.title,
fd.description,
fd.release_year,
fd.rating,
fd.actor_name,
fp.total_payment_amount,
fp.payment_count
FROM FilmDetails fd
LEFT JOIN FilmPayments fp ON fd.film_id = fp.film_id
ORDER BY fd.title; |
Sept. 11, 2024, 8:34 p.m. |
54 |
1 |
41.73159599304199 |
|
None |
True |
24 |
322 |
70404 |
select * from data; |
Sept. 11, 2024, 8:39 p.m. |
161 |
1 |
8.610248565673828 |
|
None |
True |
59 |
323 |
70406 |
SELECT *
FROM hello_greeting |
Sept. 11, 2024, 8:40 p.m. |
58 |
1 |
1.7135143280029297 |
|
None |
True |
223 |
324 |
3035 |
select * from django_session |
July 5, 2024, 2:50 p.m. |
None |
1 |
105.38840293884277 |
default |
None |
True |
223 |
325 |
70405 |
SELECT session_key AS test,
session_data AS DATA,
expire_date
FROM django_session
WHERE expire_date > CURRENT_TIMESTAMP; |
Sept. 11, 2024, 8:40 p.m. |
55 |
1 |
None |
|
no such table: django_session |
False |
24 |
326 |
70407 |
SELECT
Products.ProductID,
Products.ProductName,
Products.SupplierID,
Products.CategoryID,
Products.QuantityPerUnit,
Products.UnitPrice,
Products.UnitsInStock,
Products.ProductName,
Products.UnitsOnOrder,
Products.ReorderLevel,
Products.Discontinued,
Employees.Address AS EmployeeAddress,
prod.ReorderLevel
FROM
Products prod
JOIN
Employees ON Products.SupplierID = Employees.EmployeeID
group BY
Products.CategoryID,Products.ProductName
ORDER BY
Products.ProductName |
Sept. 11, 2024, 8:43 p.m. |
21 |
1 |
None |
|
no such column: Products.ProductID |
False |
23 |
327 |
26907 |
select * from explorer_querylog |
July 12, 2024, 3:09 p.m. |
None |
1 |
40.86923599243164 |
default |
None |
True |
223 |
328 |
2518 |
SELECT COUNT(*) AS num_migrations
FROM django_migrations;
|
July 5, 2024, 12:52 p.m. |
None |
1 |
1.4777183532714844 |
default |
None |
True |
223 |
329 |
70408 |
SELECT session_key AS test,
session_data AS DATA,
expire_date
FROM django_session
WHERE expire_date > CURRENT_TIMESTAMP; |
Sept. 11, 2024, 8:59 p.m. |
55 |
1 |
None |
|
no such table: django_session |
False |
24 |
330 |
6546 |
SELECT * FROM hello_greeting |
July 6, 2024, 9:37 a.m. |
None |
1 |
6.904363632202148 |
default |
None |
True |
223 |
331 |
70409 |
SELECT *
FROM hello_greeting
ORDER BY "when" ASC
LIMIT 1; |
Sept. 11, 2024, 9 p.m. |
159 |
1 |
1.8887519836425781 |
|
None |
True |
223 |
332 |
70410 |
select *
from data
limit 10 |
Sept. 11, 2024, 9:05 p.m. |
46 |
1 |
3.1440258026123047 |
|
None |
True |
25 |
333 |
70411 |
PRAGMA table_info('data'); |
Sept. 11, 2024, 9:18 p.m. |
44 |
1 |
3.382444381713867 |
|
None |
True |
58 |
334 |
70412 |
select * from actor; |
Sept. 11, 2024, 9:19 p.m. |
74 |
1 |
3.519296646118164 |
|
None |
True |
24 |
335 |
70416 |
PRAGMA table_info(your_table_name); |
Sept. 11, 2024, 9:24 p.m. |
42 |
1 |
3.042459487915039 |
|
None |
True |
58 |
336 |
70413 |
select * from Customers c where c.CompanyName like '%a%'; |
Sept. 11, 2024, 9:21 p.m. |
None |
1 |
11.623382568359375 |
|
None |
True |
23 |
337 |
70414 |
SELECT Title, [Release Year]
FROM data |
Sept. 11, 2024, 9:24 p.m. |
68 |
1 |
4.608154296875 |
|
None |
True |
25 |
338 |
70415 |
select * from actor; |
Sept. 11, 2024, 9:24 p.m. |
67 |
1 |
3.676176071166992 |
|
None |
True |
24 |
339 |
70417 |
PRAGMA table_info('data'); |
Sept. 11, 2024, 9:28 p.m. |
44 |
1 |
3.5085678100585938 |
|
None |
True |
58 |
340 |
70419 |
PRAGMA table_info(your_table_name); |
Sept. 11, 2024, 9:33 p.m. |
42 |
1 |
3.0770301818847656 |
|
None |
True |
58 |
341 |
70418 |
SELECT location, COUNT(*) as job_count
FROM jobs
GROUP BY location; |
Sept. 11, 2024, 9:29 p.m. |
3 |
1 |
None |
|
no such table: jobs |
False |
59 |
342 |
6547 |
SELECT *
FROM django_migrations
WHERE django_migrations.app = '' |
July 6, 2024, 9:37 a.m. |
None |
1 |
1.6999244689941406 |
default |
None |
True |
223 |
343 |
70420 |
WITH session_user_map AS (
SELECT
session_key,
-- Hypothetically extracting user ID from session data
-- Replace this with the real method of extracting user_id from session_data
regexp_replace(session_data, '.*user_id:(\d+).*', '\1') AS user_id
FROM django_session
)
SELECT
user_id,
COUNT(session_key) AS session_count
FROM session_user_map
GROUP BY user_id
ORDER BY session_count DESC; |
Sept. 11, 2024, 9:35 p.m. |
225 |
1 |
8034.3921184539795 |
|
None |
True |
223 |
344 |
70421 |
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; |
Sept. 11, 2024, 9:39 p.m. |
17 |
1 |
33.06770324707031 |
|
None |
True |
24 |
345 |
70422 |
SELECT
movie_id,
title,
score
FROM
movies
WHERE
score >= 8
ORDER BY
score DESC; |
Sept. 11, 2024, 9:52 p.m. |
63 |
1 |
None |
|
relation "movies" does not exist
LINE 6: movies
^ |
False |
223 |
346 |
3137 |
select * from django_session |
July 5, 2024, 3 p.m. |
None |
1 |
103.45029830932617 |
default |
None |
True |
223 |
347 |
3151 |
select * from django_session |
July 5, 2024, 3:01 p.m. |
None |
1 |
112.10918426513672 |
default |
None |
True |
223 |
348 |
252 |
select 1; |
April 22, 2024, 10:37 a.m. |
None |
1 |
0.19311904907226562 |
default |
None |
True |
223 |
349 |
253 |
select 1; |
April 22, 2024, 10:37 a.m. |
None |
1 |
0.19216537475585938 |
default |
None |
True |
223 |
350 |
254 |
select 1; |
April 22, 2024, 10:37 a.m. |
None |
1 |
0.1468658447265625 |
default |
None |
True |
223 |
351 |
255 |
select 1; |
April 22, 2024, 10:37 a.m. |
None |
1 |
0.14901161193847656 |
default |
None |
True |
223 |
352 |
70423 |
select * from django_session |
Sept. 11, 2024, 10:01 p.m. |
37 |
1 |
181.3983917236328 |
|
None |
True |
223 |
353 |
70424 |
WITH session_user_map AS (
SELECT
session_key,
-- Hypothetically extracting user ID from session data
-- Replace this with the real method of extracting user_id from session_data
regexp_replace(session_data, '.*user_id:(\d+).*', '\1') AS user_id
FROM django_session
)
SELECT
user_id,
COUNT(session_key) AS session_count
FROM session_user_map
GROUP BY user_id
ORDER BY session_count DESC; |
Sept. 11, 2024, 10:33 p.m. |
225 |
1 |
8283.130407333374 |
|
None |
True |
223 |
354 |
3147 |
select * from explorer_querylog |
July 5, 2024, 3:01 p.m. |
None |
1 |
11.034488677978516 |
default |
None |
True |
223 |
355 |
3719 |
select * from django_migrations where django_migrations.app = '' |
July 5, 2024, 4:26 p.m. |
13 |
1 |
7.157325744628906 |
default |
None |
True |
223 |
356 |
3156 |
SELECT app,
COUNT(*) AS num_migrations
FROM django_migrations
GROUP BY app
ORDER BY num_migrations ASC; |
July 5, 2024, 3:02 p.m. |
4 |
1 |
1.9991397857666016 |
default |
None |
True |
223 |
357 |
70425 |
SELECT * FROM data; |
Sept. 11, 2024, 10:34 p.m. |
73 |
1 |
3.6382675170898438 |
|
None |
True |
58 |
358 |
70426 |
select count(*)
from Products
where UnitsInStock > '10' |
Sept. 11, 2024, 10:34 p.m. |
192 |
1 |
4.8675537109375 |
|
None |
True |
23 |
359 |
70427 |
SELECT * FROM hello_greeting |
Sept. 11, 2024, 10:35 p.m. |
39 |
1 |
2.1295547485351562 |
|
None |
True |
223 |
360 |
3731 |
select * from django_migrations where django_migrations.app = '' |
July 5, 2024, 4:29 p.m. |
13 |
1 |
7.676601409912109 |
default |
None |
True |
223 |
361 |
70428 |
SELECT * FROM "maestro-v3.0.0_1" WHERE canonical_composer = "Alban Berg"; |
Sept. 11, 2024, 10:47 p.m. |
162 |
1 |
None |
|
no such table: maestro-v3.0.0_1 |
False |
124 |
362 |
70429 |
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, salesamount
FROM SalesData |
Sept. 11, 2024, 10:48 p.m. |
14 |
1 |
69.14234161376953 |
|
None |
True |
23 |
363 |
70430 |
SELECT
Title,
COUNT(DISTINCT Director) AS Director_Count
FROM
data
GROUP BY
Title; |
Sept. 11, 2024, 11 p.m. |
390 |
1 |
16.034603118896484 |
|
None |
True |
25 |
364 |
70431 |
SELECT
Products.ProductID,
Products.ProductName,
Products.SupplierID,
Products.CategoryID,
Products.QuantityPerUnit,
Products.UnitPrice,
Products.UnitsInStock,
Products.ProductName,
Products.UnitsOnOrder,
Products.ReorderLevel,
Products.Discontinued,
Employees.Address AS EmployeeAddress,
prod.ReorderLevel
FROM
Products prod
JOIN
Employees ON Products.SupplierID = Employees.EmployeeID
group BY
Products.CategoryID,Products.ProductName
ORDER BY
Products.ProductName |
Sept. 11, 2024, 11 p.m. |
21 |
1 |
None |
|
no such column: Products.ProductID |
False |
23 |
365 |
70432 |
select * FROM explorer_querylog |
Sept. 11, 2024, 11:09 p.m. |
258 |
1 |
146.1935043334961 |
|
None |
True |
223 |
366 |
70433 |
select * from Customers c where c.CompanyName like '%a%'; |
Sept. 11, 2024, 11:09 p.m. |
19 |
1 |
5.208253860473633 |
|
None |
True |
23 |
367 |
70435 |
WITH StoreRentals AS (
SELECT
i.store_id,
COUNT(r.rental_id) AS rental_count
FROM
rental r
INNER JOIN inventory i ON r.inventory_id = i.inventory_id
GROUP BY
i.store_id
)
SELECT
s.store_id,
s.manager_staff_id,
s.address_id,
sr.rental_count
FROM
StoreRentals sr
INNER JOIN store s ON sr.store_id = s.store_id
ORDER BY
sr.rental_count DESC; |
Sept. 11, 2024, 11:10 p.m. |
18 |
1 |
2474.3974208831787 |
|
None |
True |
24 |
368 |
5071 |
SELECT
sql,
AVG(duration) AS average_duration
FROM
explorer_querylog
GROUP BY
sql
ORDER BY
average_duration DESC; |
July 5, 2024, 8:48 p.m. |
26 |
1 |
7.992744445800781 |
default |
None |
True |
223 |
369 |
2673 |
SELECT app,
COUNT(*) AS num_migrations
FROM django_migrations
GROUP BY app
ORDER BY num_migrations ASC; |
July 5, 2024, 1:30 p.m. |
None |
1 |
8.260011672973633 |
default |
None |
True |
223 |
370 |
5074 |
SELECT
sql,
AVG(duration) AS average_duration
FROM
explorer_querylog
GROUP BY
sql
ORDER BY
average_duration DESC; |
July 5, 2024, 8:49 p.m. |
26 |
1 |
8.236408233642578 |
default |
None |
True |
223 |
371 |
70434 |
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; |
Sept. 11, 2024, 11:10 p.m. |
20 |
1 |
11.280298233032227 |
|
None |
True |
223 |
372 |
70436 |
WITH FilmDetails AS
(SELECT f.film_id,
f.title,
f.description,
f.release_year,
f.rating,
a.actor_id,
a.first_name || ' ' || a.last_name AS actor_name
FROM film f
JOIN film_actor fa ON f.film_id = fa.film_id
JOIN actor a ON fa.actor_id = a.actor_id),
FilmPayments AS
(SELECT f.film_id,
SUM(p.amount) AS total_payment_amount,
COUNT(p.payment_id) AS payment_count
FROM film f
JOIN inventory i ON f.film_id = i.film_id
JOIN rental r ON i.inventory_id = r.inventory_id
JOIN payment p ON r.rental_id = p.rental_id
GROUP BY f.film_id)
SELECT fd.title,
fd.description,
fd.release_year,
fd.rating,
fd.actor_name,
fp.total_payment_amount,
fp.payment_count
FROM FilmDetails fd
LEFT JOIN FilmPayments fp ON fd.film_id = fp.film_id
ORDER BY fd.title; |
Sept. 11, 2024, 11:10 p.m. |
54 |
1 |
91.52388572692871 |
|
None |
True |
24 |
373 |
19229 |
select * from actor |
July 11, 2024, 9:25 a.m. |
None |
1 |
3.340005874633789 |
sqlite-sakila.db |
None |
True |
24 |
374 |
70437 |
select 12; |
Sept. 11, 2024, 11:11 p.m. |
65 |
1 |
1.741170883178711 |
|
None |
True |
223 |
375 |
70438 |
SELECT job_link as jl
FROM data
WHERE job_location = 'Knoxville, TN'; |
Sept. 11, 2024, 11:46 p.m. |
61 |
1 |
5.442380905151367 |
|
None |
True |
59 |
376 |
70440 |
SELECT * FROM data
--WHERE when =
--FORMAT |
Sept. 11, 2024, 11:55 p.m. |
40 |
1 |
3.615856170654297 |
|
None |
True |
25 |
377 |
70439 |
SELECT Title,
Summary,
Director,
Writer,
"Main Genres",
"Motion Picture Rating",
"Release Year",
"Runtime (Minutes)",
"Rating (Out of 10)",
"Number of Ratings (in thousands)",
"Budget (in millions)",
"Gross in US & Canada (in millions)",
"Gross worldwide (in millions)",
"Opening Weekend in US & Canada",
"Gross Opening Weekend (in millions)"
FROM data
ORDER BY LENGTH(Title) DESC
LIMIT 1; |
Sept. 11, 2024, 11:52 p.m. |
72 |
1 |
5.822420120239258 |
|
None |
True |
25 |
378 |
70442 |
SELECT action_time,
content_type_id
FROM django_admin_log; |
Sept. 11, 2024, 11:59 p.m. |
71 |
1 |
None |
|
no such table: django_admin_log |
False |
23 |
379 |
3203 |
select id, duration from explorer_promptlog; |
July 5, 2024, 3:09 p.m. |
3 |
1 |
1.9805431365966797 |
default |
None |
True |
223 |
380 |
70441 |
select * from actor; |
Sept. 11, 2024, 11:56 p.m. |
67 |
1 |
3.6890506744384766 |
|
None |
True |
24 |
381 |
70443 |
SELECT *
FROM DATA
WHERE `Runtime (Minutes)` < 90; |
Sept. 12, 2024, 12:02 a.m. |
69 |
1 |
3.204822540283203 |
|
None |
True |
25 |
382 |
70444 |
SELECT Title, [Release Year]
FROM data |
Sept. 12, 2024, 12:04 a.m. |
68 |
1 |
3.123044967651367 |
|
None |
True |
25 |
383 |
2737 |
select * from explorer_querylog |
July 5, 2024, 1:46 p.m. |
None |
1 |
5.19108772277832 |
default |
None |
True |
223 |
384 |