variant stringclasses 3
values | prompt stringlengths 160 237 | sql stringlengths 102 141 | metadata unknown | token_group stringclasses 2
values | id stringlengths 24 24 | split stringclasses 1
value |
|---|---|---|---|---|---|---|
v3 | Schema:
customers (alias: cust)(level, status, amount, value)
staff(salary, amount, type, level)
Task: Find id from customers where value exceeds the minimum amount from staff for the same level.
SQL: | SELECT id FROM customers AS cust
WHERE value > (
SELECT MIN(amount) FROM staff AS empl
WHERE empl.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "staff",
"outer_alias": "cust",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05100 | train |
v3 | Schema:
branches (alias: brc)(level, name, code, salary)
invoices(amount, salary, name, id)
Task: Retrieve name from branches with amount above the MIN(amount) of invoices rows sharing the same type.
SQL: | SELECT name FROM branches AS brc
WHERE amount > (
SELECT MIN(amount) FROM invoices AS inv
WHERE inv.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "invoices",
"outer_alias": "brc",
"inner_alias": "inv",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05101 | train |
v3 | Schema:
managers (alias: mgr)(code, level, name, value)
shipments(value, code, id, date)
Task: Retrieve amount from managers with amount above the SUM(salary) of shipments rows sharing the same level.
SQL: | SELECT amount FROM managers AS mgr
WHERE amount > (
SELECT SUM(salary) FROM shipments AS shp
WHERE shp.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "shipments",
"outer_alias": "mgr",
"inner_alias": "shp",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05102 | train |
v2 | Schema:
branches (alias: brc)(level, salary, id, amount)
employees(amount, id, status, code)
Task: Find value from branches where a matching record exists in employees with the same code.
SQL: | SELECT value FROM branches AS brc
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.code = brc.code
); | {
"outer_table": "branches",
"inner_table": "employees",
"outer_alias": "brc",
"inner_alias": "emp",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "brc.code",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05103 | train |
v2 | Schema:
invoices (alias: inv)(status, code, name, amount)
regions(id, type, name, level)
Task: Find name from invoices where a matching record exists in regions with the same id.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM regions AS rgn
WHERE rgn.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05104 | train |
v1 | Schema:
employees (alias: emp)(code, type, name, salary)
projects(date, salary, level, code)
Task: Retrieve id from employees whose id is found in projects rows where status matches the outer record.
SQL: | SELECT id FROM employees AS emp
WHERE id IN (
SELECT id FROM projects AS prj
WHERE prj.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "projects",
"outer_alias": "emp",
"inner_alias": "prj",
"proj_col": "id",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05105 | train |
v3 | Schema:
products (alias: prod)(amount, status, value, level)
invoices(date, name, status, amount)
Task: Retrieve id from products with value above the SUM(value) of invoices rows sharing the same id.
SQL: | SELECT id FROM products AS prod
WHERE value > (
SELECT SUM(value) FROM invoices AS inv
WHERE inv.id = prod.id
); | {
"outer_table": "products",
"inner_table": "invoices",
"outer_alias": "prod",
"inner_alias": "inv",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05106 | train |
v3 | Schema:
invoices (alias: inv)(id, type, value, salary)
regions(status, id, salary, date)
Task: Retrieve name from invoices with amount above the MIN(amount) of regions rows sharing the same code.
SQL: | SELECT name FROM invoices AS inv
WHERE amount > (
SELECT MIN(amount) FROM regions AS rgn
WHERE rgn.code = inv.code
); | {
"outer_table": "invoices",
"inner_table": "regions",
"outer_alias": "inv",
"inner_alias": "rgn",
"proj_col": "name",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "inv.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05107 | train |
v2 | Schema:
items (alias: lne)(salary, value, amount, level)
branches(salary, level, id, status)
Task: Retrieve name from items that have at least one corresponding entry in branches sharing the same code.
SQL: | SELECT name FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.code = lne.code
); | {
"outer_table": "items",
"inner_table": "branches",
"outer_alias": "lne",
"inner_alias": "brc",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "lne.code",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05108 | train |
v3 | Schema:
accounts (alias: acct)(status, name, id, code)
requests(id, code, name, level)
Task: Find code from accounts where amount exceeds the total salary from requests for the same code.
SQL: | SELECT code FROM accounts AS acct
WHERE amount > (
SELECT SUM(salary) FROM requests AS ordr
WHERE ordr.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "requests",
"outer_alias": "acct",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05109 | train |
v1 | Schema:
departments (alias: dept)(status, value, type, id)
orders(level, status, code, value)
Task: Select salary from departments where code exists in orders for the same level.
SQL: | SELECT salary FROM departments AS dept
WHERE code IN (
SELECT code FROM orders AS ord
WHERE ord.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "orders",
"outer_alias": "dept",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05110 | train |
v3 | Schema:
products (alias: prod)(id, code, status, type)
tasks(value, date, code, type)
Task: Find amount from products where value exceeds the maximum salary from tasks for the same code.
SQL: | SELECT amount FROM products AS prod
WHERE value > (
SELECT MAX(salary) FROM tasks AS tsk
WHERE tsk.code = prod.code
); | {
"outer_table": "products",
"inner_table": "tasks",
"outer_alias": "prod",
"inner_alias": "tsk",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "code",
"correlated_ref": "prod.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05111 | train |
v3 | Schema:
shipments (alias: shp)(value, amount, date, status)
products(level, salary, value, date)
Task: Retrieve value from shipments with salary above the COUNT(amount) of products rows sharing the same level.
SQL: | SELECT value FROM shipments AS shp
WHERE salary > (
SELECT COUNT(amount) FROM products AS prod
WHERE prod.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05112 | train |
v3 | Schema:
products (alias: prod)(type, level, status, date)
tasks(type, status, name, value)
Task: Retrieve id from products with value above the MAX(value) of tasks rows sharing the same type.
SQL: | SELECT id FROM products AS prod
WHERE value > (
SELECT MAX(value) FROM tasks AS tsk
WHERE tsk.type = prod.type
); | {
"outer_table": "products",
"inner_table": "tasks",
"outer_alias": "prod",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05113 | train |
v1 | Schema:
departments (alias: dept)(code, amount, id, status)
invoices(level, value, date, amount)
Task: Select value from departments where type exists in invoices for the same code.
SQL: | SELECT value FROM departments AS dept
WHERE type IN (
SELECT type FROM invoices AS inv
WHERE inv.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "invoices",
"outer_alias": "dept",
"inner_alias": "inv",
"proj_col": "value",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05114 | train |
v3 | Schema:
projects (alias: prj)(name, amount, date, type)
departments(type, status, salary, date)
Task: Retrieve amount from projects with amount above the AVG(value) of departments rows sharing the same code.
SQL: | SELECT amount FROM projects AS prj
WHERE amount > (
SELECT AVG(value) FROM departments AS dept
WHERE dept.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "departments",
"outer_alias": "prj",
"inner_alias": "dept",
"proj_col": "amount",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05115 | train |
v3 | Schema:
staff (alias: empl)(date, id, type, status)
tasks(status, date, level, id)
Task: Find id from staff where amount exceeds the maximum value from tasks for the same id.
SQL: | SELECT id FROM staff AS empl
WHERE amount > (
SELECT MAX(value) FROM tasks AS tsk
WHERE tsk.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "tasks",
"outer_alias": "empl",
"inner_alias": "tsk",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05116 | train |
v1 | Schema:
departments (alias: dept)(type, value, level, salary)
schedules(salary, status, name, value)
Task: Select amount from departments where status exists in schedules for the same status.
SQL: | SELECT amount FROM departments AS dept
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.status = dept.status
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "amount",
"filter_col": "status",
"join_col": "status",
"correlated_ref": "dept.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05117 | train |
v2 | Schema:
customers (alias: cust)(date, value, id, type)
projects(type, id, status, level)
Task: Find id from customers where a matching record exists in projects with the same status.
SQL: | SELECT id FROM customers AS cust
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.status = cust.status
); | {
"outer_table": "customers",
"inner_table": "projects",
"outer_alias": "cust",
"inner_alias": "prj",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "cust.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05118 | train |
v3 | Schema:
managers (alias: mgr)(code, salary, level, amount)
regions(code, level, type, name)
Task: Retrieve code from managers with amount above the COUNT(salary) of regions rows sharing the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE amount > (
SELECT COUNT(salary) FROM regions AS rgn
WHERE rgn.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "regions",
"outer_alias": "mgr",
"inner_alias": "rgn",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05119 | train |
v2 | Schema:
employees (alias: emp)(type, level, salary, amount)
branches(id, level, value, code)
Task: Retrieve amount from employees that have at least one corresponding entry in branches sharing the same id.
SQL: | SELECT amount FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "amount",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05120 | train |
v1 | Schema:
sales (alias: sale)(id, amount, salary, level)
items(level, amount, id, date)
Task: Retrieve name from sales whose code is found in items rows where level matches the outer record.
SQL: | SELECT name FROM sales AS sale
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.level = sale.level
); | {
"outer_table": "sales",
"inner_table": "items",
"outer_alias": "sale",
"inner_alias": "lne",
"proj_col": "name",
"filter_col": "code",
"join_col": "level",
"correlated_ref": "sale.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05121 | train |
v2 | Schema:
products (alias: prod)(type, salary, level, amount)
projects(type, id, status, salary)
Task: Retrieve id from products that have at least one corresponding entry in projects sharing the same id.
SQL: | SELECT id FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = prod.id
); | {
"outer_table": "products",
"inner_table": "projects",
"outer_alias": "prod",
"inner_alias": "prj",
"proj_col": "id",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05122 | train |
v3 | Schema:
sales (alias: sale)(salary, value, status, date)
accounts(salary, id, status, amount)
Task: Find id from sales where amount exceeds the minimum amount from accounts for the same code.
SQL: | SELECT id FROM sales AS sale
WHERE amount > (
SELECT MIN(amount) FROM accounts AS acct
WHERE acct.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "accounts",
"outer_alias": "sale",
"inner_alias": "acct",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05123 | train |
v2 | Schema:
transactions (alias: txn)(date, id, name, code)
products(name, level, value, amount)
Task: Find id from transactions where a matching record exists in products with the same code.
SQL: | SELECT id FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "id",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05124 | train |
v1 | Schema:
accounts (alias: acct)(level, date, status, code)
schedules(code, status, date, amount)
Task: Retrieve code from accounts whose status is found in schedules rows where type matches the outer record.
SQL: | SELECT code FROM accounts AS acct
WHERE status IN (
SELECT status FROM schedules AS schd
WHERE schd.type = acct.type
); | {
"outer_table": "accounts",
"inner_table": "schedules",
"outer_alias": "acct",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "acct.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05125 | train |
v1 | Schema:
customers (alias: cust)(code, amount, type, status)
managers(id, code, status, value)
Task: Find id from customers where type appears in managers entries with matching level.
SQL: | SELECT id FROM customers AS cust
WHERE type IN (
SELECT type FROM managers AS mgr
WHERE mgr.level = cust.level
); | {
"outer_table": "customers",
"inner_table": "managers",
"outer_alias": "cust",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "type",
"join_col": "level",
"correlated_ref": "cust.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05126 | train |
v1 | Schema:
branches (alias: brc)(name, id, level, salary)
tasks(code, amount, id, level)
Task: Retrieve value from branches whose code is found in tasks rows where status matches the outer record.
SQL: | SELECT value FROM branches AS brc
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.status = brc.status
); | {
"outer_table": "branches",
"inner_table": "tasks",
"outer_alias": "brc",
"inner_alias": "tsk",
"proj_col": "value",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "brc.status",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05127 | train |
v2 | Schema:
managers (alias: mgr)(salary, id, type, level)
projects(amount, value, level, code)
Task: Find value from managers where a matching record exists in projects with the same level.
SQL: | SELECT value FROM managers AS mgr
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = mgr.level
); | {
"outer_table": "managers",
"inner_table": "projects",
"outer_alias": "mgr",
"inner_alias": "prj",
"proj_col": "value",
"join_col": "level",
"correlated_ref": "mgr.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05128 | train |
v3 | Schema:
departments (alias: dept)(date, id, status, value)
customers(level, date, salary, type)
Task: Find salary from departments where value exceeds the total value from customers for the same code.
SQL: | SELECT salary FROM departments AS dept
WHERE value > (
SELECT SUM(value) FROM customers AS cust
WHERE cust.code = dept.code
); | {
"outer_table": "departments",
"inner_table": "customers",
"outer_alias": "dept",
"inner_alias": "cust",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "code",
"correlated_ref": "dept.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05129 | train |
v3 | Schema:
orders (alias: ord)(level, amount, salary, code)
sales(salary, amount, status, code)
Task: Retrieve salary from orders with value above the MAX(salary) of sales rows sharing the same level.
SQL: | SELECT salary FROM orders AS ord
WHERE value > (
SELECT MAX(salary) FROM sales AS sale
WHERE sale.level = ord.level
); | {
"outer_table": "orders",
"inner_table": "sales",
"outer_alias": "ord",
"inner_alias": "sale",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "level",
"correlated_ref": "ord.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05130 | train |
v3 | Schema:
departments (alias: dept)(value, salary, id, amount)
categories(code, name, level, date)
Task: Find name from departments where value exceeds the total value from categories for the same level.
SQL: | SELECT name FROM departments AS dept
WHERE value > (
SELECT SUM(value) FROM categories AS catg
WHERE catg.level = dept.level
); | {
"outer_table": "departments",
"inner_table": "categories",
"outer_alias": "dept",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "dept.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05131 | train |
v2 | Schema:
projects (alias: prj)(id, value, name, status)
transactions(salary, type, code, value)
Task: Find name from projects where a matching record exists in transactions with the same level.
SQL: | SELECT name FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM transactions AS txn
WHERE txn.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "transactions",
"outer_alias": "prj",
"inner_alias": "txn",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05132 | train |
v2 | Schema:
shipments (alias: shp)(value, name, date, status)
schedules(id, date, salary, value)
Task: Find value from shipments where a matching record exists in schedules with the same id.
SQL: | SELECT value FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "schedules",
"outer_alias": "shp",
"inner_alias": "schd",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05133 | train |
v3 | Schema:
products (alias: prod)(id, value, status, date)
schedules(salary, date, level, status)
Task: Retrieve name from products with value above the SUM(value) of schedules rows sharing the same status.
SQL: | SELECT name FROM products AS prod
WHERE value > (
SELECT SUM(value) FROM schedules AS schd
WHERE schd.status = prod.status
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "name",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "prod.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05134 | train |
v1 | Schema:
shipments (alias: shp)(type, value, status, code)
items(id, type, salary, level)
Task: Select value from shipments where code exists in items for the same type.
SQL: | SELECT value FROM shipments AS shp
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "items",
"outer_alias": "shp",
"inner_alias": "lne",
"proj_col": "value",
"filter_col": "code",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05135 | train |
v1 | Schema:
shipments (alias: shp)(name, code, date, value)
employees(id, name, code, date)
Task: Select code from shipments where id exists in employees for the same status.
SQL: | SELECT code FROM shipments AS shp
WHERE id IN (
SELECT id FROM employees AS emp
WHERE emp.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "code",
"filter_col": "id",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05136 | train |
v1 | Schema:
employees (alias: emp)(code, value, type, date)
tasks(code, date, level, id)
Task: Find salary from employees where code appears in tasks entries with matching code.
SQL: | SELECT salary FROM employees AS emp
WHERE code IN (
SELECT code FROM tasks AS tsk
WHERE tsk.code = emp.code
); | {
"outer_table": "employees",
"inner_table": "tasks",
"outer_alias": "emp",
"inner_alias": "tsk",
"proj_col": "salary",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "emp.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05137 | train |
v3 | Schema:
managers (alias: mgr)(date, id, name, amount)
schedules(value, date, level, name)
Task: Retrieve code from managers with amount above the SUM(value) of schedules rows sharing the same id.
SQL: | SELECT code FROM managers AS mgr
WHERE amount > (
SELECT SUM(value) FROM schedules AS schd
WHERE schd.id = mgr.id
); | {
"outer_table": "managers",
"inner_table": "schedules",
"outer_alias": "mgr",
"inner_alias": "schd",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "mgr.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05138 | train |
v3 | Schema:
products (alias: prod)(type, status, level, name)
categories(value, id, level, type)
Task: Find id from products where value exceeds the total salary from categories for the same type.
SQL: | SELECT id FROM products AS prod
WHERE value > (
SELECT SUM(salary) FROM categories AS catg
WHERE catg.type = prod.type
); | {
"outer_table": "products",
"inner_table": "categories",
"outer_alias": "prod",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "SUM",
"join_col": "type",
"correlated_ref": "prod.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05139 | train |
v2 | Schema:
categories (alias: catg)(salary, date, code, name)
managers(salary, value, code, date)
Task: Retrieve amount from categories that have at least one corresponding entry in managers sharing the same type.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05140 | train |
v1 | Schema:
accounts (alias: acct)(name, type, level, id)
items(id, type, value, date)
Task: Find id from accounts where code appears in items entries with matching code.
SQL: | SELECT id FROM accounts AS acct
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "items",
"outer_alias": "acct",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "code",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05141 | train |
v3 | Schema:
categories (alias: catg)(name, type, date, code)
customers(type, id, value, salary)
Task: Find id from categories where salary exceeds the count of amount from customers for the same level.
SQL: | SELECT id FROM categories AS catg
WHERE salary > (
SELECT COUNT(amount) FROM customers AS cust
WHERE cust.level = catg.level
); | {
"outer_table": "categories",
"inner_table": "customers",
"outer_alias": "catg",
"inner_alias": "cust",
"proj_col": "id",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "catg.level",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05142 | train |
v3 | Schema:
orders (alias: ord)(code, salary, value, level)
categories(name, status, level, id)
Task: Find amount from orders where value exceeds the count of amount from categories for the same code.
SQL: | SELECT amount FROM orders AS ord
WHERE value > (
SELECT COUNT(amount) FROM categories AS catg
WHERE catg.code = ord.code
); | {
"outer_table": "orders",
"inner_table": "categories",
"outer_alias": "ord",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "code",
"correlated_ref": "ord.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05143 | train |
v2 | Schema:
categories (alias: catg)(date, type, value, level)
employees(status, level, amount, type)
Task: Retrieve amount from categories that have at least one corresponding entry in employees sharing the same type.
SQL: | SELECT amount FROM categories AS catg
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.type = catg.type
); | {
"outer_table": "categories",
"inner_table": "employees",
"outer_alias": "catg",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "catg.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05144 | train |
v3 | Schema:
sales (alias: sale)(name, id, value, type)
branches(type, amount, code, date)
Task: Retrieve name from sales with salary above the COUNT(value) of branches rows sharing the same type.
SQL: | SELECT name FROM sales AS sale
WHERE salary > (
SELECT COUNT(value) FROM branches AS brc
WHERE brc.type = sale.type
); | {
"outer_table": "sales",
"inner_table": "branches",
"outer_alias": "sale",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "sale.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05145 | train |
v1 | Schema:
employees (alias: emp)(code, salary, amount, value)
shipments(value, date, id, type)
Task: Retrieve id from employees whose id is found in shipments rows where type matches the outer record.
SQL: | SELECT id FROM employees AS emp
WHERE id IN (
SELECT id FROM shipments AS shp
WHERE shp.type = emp.type
); | {
"outer_table": "employees",
"inner_table": "shipments",
"outer_alias": "emp",
"inner_alias": "shp",
"proj_col": "id",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "emp.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05146 | train |
v1 | Schema:
products (alias: prod)(salary, amount, name, code)
schedules(value, code, name, id)
Task: Find value from products where level appears in schedules entries with matching level.
SQL: | SELECT value FROM products AS prod
WHERE level IN (
SELECT level FROM schedules AS schd
WHERE schd.level = prod.level
); | {
"outer_table": "products",
"inner_table": "schedules",
"outer_alias": "prod",
"inner_alias": "schd",
"proj_col": "value",
"filter_col": "level",
"join_col": "level",
"correlated_ref": "prod.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05147 | train |
v1 | Schema:
transactions (alias: txn)(id, name, status, type)
items(date, level, id, type)
Task: Find id from transactions where code appears in items entries with matching status.
SQL: | SELECT id FROM transactions AS txn
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "items",
"outer_alias": "txn",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "code",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05148 | train |
v3 | Schema:
shipments (alias: shp)(amount, name, value, level)
products(date, status, id, code)
Task: Retrieve salary from shipments with amount above the COUNT(salary) of products rows sharing the same status.
SQL: | SELECT salary FROM shipments AS shp
WHERE amount > (
SELECT COUNT(salary) FROM products AS prod
WHERE prod.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "products",
"outer_alias": "shp",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05149 | train |
v3 | Schema:
items (alias: lne)(code, amount, status, date)
categories(type, id, value, status)
Task: Retrieve id from items with value above the COUNT(amount) of categories rows sharing the same level.
SQL: | SELECT id FROM items AS lne
WHERE value > (
SELECT COUNT(amount) FROM categories AS catg
WHERE catg.level = lne.level
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "level",
"correlated_ref": "lne.level",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05150 | train |
v2 | Schema:
transactions (alias: txn)(level, value, name, code)
managers(value, status, salary, level)
Task: Find value from transactions where a matching record exists in managers with the same code.
SQL: | SELECT value FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM managers AS mgr
WHERE mgr.code = txn.code
); | {
"outer_table": "transactions",
"inner_table": "managers",
"outer_alias": "txn",
"inner_alias": "mgr",
"proj_col": "value",
"join_col": "code",
"correlated_ref": "txn.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05151 | train |
v1 | Schema:
projects (alias: prj)(type, code, id, name)
products(date, level, name, type)
Task: Find salary from projects where type appears in products entries with matching id.
SQL: | SELECT salary FROM projects AS prj
WHERE type IN (
SELECT type FROM products AS prod
WHERE prod.id = prj.id
); | {
"outer_table": "projects",
"inner_table": "products",
"outer_alias": "prj",
"inner_alias": "prod",
"proj_col": "salary",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "prj.id",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05152 | train |
v2 | Schema:
shipments (alias: shp)(amount, date, name, level)
branches(salary, id, amount, type)
Task: Find amount from shipments where a matching record exists in branches with the same type.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM branches AS brc
WHERE brc.type = shp.type
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "shp.type",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05153 | train |
v2 | Schema:
tasks (alias: tsk)(type, id, code, amount)
sales(date, amount, name, salary)
Task: Retrieve amount from tasks that have at least one corresponding entry in sales sharing the same type.
SQL: | SELECT amount FROM tasks AS tsk
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.type = tsk.type
); | {
"outer_table": "tasks",
"inner_table": "sales",
"outer_alias": "tsk",
"inner_alias": "sale",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "tsk.type",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05154 | train |
v1 | Schema:
schedules (alias: schd)(amount, date, code, name)
orders(type, status, value, name)
Task: Retrieve value from schedules whose level is found in orders rows where type matches the outer record.
SQL: | SELECT value FROM schedules AS schd
WHERE level IN (
SELECT level FROM orders AS ord
WHERE ord.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "orders",
"outer_alias": "schd",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "level",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05155 | train |
v3 | Schema:
transactions (alias: txn)(salary, type, amount, value)
requests(level, salary, date, status)
Task: Find code from transactions where value exceeds the maximum salary from requests for the same status.
SQL: | SELECT code FROM transactions AS txn
WHERE value > (
SELECT MAX(salary) FROM requests AS ordr
WHERE ordr.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "requests",
"outer_alias": "txn",
"inner_alias": "ordr",
"proj_col": "code",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05156 | train |
v1 | Schema:
shipments (alias: shp)(date, status, id, value)
branches(amount, name, level, salary)
Task: Find code from shipments where code appears in branches entries with matching id.
SQL: | SELECT code FROM shipments AS shp
WHERE code IN (
SELECT code FROM branches AS brc
WHERE brc.id = shp.id
); | {
"outer_table": "shipments",
"inner_table": "branches",
"outer_alias": "shp",
"inner_alias": "brc",
"proj_col": "code",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "shp.id",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05157 | train |
v1 | Schema:
projects (alias: prj)(type, status, id, value)
accounts(level, value, date, amount)
Task: Select code from projects where type exists in accounts for the same code.
SQL: | SELECT code FROM projects AS prj
WHERE type IN (
SELECT type FROM accounts AS acct
WHERE acct.code = prj.code
); | {
"outer_table": "projects",
"inner_table": "accounts",
"outer_alias": "prj",
"inner_alias": "acct",
"proj_col": "code",
"filter_col": "type",
"join_col": "code",
"correlated_ref": "prj.code",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05158 | train |
v3 | Schema:
tasks (alias: tsk)(level, status, code, value)
transactions(id, level, value, type)
Task: Retrieve value from tasks with value above the AVG(value) of transactions rows sharing the same status.
SQL: | SELECT value FROM tasks AS tsk
WHERE value > (
SELECT AVG(value) FROM transactions AS txn
WHERE txn.status = tsk.status
); | {
"outer_table": "tasks",
"inner_table": "transactions",
"outer_alias": "tsk",
"inner_alias": "txn",
"proj_col": "value",
"filter_col": "value",
"agg_col": "value",
"agg_fn": "AVG",
"join_col": "status",
"correlated_ref": "tsk.status",
"token_group": "T2",
"fan_out": 1586
} | T2 | cs8_fixed_v4_train_05159 | train |
v3 | Schema:
employees (alias: emp)(date, level, id, type)
orders(value, salary, code, level)
Task: Find value from employees where value exceeds the maximum salary from orders for the same status.
SQL: | SELECT value FROM employees AS emp
WHERE value > (
SELECT MAX(salary) FROM orders AS ord
WHERE ord.status = emp.status
); | {
"outer_table": "employees",
"inner_table": "orders",
"outer_alias": "emp",
"inner_alias": "ord",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "MAX",
"join_col": "status",
"correlated_ref": "emp.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05160 | train |
v2 | Schema:
staff (alias: empl)(name, id, status, amount)
departments(id, salary, name, status)
Task: Retrieve name from staff that have at least one corresponding entry in departments sharing the same id.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = empl.id
); | {
"outer_table": "staff",
"inner_table": "departments",
"outer_alias": "empl",
"inner_alias": "dept",
"proj_col": "name",
"join_col": "id",
"correlated_ref": "empl.id",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05161 | train |
v2 | Schema:
projects (alias: prj)(amount, level, id, salary)
employees(id, code, value, level)
Task: Retrieve code from projects that have at least one corresponding entry in employees sharing the same level.
SQL: | SELECT code FROM projects AS prj
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = prj.level
); | {
"outer_table": "projects",
"inner_table": "employees",
"outer_alias": "prj",
"inner_alias": "emp",
"proj_col": "code",
"join_col": "level",
"correlated_ref": "prj.level",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05162 | train |
v1 | Schema:
employees (alias: emp)(amount, status, salary, code)
categories(salary, date, status, level)
Task: Find value from employees where status appears in categories entries with matching level.
SQL: | SELECT value FROM employees AS emp
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.level = emp.level
); | {
"outer_table": "employees",
"inner_table": "categories",
"outer_alias": "emp",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "status",
"join_col": "level",
"correlated_ref": "emp.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05163 | train |
v1 | Schema:
invoices (alias: inv)(name, value, amount, level)
accounts(type, salary, status, date)
Task: Select value from invoices where id exists in accounts for the same id.
SQL: | SELECT value FROM invoices AS inv
WHERE id IN (
SELECT id FROM accounts AS acct
WHERE acct.id = inv.id
); | {
"outer_table": "invoices",
"inner_table": "accounts",
"outer_alias": "inv",
"inner_alias": "acct",
"proj_col": "value",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "inv.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05164 | train |
v2 | Schema:
items (alias: lne)(amount, name, salary, status)
categories(name, id, date, salary)
Task: Retrieve id from items that have at least one corresponding entry in categories sharing the same status.
SQL: | SELECT id FROM items AS lne
WHERE EXISTS (
SELECT 1 FROM categories AS catg
WHERE catg.status = lne.status
); | {
"outer_table": "items",
"inner_table": "categories",
"outer_alias": "lne",
"inner_alias": "catg",
"proj_col": "id",
"join_col": "status",
"correlated_ref": "lne.status",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05165 | train |
v1 | Schema:
regions (alias: rgn)(id, level, date, salary)
departments(level, value, status, type)
Task: Select name from regions where type exists in departments for the same type.
SQL: | SELECT name FROM regions AS rgn
WHERE type IN (
SELECT type FROM departments AS dept
WHERE dept.type = rgn.type
); | {
"outer_table": "regions",
"inner_table": "departments",
"outer_alias": "rgn",
"inner_alias": "dept",
"proj_col": "name",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "rgn.type",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05166 | train |
v1 | Schema:
shipments (alias: shp)(date, amount, status, name)
categories(id, status, name, amount)
Task: Retrieve value from shipments whose id is found in categories rows where code matches the outer record.
SQL: | SELECT value FROM shipments AS shp
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "categories",
"outer_alias": "shp",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "id",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05167 | train |
v2 | Schema:
invoices (alias: inv)(level, salary, name, code)
projects(name, type, status, amount)
Task: Find name from invoices where a matching record exists in projects with the same level.
SQL: | SELECT name FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.level = inv.level
); | {
"outer_table": "invoices",
"inner_table": "projects",
"outer_alias": "inv",
"inner_alias": "prj",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "inv.level",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05168 | train |
v1 | Schema:
items (alias: lne)(value, id, date, status)
employees(value, code, date, status)
Task: Find name from items where type appears in employees entries with matching id.
SQL: | SELECT name FROM items AS lne
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.id = lne.id
); | {
"outer_table": "items",
"inner_table": "employees",
"outer_alias": "lne",
"inner_alias": "emp",
"proj_col": "name",
"filter_col": "type",
"join_col": "id",
"correlated_ref": "lne.id",
"token_group": "T2",
"fan_out": 883
} | T2 | cs8_fixed_v4_train_05169 | train |
v3 | Schema:
regions (alias: rgn)(name, type, code, date)
categories(code, amount, name, status)
Task: Find amount from regions where salary exceeds the minimum amount from categories for the same id.
SQL: | SELECT amount FROM regions AS rgn
WHERE salary > (
SELECT MIN(amount) FROM categories AS catg
WHERE catg.id = rgn.id
); | {
"outer_table": "regions",
"inner_table": "categories",
"outer_alias": "rgn",
"inner_alias": "catg",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "MIN",
"join_col": "id",
"correlated_ref": "rgn.id",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05170 | train |
v3 | Schema:
regions (alias: rgn)(amount, code, date, type)
branches(type, level, salary, date)
Task: Retrieve id from regions with value above the SUM(amount) of branches rows sharing the same level.
SQL: | SELECT id FROM regions AS rgn
WHERE value > (
SELECT SUM(amount) FROM branches AS brc
WHERE brc.level = rgn.level
); | {
"outer_table": "regions",
"inner_table": "branches",
"outer_alias": "rgn",
"inner_alias": "brc",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "level",
"correlated_ref": "rgn.level",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05171 | train |
v3 | Schema:
orders (alias: ord)(name, date, type, amount)
branches(type, salary, code, date)
Task: Find value from orders where salary exceeds the total value from branches for the same id.
SQL: | SELECT value FROM orders AS ord
WHERE salary > (
SELECT SUM(value) FROM branches AS brc
WHERE brc.id = ord.id
); | {
"outer_table": "orders",
"inner_table": "branches",
"outer_alias": "ord",
"inner_alias": "brc",
"proj_col": "value",
"filter_col": "salary",
"agg_col": "value",
"agg_fn": "SUM",
"join_col": "id",
"correlated_ref": "ord.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05172 | train |
v1 | Schema:
shipments (alias: shp)(salary, status, type, code)
orders(amount, name, status, date)
Task: Retrieve salary from shipments whose status is found in orders rows where code matches the outer record.
SQL: | SELECT salary FROM shipments AS shp
WHERE status IN (
SELECT status FROM orders AS ord
WHERE ord.code = shp.code
); | {
"outer_table": "shipments",
"inner_table": "orders",
"outer_alias": "shp",
"inner_alias": "ord",
"proj_col": "salary",
"filter_col": "status",
"join_col": "code",
"correlated_ref": "shp.code",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05173 | train |
v3 | Schema:
managers (alias: mgr)(amount, status, type, code)
items(type, date, amount, level)
Task: Find salary from managers where value exceeds the count of amount from items for the same status.
SQL: | SELECT salary FROM managers AS mgr
WHERE value > (
SELECT COUNT(amount) FROM items AS lne
WHERE lne.status = mgr.status
); | {
"outer_table": "managers",
"inner_table": "items",
"outer_alias": "mgr",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "mgr.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05174 | train |
v2 | Schema:
shipments (alias: shp)(salary, code, type, value)
employees(status, date, name, level)
Task: Find amount from shipments where a matching record exists in employees with the same level.
SQL: | SELECT amount FROM shipments AS shp
WHERE EXISTS (
SELECT 1 FROM employees AS emp
WHERE emp.level = shp.level
); | {
"outer_table": "shipments",
"inner_table": "employees",
"outer_alias": "shp",
"inner_alias": "emp",
"proj_col": "amount",
"join_col": "level",
"correlated_ref": "shp.level",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05175 | train |
v3 | Schema:
categories (alias: catg)(date, code, type, value)
items(amount, date, status, level)
Task: Retrieve id from categories with value above the MAX(amount) of items rows sharing the same id.
SQL: | SELECT id FROM categories AS catg
WHERE value > (
SELECT MAX(amount) FROM items AS lne
WHERE lne.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "items",
"outer_alias": "catg",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "value",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05176 | train |
v1 | Schema:
managers (alias: mgr)(level, name, type, salary)
categories(level, code, date, value)
Task: Retrieve name from managers whose id is found in categories rows where type matches the outer record.
SQL: | SELECT name FROM managers AS mgr
WHERE id IN (
SELECT id FROM categories AS catg
WHERE catg.type = mgr.type
); | {
"outer_table": "managers",
"inner_table": "categories",
"outer_alias": "mgr",
"inner_alias": "catg",
"proj_col": "name",
"filter_col": "id",
"join_col": "type",
"correlated_ref": "mgr.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05177 | train |
v1 | Schema:
categories (alias: catg)(status, code, salary, amount)
managers(value, amount, name, status)
Task: Find id from categories where id appears in managers entries with matching id.
SQL: | SELECT id FROM categories AS catg
WHERE id IN (
SELECT id FROM managers AS mgr
WHERE mgr.id = catg.id
); | {
"outer_table": "categories",
"inner_table": "managers",
"outer_alias": "catg",
"inner_alias": "mgr",
"proj_col": "id",
"filter_col": "id",
"join_col": "id",
"correlated_ref": "catg.id",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05178 | train |
v2 | Schema:
staff (alias: empl)(name, date, salary, id)
shipments(amount, date, level, code)
Task: Retrieve name from staff that have at least one corresponding entry in shipments sharing the same level.
SQL: | SELECT name FROM staff AS empl
WHERE EXISTS (
SELECT 1 FROM shipments AS shp
WHERE shp.level = empl.level
); | {
"outer_table": "staff",
"inner_table": "shipments",
"outer_alias": "empl",
"inner_alias": "shp",
"proj_col": "name",
"join_col": "level",
"correlated_ref": "empl.level",
"token_group": "T2",
"fan_out": 110
} | T2 | cs8_fixed_v4_train_05179 | train |
v3 | Schema:
schedules (alias: schd)(value, id, code, type)
staff(value, level, type, salary)
Task: Retrieve salary from schedules with amount above the MAX(amount) of staff rows sharing the same type.
SQL: | SELECT salary FROM schedules AS schd
WHERE amount > (
SELECT MAX(amount) FROM staff AS empl
WHERE empl.type = schd.type
); | {
"outer_table": "schedules",
"inner_table": "staff",
"outer_alias": "schd",
"inner_alias": "empl",
"proj_col": "salary",
"filter_col": "amount",
"agg_col": "amount",
"agg_fn": "MAX",
"join_col": "type",
"correlated_ref": "schd.type",
"token_group": "T2",
"fan_out": 36
} | T2 | cs8_fixed_v4_train_05180 | train |
v2 | Schema:
products (alias: prod)(amount, value, level, status)
projects(status, type, level, value)
Task: Retrieve code from products that have at least one corresponding entry in projects sharing the same id.
SQL: | SELECT code FROM products AS prod
WHERE EXISTS (
SELECT 1 FROM projects AS prj
WHERE prj.id = prod.id
); | {
"outer_table": "products",
"inner_table": "projects",
"outer_alias": "prod",
"inner_alias": "prj",
"proj_col": "code",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05181 | train |
v1 | Schema:
customers (alias: cust)(type, code, level, status)
categories(date, code, status, name)
Task: Retrieve value from customers whose status is found in categories rows where type matches the outer record.
SQL: | SELECT value FROM customers AS cust
WHERE status IN (
SELECT status FROM categories AS catg
WHERE catg.type = cust.type
); | {
"outer_table": "customers",
"inner_table": "categories",
"outer_alias": "cust",
"inner_alias": "catg",
"proj_col": "value",
"filter_col": "status",
"join_col": "type",
"correlated_ref": "cust.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05182 | train |
v1 | Schema:
products (alias: prod)(amount, date, salary, id)
items(code, salary, status, level)
Task: Retrieve salary from products whose code is found in items rows where id matches the outer record.
SQL: | SELECT salary FROM products AS prod
WHERE code IN (
SELECT code FROM items AS lne
WHERE lne.id = prod.id
); | {
"outer_table": "products",
"inner_table": "items",
"outer_alias": "prod",
"inner_alias": "lne",
"proj_col": "salary",
"filter_col": "code",
"join_col": "id",
"correlated_ref": "prod.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05183 | train |
v2 | Schema:
sales (alias: sale)(name, salary, id, type)
tasks(salary, name, code, type)
Task: Retrieve code from sales that have at least one corresponding entry in tasks sharing the same status.
SQL: | SELECT code FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM tasks AS tsk
WHERE tsk.status = sale.status
); | {
"outer_table": "sales",
"inner_table": "tasks",
"outer_alias": "sale",
"inner_alias": "tsk",
"proj_col": "code",
"join_col": "status",
"correlated_ref": "sale.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05184 | train |
v1 | Schema:
employees (alias: emp)(type, id, date, code)
branches(id, code, type, amount)
Task: Find name from employees where status appears in branches entries with matching id.
SQL: | SELECT name FROM employees AS emp
WHERE status IN (
SELECT status FROM branches AS brc
WHERE brc.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "branches",
"outer_alias": "emp",
"inner_alias": "brc",
"proj_col": "name",
"filter_col": "status",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05185 | train |
v3 | Schema:
invoices (alias: inv)(amount, status, date, id)
staff(type, amount, value, salary)
Task: Retrieve id from invoices with amount above the COUNT(salary) of staff rows sharing the same type.
SQL: | SELECT id FROM invoices AS inv
WHERE amount > (
SELECT COUNT(salary) FROM staff AS empl
WHERE empl.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "staff",
"outer_alias": "inv",
"inner_alias": "empl",
"proj_col": "id",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05186 | train |
v2 | Schema:
regions (alias: rgn)(type, salary, id, code)
accounts(salary, date, level, value)
Task: Find salary from regions where a matching record exists in accounts with the same status.
SQL: | SELECT salary FROM regions AS rgn
WHERE EXISTS (
SELECT 1 FROM accounts AS acct
WHERE acct.status = rgn.status
); | {
"outer_table": "regions",
"inner_table": "accounts",
"outer_alias": "rgn",
"inner_alias": "acct",
"proj_col": "salary",
"join_col": "status",
"correlated_ref": "rgn.status",
"token_group": "T2",
"fan_out": 1534
} | T2 | cs8_fixed_v4_train_05187 | train |
v1 | Schema:
branches (alias: brc)(amount, salary, name, level)
items(status, level, amount, date)
Task: Retrieve id from branches whose type is found in items rows where type matches the outer record.
SQL: | SELECT id FROM branches AS brc
WHERE type IN (
SELECT type FROM items AS lne
WHERE lne.type = brc.type
); | {
"outer_table": "branches",
"inner_table": "items",
"outer_alias": "brc",
"inner_alias": "lne",
"proj_col": "id",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "brc.type",
"token_group": "T2",
"fan_out": 1329
} | T2 | cs8_fixed_v4_train_05188 | train |
v3 | Schema:
transactions (alias: txn)(id, amount, status, type)
customers(amount, type, code, value)
Task: Find code from transactions where amount exceeds the minimum salary from customers for the same status.
SQL: | SELECT code FROM transactions AS txn
WHERE amount > (
SELECT MIN(salary) FROM customers AS cust
WHERE cust.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "customers",
"outer_alias": "txn",
"inner_alias": "cust",
"proj_col": "code",
"filter_col": "amount",
"agg_col": "salary",
"agg_fn": "MIN",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05189 | train |
v3 | Schema:
shipments (alias: shp)(date, name, status, code)
customers(id, type, salary, date)
Task: Find value from shipments where value exceeds the count of salary from customers for the same status.
SQL: | SELECT value FROM shipments AS shp
WHERE value > (
SELECT COUNT(salary) FROM customers AS cust
WHERE cust.status = shp.status
); | {
"outer_table": "shipments",
"inner_table": "customers",
"outer_alias": "shp",
"inner_alias": "cust",
"proj_col": "value",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "status",
"correlated_ref": "shp.status",
"token_group": "T2",
"fan_out": 30
} | T2 | cs8_fixed_v4_train_05190 | train |
v2 | Schema:
accounts (alias: acct)(type, name, id, level)
sales(level, id, date, code)
Task: Find name from accounts where a matching record exists in sales with the same code.
SQL: | SELECT name FROM accounts AS acct
WHERE EXISTS (
SELECT 1 FROM sales AS sale
WHERE sale.code = acct.code
); | {
"outer_table": "accounts",
"inner_table": "sales",
"outer_alias": "acct",
"inner_alias": "sale",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "acct.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05191 | train |
v3 | Schema:
transactions (alias: txn)(id, date, status, code)
regions(code, value, level, date)
Task: Retrieve amount from transactions with salary above the SUM(amount) of regions rows sharing the same status.
SQL: | SELECT amount FROM transactions AS txn
WHERE salary > (
SELECT SUM(amount) FROM regions AS rgn
WHERE rgn.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "regions",
"outer_alias": "txn",
"inner_alias": "rgn",
"proj_col": "amount",
"filter_col": "salary",
"agg_col": "amount",
"agg_fn": "SUM",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05192 | train |
v1 | Schema:
departments (alias: dept)(date, name, value, level)
employees(salary, value, name, type)
Task: Select salary from departments where type exists in employees for the same type.
SQL: | SELECT salary FROM departments AS dept
WHERE type IN (
SELECT type FROM employees AS emp
WHERE emp.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "employees",
"outer_alias": "dept",
"inner_alias": "emp",
"proj_col": "salary",
"filter_col": "type",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05193 | train |
v2 | Schema:
sales (alias: sale)(date, type, salary, status)
products(salary, code, date, amount)
Task: Find name from sales where a matching record exists in products with the same code.
SQL: | SELECT name FROM sales AS sale
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.code = sale.code
); | {
"outer_table": "sales",
"inner_table": "products",
"outer_alias": "sale",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "code",
"correlated_ref": "sale.code",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05194 | train |
v2 | Schema:
transactions (alias: txn)(value, id, status, name)
products(code, status, type, name)
Task: Find name from transactions where a matching record exists in products with the same status.
SQL: | SELECT name FROM transactions AS txn
WHERE EXISTS (
SELECT 1 FROM products AS prod
WHERE prod.status = txn.status
); | {
"outer_table": "transactions",
"inner_table": "products",
"outer_alias": "txn",
"inner_alias": "prod",
"proj_col": "name",
"join_col": "status",
"correlated_ref": "txn.status",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05195 | train |
v2 | Schema:
employees (alias: emp)(name, level, salary, date)
departments(date, name, salary, level)
Task: Find value from employees where a matching record exists in departments with the same id.
SQL: | SELECT value FROM employees AS emp
WHERE EXISTS (
SELECT 1 FROM departments AS dept
WHERE dept.id = emp.id
); | {
"outer_table": "employees",
"inner_table": "departments",
"outer_alias": "emp",
"inner_alias": "dept",
"proj_col": "value",
"join_col": "id",
"correlated_ref": "emp.id",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05196 | train |
v2 | Schema:
departments (alias: dept)(id, type, name, level)
schedules(id, name, amount, code)
Task: Find id from departments where a matching record exists in schedules with the same type.
SQL: | SELECT id FROM departments AS dept
WHERE EXISTS (
SELECT 1 FROM schedules AS schd
WHERE schd.type = dept.type
); | {
"outer_table": "departments",
"inner_table": "schedules",
"outer_alias": "dept",
"inner_alias": "schd",
"proj_col": "id",
"join_col": "type",
"correlated_ref": "dept.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05197 | train |
v3 | Schema:
projects (alias: prj)(date, amount, type, status)
items(status, amount, date, type)
Task: Find amount from projects where value exceeds the count of salary from items for the same type.
SQL: | SELECT amount FROM projects AS prj
WHERE value > (
SELECT COUNT(salary) FROM items AS lne
WHERE lne.type = prj.type
); | {
"outer_table": "projects",
"inner_table": "items",
"outer_alias": "prj",
"inner_alias": "lne",
"proj_col": "amount",
"filter_col": "value",
"agg_col": "salary",
"agg_fn": "COUNT",
"join_col": "type",
"correlated_ref": "prj.type",
"token_group": "T2",
"fan_out": 712
} | T2 | cs8_fixed_v4_train_05198 | train |
v2 | Schema:
invoices (alias: inv)(level, date, name, type)
items(type, status, name, code)
Task: Find amount from invoices where a matching record exists in items with the same type.
SQL: | SELECT amount FROM invoices AS inv
WHERE EXISTS (
SELECT 1 FROM items AS lne
WHERE lne.type = inv.type
); | {
"outer_table": "invoices",
"inner_table": "items",
"outer_alias": "inv",
"inner_alias": "lne",
"proj_col": "amount",
"join_col": "type",
"correlated_ref": "inv.type",
"token_group": "T1",
"fan_out": 1
} | T1 | cs8_fixed_v4_train_05199 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.