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
v1
Schema: orders (alias: ord)(type, level, status, salary) schedules(id, level, salary, amount) Task: Find salary from orders where status appears in schedules entries with matching type. SQL:
SELECT salary FROM orders AS ord WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.type = ord.type );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_11200
train
T1
v2
Schema: regions (alias: rgn)(code, type, date, value) customers(code, value, id, date) Task: Find code from regions where a matching record exists in customers with the same code. SQL:
SELECT code FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = rgn.code );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "code", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_11201
train
T2
v2
Schema: budgets (alias: budg)(amount, value, level, code) accounts(salary, amount, level, status) Task: Retrieve amount from budgets that have at least one corresponding entry in accounts sharing the same type. SQL:
SELECT amount FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = budg.type );
{ "outer_table": "budgets", "inner_table": "accounts", "outer_alias": "budg", "inner_alias": "acct", "proj_col": "amount", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_11202
train
T2
v3
Schema: sales (alias: sale)(name, salary, type, status) managers(level, id, date, amount) Task: Retrieve name from sales with value above the MAX(value) of managers rows sharing the same status. SQL:
SELECT name FROM sales AS sale WHERE value > ( SELECT MAX(value) FROM managers AS mgr WHERE mgr.status = sale.status );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_11203
train
T1
v3
Schema: warehouses (alias: whs)(name, level, status, value) transactions(value, status, code, type) Task: Retrieve code from warehouses with salary above the AVG(amount) of transactions rows sharing the same type. SQL:
SELECT code FROM warehouses AS whs WHERE salary > ( SELECT AVG(amount) FROM transactions AS txn WHERE txn.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "transactions", "outer_alias": "whs", "inner_alias": "txn", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_11204
train
T2
v3
Schema: transactions (alias: txn)(status, value, amount, date) sales(type, value, level, code) Task: Find id from transactions where value exceeds the average amount from sales for the same code. SQL:
SELECT id FROM transactions AS txn WHERE value > ( SELECT MIN(amount) FROM sales AS sale WHERE sale.code = txn.code );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_11205
train
T1
v2
Schema: items (alias: lne)(name, date, amount, value) transactions(type, code, salary, name) Task: Retrieve code from items that have at least one corresponding entry in transactions sharing the same id. SQL:
SELECT code 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": "code", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_11206
train
T2
v2
Schema: warehouses (alias: whs)(code, level, date, salary) accounts(type, salary, value, name) Task: Retrieve amount from warehouses that have at least one corresponding entry in accounts sharing the same type. SQL:
SELECT amount FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "accounts", "outer_alias": "whs", "inner_alias": "acct", "proj_col": "amount", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_11207
train
T2
v2
Schema: employees (alias: emp)(value, date, status, type) warehouses(name, date, level, amount) Task: Retrieve value from employees that have at least one corresponding entry in warehouses sharing the same status. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.status = emp.status );
{ "outer_table": "employees", "inner_table": "warehouses", "outer_alias": "emp", "inner_alias": "whs", "proj_col": "value", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_11208
train
T1
v1
Schema: sales (alias: sale)(level, name, status, salary) managers(status, code, date, level) Task: Find id from sales where level appears in managers entries with matching level. SQL:
SELECT id FROM sales AS sale WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.level = sale.level );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_11209
train
T1
v3
Schema: budgets (alias: budg)(value, salary, name, type) managers(status, id, type, name) Task: Retrieve id from budgets with salary above the COUNT(value) of managers rows sharing the same status. SQL:
SELECT id FROM budgets AS budg WHERE salary > ( SELECT COUNT(value) FROM managers AS mgr WHERE mgr.status = budg.status );
{ "outer_table": "budgets", "inner_table": "managers", "outer_alias": "budg", "inner_alias": "mgr", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_11210
train
T2
v3
Schema: items (alias: lne)(level, value, salary, status) orders(status, value, amount, type) Task: Find value from items where value exceeds the average amount from orders for the same code. SQL:
SELECT value FROM items AS lne WHERE value > ( SELECT MAX(amount) FROM orders AS ord WHERE ord.code = lne.code );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_11211
train
T2
v3
Schema: invoices (alias: inv)(type, salary, amount, status) shipments(amount, value, id, type) Task: Retrieve code from invoices with value above the SUM(value) of shipments rows sharing the same code. SQL:
SELECT code FROM invoices AS inv WHERE value > ( SELECT SUM(value) FROM shipments AS shp WHERE shp.code = inv.code );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_11212
train
T1
v1
Schema: shipments (alias: shp)(amount, name, value, code) products(level, value, id, amount) Task: Retrieve salary from shipments whose type is found in products rows where type matches the outer record. SQL:
SELECT salary FROM shipments AS shp WHERE type IN ( SELECT type FROM products AS prod WHERE prod.type = shp.type );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_11213
train
T2
v1
Schema: schedules (alias: schd)(value, salary, level, amount) departments(amount, status, code, date) Task: Retrieve salary from schedules whose status is found in departments rows where id matches the outer record. SQL:
SELECT salary FROM schedules AS schd WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.id = schd.id );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "salary", "filter_col": "status", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_11214
train
T2
v3
Schema: warehouses (alias: whs)(id, salary, level, type) shipments(name, level, status, id) Task: Find amount from warehouses where amount exceeds the average amount from shipments for the same status. SQL:
SELECT amount FROM warehouses AS whs WHERE amount > ( SELECT SUM(amount) FROM shipments AS shp WHERE shp.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "shipments", "outer_alias": "whs", "inner_alias": "shp", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_11215
train
T2
v2
Schema: staff (alias: empl)(amount, id, status, salary) customers(status, name, salary, code) Task: Find amount from staff where a matching record exists in customers with the same type. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = empl.type );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "amount", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_11216
train
T2
v2
Schema: sales (alias: sale)(salary, code, name, date) employees(date, value, status, salary) Task: Retrieve salary from sales that have at least one corresponding entry in employees sharing the same id. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = sale.id );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "salary", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_11217
train
T1
v1
Schema: invoices (alias: inv)(status, amount, value, level) regions(type, code, level, value) Task: Find value from invoices where id appears in regions entries with matching type. SQL:
SELECT value FROM invoices AS inv WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.type = inv.type );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_11218
train
T1
v2
Schema: requests (alias: ordr)(salary, level, amount, status) warehouses(code, value, id, name) Task: Find code from requests where a matching record exists in warehouses with the same code. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.code = ordr.code );
{ "outer_table": "requests", "inner_table": "warehouses", "outer_alias": "ordr", "inner_alias": "whs", "proj_col": "code", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_11219
train
T2
v1
Schema: managers (alias: mgr)(name, date, salary, value) regions(name, code, amount, salary) Task: Find value from managers where code appears in regions entries with matching id. SQL:
SELECT value FROM managers AS mgr WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.id = mgr.id );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_11220
train
T1
v2
Schema: categories (alias: catg)(value, code, name, level) customers(salary, status, value, id) Task: Find code from categories where a matching record exists in customers with the same code. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = catg.code );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "code", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_11221
train
T2
v3
Schema: schedules (alias: schd)(salary, name, id, amount) budgets(code, date, type, amount) Task: Retrieve salary from schedules with value above the SUM(amount) of budgets rows sharing the same code. SQL:
SELECT salary FROM schedules AS schd WHERE value > ( SELECT SUM(amount) FROM budgets AS budg WHERE budg.code = schd.code );
{ "outer_table": "schedules", "inner_table": "budgets", "outer_alias": "schd", "inner_alias": "budg", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_11222
train
T2
v1
Schema: accounts (alias: acct)(type, name, code, status) shipments(amount, level, type, date) Task: Find name from accounts where status appears in shipments entries with matching status. SQL:
SELECT name FROM accounts AS acct WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.status = acct.status );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_11223
train
T1
v3
Schema: transactions (alias: txn)(level, status, value, type) requests(name, level, salary, id) Task: Find salary from transactions where value exceeds the average amount from requests for the same status. SQL:
SELECT salary FROM transactions AS txn WHERE value > ( SELECT SUM(amount) FROM requests AS ordr WHERE ordr.status = txn.status );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_11224
train
T1
v2
Schema: customers (alias: cust)(id, type, code, level) requests(level, value, code, date) Task: Retrieve code from customers that have at least one corresponding entry in requests sharing the same id. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = cust.id );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "code", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_11225
train
T1
v1
Schema: budgets (alias: budg)(date, name, value, level) accounts(name, date, code, id) Task: Select salary from budgets where level exists in accounts for the same code. SQL:
SELECT salary FROM budgets AS budg WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.code = budg.code );
{ "outer_table": "budgets", "inner_table": "accounts", "outer_alias": "budg", "inner_alias": "acct", "proj_col": "salary", "filter_col": "level", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_11226
train
T2
v1
Schema: categories (alias: catg)(status, level, salary, type) sales(status, name, value, code) Task: Find name from categories where id appears in sales entries with matching status. SQL:
SELECT name FROM categories AS catg WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.status = catg.status );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "name", "filter_col": "id", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_11227
train
T2
v1
Schema: transactions (alias: txn)(status, salary, id, type) services(status, id, value, name) Task: Select value from transactions where type exists in services for the same level. SQL:
SELECT value FROM transactions AS txn WHERE type IN ( SELECT type FROM services AS srvc WHERE srvc.level = txn.level );
{ "outer_table": "transactions", "inner_table": "services", "outer_alias": "txn", "inner_alias": "srvc", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_11228
train
T1
v2
Schema: products (alias: prod)(name, type, date, status) schedules(id, salary, date, name) Task: Find name from products where a matching record exists in schedules with the same code. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = prod.code );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "name", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_11229
train
T1
v3
Schema: shipments (alias: shp)(code, salary, value, level) budgets(type, date, code, id) Task: Retrieve value from shipments with amount above the AVG(amount) of budgets rows sharing the same type. SQL:
SELECT value FROM shipments AS shp WHERE amount > ( SELECT AVG(amount) FROM budgets AS budg WHERE budg.type = shp.type );
{ "outer_table": "shipments", "inner_table": "budgets", "outer_alias": "shp", "inner_alias": "budg", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_11230
train
T2
v1
Schema: shipments (alias: shp)(salary, code, value, level) services(status, code, date, type) Task: Retrieve code from shipments whose id is found in services rows where type matches the outer record. SQL:
SELECT code FROM shipments AS shp WHERE id IN ( SELECT id FROM services AS srvc WHERE srvc.type = shp.type );
{ "outer_table": "shipments", "inner_table": "services", "outer_alias": "shp", "inner_alias": "srvc", "proj_col": "code", "filter_col": "id", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_11231
train
T2
v1
Schema: services (alias: srvc)(name, type, status, amount) schedules(type, code, amount, level) Task: Retrieve amount from services whose status is found in schedules rows where level matches the outer record. SQL:
SELECT amount FROM services AS srvc WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.level = srvc.level );
{ "outer_table": "services", "inner_table": "schedules", "outer_alias": "srvc", "inner_alias": "schd", "proj_col": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_11232
train
T2
v3
Schema: requests (alias: ordr)(amount, value, salary, level) transactions(amount, id, date, level) Task: Retrieve value from requests with amount above the MIN(value) of transactions rows sharing the same id. SQL:
SELECT value FROM requests AS ordr WHERE amount > ( SELECT MIN(value) FROM transactions AS txn WHERE txn.id = ordr.id );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_11233
train
T2
v2
Schema: accounts (alias: acct)(date, amount, level, code) employees(name, code, level, id) Task: Retrieve value from accounts that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = acct.status );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "value", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_11234
train
T1
v3
Schema: employees (alias: emp)(type, status, amount, value) products(code, id, date, amount) Task: Retrieve name from employees with amount above the MIN(salary) of products rows sharing the same type. SQL:
SELECT name FROM employees AS emp WHERE amount > ( SELECT MIN(salary) FROM products AS prod WHERE prod.type = emp.type );
{ "outer_table": "employees", "inner_table": "products", "outer_alias": "emp", "inner_alias": "prod", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_11235
train
T1
v3
Schema: requests (alias: ordr)(value, status, salary, level) items(name, date, salary, id) Task: Find amount from requests where salary exceeds the average amount from items for the same id. SQL:
SELECT amount FROM requests AS ordr WHERE salary > ( SELECT MIN(amount) FROM items AS lne WHERE lne.id = ordr.id );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_11236
train
T2
v1
Schema: services (alias: srvc)(type, date, code, level) regions(code, status, type, id) Task: Retrieve salary from services whose level is found in regions rows where id matches the outer record. SQL:
SELECT salary FROM services AS srvc WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.id = srvc.id );
{ "outer_table": "services", "inner_table": "regions", "outer_alias": "srvc", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "level", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_11237
train
T2
v2
Schema: accounts (alias: acct)(status, code, value, type) requests(salary, amount, code, type) Task: Retrieve id from accounts that have at least one corresponding entry in requests sharing the same code. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = acct.code );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "id", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_11238
train
T1
v2
Schema: orders (alias: ord)(code, value, name, status) departments(name, level, code, id) Task: Find amount from orders where a matching record exists in departments with the same type. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = ord.type );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "amount", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_11239
train
T1
v3
Schema: services (alias: srvc)(value, name, status, code) shipments(amount, type, value, name) Task: Retrieve salary from services with value above the MIN(amount) of shipments rows sharing the same type. SQL:
SELECT salary FROM services AS srvc WHERE value > ( SELECT MIN(amount) FROM shipments AS shp WHERE shp.type = srvc.type );
{ "outer_table": "services", "inner_table": "shipments", "outer_alias": "srvc", "inner_alias": "shp", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_11240
train
T2
v2
Schema: categories (alias: catg)(level, code, type, status) items(id, type, date, amount) Task: Find amount from categories where a matching record exists in items with the same status. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = catg.status );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "amount", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_11241
train
T2
v2
Schema: categories (alias: catg)(status, id, name, type) departments(status, value, amount, date) Task: Retrieve amount from categories that have at least one corresponding entry in departments sharing the same id. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = catg.id );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "amount", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_11242
train
T2
v2
Schema: orders (alias: ord)(name, type, value, id) customers(value, name, code, salary) Task: Find amount from orders where a matching record exists in customers with the same code. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = ord.code );
{ "outer_table": "orders", "inner_table": "customers", "outer_alias": "ord", "inner_alias": "cust", "proj_col": "amount", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_11243
train
T1
v1
Schema: shipments (alias: shp)(amount, level, name, date) staff(date, id, status, name) Task: Find name from shipments where status appears in staff entries with matching type. SQL:
SELECT name FROM shipments AS shp WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.type = shp.type );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_11244
train
T2
v3
Schema: customers (alias: cust)(level, id, name, type) managers(amount, code, value, level) Task: Find id from customers where amount exceeds the average amount from managers for the same type. SQL:
SELECT id FROM customers AS cust WHERE amount > ( SELECT SUM(amount) FROM managers AS mgr WHERE mgr.type = cust.type );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_11245
train
T1
v3
Schema: regions (alias: rgn)(type, value, code, name) departments(name, level, salary, date) Task: Retrieve value from regions with value above the SUM(salary) of departments rows sharing the same code. SQL:
SELECT value FROM regions AS rgn WHERE value > ( SELECT SUM(salary) FROM departments AS dept WHERE dept.code = rgn.code );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_11246
train
T2
v3
Schema: products (alias: prod)(amount, id, code, status) categories(value, salary, id, type) Task: Retrieve name from products with amount above the AVG(amount) of categories rows sharing the same code. SQL:
SELECT name FROM products AS prod WHERE amount > ( SELECT AVG(amount) FROM categories AS catg WHERE catg.code = prod.code );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_11247
train
T1
v2
Schema: requests (alias: ordr)(date, level, salary, id) schedules(date, id, type, status) Task: Find code from requests where a matching record exists in schedules with the same level. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = ordr.level );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "code", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_11248
train
T2
v1
Schema: managers (alias: mgr)(type, level, value, id) departments(type, code, date, value) Task: Find code from managers where type appears in departments entries with matching id. SQL:
SELECT code FROM managers AS mgr WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.id = mgr.id );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "code", "filter_col": "type", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_11249
train
T1
v1
Schema: schedules (alias: schd)(value, id, code, level) items(date, status, amount, salary) Task: Select name from schedules where level exists in items for the same code. SQL:
SELECT name FROM schedules AS schd WHERE level IN ( SELECT level FROM items AS lne WHERE lne.code = schd.code );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_11250
train
T2
v3
Schema: regions (alias: rgn)(salary, amount, value, id) invoices(level, code, type, amount) Task: Find amount from regions where amount exceeds the average amount from invoices for the same code. SQL:
SELECT amount FROM regions AS rgn WHERE amount > ( SELECT MAX(amount) FROM invoices AS inv WHERE inv.code = rgn.code );
{ "outer_table": "regions", "inner_table": "invoices", "outer_alias": "rgn", "inner_alias": "inv", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_11251
train
T2
v2
Schema: managers (alias: mgr)(date, amount, id, level) departments(name, date, amount, type) Task: Find id from managers where a matching record exists in departments with the same level. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = mgr.level );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "id", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_11252
train
T1
v2
Schema: customers (alias: cust)(status, date, id, level) services(amount, level, value, status) Task: Find name from customers where a matching record exists in services with the same code. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.code = cust.code );
{ "outer_table": "customers", "inner_table": "services", "outer_alias": "cust", "inner_alias": "srvc", "proj_col": "name", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_11253
train
T1
v1
Schema: orders (alias: ord)(name, date, value, amount) schedules(amount, salary, status, id) Task: Retrieve amount from orders whose level is found in schedules rows where status matches the outer record. SQL:
SELECT amount FROM orders AS ord WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.status = ord.status );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_11254
train
T1
v3
Schema: categories (alias: catg)(id, code, name, amount) customers(level, type, salary, id) Task: Find code from categories where salary exceeds the average value from customers for the same code. SQL:
SELECT code FROM categories AS catg WHERE salary > ( SELECT SUM(value) FROM customers AS cust WHERE cust.code = catg.code );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_11255
train
T2
v2
Schema: employees (alias: emp)(date, code, status, value) regions(name, id, value, code) Task: Retrieve name from employees that have at least one corresponding entry in regions sharing the same code. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = emp.code );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "name", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_11256
train
T1
v2
Schema: products (alias: prod)(type, status, code, value) sales(type, id, name, status) Task: Retrieve code from products that have at least one corresponding entry in sales sharing the same level. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = prod.level );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "code", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_11257
train
T1
v3
Schema: customers (alias: cust)(name, value, status, id) regions(status, name, type, date) Task: Retrieve code from customers with value above the AVG(amount) of regions rows sharing the same type. SQL:
SELECT code FROM customers AS cust WHERE value > ( SELECT AVG(amount) FROM regions AS rgn WHERE rgn.type = cust.type );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_11258
train
T1
v3
Schema: employees (alias: emp)(id, amount, type, date) sales(salary, name, date, id) Task: Retrieve salary from employees with value above the MAX(salary) of sales rows sharing the same type. SQL:
SELECT salary FROM employees AS emp WHERE value > ( SELECT MAX(salary) FROM sales AS sale WHERE sale.type = emp.type );
{ "outer_table": "employees", "inner_table": "sales", "outer_alias": "emp", "inner_alias": "sale", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_11259
train
T1
v1
Schema: invoices (alias: inv)(salary, level, id, amount) categories(value, amount, code, name) Task: Retrieve id from invoices whose type is found in categories rows where type matches the outer record. SQL:
SELECT id FROM invoices AS inv WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.type = inv.type );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "id", "filter_col": "type", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_11260
train
T1
v3
Schema: budgets (alias: budg)(status, code, name, level) staff(name, value, status, type) Task: Find code from budgets where salary exceeds the average salary from staff for the same code. SQL:
SELECT code FROM budgets AS budg WHERE salary > ( SELECT AVG(salary) FROM staff AS empl WHERE empl.code = budg.code );
{ "outer_table": "budgets", "inner_table": "staff", "outer_alias": "budg", "inner_alias": "empl", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_11261
train
T2
v3
Schema: invoices (alias: inv)(id, date, salary, code) shipments(id, salary, level, type) Task: Retrieve amount from invoices with amount above the SUM(value) of shipments rows sharing the same type. SQL:
SELECT amount FROM invoices AS inv WHERE amount > ( SELECT SUM(value) FROM shipments AS shp WHERE shp.type = inv.type );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_11262
train
T1
v3
Schema: budgets (alias: budg)(code, salary, level, type) regions(name, level, amount, date) Task: Retrieve amount from budgets with value above the SUM(amount) of regions rows sharing the same code. SQL:
SELECT amount FROM budgets AS budg WHERE value > ( SELECT SUM(amount) FROM regions AS rgn WHERE rgn.code = budg.code );
{ "outer_table": "budgets", "inner_table": "regions", "outer_alias": "budg", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_11263
train
T2
v1
Schema: customers (alias: cust)(name, code, id, type) shipments(date, id, level, type) Task: Select amount from customers where id exists in shipments for the same code. SQL:
SELECT amount FROM customers AS cust WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.code = cust.code );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_11264
train
T1
v2
Schema: sales (alias: sale)(id, level, status, salary) invoices(level, code, name, id) Task: Retrieve value from sales that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = sale.type );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "value", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_11265
train
T1
v2
Schema: invoices (alias: inv)(status, salary, level, type) warehouses(status, date, salary, name) Task: Retrieve amount from invoices that have at least one corresponding entry in warehouses sharing the same status. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.status = inv.status );
{ "outer_table": "invoices", "inner_table": "warehouses", "outer_alias": "inv", "inner_alias": "whs", "proj_col": "amount", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_11266
train
T1
v3
Schema: services (alias: srvc)(type, id, amount, code) shipments(salary, id, type, level) Task: Retrieve value from services with value above the AVG(amount) of shipments rows sharing the same type. SQL:
SELECT value FROM services AS srvc WHERE value > ( SELECT AVG(amount) FROM shipments AS shp WHERE shp.type = srvc.type );
{ "outer_table": "services", "inner_table": "shipments", "outer_alias": "srvc", "inner_alias": "shp", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_11267
train
T2
v2
Schema: employees (alias: emp)(code, type, level, amount) shipments(value, id, level, date) Task: Retrieve id from employees that have at least one corresponding entry in shipments sharing the same type. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = emp.type );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "id", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_11268
train
T1
v3
Schema: regions (alias: rgn)(value, id, code, status) requests(status, date, salary, id) Task: Find code from regions where value exceeds the average value from requests for the same status. SQL:
SELECT code FROM regions AS rgn WHERE value > ( SELECT MIN(value) FROM requests AS ordr WHERE ordr.status = rgn.status );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_11269
train
T2
v1
Schema: transactions (alias: txn)(code, id, amount, status) managers(date, type, salary, status) Task: Retrieve name from transactions whose level is found in managers rows where id matches the outer record. SQL:
SELECT name FROM transactions AS txn WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.id = txn.id );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "name", "filter_col": "level", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_11270
train
T1
v3
Schema: customers (alias: cust)(id, value, salary, type) products(date, amount, level, type) Task: Find value from customers where salary exceeds the average value from products for the same type. SQL:
SELECT value FROM customers AS cust WHERE salary > ( SELECT AVG(value) FROM products AS prod WHERE prod.type = cust.type );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_11271
train
T1
v2
Schema: warehouses (alias: whs)(salary, name, status, amount) managers(status, date, type, code) Task: Retrieve code from warehouses that have at least one corresponding entry in managers sharing the same status. SQL:
SELECT code FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "managers", "outer_alias": "whs", "inner_alias": "mgr", "proj_col": "code", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_11272
train
T2
v2
Schema: departments (alias: dept)(value, level, date, id) orders(level, salary, id, date) Task: Retrieve name from departments that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = dept.code );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "name", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_11273
train
T1
v3
Schema: schedules (alias: schd)(level, value, name, salary) transactions(salary, name, date, code) Task: Find amount from schedules where amount exceeds the average amount from transactions for the same code. SQL:
SELECT amount FROM schedules AS schd WHERE amount > ( SELECT AVG(amount) FROM transactions AS txn WHERE txn.code = schd.code );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_11274
train
T2
v1
Schema: sales (alias: sale)(status, date, type, level) invoices(status, name, type, level) Task: Retrieve name from sales whose type is found in invoices rows where status matches the outer record. SQL:
SELECT name FROM sales AS sale WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.status = sale.status );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "name", "filter_col": "type", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_11275
train
T1
v3
Schema: accounts (alias: acct)(amount, level, value, type) transactions(type, amount, id, value) Task: Retrieve name from accounts with amount above the COUNT(value) of transactions rows sharing the same type. SQL:
SELECT name FROM accounts AS acct WHERE amount > ( SELECT COUNT(value) FROM transactions AS txn WHERE txn.type = acct.type );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_11276
train
T1
v2
Schema: regions (alias: rgn)(value, type, status, level) staff(amount, level, code, type) Task: Retrieve value from regions that have at least one corresponding entry in staff sharing the same id. SQL:
SELECT value FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = rgn.id );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "value", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_11277
train
T2
v3
Schema: products (alias: prod)(code, type, amount, value) accounts(id, code, amount, level) Task: Find code from products where value exceeds the average salary from accounts for the same level. SQL:
SELECT code FROM products AS prod WHERE value > ( SELECT COUNT(salary) FROM accounts AS acct WHERE acct.level = prod.level );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_11278
train
T1
v3
Schema: accounts (alias: acct)(level, date, status, value) schedules(salary, date, id, name) Task: Retrieve id from accounts with salary above the COUNT(amount) of schedules rows sharing the same id. SQL:
SELECT id FROM accounts AS acct WHERE salary > ( SELECT COUNT(amount) FROM schedules AS schd WHERE schd.id = acct.id );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_11279
train
T1
v1
Schema: services (alias: srvc)(id, type, name, amount) sales(name, amount, date, value) Task: Find value from services where code appears in sales entries with matching status. SQL:
SELECT value FROM services AS srvc WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.status = srvc.status );
{ "outer_table": "services", "inner_table": "sales", "outer_alias": "srvc", "inner_alias": "sale", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_11280
train
T2
v1
Schema: departments (alias: dept)(level, type, name, salary) staff(type, amount, status, code) Task: Retrieve amount from departments whose type is found in staff rows where type matches the outer record. SQL:
SELECT amount FROM departments AS dept WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.type = dept.type );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_11281
train
T1
v2
Schema: invoices (alias: inv)(amount, status, date, salary) requests(type, status, code, date) Task: Find id from invoices where a matching record exists in requests with the same status. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = inv.status );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "id", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_11282
train
T1
v3
Schema: orders (alias: ord)(amount, status, value, salary) requests(type, amount, code, id) Task: Retrieve salary from orders with salary above the COUNT(salary) of requests rows sharing the same id. SQL:
SELECT salary FROM orders AS ord WHERE salary > ( SELECT COUNT(salary) FROM requests AS ordr WHERE ordr.id = ord.id );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_11283
train
T1
v2
Schema: regions (alias: rgn)(code, name, amount, level) orders(salary, code, level, value) Task: Retrieve id from regions that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = rgn.code );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "id", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_11284
train
T2
v3
Schema: managers (alias: mgr)(level, code, value, name) customers(value, amount, status, type) Task: Retrieve salary from managers with value above the AVG(amount) of customers rows sharing the same code. SQL:
SELECT salary FROM managers AS mgr WHERE value > ( SELECT AVG(amount) FROM customers AS cust WHERE cust.code = mgr.code );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_11285
train
T1
v3
Schema: warehouses (alias: whs)(name, code, id, level) managers(level, name, id, code) Task: Find value from warehouses where value exceeds the average salary from managers for the same level. SQL:
SELECT value FROM warehouses AS whs WHERE value > ( SELECT COUNT(salary) FROM managers AS mgr WHERE mgr.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "managers", "outer_alias": "whs", "inner_alias": "mgr", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_11286
train
T2
v2
Schema: budgets (alias: budg)(code, value, salary, amount) categories(id, date, name, type) Task: Retrieve name from budgets that have at least one corresponding entry in categories sharing the same id. SQL:
SELECT name 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": "name", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_11287
train
T2
v1
Schema: transactions (alias: txn)(status, value, code, type) invoices(date, name, code, level) Task: Find value from transactions where type appears in invoices entries with matching level. SQL:
SELECT value FROM transactions AS txn WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.level = txn.level );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_11288
train
T1
v3
Schema: employees (alias: emp)(value, salary, amount, status) shipments(date, status, code, salary) Task: Retrieve code from employees with salary above the COUNT(value) of shipments rows sharing the same code. SQL:
SELECT code FROM employees AS emp WHERE salary > ( SELECT COUNT(value) FROM shipments AS shp WHERE shp.code = emp.code );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_11289
train
T1
v1
Schema: schedules (alias: schd)(date, name, type, salary) managers(salary, code, name, amount) Task: Select name from schedules where level exists in managers for the same level. SQL:
SELECT name FROM schedules AS schd WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.level = schd.level );
{ "outer_table": "schedules", "inner_table": "managers", "outer_alias": "schd", "inner_alias": "mgr", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_11290
train
T2
v2
Schema: requests (alias: ordr)(value, amount, salary, id) shipments(name, type, id, value) Task: Retrieve salary from requests that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = ordr.id );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "salary", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_11291
train
T2
v1
Schema: categories (alias: catg)(value, id, date, status) transactions(code, level, status, amount) Task: Find value from categories where type appears in transactions entries with matching code. SQL:
SELECT value FROM categories AS catg WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.code = catg.code );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_11292
train
T2
v3
Schema: shipments (alias: shp)(name, amount, date, code) sales(level, salary, status, value) Task: Find name from shipments where amount exceeds the average amount from sales for the same type. SQL:
SELECT name FROM shipments AS shp WHERE amount > ( SELECT MAX(amount) FROM sales AS sale WHERE sale.type = shp.type );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_11293
train
T2
v3
Schema: employees (alias: emp)(code, name, amount, date) staff(date, status, code, type) Task: Find code from employees where amount exceeds the average value from staff for the same type. SQL:
SELECT code FROM employees AS emp WHERE amount > ( SELECT COUNT(value) FROM staff AS empl WHERE empl.type = emp.type );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_11294
train
T1
v3
Schema: services (alias: srvc)(type, status, value, salary) budgets(id, type, name, status) Task: Retrieve id from services with value above the MAX(value) of budgets rows sharing the same code. SQL:
SELECT id FROM services AS srvc WHERE value > ( SELECT MAX(value) FROM budgets AS budg WHERE budg.code = srvc.code );
{ "outer_table": "services", "inner_table": "budgets", "outer_alias": "srvc", "inner_alias": "budg", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_11295
train
T2
v3
Schema: categories (alias: catg)(status, amount, id, type) products(status, id, name, amount) Task: Find amount from categories where salary exceeds the average salary from products for the same status. SQL:
SELECT amount FROM categories AS catg WHERE salary > ( SELECT MAX(salary) FROM products AS prod WHERE prod.status = catg.status );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_11296
train
T2
v2
Schema: managers (alias: mgr)(type, status, amount, salary) orders(id, code, status, name) Task: Find name from managers where a matching record exists in orders with the same id. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = mgr.id );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "name", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_11297
train
T1
v3
Schema: regions (alias: rgn)(date, name, type, amount) shipments(id, amount, type, salary) Task: Retrieve id from regions with value above the AVG(salary) of shipments rows sharing the same status. SQL:
SELECT id FROM regions AS rgn WHERE value > ( SELECT AVG(salary) FROM shipments AS shp WHERE shp.status = rgn.status );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_11298
train
T2
v2
Schema: orders (alias: ord)(type, id, status, level) products(type, name, id, code) Task: Find amount from orders where a matching record exists in products with the same status. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = ord.status );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "amount", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_11299
train
T1