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: shipments (alias: shp)(name, id, value, level) transactions(value, level, name, salary) Task: Retrieve value from shipments with salary above the MAX(salary) of transactions rows sharing the same status. SQL:
SELECT value FROM shipments AS shp WHERE salary > ( SELECT MAX(salary) FROM transactions AS txn WHERE txn.status = shp.status );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_05200
train
T2
v2
Schema: warehouses (alias: whs)(level, name, amount, type) shipments(type, amount, salary, value) Task: Retrieve id from warehouses that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT id FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "shipments", "outer_alias": "whs", "inner_alias": "shp", "proj_col": "id", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_05201
train
T2
v3
Schema: orders (alias: ord)(code, value, status, name) items(status, value, id, date) Task: Find id from orders where salary exceeds the average salary from items for the same code. SQL:
SELECT id FROM orders AS ord WHERE salary > ( SELECT AVG(salary) FROM items AS lne WHERE lne.code = ord.code );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_05202
train
T1
v3
Schema: employees (alias: emp)(level, salary, status, code) services(type, status, name, code) Task: Find salary from employees where value exceeds the average amount from services for the same level. SQL:
SELECT salary FROM employees AS emp WHERE value > ( SELECT MIN(amount) FROM services AS srvc WHERE srvc.level = emp.level );
{ "outer_table": "employees", "inner_table": "services", "outer_alias": "emp", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_05203
train
T1
v1
Schema: transactions (alias: txn)(salary, code, status, name) regions(date, level, name, status) Task: Retrieve id from transactions whose code is found in regions rows where type matches the outer record. SQL:
SELECT id FROM transactions AS txn WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.type = txn.type );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "id", "filter_col": "code", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_05204
train
T1
v2
Schema: requests (alias: ordr)(salary, type, amount, value) transactions(code, salary, level, id) Task: Retrieve salary from requests that have at least one corresponding entry in transactions sharing the same type. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = ordr.type );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "salary", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_05205
train
T2
v1
Schema: services (alias: srvc)(salary, type, status, id) customers(salary, date, type, name) Task: Find value from services where level appears in customers entries with matching type. SQL:
SELECT value FROM services AS srvc WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.type = srvc.type );
{ "outer_table": "services", "inner_table": "customers", "outer_alias": "srvc", "inner_alias": "cust", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_05206
train
T2
v3
Schema: transactions (alias: txn)(level, salary, type, date) managers(date, type, name, value) Task: Find salary from transactions where salary exceeds the average salary from managers for the same status. SQL:
SELECT salary FROM transactions AS txn WHERE salary > ( SELECT MIN(salary) FROM managers AS mgr WHERE mgr.status = txn.status );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_05207
train
T1
v3
Schema: shipments (alias: shp)(salary, name, type, status) orders(value, id, status, date) Task: Retrieve amount from shipments with salary above the MIN(salary) of orders rows sharing the same level. SQL:
SELECT amount FROM shipments AS shp WHERE salary > ( SELECT MIN(salary) FROM orders AS ord WHERE ord.level = shp.level );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_05208
train
T2
v2
Schema: accounts (alias: acct)(code, status, date, type) categories(salary, id, status, value) Task: Find amount from accounts where a matching record exists in categories with the same level. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = acct.level );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "amount", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_05209
train
T1
v2
Schema: regions (alias: rgn)(id, salary, status, name) services(type, value, name, code) Task: Retrieve amount from regions that have at least one corresponding entry in services sharing the same id. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = rgn.id );
{ "outer_table": "regions", "inner_table": "services", "outer_alias": "rgn", "inner_alias": "srvc", "proj_col": "amount", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_05210
train
T2
v2
Schema: regions (alias: rgn)(salary, id, amount, code) shipments(date, salary, name, id) Task: Find id from regions where a matching record exists in shipments with the same type. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = rgn.type );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "id", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_05211
train
T2
v1
Schema: schedules (alias: schd)(date, status, id, value) transactions(salary, status, name, level) Task: Retrieve name from schedules whose code is found in transactions rows where code matches the outer record. SQL:
SELECT name FROM schedules AS schd WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.code = schd.code );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_05212
train
T2
v2
Schema: managers (alias: mgr)(status, level, code, value) sales(date, amount, type, id) Task: Find id from managers where a matching record exists in sales with the same level. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = mgr.level );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "id", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_05213
train
T1
v2
Schema: sales (alias: sale)(amount, status, type, date) warehouses(name, id, salary, level) Task: Retrieve name from sales that have at least one corresponding entry in warehouses sharing the same code. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.code = sale.code );
{ "outer_table": "sales", "inner_table": "warehouses", "outer_alias": "sale", "inner_alias": "whs", "proj_col": "name", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_05214
train
T1
v1
Schema: accounts (alias: acct)(amount, code, date, salary) customers(status, type, amount, salary) Task: Retrieve salary from accounts whose code is found in customers rows where status matches the outer record. SQL:
SELECT salary FROM accounts AS acct WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.status = acct.status );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_05215
train
T1
v1
Schema: accounts (alias: acct)(id, amount, salary, code) services(amount, status, code, value) Task: Select id from accounts where code exists in services for the same status. SQL:
SELECT id FROM accounts AS acct WHERE code IN ( SELECT code FROM services AS srvc WHERE srvc.status = acct.status );
{ "outer_table": "accounts", "inner_table": "services", "outer_alias": "acct", "inner_alias": "srvc", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_05216
train
T1
v1
Schema: invoices (alias: inv)(name, amount, type, level) shipments(code, id, salary, type) Task: Select id from invoices where status exists in shipments for the same status. SQL:
SELECT id FROM invoices AS inv WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.status = inv.status );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_05217
train
T1
v2
Schema: items (alias: lne)(level, value, date, status) categories(name, date, salary, code) Task: Find id from items where a matching record exists in categories with the same code. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = lne.code );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "id", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_05218
train
T2
v2
Schema: products (alias: prod)(amount, salary, type, level) shipments(code, salary, value, status) Task: Retrieve code from products that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = prod.id );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "code", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_05219
train
T1
v1
Schema: customers (alias: cust)(code, name, date, status) accounts(level, type, id, name) Task: Find value from customers where code appears in accounts entries with matching level. SQL:
SELECT value FROM customers AS cust WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.level = cust.level );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_05220
train
T1
v2
Schema: requests (alias: ordr)(date, id, name, status) items(type, date, level, code) Task: Retrieve code from requests that have at least one corresponding entry in items sharing the same type. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = ordr.type );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "code", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_05221
train
T2
v1
Schema: schedules (alias: schd)(salary, level, amount, code) categories(id, type, name, value) Task: Find value from schedules where id appears in categories entries with matching type. SQL:
SELECT value FROM schedules AS schd WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.type = schd.type );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_05222
train
T2
v1
Schema: services (alias: srvc)(salary, date, status, amount) sales(id, amount, status, salary) Task: Retrieve id from services whose status is found in sales rows where level matches the outer record. SQL:
SELECT id FROM services AS srvc WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.level = srvc.level );
{ "outer_table": "services", "inner_table": "sales", "outer_alias": "srvc", "inner_alias": "sale", "proj_col": "id", "filter_col": "status", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_05223
train
T2
v1
Schema: managers (alias: mgr)(name, type, amount, status) products(status, date, salary, code) Task: Select name from managers where code exists in products for the same code. SQL:
SELECT name FROM managers AS mgr WHERE code IN ( SELECT code FROM products AS prod WHERE prod.code = mgr.code );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_05224
train
T1
v3
Schema: customers (alias: cust)(type, code, name, id) invoices(amount, level, id, type) Task: Retrieve salary from customers with salary above the AVG(salary) of invoices rows sharing the same code. SQL:
SELECT salary FROM customers AS cust WHERE salary > ( SELECT AVG(salary) FROM invoices AS inv WHERE inv.code = cust.code );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_05225
train
T1
v3
Schema: accounts (alias: acct)(amount, id, name, date) categories(salary, name, date, id) Task: Find name from accounts where amount exceeds the average value from categories for the same level. SQL:
SELECT name FROM accounts AS acct WHERE amount > ( SELECT COUNT(value) FROM categories AS catg WHERE catg.level = acct.level );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_05226
train
T1
v1
Schema: employees (alias: emp)(type, level, code, date) items(value, code, level, date) Task: Retrieve name from employees whose type is found in items rows where level matches the outer record. SQL:
SELECT name FROM employees AS emp WHERE type IN ( SELECT type FROM items AS lne WHERE lne.level = emp.level );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_05227
train
T1
v3
Schema: budgets (alias: budg)(date, name, salary, id) warehouses(code, level, date, id) Task: Find id from budgets where value exceeds the average salary from warehouses for the same status. SQL:
SELECT id FROM budgets AS budg WHERE value > ( SELECT COUNT(salary) FROM warehouses AS whs WHERE whs.status = budg.status );
{ "outer_table": "budgets", "inner_table": "warehouses", "outer_alias": "budg", "inner_alias": "whs", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_05228
train
T2
v3
Schema: customers (alias: cust)(code, amount, status, value) transactions(date, type, name, status) Task: Find amount from customers where salary exceeds the average salary from transactions for the same status. SQL:
SELECT amount FROM customers AS cust WHERE salary > ( SELECT MAX(salary) FROM transactions AS txn WHERE txn.status = cust.status );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_05229
train
T1
v3
Schema: customers (alias: cust)(date, name, code, salary) accounts(id, level, type, value) Task: Retrieve value from customers with salary above the AVG(amount) of accounts rows sharing the same level. SQL:
SELECT value FROM customers AS cust WHERE salary > ( SELECT AVG(amount) FROM accounts AS acct WHERE acct.level = cust.level );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_05230
train
T1
v2
Schema: sales (alias: sale)(date, level, amount, id) customers(value, date, type, level) Task: Retrieve name from sales that have at least one corresponding entry in customers sharing the same type. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = sale.type );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "name", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_05231
train
T1
v2
Schema: budgets (alias: budg)(status, value, id, level) categories(code, amount, name, level) Task: Retrieve amount from budgets that have at least one corresponding entry in categories sharing the same level. SQL:
SELECT amount FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = budg.level );
{ "outer_table": "budgets", "inner_table": "categories", "outer_alias": "budg", "inner_alias": "catg", "proj_col": "amount", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_05232
train
T2
v2
Schema: schedules (alias: schd)(name, id, value, status) customers(id, date, value, code) Task: Retrieve id from schedules that have at least one corresponding entry in customers sharing the same type. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = schd.type );
{ "outer_table": "schedules", "inner_table": "customers", "outer_alias": "schd", "inner_alias": "cust", "proj_col": "id", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_05233
train
T2
v2
Schema: accounts (alias: acct)(code, date, name, type) regions(level, name, code, date) Task: Find value from accounts where a matching record exists in regions with the same status. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = acct.status );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "value", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_05234
train
T1
v1
Schema: employees (alias: emp)(date, code, amount, salary) budgets(code, type, name, salary) Task: Retrieve value from employees whose type is found in budgets rows where code matches the outer record. SQL:
SELECT value FROM employees AS emp WHERE type IN ( SELECT type FROM budgets AS budg WHERE budg.code = emp.code );
{ "outer_table": "employees", "inner_table": "budgets", "outer_alias": "emp", "inner_alias": "budg", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_05235
train
T1
v3
Schema: accounts (alias: acct)(level, status, type, code) categories(date, level, code, amount) Task: Find code from accounts where value exceeds the average amount from categories for the same level. SQL:
SELECT code FROM accounts AS acct WHERE value > ( SELECT MAX(amount) FROM categories AS catg WHERE catg.level = acct.level );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_05236
train
T1
v3
Schema: schedules (alias: schd)(salary, value, type, code) requests(salary, id, date, level) Task: Retrieve amount from schedules with value above the COUNT(value) of requests rows sharing the same level. SQL:
SELECT amount FROM schedules AS schd WHERE value > ( SELECT COUNT(value) FROM requests AS ordr WHERE ordr.level = schd.level );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_05237
train
T2
v2
Schema: invoices (alias: inv)(status, amount, salary, name) categories(type, id, status, code) Task: Find id from invoices where a matching record exists in categories with the same status. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = inv.status );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "id", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_05238
train
T1
v1
Schema: services (alias: srvc)(status, salary, amount, value) schedules(salary, name, level, value) Task: Retrieve amount from services whose code is found in schedules rows where type matches the outer record. SQL:
SELECT amount FROM services AS srvc WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.type = srvc.type );
{ "outer_table": "services", "inner_table": "schedules", "outer_alias": "srvc", "inner_alias": "schd", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_05239
train
T2
v3
Schema: staff (alias: empl)(level, name, code, id) items(amount, name, salary, level) Task: Retrieve id from staff with salary above the COUNT(salary) of items rows sharing the same code. SQL:
SELECT id FROM staff AS empl WHERE salary > ( SELECT COUNT(salary) FROM items AS lne WHERE lne.code = empl.code );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_05240
train
T2
v2
Schema: requests (alias: ordr)(code, name, level, status) shipments(code, amount, date, type) Task: Find value from requests where a matching record exists in shipments with the same code. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = ordr.code );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "value", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_05241
train
T2
v1
Schema: warehouses (alias: whs)(amount, type, name, salary) requests(level, amount, id, code) Task: Find name from warehouses where type appears in requests entries with matching code. SQL:
SELECT name FROM warehouses AS whs WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "requests", "outer_alias": "whs", "inner_alias": "ordr", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_05242
train
T2
v2
Schema: budgets (alias: budg)(level, code, name, amount) services(salary, type, status, amount) Task: Find id from budgets where a matching record exists in services with the same status. SQL:
SELECT id FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.status = budg.status );
{ "outer_table": "budgets", "inner_table": "services", "outer_alias": "budg", "inner_alias": "srvc", "proj_col": "id", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_05243
train
T2
v1
Schema: orders (alias: ord)(salary, id, date, amount) services(code, id, value, status) Task: Retrieve id from orders whose code is found in services rows where id matches the outer record. SQL:
SELECT id FROM orders AS ord WHERE code IN ( SELECT code FROM services AS srvc WHERE srvc.id = ord.id );
{ "outer_table": "orders", "inner_table": "services", "outer_alias": "ord", "inner_alias": "srvc", "proj_col": "id", "filter_col": "code", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_05244
train
T1
v3
Schema: products (alias: prod)(name, date, level, salary) budgets(type, id, date, status) Task: Find value from products where value exceeds the average amount from budgets for the same type. SQL:
SELECT value FROM products AS prod WHERE value > ( SELECT MIN(amount) FROM budgets AS budg WHERE budg.type = prod.type );
{ "outer_table": "products", "inner_table": "budgets", "outer_alias": "prod", "inner_alias": "budg", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_05245
train
T1
v3
Schema: schedules (alias: schd)(salary, status, date, level) items(name, level, amount, id) Task: Find name from schedules where salary exceeds the average amount from items for the same type. SQL:
SELECT name FROM schedules AS schd WHERE salary > ( SELECT COUNT(amount) FROM items AS lne WHERE lne.type = schd.type );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_05246
train
T2
v3
Schema: regions (alias: rgn)(id, salary, status, level) categories(type, name, level, code) Task: Find salary from regions where amount exceeds the average value from categories for the same type. SQL:
SELECT salary FROM regions AS rgn WHERE amount > ( SELECT COUNT(value) FROM categories AS catg WHERE catg.type = rgn.type );
{ "outer_table": "regions", "inner_table": "categories", "outer_alias": "rgn", "inner_alias": "catg", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_05247
train
T2
v3
Schema: invoices (alias: inv)(level, salary, amount, status) transactions(status, level, code, amount) Task: Find id from invoices where amount exceeds the average value from transactions for the same code. SQL:
SELECT id FROM invoices AS inv WHERE amount > ( SELECT AVG(value) FROM transactions AS txn WHERE txn.code = inv.code );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_05248
train
T1
v1
Schema: transactions (alias: txn)(value, amount, code, level) warehouses(name, type, code, amount) Task: Find code from transactions where id appears in warehouses entries with matching id. SQL:
SELECT code FROM transactions AS txn WHERE id IN ( SELECT id FROM warehouses AS whs WHERE whs.id = txn.id );
{ "outer_table": "transactions", "inner_table": "warehouses", "outer_alias": "txn", "inner_alias": "whs", "proj_col": "code", "filter_col": "id", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_05249
train
T1
v3
Schema: categories (alias: catg)(salary, type, status, level) sales(id, date, salary, amount) Task: Retrieve code from categories with value above the AVG(salary) of sales rows sharing the same id. SQL:
SELECT code FROM categories AS catg WHERE value > ( SELECT AVG(salary) FROM sales AS sale WHERE sale.id = catg.id );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_05250
train
T2
v2
Schema: schedules (alias: schd)(date, salary, value, status) sales(code, level, type, id) Task: Retrieve code from schedules that have at least one corresponding entry in sales sharing the same status. SQL:
SELECT code FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = schd.status );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "code", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_05251
train
T2
v2
Schema: orders (alias: ord)(salary, amount, level, type) items(salary, type, amount, id) Task: Retrieve name from orders that have at least one corresponding entry in items sharing the same id. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.id = ord.id );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "name", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_05252
train
T1
v1
Schema: transactions (alias: txn)(salary, date, level, amount) products(level, name, id, value) Task: Find name from transactions where status appears in products entries with matching level. SQL:
SELECT name FROM transactions AS txn WHERE status IN ( SELECT status FROM products AS prod WHERE prod.level = txn.level );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_05253
train
T1
v2
Schema: requests (alias: ordr)(salary, date, code, type) staff(status, level, value, id) Task: Retrieve value from requests that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = ordr.type );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "value", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_05254
train
T2
v1
Schema: products (alias: prod)(level, date, amount, code) items(salary, date, type, name) Task: Retrieve id from products whose status is found in items rows where type matches the outer record. SQL:
SELECT id FROM products AS prod WHERE status IN ( SELECT status FROM items AS lne WHERE lne.type = prod.type );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_05255
train
T1
v2
Schema: requests (alias: ordr)(level, status, amount, date) categories(code, date, id, level) Task: Retrieve value from requests that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = ordr.code );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "value", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_05256
train
T2
v1
Schema: products (alias: prod)(level, date, amount, value) staff(code, date, salary, type) Task: Select code from products where code exists in staff for the same type. SQL:
SELECT code FROM products AS prod WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.type = prod.type );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "code", "filter_col": "code", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_05257
train
T1
v1
Schema: transactions (alias: txn)(status, value, salary, amount) staff(level, status, code, amount) Task: Retrieve name from transactions whose id is found in staff rows where id matches the outer record. SQL:
SELECT name FROM transactions AS txn WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.id = txn.id );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "name", "filter_col": "id", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_05258
train
T1
v2
Schema: accounts (alias: acct)(code, id, salary, type) regions(value, type, code, date) Task: Find code from accounts where a matching record exists in regions with the same status. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = acct.status );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "code", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_05259
train
T1
v3
Schema: regions (alias: rgn)(name, id, salary, code) customers(name, code, salary, level) Task: Find salary from regions where value exceeds the average amount from customers for the same level. SQL:
SELECT salary FROM regions AS rgn WHERE value > ( SELECT MAX(amount) FROM customers AS cust WHERE cust.level = rgn.level );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_05260
train
T2
v1
Schema: products (alias: prod)(code, status, level, amount) categories(status, type, level, name) Task: Find salary from products where code appears in categories entries with matching level. SQL:
SELECT salary FROM products AS prod WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.level = prod.level );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "salary", "filter_col": "code", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_05261
train
T1
v2
Schema: budgets (alias: budg)(value, type, level, salary) orders(id, date, code, type) Task: Retrieve value from budgets that have at least one corresponding entry in orders sharing the same type. SQL:
SELECT value FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = budg.type );
{ "outer_table": "budgets", "inner_table": "orders", "outer_alias": "budg", "inner_alias": "ord", "proj_col": "value", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_05262
train
T2
v1
Schema: invoices (alias: inv)(status, id, value, salary) accounts(code, value, salary, name) Task: Find name from invoices where level appears in accounts entries with matching status. SQL:
SELECT name FROM invoices AS inv WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.status = inv.status );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_05263
train
T1
v1
Schema: schedules (alias: schd)(salary, type, name, date) managers(date, level, code, name) Task: Retrieve name from schedules whose id is found in managers rows where code matches the outer record. SQL:
SELECT name FROM schedules AS schd WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.code = schd.code );
{ "outer_table": "schedules", "inner_table": "managers", "outer_alias": "schd", "inner_alias": "mgr", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_05264
train
T2
v3
Schema: schedules (alias: schd)(status, amount, name, date) regions(type, status, id, salary) Task: Find salary from schedules where amount exceeds the average salary from regions for the same type. SQL:
SELECT salary FROM schedules AS schd WHERE amount > ( SELECT SUM(salary) FROM regions AS rgn WHERE rgn.type = schd.type );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_05265
train
T2
v1
Schema: staff (alias: empl)(salary, date, amount, code) requests(value, code, status, name) Task: Retrieve value from staff whose status is found in requests rows where code matches the outer record. SQL:
SELECT value FROM staff AS empl WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.code = empl.code );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "value", "filter_col": "status", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_05266
train
T2
v2
Schema: invoices (alias: inv)(value, code, level, date) employees(value, name, type, code) Task: Find name from invoices where a matching record exists in employees with the same type. SQL:
SELECT name FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = inv.type );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "name", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_05267
train
T1
v1
Schema: invoices (alias: inv)(level, status, code, salary) customers(name, level, date, value) Task: Find name from invoices where code appears in customers entries with matching status. SQL:
SELECT name FROM invoices AS inv WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.status = inv.status );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_05268
train
T1
v3
Schema: regions (alias: rgn)(date, salary, amount, id) warehouses(date, level, name, amount) Task: Find value from regions where salary exceeds the average salary from warehouses for the same type. SQL:
SELECT value FROM regions AS rgn WHERE salary > ( SELECT SUM(salary) FROM warehouses AS whs WHERE whs.type = rgn.type );
{ "outer_table": "regions", "inner_table": "warehouses", "outer_alias": "rgn", "inner_alias": "whs", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_05269
train
T2
v2
Schema: services (alias: srvc)(value, salary, date, level) products(amount, id, salary, name) Task: Find amount from services where a matching record exists in products with the same status. SQL:
SELECT amount FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = srvc.status );
{ "outer_table": "services", "inner_table": "products", "outer_alias": "srvc", "inner_alias": "prod", "proj_col": "amount", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_05270
train
T2
v1
Schema: schedules (alias: schd)(code, status, amount, level) products(date, code, id, amount) Task: Find amount from schedules where level appears in products entries with matching level. SQL:
SELECT amount FROM schedules AS schd WHERE level IN ( SELECT level FROM products AS prod WHERE prod.level = schd.level );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "amount", "filter_col": "level", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_05271
train
T2
v1
Schema: items (alias: lne)(amount, status, code, salary) warehouses(value, level, date, name) Task: Find code from items where code appears in warehouses entries with matching code. SQL:
SELECT code FROM items AS lne WHERE code IN ( SELECT code FROM warehouses AS whs WHERE whs.code = lne.code );
{ "outer_table": "items", "inner_table": "warehouses", "outer_alias": "lne", "inner_alias": "whs", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_05272
train
T2
v3
Schema: sales (alias: sale)(level, status, code, id) invoices(type, salary, status, amount) Task: Find amount from sales where amount exceeds the average amount from invoices for the same id. SQL:
SELECT amount FROM sales AS sale WHERE amount > ( SELECT AVG(amount) FROM invoices AS inv WHERE inv.id = sale.id );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_05273
train
T1
v3
Schema: regions (alias: rgn)(value, id, status, level) orders(id, value, type, salary) Task: Retrieve name from regions with amount above the MIN(value) of orders rows sharing the same type. SQL:
SELECT name FROM regions AS rgn WHERE amount > ( SELECT MIN(value) FROM orders AS ord WHERE ord.type = rgn.type );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_05274
train
T2
v1
Schema: categories (alias: catg)(amount, date, level, name) regions(code, type, name, date) Task: Select salary from categories where id exists in regions for the same status. SQL:
SELECT salary FROM categories AS catg WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.status = catg.status );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_05275
train
T2
v3
Schema: warehouses (alias: whs)(date, code, type, name) items(id, name, level, status) Task: Retrieve value from warehouses with salary above the MIN(value) of items rows sharing the same level. SQL:
SELECT value FROM warehouses AS whs WHERE salary > ( SELECT MIN(value) FROM items AS lne WHERE lne.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "items", "outer_alias": "whs", "inner_alias": "lne", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_05276
train
T2
v1
Schema: customers (alias: cust)(value, salary, status, date) services(name, id, level, value) Task: Find salary from customers where type appears in services entries with matching code. SQL:
SELECT salary FROM customers AS cust WHERE type IN ( SELECT type FROM services AS srvc WHERE srvc.code = cust.code );
{ "outer_table": "customers", "inner_table": "services", "outer_alias": "cust", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "type", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_05277
train
T1
v2
Schema: schedules (alias: schd)(value, status, level, code) shipments(status, type, value, amount) Task: Find name from schedules where a matching record exists in shipments with the same type. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = schd.type );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "name", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_05278
train
T2
v2
Schema: employees (alias: emp)(date, amount, name, level) regions(salary, type, status, id) Task: Find amount from employees where a matching record exists in regions with the same id. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = emp.id );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "amount", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_05279
train
T1
v1
Schema: customers (alias: cust)(name, level, status, value) invoices(status, amount, id, level) Task: Find salary from customers where type appears in invoices entries with matching status. SQL:
SELECT salary FROM customers AS cust WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.status = cust.status );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "salary", "filter_col": "type", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_05280
train
T1
v1
Schema: sales (alias: sale)(type, status, value, date) products(level, value, name, salary) Task: Find salary from sales where status appears in products entries with matching level. SQL:
SELECT salary FROM sales AS sale WHERE status IN ( SELECT status FROM products AS prod WHERE prod.level = sale.level );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_05281
train
T1
v2
Schema: products (alias: prod)(level, id, amount, salary) shipments(name, code, type, id) Task: Retrieve name from products that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = prod.id );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "name", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_05282
train
T1
v2
Schema: products (alias: prod)(date, amount, status, code) sales(level, name, id, salary) Task: Find value from products where a matching record exists in sales with the same status. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = prod.status );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "value", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_05283
train
T1
v3
Schema: categories (alias: catg)(type, status, level, name) products(salary, code, id, status) Task: Retrieve id from categories with amount above the COUNT(value) of products rows sharing the same code. SQL:
SELECT id FROM categories AS catg WHERE amount > ( SELECT COUNT(value) FROM products AS prod WHERE prod.code = catg.code );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_05284
train
T2
v1
Schema: sales (alias: sale)(amount, salary, level, id) items(status, level, id, salary) Task: Retrieve amount from sales whose type is found in items rows where status matches the outer record. SQL:
SELECT amount FROM sales AS sale WHERE type IN ( SELECT type FROM items AS lne WHERE lne.status = sale.status );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_05285
train
T1
v3
Schema: shipments (alias: shp)(date, level, type, code) managers(date, salary, value, name) Task: Retrieve amount from shipments with value above the AVG(value) of managers rows sharing the same level. SQL:
SELECT amount FROM shipments AS shp WHERE value > ( SELECT AVG(value) FROM managers AS mgr WHERE mgr.level = shp.level );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_05286
train
T2
v2
Schema: transactions (alias: txn)(value, date, name, code) schedules(value, status, type, salary) Task: Find code from transactions where a matching record exists in schedules with the same code. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = txn.code );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "code", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_05287
train
T1
v2
Schema: invoices (alias: inv)(status, value, id, code) employees(salary, level, type, name) Task: Retrieve value from invoices that have at least one corresponding entry in employees sharing the same type. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = inv.type );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "value", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_05288
train
T1
v1
Schema: sales (alias: sale)(type, code, name, date) budgets(status, level, code, value) Task: Retrieve amount from sales whose type is found in budgets rows where id matches the outer record. SQL:
SELECT amount FROM sales AS sale WHERE type IN ( SELECT type FROM budgets AS budg WHERE budg.id = sale.id );
{ "outer_table": "sales", "inner_table": "budgets", "outer_alias": "sale", "inner_alias": "budg", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_05289
train
T1
v2
Schema: items (alias: lne)(date, status, amount, id) sales(code, salary, level, amount) Task: Find name from items where a matching record exists in sales with the same type. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = lne.type );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "name", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_05290
train
T2
v2
Schema: requests (alias: ordr)(code, value, date, salary) staff(salary, amount, value, date) Task: Find code from requests where a matching record exists in staff with the same type. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = ordr.type );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "code", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_05291
train
T2
v3
Schema: accounts (alias: acct)(code, status, name, type) invoices(amount, level, date, type) Task: Find value from accounts where salary exceeds the average value from invoices for the same level. SQL:
SELECT value FROM accounts AS acct WHERE salary > ( SELECT COUNT(value) FROM invoices AS inv WHERE inv.level = acct.level );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_05292
train
T1
v1
Schema: customers (alias: cust)(date, name, code, level) managers(level, amount, date, salary) Task: Select id from customers where type exists in managers for the same level. SQL:
SELECT id FROM customers AS cust WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.level = cust.level );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_05293
train
T1
v3
Schema: invoices (alias: inv)(level, code, name, amount) staff(date, value, name, amount) Task: Find salary from invoices where salary exceeds the average amount from staff for the same code. SQL:
SELECT salary FROM invoices AS inv WHERE salary > ( SELECT AVG(amount) FROM staff AS empl WHERE empl.code = inv.code );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_05294
train
T1
v2
Schema: shipments (alias: shp)(value, type, status, amount) categories(name, level, id, status) Task: Find name from shipments where a matching record exists in categories with the same type. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = shp.type );
{ "outer_table": "shipments", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "catg", "proj_col": "name", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_05295
train
T2
v1
Schema: regions (alias: rgn)(salary, date, code, type) customers(value, type, date, status) Task: Find id from regions where id appears in customers entries with matching id. SQL:
SELECT id FROM regions AS rgn WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.id = rgn.id );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_05296
train
T2
v3
Schema: sales (alias: sale)(value, salary, name, code) warehouses(value, salary, type, name) Task: Retrieve amount from sales with value above the COUNT(value) of warehouses rows sharing the same code. SQL:
SELECT amount FROM sales AS sale WHERE value > ( SELECT COUNT(value) FROM warehouses AS whs WHERE whs.code = sale.code );
{ "outer_table": "sales", "inner_table": "warehouses", "outer_alias": "sale", "inner_alias": "whs", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_05297
train
T1
v1
Schema: orders (alias: ord)(salary, date, id, status) items(id, status, level, amount) Task: Select salary from orders where status exists in items for the same type. SQL:
SELECT salary FROM orders AS ord WHERE status IN ( SELECT status FROM items AS lne WHERE lne.type = ord.type );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_05298
train
T1
v1
Schema: regions (alias: rgn)(date, amount, status, type) transactions(type, amount, name, salary) Task: Find code from regions where level appears in transactions entries with matching status. SQL:
SELECT code FROM regions AS rgn WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.status = rgn.status );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_05299
train
T2