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
v2
Schema: items (alias: lne)(level, salary, date, code) transactions(type, level, salary, id) Task: Retrieve code from items that have at least one corresponding entry in transactions sharing the same level. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = lne.level );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "code", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_01100
train
T2
v3
Schema: budgets (alias: budg)(salary, type, date, code) shipments(type, salary, code, level) Task: Retrieve salary from budgets with value above the SUM(salary) of shipments rows sharing the same level. SQL:
SELECT salary FROM budgets AS budg WHERE value > ( SELECT SUM(salary) FROM shipments AS shp WHERE shp.level = budg.level );
{ "outer_table": "budgets", "inner_table": "shipments", "outer_alias": "budg", "inner_alias": "shp", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_01101
train
T2
v1
Schema: products (alias: prod)(salary, status, level, value) requests(status, type, name, date) Task: Find name from products where type appears in requests entries with matching level. SQL:
SELECT name FROM products AS prod WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.level = prod.level );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_01102
train
T1
v3
Schema: budgets (alias: budg)(code, status, salary, level) invoices(type, code, level, id) Task: Find amount from budgets where salary exceeds the average value from invoices for the same status. SQL:
SELECT amount FROM budgets AS budg WHERE salary > ( SELECT SUM(value) FROM invoices AS inv WHERE inv.status = budg.status );
{ "outer_table": "budgets", "inner_table": "invoices", "outer_alias": "budg", "inner_alias": "inv", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_01103
train
T2
v1
Schema: employees (alias: emp)(salary, id, type, amount) regions(salary, code, value, level) Task: Select salary from employees where code exists in regions for the same id. SQL:
SELECT salary FROM employees AS emp WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.id = emp.id );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_01104
train
T1
v1
Schema: shipments (alias: shp)(name, amount, salary, value) invoices(code, date, salary, level) Task: Find value from shipments where code appears in invoices entries with matching id. SQL:
SELECT value FROM shipments AS shp WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.id = shp.id );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_01105
train
T2
v2
Schema: customers (alias: cust)(type, amount, id, salary) accounts(code, value, level, id) Task: Find salary from customers where a matching record exists in accounts with the same level. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = cust.level );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "salary", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_01106
train
T1
v2
Schema: regions (alias: rgn)(status, value, name, type) services(id, type, value, date) Task: Find value from regions where a matching record exists in services with the same id. SQL:
SELECT value 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": "value", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_01107
train
T2
v3
Schema: orders (alias: ord)(value, amount, name, id) transactions(name, code, date, amount) Task: Find code from orders where value exceeds the average amount from transactions for the same type. SQL:
SELECT code FROM orders AS ord WHERE value > ( SELECT SUM(amount) FROM transactions AS txn WHERE txn.type = ord.type );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_01108
train
T1
v2
Schema: accounts (alias: acct)(level, id, code, value) departments(level, amount, code, type) Task: Retrieve name from accounts that have at least one corresponding entry in departments sharing the same type. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = acct.type );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "name", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_01109
train
T1
v3
Schema: budgets (alias: budg)(level, status, amount, date) items(value, salary, status, id) Task: Retrieve id from budgets with amount above the COUNT(value) of items rows sharing the same type. SQL:
SELECT id FROM budgets AS budg WHERE amount > ( SELECT COUNT(value) FROM items AS lne WHERE lne.type = budg.type );
{ "outer_table": "budgets", "inner_table": "items", "outer_alias": "budg", "inner_alias": "lne", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_01110
train
T2
v3
Schema: sales (alias: sale)(code, id, date, value) requests(date, name, level, code) Task: Retrieve id from sales with amount above the COUNT(salary) of requests rows sharing the same level. SQL:
SELECT id FROM sales AS sale WHERE amount > ( SELECT COUNT(salary) FROM requests AS ordr WHERE ordr.level = sale.level );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_01111
train
T1
v2
Schema: transactions (alias: txn)(salary, value, status, level) staff(type, amount, level, status) Task: Retrieve amount from transactions that have at least one corresponding entry in staff sharing the same level. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = txn.level );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "amount", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_01112
train
T1
v1
Schema: requests (alias: ordr)(type, salary, name, amount) managers(date, level, amount, code) Task: Find amount from requests where type appears in managers entries with matching status. SQL:
SELECT amount FROM requests AS ordr WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.status = ordr.status );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_01113
train
T2
v3
Schema: budgets (alias: budg)(amount, level, id, salary) orders(status, date, value, salary) Task: Find salary from budgets where value exceeds the average amount from orders for the same type. SQL:
SELECT salary FROM budgets AS budg WHERE value > ( SELECT SUM(amount) FROM orders AS ord WHERE ord.type = budg.type );
{ "outer_table": "budgets", "inner_table": "orders", "outer_alias": "budg", "inner_alias": "ord", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_01114
train
T2
v1
Schema: employees (alias: emp)(date, level, status, amount) items(level, name, code, date) Task: Find code from employees where code appears in items entries with matching level. SQL:
SELECT code FROM employees AS emp WHERE code IN ( SELECT code FROM items AS lne WHERE lne.level = emp.level );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "code", "filter_col": "code", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_01115
train
T1
v3
Schema: transactions (alias: txn)(value, date, amount, type) departments(status, date, salary, amount) Task: Retrieve name from transactions with salary above the COUNT(amount) of departments rows sharing the same status. SQL:
SELECT name FROM transactions AS txn WHERE salary > ( SELECT COUNT(amount) FROM departments AS dept WHERE dept.status = txn.status );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_01116
train
T1
v2
Schema: services (alias: srvc)(salary, value, date, name) categories(code, level, type, id) Task: Find name from services where a matching record exists in categories with the same status. SQL:
SELECT name FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = srvc.status );
{ "outer_table": "services", "inner_table": "categories", "outer_alias": "srvc", "inner_alias": "catg", "proj_col": "name", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_01117
train
T2
v2
Schema: schedules (alias: schd)(id, level, date, status) customers(name, amount, value, status) Task: Retrieve name from schedules that have at least one corresponding entry in customers sharing the same type. SQL:
SELECT name 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": "name", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_01118
train
T2
v3
Schema: invoices (alias: inv)(type, salary, code, amount) schedules(date, value, salary, name) Task: Find name from invoices where amount exceeds the average salary from schedules for the same status. SQL:
SELECT name FROM invoices AS inv WHERE amount > ( SELECT MIN(salary) FROM schedules AS schd WHERE schd.status = inv.status );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_01119
train
T1
v1
Schema: accounts (alias: acct)(amount, value, level, id) items(amount, date, id, type) Task: Retrieve value from accounts whose level is found in items rows where type matches the outer record. SQL:
SELECT value FROM accounts AS acct WHERE level IN ( SELECT level FROM items AS lne WHERE lne.type = acct.type );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_01120
train
T1
v2
Schema: staff (alias: empl)(type, id, level, date) shipments(status, type, code, salary) Task: Retrieve code from staff that have at least one corresponding entry in shipments sharing the same level. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = empl.level );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "code", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_01121
train
T2
v2
Schema: items (alias: lne)(code, level, value, amount) invoices(name, type, amount, value) Task: Retrieve salary from items that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = lne.type );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "salary", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_01122
train
T2
v1
Schema: schedules (alias: schd)(name, type, level, code) invoices(id, amount, name, value) Task: Retrieve value from schedules whose code is found in invoices rows where id matches the outer record. SQL:
SELECT value FROM schedules AS schd WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.id = schd.id );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_01123
train
T2
v1
Schema: schedules (alias: schd)(value, amount, salary, id) warehouses(value, status, name, id) Task: Select value from schedules where code exists in warehouses for the same level. SQL:
SELECT value FROM schedules AS schd WHERE code IN ( SELECT code FROM warehouses AS whs WHERE whs.level = schd.level );
{ "outer_table": "schedules", "inner_table": "warehouses", "outer_alias": "schd", "inner_alias": "whs", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_01124
train
T2
v2
Schema: invoices (alias: inv)(id, code, value, salary) regions(type, status, date, level) Task: Find value from invoices where a matching record exists in regions with the same status. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = inv.status );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "value", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_01125
train
T1
v3
Schema: orders (alias: ord)(name, id, level, salary) budgets(type, id, salary, date) Task: Retrieve amount from orders with salary above the COUNT(amount) of budgets rows sharing the same type. SQL:
SELECT amount FROM orders AS ord WHERE salary > ( SELECT COUNT(amount) FROM budgets AS budg WHERE budg.type = ord.type );
{ "outer_table": "orders", "inner_table": "budgets", "outer_alias": "ord", "inner_alias": "budg", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_01126
train
T1
v1
Schema: requests (alias: ordr)(salary, amount, level, id) departments(date, level, code, salary) Task: Retrieve value from requests whose status is found in departments rows where type matches the outer record. SQL:
SELECT value FROM requests AS ordr WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.type = ordr.type );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "value", "filter_col": "status", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_01127
train
T2
v3
Schema: managers (alias: mgr)(salary, date, amount, name) orders(id, type, amount, code) Task: Retrieve value from managers with value above the MAX(amount) of orders rows sharing the same level. SQL:
SELECT value FROM managers AS mgr WHERE value > ( SELECT MAX(amount) FROM orders AS ord WHERE ord.level = mgr.level );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_01128
train
T1
v1
Schema: accounts (alias: acct)(amount, level, name, id) requests(level, date, id, amount) Task: Find name from accounts where type appears in requests entries with matching type. SQL:
SELECT name FROM accounts AS acct WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.type = acct.type );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "name", "filter_col": "type", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_01129
train
T1
v3
Schema: shipments (alias: shp)(id, name, code, amount) products(id, type, date, salary) Task: Find amount from shipments where amount exceeds the average salary from products for the same level. SQL:
SELECT amount FROM shipments AS shp WHERE amount > ( SELECT AVG(salary) FROM products AS prod WHERE prod.level = shp.level );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_01130
train
T2
v1
Schema: shipments (alias: shp)(date, salary, status, amount) invoices(amount, code, status, level) Task: Select id from shipments where level exists in invoices for the same level. SQL:
SELECT id FROM shipments AS shp WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.level = shp.level );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_01131
train
T2
v3
Schema: categories (alias: catg)(amount, value, id, name) requests(value, name, id, amount) Task: Retrieve salary from categories with salary above the AVG(amount) of requests rows sharing the same type. SQL:
SELECT salary FROM categories AS catg WHERE salary > ( SELECT AVG(amount) FROM requests AS ordr WHERE ordr.type = catg.type );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_01132
train
T2
v1
Schema: products (alias: prod)(salary, type, id, date) regions(name, salary, level, status) Task: Find name from products where status appears in regions entries with matching id. SQL:
SELECT name FROM products AS prod WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.id = prod.id );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_01133
train
T1
v2
Schema: services (alias: srvc)(name, id, status, level) departments(level, date, amount, id) Task: Retrieve name from services that have at least one corresponding entry in departments sharing the same code. SQL:
SELECT name FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = srvc.code );
{ "outer_table": "services", "inner_table": "departments", "outer_alias": "srvc", "inner_alias": "dept", "proj_col": "name", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_01134
train
T2
v2
Schema: customers (alias: cust)(type, value, amount, code) invoices(value, name, amount, date) Task: Retrieve name from customers that have at least one corresponding entry in invoices sharing the same status. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = cust.status );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "name", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_01135
train
T1
v2
Schema: orders (alias: ord)(level, code, name, amount) categories(salary, amount, date, status) Task: Find code from orders where a matching record exists in categories with the same status. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = ord.status );
{ "outer_table": "orders", "inner_table": "categories", "outer_alias": "ord", "inner_alias": "catg", "proj_col": "code", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_01136
train
T1
v3
Schema: managers (alias: mgr)(id, level, type, code) products(amount, status, id, date) Task: Retrieve amount from managers with salary above the AVG(amount) of products rows sharing the same level. SQL:
SELECT amount FROM managers AS mgr WHERE salary > ( SELECT AVG(amount) FROM products AS prod WHERE prod.level = mgr.level );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_01137
train
T1
v1
Schema: customers (alias: cust)(status, date, level, salary) invoices(level, code, type, name) Task: Select id from customers where status exists in invoices for the same status. SQL:
SELECT id FROM customers AS cust WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.status = cust.status );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_01138
train
T1
v1
Schema: services (alias: srvc)(value, level, code, amount) schedules(amount, level, value, type) Task: Find amount from services where code appears in schedules entries with matching status. SQL:
SELECT amount FROM services AS srvc WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.status = srvc.status );
{ "outer_table": "services", "inner_table": "schedules", "outer_alias": "srvc", "inner_alias": "schd", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_01139
train
T2
v1
Schema: shipments (alias: shp)(level, code, status, value) accounts(date, id, code, amount) Task: Select value from shipments where status exists in accounts for the same type. SQL:
SELECT value FROM shipments AS shp WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.type = shp.type );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "value", "filter_col": "status", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_01140
train
T2
v3
Schema: warehouses (alias: whs)(status, name, amount, id) requests(value, date, amount, status) Task: Retrieve value from warehouses with salary above the MIN(amount) of requests rows sharing the same level. SQL:
SELECT value FROM warehouses AS whs WHERE salary > ( SELECT MIN(amount) FROM requests AS ordr WHERE ordr.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "requests", "outer_alias": "whs", "inner_alias": "ordr", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_01141
train
T2
v3
Schema: customers (alias: cust)(id, date, code, status) departments(id, level, date, value) Task: Retrieve salary from customers with salary above the COUNT(value) of departments rows sharing the same status. SQL:
SELECT salary FROM customers AS cust WHERE salary > ( SELECT COUNT(value) FROM departments AS dept WHERE dept.status = cust.status );
{ "outer_table": "customers", "inner_table": "departments", "outer_alias": "cust", "inner_alias": "dept", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_01142
train
T1
v2
Schema: requests (alias: ordr)(value, name, amount, date) invoices(date, status, amount, level) Task: Retrieve id from requests that have at least one corresponding entry in invoices sharing the same level. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = ordr.level );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "id", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_01143
train
T2
v2
Schema: invoices (alias: inv)(name, status, amount, value) departments(id, date, name, status) Task: Retrieve id from invoices that have at least one corresponding entry in departments sharing the same level. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = inv.level );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "id", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_01144
train
T1
v3
Schema: customers (alias: cust)(date, id, code, type) managers(code, status, amount, id) Task: Retrieve amount from customers with amount above the MAX(amount) of managers rows sharing the same id. SQL:
SELECT amount FROM customers AS cust WHERE amount > ( SELECT MAX(amount) FROM managers AS mgr WHERE mgr.id = cust.id );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_01145
train
T1
v2
Schema: departments (alias: dept)(id, level, amount, salary) managers(name, type, level, salary) Task: Retrieve amount from departments that have at least one corresponding entry in managers sharing the same id. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = dept.id );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "amount", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_01146
train
T1
v3
Schema: orders (alias: ord)(type, id, salary, code) regions(date, value, type, code) Task: Find salary from orders where salary exceeds the average value from regions for the same type. SQL:
SELECT salary FROM orders AS ord WHERE salary > ( SELECT MIN(value) FROM regions AS rgn WHERE rgn.type = ord.type );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_01147
train
T1
v1
Schema: invoices (alias: inv)(name, amount, id, status) requests(code, level, name, type) Task: Select amount from invoices where type exists in requests for the same type. SQL:
SELECT amount FROM invoices AS inv WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.type = inv.type );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_01148
train
T1
v2
Schema: staff (alias: empl)(code, value, salary, date) shipments(value, date, amount, salary) Task: Find name from staff where a matching record exists in shipments with the same status. SQL:
SELECT name FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = empl.status );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "name", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_01149
train
T2
v2
Schema: transactions (alias: txn)(date, status, code, salary) accounts(level, name, value, type) Task: Retrieve salary from transactions that have at least one corresponding entry in accounts sharing the same status. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = txn.status );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "salary", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_01150
train
T1
v2
Schema: transactions (alias: txn)(value, id, level, name) departments(level, date, name, status) Task: Find amount from transactions where a matching record exists in departments with the same id. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = txn.id );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "amount", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_01151
train
T1
v3
Schema: warehouses (alias: whs)(salary, code, type, id) schedules(value, code, amount, salary) Task: Retrieve id from warehouses with amount above the AVG(salary) of schedules rows sharing the same type. SQL:
SELECT id FROM warehouses AS whs WHERE amount > ( SELECT AVG(salary) FROM schedules AS schd WHERE schd.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "schedules", "outer_alias": "whs", "inner_alias": "schd", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_01152
train
T2
v1
Schema: services (alias: srvc)(status, type, code, name) managers(status, amount, name, level) Task: Retrieve code from services whose level is found in managers rows where code matches the outer record. SQL:
SELECT code FROM services AS srvc WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.code = srvc.code );
{ "outer_table": "services", "inner_table": "managers", "outer_alias": "srvc", "inner_alias": "mgr", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_01153
train
T2
v1
Schema: products (alias: prod)(type, date, level, name) accounts(status, level, amount, value) Task: Find salary from products where status appears in accounts entries with matching type. SQL:
SELECT salary FROM products AS prod WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.type = prod.type );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_01154
train
T1
v3
Schema: items (alias: lne)(level, status, id, type) orders(code, date, level, id) Task: Find value from items where amount exceeds the average value from orders for the same type. SQL:
SELECT value FROM items AS lne WHERE amount > ( SELECT SUM(value) FROM orders AS ord WHERE ord.type = lne.type );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_01155
train
T2
v1
Schema: regions (alias: rgn)(level, value, salary, status) schedules(id, status, type, salary) Task: Retrieve id from regions whose status is found in schedules rows where id matches the outer record. SQL:
SELECT id FROM regions AS rgn WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.id = rgn.id );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_01156
train
T2
v3
Schema: customers (alias: cust)(date, status, name, code) products(status, value, amount, name) Task: Find id from customers where salary exceeds the average amount from products for the same type. SQL:
SELECT id FROM customers AS cust WHERE salary > ( SELECT MAX(amount) FROM products AS prod WHERE prod.type = cust.type );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_01157
train
T1
v1
Schema: warehouses (alias: whs)(salary, status, id, value) requests(date, name, level, value) Task: Find salary from warehouses where type appears in requests entries with matching code. SQL:
SELECT salary 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": "salary", "filter_col": "type", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_01158
train
T2
v3
Schema: warehouses (alias: whs)(date, value, salary, amount) schedules(code, id, value, level) Task: Retrieve name from warehouses with value above the SUM(salary) of schedules rows sharing the same level. SQL:
SELECT name FROM warehouses AS whs WHERE value > ( SELECT SUM(salary) FROM schedules AS schd WHERE schd.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "schedules", "outer_alias": "whs", "inner_alias": "schd", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_01159
train
T2
v3
Schema: budgets (alias: budg)(id, type, name, code) schedules(code, date, salary, value) Task: Find code from budgets where value exceeds the average amount from schedules for the same type. SQL:
SELECT code FROM budgets AS budg WHERE value > ( SELECT SUM(amount) FROM schedules AS schd WHERE schd.type = budg.type );
{ "outer_table": "budgets", "inner_table": "schedules", "outer_alias": "budg", "inner_alias": "schd", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_01160
train
T2
v2
Schema: shipments (alias: shp)(date, salary, level, type) transactions(type, amount, status, level) Task: Retrieve id from shipments that have at least one corresponding entry in transactions sharing the same code. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = shp.code );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "id", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_01161
train
T2
v1
Schema: budgets (alias: budg)(date, status, id, code) customers(id, date, code, level) Task: Retrieve name from budgets whose id is found in customers rows where code matches the outer record. SQL:
SELECT name FROM budgets AS budg WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.code = budg.code );
{ "outer_table": "budgets", "inner_table": "customers", "outer_alias": "budg", "inner_alias": "cust", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_01162
train
T2
v2
Schema: regions (alias: rgn)(salary, date, id, name) shipments(salary, status, date, id) Task: Find salary from regions where a matching record exists in shipments with the same code. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = rgn.code );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "salary", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_01163
train
T2
v3
Schema: regions (alias: rgn)(status, value, id, code) customers(status, level, type, id) Task: Find salary from regions where salary exceeds the average amount from customers for the same type. SQL:
SELECT salary FROM regions AS rgn WHERE salary > ( SELECT MAX(amount) FROM customers AS cust WHERE cust.type = rgn.type );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_01164
train
T2
v1
Schema: items (alias: lne)(id, level, salary, value) sales(type, date, level, amount) Task: Find value from items where code appears in sales entries with matching type. SQL:
SELECT value FROM items AS lne WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.type = lne.type );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_01165
train
T2
v3
Schema: regions (alias: rgn)(value, code, status, level) customers(value, name, amount, code) Task: Find value from regions where value exceeds the average value from customers for the same type. SQL:
SELECT value FROM regions AS rgn WHERE value > ( SELECT MAX(value) FROM customers AS cust WHERE cust.type = rgn.type );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_01166
train
T2
v1
Schema: items (alias: lne)(value, amount, type, code) employees(value, name, type, code) Task: Retrieve id from items whose level is found in employees rows where code matches the outer record. SQL:
SELECT id FROM items AS lne WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.code = lne.code );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_01167
train
T2
v2
Schema: sales (alias: sale)(type, value, status, code) invoices(date, amount, level, name) Task: Find code from sales where a matching record exists in invoices with the same id. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = sale.id );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "code", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_01168
train
T1
v3
Schema: budgets (alias: budg)(level, date, name, amount) departments(name, type, value, id) Task: Find code from budgets where salary exceeds the average salary from departments for the same status. SQL:
SELECT code FROM budgets AS budg WHERE salary > ( SELECT MAX(salary) FROM departments AS dept WHERE dept.status = budg.status );
{ "outer_table": "budgets", "inner_table": "departments", "outer_alias": "budg", "inner_alias": "dept", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_01169
train
T2
v1
Schema: categories (alias: catg)(name, status, id, code) warehouses(code, type, date, level) Task: Find code from categories where level appears in warehouses entries with matching id. SQL:
SELECT code FROM categories AS catg WHERE level IN ( SELECT level FROM warehouses AS whs WHERE whs.id = catg.id );
{ "outer_table": "categories", "inner_table": "warehouses", "outer_alias": "catg", "inner_alias": "whs", "proj_col": "code", "filter_col": "level", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_01170
train
T2
v1
Schema: departments (alias: dept)(status, type, value, date) regions(type, name, salary, code) Task: Retrieve salary from departments whose code is found in regions rows where status matches the outer record. SQL:
SELECT salary FROM departments AS dept WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.status = dept.status );
{ "outer_table": "departments", "inner_table": "regions", "outer_alias": "dept", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_01171
train
T1
v3
Schema: transactions (alias: txn)(level, type, amount, status) staff(code, level, status, amount) Task: Retrieve salary from transactions with value above the MAX(value) of staff rows sharing the same status. SQL:
SELECT salary FROM transactions AS txn WHERE value > ( SELECT MAX(value) FROM staff AS empl WHERE empl.status = txn.status );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_01172
train
T1
v3
Schema: accounts (alias: acct)(code, type, amount, salary) schedules(type, id, amount, name) Task: Retrieve name from accounts with value above the COUNT(amount) of schedules rows sharing the same code. SQL:
SELECT name FROM accounts AS acct WHERE value > ( SELECT COUNT(amount) FROM schedules AS schd WHERE schd.code = acct.code );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_01173
train
T1
v3
Schema: warehouses (alias: whs)(level, type, date, id) managers(level, id, salary, code) Task: Find id from warehouses where salary exceeds the average amount from managers for the same id. SQL:
SELECT id FROM warehouses AS whs WHERE salary > ( SELECT MAX(amount) FROM managers AS mgr WHERE mgr.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "managers", "outer_alias": "whs", "inner_alias": "mgr", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_01174
train
T2
v1
Schema: shipments (alias: shp)(value, level, salary, status) managers(name, type, code, level) Task: Find code from shipments where type appears in managers entries with matching level. SQL:
SELECT code FROM shipments AS shp WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.level = shp.level );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "code", "filter_col": "type", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_01175
train
T2
v1
Schema: transactions (alias: txn)(status, id, date, amount) sales(id, level, value, date) Task: Retrieve amount from transactions whose code is found in sales rows where type matches the outer record. SQL:
SELECT amount FROM transactions AS txn WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.type = txn.type );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_01176
train
T1
v2
Schema: employees (alias: emp)(id, date, salary, value) requests(level, status, value, salary) Task: Retrieve value from employees that have at least one corresponding entry in requests sharing the same status. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = emp.status );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "value", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_01177
train
T1
v1
Schema: managers (alias: mgr)(amount, type, status, name) categories(amount, name, date, id) Task: Retrieve id from managers whose level is found in categories rows where status matches the outer record. SQL:
SELECT id FROM managers AS mgr WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.status = mgr.status );
{ "outer_table": "managers", "inner_table": "categories", "outer_alias": "mgr", "inner_alias": "catg", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_01178
train
T1
v1
Schema: schedules (alias: schd)(code, value, status, id) categories(salary, amount, status, name) Task: Find value from schedules where type appears in categories entries with matching id. SQL:
SELECT value FROM schedules AS schd WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.id = schd.id );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "value", "filter_col": "type", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_01179
train
T2
v2
Schema: shipments (alias: shp)(name, code, id, value) accounts(level, name, code, id) Task: Retrieve salary from shipments that have at least one corresponding entry in accounts sharing the same id. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = shp.id );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "salary", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_01180
train
T2
v2
Schema: regions (alias: rgn)(value, salary, date, name) items(date, type, code, name) Task: Find id from regions where a matching record exists in items with the same level. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.level = rgn.level );
{ "outer_table": "regions", "inner_table": "items", "outer_alias": "rgn", "inner_alias": "lne", "proj_col": "id", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_01181
train
T2
v2
Schema: warehouses (alias: whs)(name, date, amount, status) transactions(date, level, status, id) Task: Retrieve code from warehouses that have at least one corresponding entry in transactions sharing the same type. SQL:
SELECT code FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "transactions", "outer_alias": "whs", "inner_alias": "txn", "proj_col": "code", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_01182
train
T2
v1
Schema: requests (alias: ordr)(status, name, type, salary) invoices(date, code, type, salary) Task: Select name from requests where status exists in invoices for the same type. SQL:
SELECT name FROM requests AS ordr WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.type = ordr.type );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_01183
train
T2
v2
Schema: regions (alias: rgn)(id, type, level, status) customers(id, code, value, level) Task: Retrieve value from regions that have at least one corresponding entry in customers sharing the same status. SQL:
SELECT value FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = rgn.status );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "value", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_01184
train
T2
v2
Schema: requests (alias: ordr)(id, date, amount, code) regions(id, code, name, level) Task: Retrieve name from requests that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = ordr.level );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "name", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_01185
train
T2
v1
Schema: products (alias: prod)(amount, status, level, date) invoices(id, salary, level, code) Task: Select value from products where type exists in invoices for the same type. SQL:
SELECT value FROM products AS prod WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.type = prod.type );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "value", "filter_col": "type", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_01186
train
T1
v2
Schema: budgets (alias: budg)(amount, date, id, value) employees(type, code, salary, level) Task: Retrieve id from budgets that have at least one corresponding entry in employees sharing the same level. SQL:
SELECT id FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = budg.level );
{ "outer_table": "budgets", "inner_table": "employees", "outer_alias": "budg", "inner_alias": "emp", "proj_col": "id", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_01187
train
T2
v3
Schema: transactions (alias: txn)(type, value, status, name) products(level, status, id, date) Task: Find salary from transactions where value exceeds the average salary from products for the same type. SQL:
SELECT salary FROM transactions AS txn WHERE value > ( SELECT MIN(salary) FROM products AS prod WHERE prod.type = txn.type );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_01188
train
T1
v2
Schema: products (alias: prod)(date, level, status, id) services(amount, id, level, name) Task: Find salary from products where a matching record exists in services with the same type. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.type = prod.type );
{ "outer_table": "products", "inner_table": "services", "outer_alias": "prod", "inner_alias": "srvc", "proj_col": "salary", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_01189
train
T1
v1
Schema: invoices (alias: inv)(date, level, salary, code) departments(id, status, value, name) Task: Find id from invoices where level appears in departments entries with matching code. SQL:
SELECT id FROM invoices AS inv WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.code = inv.code );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_01190
train
T1
v3
Schema: employees (alias: emp)(id, type, salary, value) shipments(status, salary, level, id) Task: Retrieve code from employees with salary above the AVG(value) of shipments rows sharing the same id. SQL:
SELECT code FROM employees AS emp WHERE salary > ( SELECT AVG(value) FROM shipments AS shp WHERE shp.id = emp.id );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_01191
train
T1
v2
Schema: transactions (alias: txn)(date, id, type, amount) sales(salary, code, name, type) Task: Retrieve amount from transactions that have at least one corresponding entry in sales sharing the same id. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = txn.id );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "amount", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_01192
train
T1
v2
Schema: items (alias: lne)(code, level, id, salary) invoices(level, value, id, type) Task: Find value from items where a matching record exists in invoices with the same id. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = lne.id );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "value", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_01193
train
T2
v3
Schema: sales (alias: sale)(amount, date, salary, status) warehouses(status, level, amount, salary) Task: Find value from sales where value exceeds the average value from warehouses for the same code. SQL:
SELECT value 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": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_01194
train
T1
v3
Schema: shipments (alias: shp)(date, name, amount, id) staff(name, code, level, salary) Task: Find salary from shipments where salary exceeds the average amount from staff for the same level. SQL:
SELECT salary FROM shipments AS shp WHERE salary > ( SELECT SUM(amount) FROM staff AS empl WHERE empl.level = shp.level );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_01195
train
T2
v2
Schema: products (alias: prod)(id, name, type, salary) warehouses(name, level, salary, code) Task: Find code from products where a matching record exists in warehouses with the same code. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.code = prod.code );
{ "outer_table": "products", "inner_table": "warehouses", "outer_alias": "prod", "inner_alias": "whs", "proj_col": "code", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_01196
train
T1
v1
Schema: employees (alias: emp)(salary, code, status, name) products(name, level, type, date) Task: Find value from employees where level appears in products entries with matching type. SQL:
SELECT value FROM employees AS emp WHERE level IN ( SELECT level FROM products AS prod WHERE prod.type = emp.type );
{ "outer_table": "employees", "inner_table": "products", "outer_alias": "emp", "inner_alias": "prod", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_01197
train
T1
v1
Schema: orders (alias: ord)(amount, name, date, code) staff(value, name, status, type) Task: Find code from orders where level appears in staff entries with matching type. SQL:
SELECT code FROM orders AS ord WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.type = ord.type );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_01198
train
T1
v1
Schema: transactions (alias: txn)(amount, level, status, id) items(id, name, level, status) Task: Find salary from transactions where code appears in items entries with matching status. SQL:
SELECT salary FROM transactions AS txn WHERE code IN ( SELECT code FROM items AS lne WHERE lne.status = txn.status );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_01199
train
T1