task_id int64 0 1.05k | db_id stringclasses 14
values | prompt stringlengths 451 3.66k | solution stringlengths 26 1.68k | top_k_progression stringlengths 1.41k 69.1k |
|---|---|---|---|---|
0 | department_management | Given the SQL schema:
PRAGMA foreign_keys=ON;
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "department" (
"Department_ID" int,
"Name" text,
"Creation" text,
"Ranking" int,
"Budget_in_Billions" real,
"Num_Employees" real,
PRIMARY KEY ("Department_ID")
);
CREATE TABLE IF NOT EXISTS "head" (
"head_ID" int,
"name" text,
"... | SELECT COUNT(*) FROM head WHERE age > 56;
The SQL query to find the number of department heads older than 56 is indeed correct. Here's the completed query:
```sql
SELECT COUNT(*)
FROM head
WHERE age > 56;
``` | {"step_0": {"top_k": [{"token": "SELECT", "prob": 0.92542}, {"token": "```", "prob": 0.03167}, {"token": "To", "prob": 0.01189}, {"token": "<", "prob": 0.00889}, {"token": "{", "prob": 0.00562}], "pred_entropy": 0.58166}, "step_1": {"top_k": [{"token": "\u0120COUNT", "prob": 0.7069}, {"token": "\u0120count", "prob": 0.... |
1 | department_management | Given the SQL schema:
PRAGMA foreign_keys=ON;
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "department" (
"Department_ID" int,
"Name" text,
"Creation" text,
"Ranking" int,
"Budget_in_Billions" real,
"Num_Employees" real,
PRIMARY KEY ("Department_ID")
);
CREATE TABLE IF NOT EXISTS "head" (
"head_ID" int,
"name" text,
"... | SELECT name, born_state, age FROM head WHERE head_ID IN (SELECT head_ID FROM management) ORDER BY age; | {"step_0": {"top_k": [{"token": "SELECT", "prob": 0.93643}, {"token": "```", "prob": 0.03341}, {"token": "To", "prob": 0.00998}, {"token": "BEGIN", "prob": 0.00618}, {"token": "Answer", "prob": 0.00462}], "pred_entropy": 0.48458}, "step_1": {"top_k": [{"token": "\u0120name", "prob": 0.60138}, {"token": "\u0120head", "p... |
2 | department_management | Given the SQL schema:
PRAGMA foreign_keys=ON;
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "department" (
"Department_ID" int,
"Name" text,
"Creation" text,
"Ranking" int,
"Budget_in_Billions" real,
"Num_Employees" real,
PRIMARY KEY ("Department_ID")
);
CREATE TABLE IF NOT EXISTS "head" (
"head_ID" int,
"name" text,
"... | SELECT Creation, Name, Budget_in_Billions
FROM department; | {"step_0": {"top_k": [{"token": "SELECT", "prob": 0.94281}, {"token": "```", "prob": 0.03226}, {"token": "To", "prob": 0.00905}, {"token": "Answer", "prob": 0.00455}, {"token": "BEGIN", "prob": 0.00428}], "pred_entropy": 0.43471}, "step_1": {"top_k": [{"token": "\u0120Creation", "prob": 0.42519}, {"token": "\u0120creat... |
3 | department_management | Given the SQL schema:
PRAGMA foreign_keys=ON;
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "department" (
"Department_ID" int,
"Name" text,
"Creation" text,
"Ranking" int,
"Budget_in_Billions" real,
"Num_Employees" real,
PRIMARY KEY ("Department_ID")
);
CREATE TABLE IF NOT EXISTS "head" (
"head_ID" int,
"name" text,
"... | -- sql
SELECT
MAX(Budget_in_Billions) AS max_budget,
MIN(Budget_in_Billions) AS min_budget
FROM department; | {"step_0": {"top_k": [{"token": "SELECT", "prob": 0.90414}, {"token": "```", "prob": 0.04142}, {"token": "To", "prob": 0.02171}, {"token": "BEGIN", "prob": 0.01138}, {"token": "Answer", "prob": 0.0075}], "pred_entropy": 0.69062}, "step_1": {"top_k": [{"token": "\u0120SQL", "prob": 0.32975}, {"token": "\u0120Write", "pr... |
4 | department_management | Given the SQL schema:
PRAGMA foreign_keys=ON;
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "department" (
"Department_ID" int,
"Name" text,
"Creation" text,
"Ranking" int,
"Budget_in_Billions" real,
"Num_Employees" real,
PRIMARY KEY ("Department_ID")
);
CREATE TABLE IF NOT EXISTS "head" (
"head_ID" int,
"name" text,
"... | To find the average number of employees of departments whose rank is between 10 and 15, you can use the following SQL query:
```sql
SELECT AVG(Num_Employees) AS Average_Employees
FROM department
WHERE Ranking BETWEEN 10 AND 15;
```
Explanation:
- The `SELECT AVG(Num_Employees) AS Average_Employees` statement calcula... | {"step_0": {"top_k": [{"token": "SELECT", "prob": 0.92987}, {"token": "```", "prob": 0.0275}, {"token": "Answer", "prob": 0.01033}, {"token": "<", "prob": 0.00856}, {"token": "To", "prob": 0.00804}], "pred_entropy": 0.55657}, "step_1": {"top_k": [{"token": "\u0120calculate", "prob": 0.79139}, {"token": "\u0120find", "p... |
5 | department_management | Given the SQL schema:
PRAGMA foreign_keys=ON;
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "department" (
"Department_ID" int,
"Name" text,
"Creation" text,
"Ranking" int,
"Budget_in_Billions" real,
"Num_Employees" real,
PRIMARY KEY ("Department_ID")
);
CREATE TABLE IF NOT EXISTS "head" (
"head_ID" int,
"name" text,
"... | SELECT DISTINCT head.name
FROM head
WHERE head.born_state != 'California'; | {"step_0": {"top_k": [{"token": "SELECT", "prob": 0.94789}, {"token": "```", "prob": 0.036}, {"token": "Answer", "prob": 0.00379}, {"token": "To", "prob": 0.00364}, {"token": "BEGIN", "prob": 0.00315}], "pred_entropy": 0.38223}, "step_1": {"top_k": [{"token": "\u0120name", "prob": 0.42783}, {"token": "\u0120head", "pro... |
6 | department_management | Given the SQL schema:
PRAGMA foreign_keys=ON;
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "department" (
"Department_ID" int,
"Name" text,
"Creation" text,
"Ranking" int,
"Budget_in_Billions" real,
"Num_Employees" real,
PRIMARY KEY ("Department_ID")
);
CREATE TABLE IF NOT EXISTS "head" (
"head_ID" int,
"name" text,
"... | SELECT DISTINCT "Creation"
FROM department
WHERE Department_ID IN (
SELECT DISTINCT department_ID
FROM management
WHERE head_ID IN (
SELECT head_ID
FROM head
WHERE born_state = 'Alabama'
)); | {"step_0": {"top_k": [{"token": "SELECT", "prob": 0.92533}, {"token": "```", "prob": 0.05007}, {"token": "To", "prob": 0.00637}, {"token": "[", "prob": 0.00562}, {"token": "{", "prob": 0.00386}], "pred_entropy": 0.51292}, "step_1": {"top_k": [{"token": "\u0120DISTINCT", "prob": 0.96247}, {"token": "\u0120distinct", "pr... |
7 | department_management | Given the SQL schema:
PRAGMA foreign_keys=ON;
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "department" (
"Department_ID" int,
"Name" text,
"Creation" text,
"Ranking" int,
"Budget_in_Billions" real,
"Num_Employees" real,
PRIMARY KEY ("Department_ID")
);
CREATE TABLE IF NOT EXISTS "head" (
"head_ID" int,
"name" text,
"... | SELECT born_state
FROM head
GROUP BY born_state
HAVING COUNT(*) >= 3; | {"step_0": {"top_k": [{"token": "SELECT", "prob": 0.94868}, {"token": "```", "prob": 0.03835}, {"token": "To", "prob": 0.00284}, {"token": "[", "prob": 0.00245}, {"token": "``", "prob": 0.00226}], "pred_entropy": 0.36697}, "step_1": {"top_k": [{"token": "\u0120born", "prob": 0.5323}, {"token": "\u0120DISTINCT", "prob":... |
8 | department_management | Given the SQL schema:
PRAGMA foreign_keys=ON;
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "department" (
"Department_ID" int,
"Name" text,
"Creation" text,
"Ranking" int,
"Budget_in_Billions" real,
"Num_Employees" real,
PRIMARY KEY ("Department_ID")
);
CREATE TABLE IF NOT EXISTS "head" (
"head_ID" int,
"name" text,
"... | ```sql
SELECT Creation FROM department GROUP BY Creation ORDER BY COUNT(Creation) DESC LIMIT 1;
``` | {"step_0": {"top_k": [{"token": "SELECT", "prob": 0.9044}, {"token": "```", "prob": 0.03974}, {"token": "Answer", "prob": 0.01589}, {"token": "To", "prob": 0.01092}, {"token": "<", "prob": 0.00868}], "pred_entropy": 0.71224}, "step_1": {"top_k": [{"token": "sql", "prob": 1.0}, {"token": "#", "prob": 0.0}, {"token": "!"... |
9 | department_management | Given the SQL schema:
PRAGMA foreign_keys=ON;
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "department" (
"Department_ID" int,
"Name" text,
"Creation" text,
"Ranking" int,
"Budget_in_Billions" real,
"Num_Employees" real,
PRIMARY KEY ("Department_ID")
);
CREATE TABLE IF NOT EXISTS "head" (
"head_ID" int,
"name" text,
"... | SELECT Name AS Name, Num_Employees AS Number_of_Employees
FROM department
INNER JOIN management ON department.Department_ID = management.Department_ID
INNER JOIN head ON management.head_ID = head.head_ID
WHERE head.temporary_acting = 'Yes'; | {"step_0": {"top_k": [{"token": "SELECT", "prob": 0.92709}, {"token": "```", "prob": 0.04247}, {"token": "To", "prob": 0.01096}, {"token": "Answer", "prob": 0.00518}, {"token": "BEGIN", "prob": 0.00429}], "pred_entropy": 0.52502}, "step_1": {"top_k": [{"token": "\u0120d", "prob": 0.33111}, {"token": "\u0120department",... |
10 | department_management | Given the SQL schema:
PRAGMA foreign_keys=ON;
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "department" (
"Department_ID" int,
"Name" text,
"Creation" text,
"Ranking" int,
"Budget_in_Billions" real,
"Num_Employees" real,
PRIMARY KEY ("Department_ID")
);
CREATE TABLE IF NOT EXISTS "head" (
"head_ID" int,
"name" text,
"... | SELECT count(distinct temporary_acting) from management;
SELECT count(distinct temporary_acting) FROM management; | {"step_0": {"top_k": [{"token": "SELECT", "prob": 0.91659}, {"token": "```", "prob": 0.04469}, {"token": "To", "prob": 0.00997}, {"token": "<", "prob": 0.00671}, {"token": "Answer", "prob": 0.00605}], "pred_entropy": 0.61243}, "step_1": {"top_k": [{"token": "\u0120COUNT", "prob": 0.54313}, {"token": "\u0120DISTINCT", "... |
11 | department_management | Given the SQL schema:
PRAGMA foreign_keys=ON;
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "department" (
"Department_ID" int,
"Name" text,
"Creation" text,
"Ranking" int,
"Budget_in_Billions" real,
"Num_Employees" real,
PRIMARY KEY ("Department_ID")
);
CREATE TABLE IF NOT EXISTS "head" (
"head_ID" int,
"name" text,
"... | SELECT count(*) FROM management WHERE head_ID IS NULL; | {"step_0": {"top_k": [{"token": "SELECT", "prob": 0.91471}, {"token": "```", "prob": 0.06096}, {"token": "{", "prob": 0.00791}, {"token": "``", "prob": 0.0048}, {"token": "Answer", "prob": 0.0033}], "pred_entropy": 0.55672}, "step_1": {"top_k": [{"token": "\u0120COUNT", "prob": 0.70962}, {"token": "\u0120count", "prob"... |
12 | department_management | Given the SQL schema:
PRAGMA foreign_keys=ON;
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "department" (
"Department_ID" int,
"Name" text,
"Creation" text,
"Ranking" int,
"Budget_in_Billions" real,
"Num_Employees" real,
PRIMARY KEY ("Department_ID")
);
CREATE TABLE IF NOT EXISTS "head" (
"head_ID" int,
"name" text,
"... | SELECT DISTINCT a.age FROM head a WHERE a.head_ID IN (SELECT DISTINCT b.head_ID FROM management b WHERE b.temporary_acting == 'True'); | {"step_0": {"top_k": [{"token": "SELECT", "prob": 0.94623}, {"token": "```", "prob": 0.03238}, {"token": "[", "prob": 0.00836}, {"token": "To", "prob": 0.00693}, {"token": "{", "prob": 0.00277}], "pred_entropy": 0.39736}, "step_1": {"top_k": [{"token": "\u0120DISTINCT", "prob": 0.97245}, {"token": "\u0120distinct", "pr... |
13 | department_management | Given the SQL schema:
PRAGMA foreign_keys=ON;
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "department" (
"Department_ID" int,
"Name" text,
"Creation" text,
"Ranking" int,
"Budget_in_Billions" real,
"Num_Employees" real,
PRIMARY KEY ("Department_ID")
);
CREATE TABLE IF NOT EXISTS "head" (
"head_ID" int,
"name" text,
"... | SELECT DISTINCT b.born_state
FROM head b
INNER JOIN management m ON b.head_ID = m.head_ID
INNER JOIN department d ON m.Department_ID = d.Department_ID
WHERE d.Name = 'Treasury' OR d.Name = 'Homeland Security'; | {"step_0": {"top_k": [{"token": "SELECT", "prob": 0.89097}, {"token": "```", "prob": 0.07625}, {"token": "BEGIN", "prob": 0.00969}, {"token": "``", "prob": 0.00576}, {"token": "Answer", "prob": 0.00448}], "pred_entropy": 0.68443}, "step_1": {"top_k": [{"token": "\u0120DISTINCT", "prob": 0.63555}, {"token": "\u0120t", "... |
14 | department_management | Given the SQL schema:
PRAGMA foreign_keys=ON;
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "department" (
"Department_ID" int,
"Name" text,
"Creation" text,
"Ranking" int,
"Budget_in_Billions" real,
"Num_Employees" real,
PRIMARY KEY ("Department_ID")
);
CREATE TABLE IF NOT EXISTS "head" (
"head_ID" int,
"name" text,
"... | SELECT department.Department_ID, department.Name, COUNT(management.head_ID) AS num_heads
FROM department
JOIN management ON department.Department_ID = management.Department_ID
GROUP BY department.Department_ID, department.Name
HAVING num_heads > 1; | {"step_0": {"top_k": [{"token": "SELECT", "prob": 0.93981}, {"token": "```", "prob": 0.02165}, {"token": "BEGIN", "prob": 0.01208}, {"token": "To", "prob": 0.00647}, {"token": "select", "prob": 0.00493}], "pred_entropy": 0.49388}, "step_1": {"top_k": [{"token": "\u0120department", "prob": 0.47645}, {"token": "\u0120d",... |
15 | department_management | Given the SQL schema:
PRAGMA foreign_keys=ON;
BEGIN TRANSACTION;
CREATE TABLE IF NOT EXISTS "department" (
"Department_ID" int,
"Name" text,
"Creation" text,
"Ranking" int,
"Budget_in_Billions" real,
"Num_Employees" real,
PRIMARY KEY ("Department_ID")
);
CREATE TABLE IF NOT EXISTS "head" (
"head_ID" int,
"name" text,
"... | SELECT name, head_ID FROM head WHERE name LIKE '%Ha%' | {"step_0": {"top_k": [{"token": "SELECT", "prob": 0.91522}, {"token": "```", "prob": 0.03476}, {"token": "BEGIN", "prob": 0.02065}, {"token": "To", "prob": 0.01333}, {"token": "Answer", "prob": 0.00617}], "pred_entropy": 0.6172}, "step_1": {"top_k": [{"token": "\u0120head", "prob": 0.88127}, {"token": "\u0120`", "prob"... |
16 | farm | Given the SQL schema:
PRAGMA foreign_keys = ON;
CREATE TABLE "city" (
"City_ID" int,
"Official_Name" text,
"Status" text,
"Area_km_2" real,
"Population" real,
"Census_Ranking" text,
PRIMARY KEY ("City_ID")
);
CREATE TABLE "farm" (
"Farm_ID" int,
"Year" int,
"Total_Horses" real,
"Working_Horses" real,
"Total_Cattle" r... | SELECT COUNT(*)
FROM Farm;
SELECT COUNT(*)
FROM Farm; | {"step_0": {"top_k": [{"token": "SELECT", "prob": 0.94756}, {"token": "```", "prob": 0.01409}, {"token": "Answer", "prob": 0.01075}, {"token": "select", "prob": 0.00786}, {"token": "<", "prob": 0.00612}], "pred_entropy": 0.45071}, "step_1": {"top_k": [{"token": "\u0120COUNT", "prob": 0.67524}, {"token": "\u0120count", ... |
17 | farm | Given the SQL schema:
PRAGMA foreign_keys = ON;
CREATE TABLE "city" (
"City_ID" int,
"Official_Name" text,
"Status" text,
"Area_km_2" real,
"Population" real,
"Census_Ranking" text,
PRIMARY KEY ("City_ID")
);
CREATE TABLE "farm" (
"Farm_ID" int,
"Year" int,
"Total_Horses" real,
"Working_Horses" real,
"Total_Cattle" r... | SELECT COUNT(*) FROM farm; | {"step_0": {"top_k": [{"token": "SELECT", "prob": 0.93534}, {"token": "```", "prob": 0.01901}, {"token": "Answer", "prob": 0.01018}, {"token": "COUNT", "prob": 0.00714}, {"token": "To", "prob": 0.00592}], "pred_entropy": 0.55625}, "step_1": {"top_k": [{"token": "\u0120COUNT", "prob": 0.62918}, {"token": "\u0120count", ... |
18 | farm | Given the SQL schema:
PRAGMA foreign_keys = ON;
CREATE TABLE "city" (
"City_ID" int,
"Official_Name" text,
"Status" text,
"Area_km_2" real,
"Population" real,
"Census_Ranking" text,
PRIMARY KEY ("City_ID")
);
CREATE TABLE "farm" (
"Farm_ID" int,
"Year" int,
"Total_Horses" real,
"Working_Horses" real,
"Total_Cattle" r... | SELECT SUM(`Total_Horses`) FROM `farm`;
SQL Query: | {"step_0": {"top_k": [{"token": "SELECT", "prob": 0.96898}, {"token": "```", "prob": 0.0099}, {"token": "Answer", "prob": 0.00613}, {"token": "select", "prob": 0.00613}, {"token": "<", "prob": 0.00519}], "pred_entropy": 0.27277}, "step_1": {"top_k": [{"token": "\u0120SUM", "prob": 0.49188}, {"token": "\u0120Total", "pr... |
End of preview. Expand in Data Studio
README.md exists but content is empty.
- Downloads last month
- 16