variant
stringclasses
3 values
prompt
stringlengths
163
237
sql
stringlengths
103
143
metadata
unknown
id
stringlengths
21
21
split
stringclasses
1 value
token_group
stringclasses
2 values
v3
Schema: orders (alias: ord)(level, id, status, salary) budgets(type, value, salary, code) Task: Retrieve amount from orders with value above the MIN(salary) of budgets rows sharing the same id. SQL:
SELECT amount FROM orders AS ord WHERE value > ( SELECT MIN(salary) FROM budgets AS budg WHERE budg.id = ord.id );
{ "outer_table": "orders", "inner_table": "budgets", "outer_alias": "ord", "inner_alias": "budg", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_09900
train
T1
v1
Schema: categories (alias: catg)(level, amount, status, value) shipments(amount, code, type, level) Task: Retrieve amount from categories whose type is found in shipments rows where code matches the outer record. SQL:
SELECT amount FROM categories AS catg WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.code = catg.code );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "catg", "inner_alias": "shp", "proj_col": "amount", "filter_col": "type", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_09901
train
T2
v1
Schema: requests (alias: ordr)(status, code, date, name) products(salary, amount, type, date) Task: Retrieve salary from requests whose code is found in products rows where type matches the outer record. SQL:
SELECT salary FROM requests AS ordr WHERE code IN ( SELECT code FROM products AS prod WHERE prod.type = ordr.type );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_09902
train
T2
v2
Schema: managers (alias: mgr)(amount, code, status, name) staff(date, id, name, value) Task: Find code from managers where a matching record exists in staff with the same code. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = mgr.code );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "code", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_09903
train
T1
v2
Schema: sales (alias: sale)(name, level, amount, code) categories(status, name, date, code) Task: Find name from sales where a matching record exists in categories with the same id. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = sale.id );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "name", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_09904
train
T1
v1
Schema: staff (alias: empl)(status, type, id, name) schedules(date, type, level, salary) Task: Find salary from staff where code appears in schedules entries with matching type. SQL:
SELECT salary FROM staff AS empl WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.type = empl.type );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_09905
train
T2
v3
Schema: regions (alias: rgn)(id, code, type, level) managers(value, id, level, status) Task: Retrieve amount from regions with value above the SUM(salary) of managers rows sharing the same code. SQL:
SELECT amount FROM regions AS rgn WHERE value > ( SELECT SUM(salary) FROM managers AS mgr WHERE mgr.code = rgn.code );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_09906
train
T2
v1
Schema: regions (alias: rgn)(name, status, value, id) products(type, date, id, salary) Task: Find salary from regions where id appears in products entries with matching code. SQL:
SELECT salary FROM regions AS rgn WHERE id IN ( SELECT id FROM products AS prod WHERE prod.code = rgn.code );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_09907
train
T2
v1
Schema: budgets (alias: budg)(value, status, code, type) orders(date, id, code, status) Task: Find name from budgets where type appears in orders entries with matching code. SQL:
SELECT name FROM budgets AS budg WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.code = budg.code );
{ "outer_table": "budgets", "inner_table": "orders", "outer_alias": "budg", "inner_alias": "ord", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_09908
train
T2
v2
Schema: accounts (alias: acct)(value, amount, code, status) employees(value, amount, code, status) Task: Retrieve salary from accounts that have at least one corresponding entry in employees sharing the same level. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = acct.level );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "salary", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_09909
train
T1
v2
Schema: managers (alias: mgr)(amount, value, name, level) items(name, code, value, type) Task: Retrieve name from managers that have at least one corresponding entry in items sharing the same code. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = mgr.code );
{ "outer_table": "managers", "inner_table": "items", "outer_alias": "mgr", "inner_alias": "lne", "proj_col": "name", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_09910
train
T1
v1
Schema: transactions (alias: txn)(date, value, level, amount) employees(salary, level, status, type) Task: Select salary from transactions where status exists in employees for the same level. SQL:
SELECT salary FROM transactions AS txn WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.level = txn.level );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_09911
train
T1
v3
Schema: requests (alias: ordr)(amount, date, salary, code) invoices(type, name, value, status) Task: Find value from requests where salary exceeds the average amount from invoices for the same id. SQL:
SELECT value FROM requests AS ordr WHERE salary > ( SELECT AVG(amount) FROM invoices AS inv WHERE inv.id = ordr.id );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_09912
train
T2
v1
Schema: warehouses (alias: whs)(code, salary, type, status) invoices(code, id, date, name) Task: Retrieve amount from warehouses whose type is found in invoices rows where type matches the outer record. SQL:
SELECT amount FROM warehouses AS whs WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "invoices", "outer_alias": "whs", "inner_alias": "inv", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_09913
train
T2
v2
Schema: budgets (alias: budg)(status, value, salary, level) employees(code, salary, status, amount) Task: Retrieve amount from budgets that have at least one corresponding entry in employees sharing the same level. SQL:
SELECT amount FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = budg.level );
{ "outer_table": "budgets", "inner_table": "employees", "outer_alias": "budg", "inner_alias": "emp", "proj_col": "amount", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_09914
train
T2
v2
Schema: staff (alias: empl)(date, level, salary, id) requests(salary, amount, date, code) Task: Find name from staff where a matching record exists in requests with the same code. SQL:
SELECT name FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = empl.code );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "name", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_09915
train
T2
v1
Schema: items (alias: lne)(name, level, code, date) managers(name, amount, status, salary) Task: Find code from items where id appears in managers entries with matching type. SQL:
SELECT code FROM items AS lne WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.type = lne.type );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "code", "filter_col": "id", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_09916
train
T2
v3
Schema: budgets (alias: budg)(id, amount, level, date) departments(id, name, status, level) Task: Retrieve value from budgets with salary above the MIN(value) of departments rows sharing the same type. SQL:
SELECT value FROM budgets AS budg WHERE salary > ( SELECT MIN(value) FROM departments AS dept WHERE dept.type = budg.type );
{ "outer_table": "budgets", "inner_table": "departments", "outer_alias": "budg", "inner_alias": "dept", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_09917
train
T2
v1
Schema: services (alias: srvc)(salary, value, name, amount) items(code, salary, amount, name) Task: Retrieve salary from services whose code is found in items rows where id matches the outer record. SQL:
SELECT salary FROM services AS srvc WHERE code IN ( SELECT code FROM items AS lne WHERE lne.id = srvc.id );
{ "outer_table": "services", "inner_table": "items", "outer_alias": "srvc", "inner_alias": "lne", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_09918
train
T2
v3
Schema: invoices (alias: inv)(value, id, status, name) departments(type, name, status, code) Task: Find id from invoices where amount exceeds the average amount from departments for the same status. SQL:
SELECT id FROM invoices AS inv WHERE amount > ( SELECT MAX(amount) FROM departments AS dept WHERE dept.status = inv.status );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_09919
train
T1
v2
Schema: transactions (alias: txn)(name, id, type, value) services(amount, salary, type, value) Task: Retrieve name from transactions that have at least one corresponding entry in services sharing the same status. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.status = txn.status );
{ "outer_table": "transactions", "inner_table": "services", "outer_alias": "txn", "inner_alias": "srvc", "proj_col": "name", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_09920
train
T1
v2
Schema: managers (alias: mgr)(amount, value, level, date) requests(type, id, value, level) Task: Find code from managers where a matching record exists in requests with the same level. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = mgr.level );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "code", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_09921
train
T1
v1
Schema: services (alias: srvc)(amount, id, status, date) schedules(type, date, code, level) Task: Find id from services where id appears in schedules entries with matching type. SQL:
SELECT id FROM services AS srvc WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.type = srvc.type );
{ "outer_table": "services", "inner_table": "schedules", "outer_alias": "srvc", "inner_alias": "schd", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_09922
train
T2
v3
Schema: schedules (alias: schd)(value, date, type, name) accounts(name, status, salary, amount) Task: Retrieve salary from schedules with value above the SUM(amount) of accounts rows sharing the same type. SQL:
SELECT salary FROM schedules AS schd WHERE value > ( SELECT SUM(amount) FROM accounts AS acct WHERE acct.type = schd.type );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_09923
train
T2
v1
Schema: shipments (alias: shp)(code, amount, value, level) sales(id, status, amount, value) Task: Select name from shipments where status exists in sales for the same level. SQL:
SELECT name FROM shipments AS shp WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.level = shp.level );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_09924
train
T2
v2
Schema: requests (alias: ordr)(value, name, code, status) services(level, status, code, type) Task: Find salary from requests where a matching record exists in services with the same type. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.type = ordr.type );
{ "outer_table": "requests", "inner_table": "services", "outer_alias": "ordr", "inner_alias": "srvc", "proj_col": "salary", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_09925
train
T2
v1
Schema: requests (alias: ordr)(type, salary, date, name) schedules(status, level, amount, code) Task: Select code from requests where code exists in schedules for the same code. SQL:
SELECT code FROM requests AS ordr WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.code = ordr.code );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_09926
train
T2
v2
Schema: schedules (alias: schd)(type, level, status, value) categories(name, level, salary, date) Task: Retrieve code from schedules that have at least one corresponding entry in categories sharing the same id. SQL:
SELECT code FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = schd.id );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "code", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_09927
train
T2
v2
Schema: budgets (alias: budg)(salary, value, code, id) items(date, id, level, amount) Task: Find id from budgets where a matching record exists in items with the same level. SQL:
SELECT id FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.level = budg.level );
{ "outer_table": "budgets", "inner_table": "items", "outer_alias": "budg", "inner_alias": "lne", "proj_col": "id", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_09928
train
T2
v2
Schema: items (alias: lne)(code, level, type, amount) accounts(salary, name, type, code) Task: Retrieve salary from items that have at least one corresponding entry in accounts sharing the same type. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = lne.type );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "salary", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_09929
train
T2
v1
Schema: services (alias: srvc)(value, level, name, type) sales(salary, name, type, date) Task: Retrieve salary from services whose code is found in sales rows where level matches the outer record. SQL:
SELECT salary FROM services AS srvc WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.level = srvc.level );
{ "outer_table": "services", "inner_table": "sales", "outer_alias": "srvc", "inner_alias": "sale", "proj_col": "salary", "filter_col": "code", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_09930
train
T2
v3
Schema: managers (alias: mgr)(amount, id, value, date) warehouses(code, level, name, id) Task: Find name from managers where amount exceeds the average amount from warehouses for the same id. SQL:
SELECT name FROM managers AS mgr WHERE amount > ( SELECT SUM(amount) FROM warehouses AS whs WHERE whs.id = mgr.id );
{ "outer_table": "managers", "inner_table": "warehouses", "outer_alias": "mgr", "inner_alias": "whs", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_09931
train
T1
v2
Schema: products (alias: prod)(status, value, salary, type) customers(id, code, type, status) Task: Retrieve salary from products that have at least one corresponding entry in customers sharing the same level. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = prod.level );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "salary", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_09932
train
T1
v3
Schema: schedules (alias: schd)(salary, type, level, value) warehouses(id, name, status, value) Task: Find code from schedules where amount exceeds the average amount from warehouses for the same level. SQL:
SELECT code FROM schedules AS schd WHERE amount > ( SELECT MAX(amount) FROM warehouses AS whs WHERE whs.level = schd.level );
{ "outer_table": "schedules", "inner_table": "warehouses", "outer_alias": "schd", "inner_alias": "whs", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_09933
train
T2
v3
Schema: schedules (alias: schd)(type, level, code, amount) transactions(salary, date, name, status) Task: Retrieve salary from schedules with value above the AVG(salary) of transactions rows sharing the same type. SQL:
SELECT salary FROM schedules AS schd WHERE value > ( SELECT AVG(salary) FROM transactions AS txn WHERE txn.type = schd.type );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_09934
train
T2
v3
Schema: items (alias: lne)(name, amount, date, salary) invoices(type, value, id, code) Task: Find amount from items where value exceeds the average value from invoices for the same level. SQL:
SELECT amount FROM items AS lne WHERE value > ( SELECT MIN(value) FROM invoices AS inv WHERE inv.level = lne.level );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_09935
train
T2
v3
Schema: sales (alias: sale)(code, id, name, date) items(amount, salary, value, type) Task: Find amount from sales where amount exceeds the average value from items for the same type. SQL:
SELECT amount FROM sales AS sale WHERE amount > ( SELECT AVG(value) FROM items AS lne WHERE lne.type = sale.type );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_09936
train
T1
v3
Schema: orders (alias: ord)(code, type, salary, id) products(id, value, date, name) Task: Find salary from orders where value exceeds the average value from products for the same level. SQL:
SELECT salary FROM orders AS ord WHERE value > ( SELECT AVG(value) FROM products AS prod WHERE prod.level = ord.level );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_09937
train
T1
v1
Schema: orders (alias: ord)(name, salary, amount, status) accounts(amount, name, code, salary) Task: Retrieve code from orders whose status is found in accounts rows where type matches the outer record. SQL:
SELECT code FROM orders AS ord WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.type = ord.type );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_09938
train
T1
v1
Schema: accounts (alias: acct)(code, id, value, status) invoices(date, amount, salary, value) Task: Find id from accounts where type appears in invoices entries with matching level. SQL:
SELECT id FROM accounts AS acct WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.level = acct.level );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_09939
train
T1
v3
Schema: departments (alias: dept)(amount, status, date, name) shipments(id, type, status, amount) Task: Retrieve id from departments with value above the MAX(value) of shipments rows sharing the same code. SQL:
SELECT id FROM departments AS dept WHERE value > ( SELECT MAX(value) FROM shipments AS shp WHERE shp.code = dept.code );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_09940
train
T1
v3
Schema: staff (alias: empl)(name, salary, level, date) requests(amount, code, name, date) Task: Retrieve salary from staff with amount above the SUM(value) of requests rows sharing the same code. SQL:
SELECT salary FROM staff AS empl WHERE amount > ( SELECT SUM(value) FROM requests AS ordr WHERE ordr.code = empl.code );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_09941
train
T2
v1
Schema: requests (alias: ordr)(code, id, amount, status) accounts(status, id, name, type) Task: Find name from requests where type appears in accounts entries with matching id. SQL:
SELECT name FROM requests AS ordr WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.id = ordr.id );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "name", "filter_col": "type", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_09942
train
T2
v3
Schema: invoices (alias: inv)(amount, salary, name, status) departments(level, value, salary, status) Task: Retrieve salary from invoices with value above the AVG(value) of departments rows sharing the same status. SQL:
SELECT salary FROM invoices AS inv WHERE value > ( SELECT AVG(value) FROM departments AS dept WHERE dept.status = inv.status );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_09943
train
T1
v2
Schema: sales (alias: sale)(amount, value, status, type) items(level, amount, salary, type) Task: Retrieve salary from sales that have at least one corresponding entry in items sharing the same id. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.id = sale.id );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "salary", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_09944
train
T1
v3
Schema: accounts (alias: acct)(type, salary, name, level) warehouses(code, amount, type, level) Task: Retrieve amount from accounts with salary above the MAX(salary) of warehouses rows sharing the same status. SQL:
SELECT amount FROM accounts AS acct WHERE salary > ( SELECT MAX(salary) FROM warehouses AS whs WHERE whs.status = acct.status );
{ "outer_table": "accounts", "inner_table": "warehouses", "outer_alias": "acct", "inner_alias": "whs", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_09945
train
T1
v2
Schema: transactions (alias: txn)(date, id, level, type) categories(name, id, level, date) Task: Retrieve id from transactions that have at least one corresponding entry in categories sharing the same level. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = txn.level );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "id", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_09946
train
T1
v1
Schema: regions (alias: rgn)(name, salary, value, status) managers(value, status, name, level) Task: Select id from regions where id exists in managers for the same status. SQL:
SELECT id FROM regions AS rgn WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.status = rgn.status );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "id", "filter_col": "id", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_09947
train
T2
v3
Schema: orders (alias: ord)(code, date, id, salary) transactions(salary, amount, name, date) Task: Retrieve amount from orders with value above the AVG(value) of transactions rows sharing the same type. SQL:
SELECT amount FROM orders AS ord WHERE value > ( SELECT AVG(value) FROM transactions AS txn WHERE txn.type = ord.type );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_09948
train
T1
v2
Schema: regions (alias: rgn)(level, value, status, amount) schedules(id, status, code, type) Task: Find salary from regions where a matching record exists in schedules with the same type. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = rgn.type );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "salary", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_09949
train
T2
v2
Schema: schedules (alias: schd)(code, id, type, status) products(name, id, status, code) Task: Retrieve salary from schedules that have at least one corresponding entry in products sharing the same type. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = schd.type );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "salary", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_09950
train
T2
v3
Schema: schedules (alias: schd)(salary, level, status, amount) invoices(code, level, type, name) Task: Find code from schedules where value exceeds the average amount from invoices for the same level. SQL:
SELECT code FROM schedules AS schd WHERE value > ( SELECT AVG(amount) FROM invoices AS inv WHERE inv.level = schd.level );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_09951
train
T2
v2
Schema: managers (alias: mgr)(salary, value, code, level) staff(value, name, salary, amount) Task: Find salary from managers where a matching record exists in staff with the same status. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = mgr.status );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "salary", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_09952
train
T1
v2
Schema: products (alias: prod)(date, level, id, status) items(salary, date, type, status) Task: Find amount from products where a matching record exists in items with the same code. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = prod.code );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "amount", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_09953
train
T1
v2
Schema: items (alias: lne)(salary, level, date, name) transactions(level, status, value, type) Task: Retrieve amount from items that have at least one corresponding entry in transactions sharing the same id. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = lne.id );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "amount", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_09954
train
T2
v3
Schema: departments (alias: dept)(code, name, type, status) schedules(level, date, amount, value) Task: Find amount from departments where value exceeds the average salary from schedules for the same id. SQL:
SELECT amount FROM departments AS dept WHERE value > ( SELECT AVG(salary) FROM schedules AS schd WHERE schd.id = dept.id );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_09955
train
T1
v3
Schema: products (alias: prod)(name, type, value, code) items(status, date, level, salary) Task: Find salary from products where salary exceeds the average amount from items for the same level. SQL:
SELECT salary FROM products AS prod WHERE salary > ( SELECT AVG(amount) FROM items AS lne WHERE lne.level = prod.level );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_09956
train
T1
v1
Schema: regions (alias: rgn)(date, value, level, name) warehouses(id, type, code, status) Task: Find code from regions where code appears in warehouses entries with matching id. SQL:
SELECT code FROM regions AS rgn WHERE code IN ( SELECT code FROM warehouses AS whs WHERE whs.id = rgn.id );
{ "outer_table": "regions", "inner_table": "warehouses", "outer_alias": "rgn", "inner_alias": "whs", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_09957
train
T2
v1
Schema: departments (alias: dept)(id, value, status, level) managers(amount, type, level, code) Task: Retrieve value from departments whose id is found in managers rows where status matches the outer record. SQL:
SELECT value FROM departments AS dept WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.status = dept.status );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_09958
train
T1
v1
Schema: departments (alias: dept)(date, status, value, level) schedules(name, level, type, amount) Task: Select value from departments where status exists in schedules for the same code. SQL:
SELECT value FROM departments AS dept WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.code = dept.code );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "value", "filter_col": "status", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_09959
train
T1
v1
Schema: managers (alias: mgr)(type, date, value, code) sales(value, name, date, type) Task: Select code from managers where id exists in sales for the same code. SQL:
SELECT code FROM managers AS mgr WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.code = mgr.code );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "code", "filter_col": "id", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_09960
train
T1
v2
Schema: budgets (alias: budg)(amount, status, value, code) categories(value, level, code, date) Task: Find id from budgets where a matching record exists in categories with the same id. SQL:
SELECT id FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = budg.id );
{ "outer_table": "budgets", "inner_table": "categories", "outer_alias": "budg", "inner_alias": "catg", "proj_col": "id", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_09961
train
T2
v2
Schema: shipments (alias: shp)(salary, amount, level, value) staff(value, date, id, code) Task: Retrieve id from shipments that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = shp.status );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "id", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_09962
train
T2
v1
Schema: staff (alias: empl)(status, date, value, code) schedules(amount, code, id, value) Task: Find amount from staff where code appears in schedules entries with matching code. SQL:
SELECT amount FROM staff AS empl WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.code = empl.code );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_09963
train
T2
v2
Schema: items (alias: lne)(status, salary, id, date) customers(id, level, value, status) Task: Find amount from items where a matching record exists in customers with the same code. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = lne.code );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "amount", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_09964
train
T2
v1
Schema: products (alias: prod)(date, code, type, name) budgets(name, salary, id, level) Task: Find id from products where status appears in budgets entries with matching code. SQL:
SELECT id FROM products AS prod WHERE status IN ( SELECT status FROM budgets AS budg WHERE budg.code = prod.code );
{ "outer_table": "products", "inner_table": "budgets", "outer_alias": "prod", "inner_alias": "budg", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_09965
train
T1
v3
Schema: employees (alias: emp)(status, code, amount, level) items(salary, date, name, code) Task: Find amount from employees where amount exceeds the average amount from items for the same type. SQL:
SELECT amount FROM employees AS emp WHERE amount > ( SELECT COUNT(amount) FROM items AS lne WHERE lne.type = emp.type );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_09966
train
T1
v1
Schema: schedules (alias: schd)(type, id, status, level) requests(id, code, status, name) Task: Select code from schedules where status exists in requests for the same code. SQL:
SELECT code FROM schedules AS schd WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.code = schd.code );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "code", "filter_col": "status", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_09967
train
T2
v3
Schema: customers (alias: cust)(status, salary, date, amount) sales(salary, amount, type, code) Task: Find salary from customers where amount exceeds the average value from sales for the same level. SQL:
SELECT salary FROM customers AS cust WHERE amount > ( SELECT SUM(value) FROM sales AS sale WHERE sale.level = cust.level );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_09968
train
T1
v2
Schema: departments (alias: dept)(status, amount, name, date) categories(date, level, value, name) Task: Retrieve amount from departments that have at least one corresponding entry in categories sharing the same level. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = dept.level );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "amount", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_09969
train
T1
v2
Schema: accounts (alias: acct)(code, level, name, id) categories(level, name, type, code) Task: Retrieve id from accounts that have at least one corresponding entry in categories sharing the same id. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = acct.id );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "id", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_09970
train
T1
v3
Schema: shipments (alias: shp)(salary, id, amount, value) items(salary, name, date, type) Task: Retrieve value from shipments with value above the COUNT(value) of items rows sharing the same status. SQL:
SELECT value FROM shipments AS shp WHERE value > ( SELECT COUNT(value) FROM items AS lne WHERE lne.status = shp.status );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_09971
train
T2
v1
Schema: shipments (alias: shp)(date, type, level, amount) customers(name, amount, id, date) Task: Select amount from shipments where code exists in customers for the same status. SQL:
SELECT amount FROM shipments AS shp WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.status = shp.status );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_09972
train
T2
v2
Schema: staff (alias: empl)(name, id, code, amount) invoices(salary, level, type, date) Task: Retrieve value from staff that have at least one corresponding entry in invoices sharing the same status. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = empl.status );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "value", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_09973
train
T2
v3
Schema: managers (alias: mgr)(code, name, amount, salary) products(code, amount, id, salary) Task: Find value from managers where value exceeds the average amount from products for the same code. SQL:
SELECT value FROM managers AS mgr WHERE value > ( SELECT MAX(amount) FROM products AS prod WHERE prod.code = mgr.code );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_09974
train
T1
v3
Schema: requests (alias: ordr)(date, salary, level, name) invoices(level, status, date, id) Task: Find amount from requests where value exceeds the average amount from invoices for the same type. SQL:
SELECT amount FROM requests AS ordr WHERE value > ( SELECT AVG(amount) FROM invoices AS inv WHERE inv.type = ordr.type );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_09975
train
T2
v1
Schema: transactions (alias: txn)(value, level, amount, type) orders(code, status, salary, name) Task: Find amount from transactions where code appears in orders entries with matching code. SQL:
SELECT amount FROM transactions AS txn WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.code = txn.code );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_09976
train
T1
v1
Schema: regions (alias: rgn)(salary, name, date, type) customers(value, code, date, name) Task: Select value from regions where level exists in customers for the same code. SQL:
SELECT value FROM regions AS rgn WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.code = rgn.code );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_09977
train
T2
v1
Schema: shipments (alias: shp)(status, date, code, level) accounts(status, id, code, level) Task: Select salary from shipments where level exists in accounts for the same level. SQL:
SELECT salary FROM shipments AS shp WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.level = shp.level );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "salary", "filter_col": "level", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_09978
train
T2
v1
Schema: shipments (alias: shp)(type, status, code, amount) employees(value, salary, code, name) Task: Select amount from shipments where type exists in employees for the same level. SQL:
SELECT amount FROM shipments AS shp WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.level = shp.level );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_09979
train
T2
v1
Schema: regions (alias: rgn)(date, name, status, code) invoices(code, name, date, type) Task: Find amount from regions where type appears in invoices entries with matching type. SQL:
SELECT amount FROM regions AS rgn WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.type = rgn.type );
{ "outer_table": "regions", "inner_table": "invoices", "outer_alias": "rgn", "inner_alias": "inv", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_09980
train
T2
v1
Schema: orders (alias: ord)(level, name, id, status) customers(level, id, salary, code) Task: Retrieve code from orders whose status is found in customers rows where type matches the outer record. SQL:
SELECT code FROM orders AS ord WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.type = ord.type );
{ "outer_table": "orders", "inner_table": "customers", "outer_alias": "ord", "inner_alias": "cust", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_09981
train
T1
v2
Schema: categories (alias: catg)(id, salary, date, code) products(id, status, value, type) Task: Find name from categories where a matching record exists in products with the same code. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = catg.code );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "name", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_09982
train
T2
v3
Schema: employees (alias: emp)(amount, level, status, name) managers(code, salary, type, amount) Task: Retrieve code from employees with value above the AVG(value) of managers rows sharing the same status. SQL:
SELECT code FROM employees AS emp WHERE value > ( SELECT AVG(value) FROM managers AS mgr WHERE mgr.status = emp.status );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_09983
train
T1
v2
Schema: requests (alias: ordr)(value, code, salary, status) invoices(code, amount, salary, value) Task: Retrieve value from requests that have at least one corresponding entry in invoices sharing the same status. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = ordr.status );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "value", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_09984
train
T2
v2
Schema: shipments (alias: shp)(amount, type, code, id) warehouses(code, value, level, date) Task: Retrieve name from shipments that have at least one corresponding entry in warehouses sharing the same status. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.status = shp.status );
{ "outer_table": "shipments", "inner_table": "warehouses", "outer_alias": "shp", "inner_alias": "whs", "proj_col": "name", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_09985
train
T2
v3
Schema: sales (alias: sale)(status, name, value, id) schedules(name, amount, status, salary) Task: Retrieve value from sales with salary above the MAX(salary) of schedules rows sharing the same level. SQL:
SELECT value FROM sales AS sale WHERE salary > ( SELECT MAX(salary) FROM schedules AS schd WHERE schd.level = sale.level );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_09986
train
T1
v1
Schema: shipments (alias: shp)(value, code, id, salary) departments(id, type, value, level) Task: Select id from shipments where status exists in departments for the same code. SQL:
SELECT id FROM shipments AS shp WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.code = shp.code );
{ "outer_table": "shipments", "inner_table": "departments", "outer_alias": "shp", "inner_alias": "dept", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_09987
train
T2
v2
Schema: customers (alias: cust)(date, value, salary, amount) shipments(level, value, status, amount) Task: Retrieve salary from customers that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = cust.id );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "salary", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_09988
train
T1
v3
Schema: invoices (alias: inv)(code, id, type, date) employees(salary, status, date, amount) Task: Retrieve value from invoices with amount above the SUM(value) of employees rows sharing the same level. SQL:
SELECT value FROM invoices AS inv WHERE amount > ( SELECT SUM(value) FROM employees AS emp WHERE emp.level = inv.level );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_09989
train
T1
v1
Schema: schedules (alias: schd)(level, date, amount, name) warehouses(code, id, date, level) Task: Select salary from schedules where status exists in warehouses for the same level. SQL:
SELECT salary FROM schedules AS schd WHERE status IN ( SELECT status FROM warehouses AS whs WHERE whs.level = schd.level );
{ "outer_table": "schedules", "inner_table": "warehouses", "outer_alias": "schd", "inner_alias": "whs", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_09990
train
T2
v3
Schema: employees (alias: emp)(status, name, amount, level) categories(code, value, date, type) Task: Find value from employees where value exceeds the average salary from categories for the same code. SQL:
SELECT value FROM employees AS emp WHERE value > ( SELECT AVG(salary) FROM categories AS catg WHERE catg.code = emp.code );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_09991
train
T1
v2
Schema: services (alias: srvc)(amount, level, value, date) budgets(value, status, amount, date) Task: Retrieve id from services that have at least one corresponding entry in budgets sharing the same code. SQL:
SELECT id FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.code = srvc.code );
{ "outer_table": "services", "inner_table": "budgets", "outer_alias": "srvc", "inner_alias": "budg", "proj_col": "id", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_09992
train
T2
v2
Schema: categories (alias: catg)(code, value, date, level) requests(type, amount, code, name) Task: Retrieve name from categories that have at least one corresponding entry in requests sharing the same status. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = catg.status );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "name", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_09993
train
T2
v3
Schema: managers (alias: mgr)(value, status, level, name) departments(type, id, date, status) Task: Find id from managers where amount exceeds the average salary from departments for the same type. SQL:
SELECT id FROM managers AS mgr WHERE amount > ( SELECT SUM(salary) FROM departments AS dept WHERE dept.type = mgr.type );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_09994
train
T1
v2
Schema: budgets (alias: budg)(code, id, level, status) employees(status, level, date, salary) Task: Find id from budgets where a matching record exists in employees with the same type. SQL:
SELECT id FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = budg.type );
{ "outer_table": "budgets", "inner_table": "employees", "outer_alias": "budg", "inner_alias": "emp", "proj_col": "id", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_09995
train
T2
v3
Schema: services (alias: srvc)(value, level, date, status) schedules(status, salary, id, level) Task: Retrieve code from services with salary above the AVG(amount) of schedules rows sharing the same id. SQL:
SELECT code FROM services AS srvc WHERE salary > ( SELECT AVG(amount) FROM schedules AS schd WHERE schd.id = srvc.id );
{ "outer_table": "services", "inner_table": "schedules", "outer_alias": "srvc", "inner_alias": "schd", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_09996
train
T2
v1
Schema: staff (alias: empl)(amount, level, id, value) products(type, name, code, status) Task: Select amount from staff where id exists in products for the same level. SQL:
SELECT amount FROM staff AS empl WHERE id IN ( SELECT id FROM products AS prod WHERE prod.level = empl.level );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_09997
train
T2
v3
Schema: sales (alias: sale)(type, status, id, value) staff(status, name, code, amount) Task: Retrieve amount from sales with value above the SUM(amount) of staff rows sharing the same status. SQL:
SELECT amount FROM sales AS sale WHERE value > ( SELECT SUM(amount) FROM staff AS empl WHERE empl.status = sale.status );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_09998
train
T1
v1
Schema: warehouses (alias: whs)(date, level, id, status) items(salary, date, amount, name) Task: Retrieve amount from warehouses whose status is found in items rows where type matches the outer record. SQL:
SELECT amount FROM warehouses AS whs WHERE status IN ( SELECT status FROM items AS lne WHERE lne.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "items", "outer_alias": "whs", "inner_alias": "lne", "proj_col": "amount", "filter_col": "status", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_09999
train
T2