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: warehouses (alias: whs)(id, code, level, type) regions(status, code, id, amount) Task: Find id from warehouses where amount exceeds the average salary from regions for the same code. SQL:
SELECT id FROM warehouses AS whs WHERE amount > ( SELECT MAX(salary) FROM regions AS rgn WHERE rgn.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "regions", "outer_alias": "whs", "inner_alias": "rgn", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_06100
train
T2
v3
Schema: staff (alias: empl)(value, name, salary, status) sales(value, level, id, code) Task: Retrieve code from staff with amount above the AVG(salary) of sales rows sharing the same level. SQL:
SELECT code FROM staff AS empl WHERE amount > ( SELECT AVG(salary) FROM sales AS sale WHERE sale.level = empl.level );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_06101
train
T2
v1
Schema: departments (alias: dept)(value, amount, level, date) orders(status, amount, id, value) Task: Select salary from departments where type exists in orders for the same status. SQL:
SELECT salary FROM departments AS dept WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.status = dept.status );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "salary", "filter_col": "type", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_06102
train
T1
v1
Schema: shipments (alias: shp)(type, code, amount, value) orders(value, name, amount, type) Task: Select name from shipments where status exists in orders for the same code. SQL:
SELECT name FROM shipments AS shp WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.code = shp.code );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_06103
train
T2
v2
Schema: employees (alias: emp)(status, code, value, name) shipments(level, value, amount, salary) Task: Find code from employees where a matching record exists in shipments with the same code. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = emp.code );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "code", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_06104
train
T1
v3
Schema: schedules (alias: schd)(date, status, id, type) requests(id, status, type, value) Task: Find id from schedules where value exceeds the average amount from requests for the same level. SQL:
SELECT id FROM schedules AS schd WHERE value > ( SELECT COUNT(amount) FROM requests AS ordr WHERE ordr.level = schd.level );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_06105
train
T2
v2
Schema: departments (alias: dept)(name, amount, type, status) invoices(amount, name, date, status) Task: Retrieve salary from departments that have at least one corresponding entry in invoices sharing the same status. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = dept.status );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "salary", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_06106
train
T1
v2
Schema: customers (alias: cust)(code, date, value, id) managers(status, salary, amount, code) Task: Find salary from customers where a matching record exists in managers with the same level. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = cust.level );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "salary", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_06107
train
T1
v2
Schema: budgets (alias: budg)(id, salary, type, date) departments(level, type, date, id) Task: Retrieve id from budgets that have at least one corresponding entry in departments sharing the same type. SQL:
SELECT id FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = budg.type );
{ "outer_table": "budgets", "inner_table": "departments", "outer_alias": "budg", "inner_alias": "dept", "proj_col": "id", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_06108
train
T2
v3
Schema: categories (alias: catg)(salary, code, id, level) shipments(date, salary, value, status) Task: Find value from categories where value exceeds the average amount from shipments for the same level. SQL:
SELECT value FROM categories AS catg WHERE value > ( SELECT MIN(amount) FROM shipments AS shp WHERE shp.level = catg.level );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "catg", "inner_alias": "shp", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_06109
train
T2
v2
Schema: invoices (alias: inv)(level, date, id, name) products(status, salary, id, type) Task: Find code from invoices where a matching record exists in products with the same type. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = inv.type );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_06110
train
T1
v2
Schema: products (alias: prod)(amount, salary, code, level) staff(value, status, name, type) Task: Retrieve amount from products that have at least one corresponding entry in staff sharing the same code. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = prod.code );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "amount", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_06111
train
T1
v1
Schema: transactions (alias: txn)(name, type, value, code) customers(salary, type, name, status) Task: Retrieve name from transactions whose level is found in customers rows where code matches the outer record. SQL:
SELECT name FROM transactions AS txn WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.code = txn.code );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_06112
train
T1
v3
Schema: transactions (alias: txn)(level, salary, status, type) items(amount, level, code, date) Task: Retrieve amount from transactions with salary above the MIN(amount) of items rows sharing the same id. SQL:
SELECT amount FROM transactions AS txn WHERE salary > ( SELECT MIN(amount) FROM items AS lne WHERE lne.id = txn.id );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_06113
train
T1
v3
Schema: shipments (alias: shp)(id, level, name, amount) managers(level, date, amount, salary) Task: Retrieve amount from shipments with value above the SUM(value) of managers rows sharing the same type. SQL:
SELECT amount FROM shipments AS shp WHERE value > ( SELECT SUM(value) FROM managers AS mgr WHERE mgr.type = shp.type );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_06114
train
T2
v2
Schema: shipments (alias: shp)(level, code, name, id) products(level, value, date, amount) Task: Retrieve id from shipments that have at least one corresponding entry in products sharing the same code. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = shp.code );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "id", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_06115
train
T2
v1
Schema: shipments (alias: shp)(salary, date, status, value) invoices(salary, status, level, type) Task: Find name from shipments where type appears in invoices entries with matching id. SQL:
SELECT name FROM shipments AS shp WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.id = shp.id );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "name", "filter_col": "type", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_06116
train
T2
v2
Schema: managers (alias: mgr)(id, level, type, amount) employees(level, id, value, amount) Task: Retrieve value from managers that have at least one corresponding entry in employees sharing the same code. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = mgr.code );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "value", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_06117
train
T1
v1
Schema: sales (alias: sale)(type, status, code, id) warehouses(amount, type, code, level) Task: Retrieve amount from sales whose code is found in warehouses rows where code matches the outer record. SQL:
SELECT amount FROM sales AS sale WHERE code IN ( SELECT code 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": "code", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_06118
train
T1
v2
Schema: requests (alias: ordr)(status, name, level, id) departments(level, date, name, id) Task: Retrieve amount from requests that have at least one corresponding entry in departments sharing the same type. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = ordr.type );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "amount", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_06119
train
T2
v3
Schema: sales (alias: sale)(amount, status, date, id) managers(salary, date, id, status) Task: Retrieve amount from sales with salary above the SUM(salary) of managers rows sharing the same id. SQL:
SELECT amount FROM sales AS sale WHERE salary > ( SELECT SUM(salary) FROM managers AS mgr WHERE mgr.id = sale.id );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_06120
train
T1
v3
Schema: invoices (alias: inv)(status, salary, date, amount) accounts(code, amount, date, value) Task: Find code from invoices where amount exceeds the average salary from accounts for the same level. SQL:
SELECT code FROM invoices AS inv WHERE amount > ( SELECT AVG(salary) FROM accounts AS acct WHERE acct.level = inv.level );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_06121
train
T1
v1
Schema: employees (alias: emp)(date, value, id, amount) accounts(level, salary, date, status) Task: Select amount from employees where level exists in accounts for the same code. SQL:
SELECT amount FROM employees AS emp WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.code = emp.code );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_06122
train
T1
v3
Schema: budgets (alias: budg)(amount, id, salary, name) staff(status, date, id, salary) Task: Retrieve value from budgets with amount above the SUM(amount) of staff rows sharing the same id. SQL:
SELECT value FROM budgets AS budg WHERE amount > ( SELECT SUM(amount) FROM staff AS empl WHERE empl.id = budg.id );
{ "outer_table": "budgets", "inner_table": "staff", "outer_alias": "budg", "inner_alias": "empl", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_06123
train
T2
v1
Schema: transactions (alias: txn)(salary, status, type, id) requests(status, value, id, amount) Task: Find amount from transactions where level appears in requests entries with matching status. SQL:
SELECT amount FROM transactions AS txn WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.status = txn.status );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_06124
train
T1
v2
Schema: products (alias: prod)(type, level, value, amount) regions(amount, code, type, id) Task: Retrieve amount from products that have at least one corresponding entry in regions sharing the same code. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = prod.code );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "amount", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_06125
train
T1
v1
Schema: customers (alias: cust)(type, name, salary, id) transactions(salary, value, code, type) Task: Find id from customers where level appears in transactions entries with matching id. SQL:
SELECT id FROM customers AS cust WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.id = cust.id );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_06126
train
T1
v1
Schema: departments (alias: dept)(amount, type, level, date) products(name, id, amount, code) Task: Retrieve code from departments whose status is found in products rows where type matches the outer record. SQL:
SELECT code FROM departments AS dept WHERE status IN ( SELECT status FROM products AS prod WHERE prod.type = dept.type );
{ "outer_table": "departments", "inner_table": "products", "outer_alias": "dept", "inner_alias": "prod", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_06127
train
T1
v3
Schema: services (alias: srvc)(level, date, amount, salary) categories(value, amount, status, id) Task: Find code from services where value exceeds the average salary from categories for the same level. SQL:
SELECT code FROM services AS srvc WHERE value > ( SELECT AVG(salary) FROM categories AS catg WHERE catg.level = srvc.level );
{ "outer_table": "services", "inner_table": "categories", "outer_alias": "srvc", "inner_alias": "catg", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_06128
train
T2
v3
Schema: shipments (alias: shp)(name, date, status, value) customers(date, level, name, amount) Task: Retrieve value from shipments with amount above the MIN(salary) of customers rows sharing the same id. SQL:
SELECT value FROM shipments AS shp WHERE amount > ( SELECT MIN(salary) FROM customers AS cust WHERE cust.id = shp.id );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_06129
train
T2
v3
Schema: orders (alias: ord)(type, salary, level, date) products(code, id, status, date) Task: Find name from orders where value exceeds the average value from products for the same id. SQL:
SELECT name FROM orders AS ord WHERE value > ( SELECT MAX(value) FROM products AS prod WHERE prod.id = ord.id );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_06130
train
T1
v1
Schema: services (alias: srvc)(level, date, id, type) transactions(id, type, amount, date) Task: Find salary from services where id appears in transactions entries with matching id. SQL:
SELECT salary FROM services AS srvc WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.id = srvc.id );
{ "outer_table": "services", "inner_table": "transactions", "outer_alias": "srvc", "inner_alias": "txn", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_06131
train
T2
v3
Schema: budgets (alias: budg)(level, value, salary, date) regions(name, code, amount, type) Task: Find salary from budgets where amount exceeds the average amount from regions for the same type. SQL:
SELECT salary FROM budgets AS budg WHERE amount > ( SELECT AVG(amount) FROM regions AS rgn WHERE rgn.type = budg.type );
{ "outer_table": "budgets", "inner_table": "regions", "outer_alias": "budg", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_06132
train
T2
v2
Schema: categories (alias: catg)(level, status, code, amount) orders(level, salary, code, id) Task: Retrieve amount from categories that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = catg.level );
{ "outer_table": "categories", "inner_table": "orders", "outer_alias": "catg", "inner_alias": "ord", "proj_col": "amount", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_06133
train
T2
v1
Schema: schedules (alias: schd)(amount, status, date, type) categories(id, date, level, type) Task: Find id from schedules where status appears in categories entries with matching code. SQL:
SELECT id FROM schedules AS schd WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.code = schd.code );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_06134
train
T2
v1
Schema: accounts (alias: acct)(type, date, id, value) requests(name, code, level, type) Task: Find name from accounts where id appears in requests entries with matching level. SQL:
SELECT name FROM accounts AS acct WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.level = acct.level );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "name", "filter_col": "id", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_06135
train
T1
v2
Schema: managers (alias: mgr)(code, date, id, salary) budgets(type, code, value, date) Task: Retrieve id from managers that have at least one corresponding entry in budgets sharing the same status. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.status = mgr.status );
{ "outer_table": "managers", "inner_table": "budgets", "outer_alias": "mgr", "inner_alias": "budg", "proj_col": "id", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_06136
train
T1
v2
Schema: budgets (alias: budg)(amount, status, id, type) categories(amount, type, date, level) Task: Find code from budgets where a matching record exists in categories with the same id. SQL:
SELECT code FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = budg.id );
{ "outer_table": "budgets", "inner_table": "categories", "outer_alias": "budg", "inner_alias": "catg", "proj_col": "code", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_06137
train
T2
v3
Schema: managers (alias: mgr)(value, code, name, id) staff(amount, name, salary, id) Task: Retrieve id from managers with salary above the AVG(amount) of staff rows sharing the same status. SQL:
SELECT id FROM managers AS mgr WHERE salary > ( SELECT AVG(amount) FROM staff AS empl WHERE empl.status = mgr.status );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_06138
train
T1
v3
Schema: accounts (alias: acct)(salary, date, level, amount) employees(salary, value, date, code) Task: Retrieve salary from accounts with amount above the MAX(amount) of employees rows sharing the same status. SQL:
SELECT salary FROM accounts AS acct WHERE amount > ( SELECT MAX(amount) FROM employees AS emp WHERE emp.status = acct.status );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_06139
train
T1
v1
Schema: orders (alias: ord)(type, salary, id, amount) departments(id, code, name, salary) Task: Retrieve name from orders whose type is found in departments rows where level matches the outer record. SQL:
SELECT name FROM orders AS ord WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.level = ord.level );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_06140
train
T1
v1
Schema: orders (alias: ord)(salary, code, id, type) products(level, code, id, salary) Task: Retrieve amount from orders whose status is found in products rows where id matches the outer record. SQL:
SELECT amount FROM orders AS ord WHERE status IN ( SELECT status FROM products AS prod WHERE prod.id = ord.id );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_06141
train
T1
v2
Schema: schedules (alias: schd)(value, level, type, salary) departments(amount, name, code, status) Task: Retrieve name from schedules that have at least one corresponding entry in departments sharing the same id. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = schd.id );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "name", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_06142
train
T2
v3
Schema: orders (alias: ord)(name, level, salary, code) managers(name, status, amount, level) Task: Find value from orders where amount exceeds the average amount from managers for the same level. SQL:
SELECT value FROM orders AS ord WHERE amount > ( SELECT MAX(amount) FROM managers AS mgr WHERE mgr.level = ord.level );
{ "outer_table": "orders", "inner_table": "managers", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_06143
train
T1
v1
Schema: transactions (alias: txn)(code, salary, type, date) products(id, value, amount, name) Task: Retrieve value from transactions whose level is found in products rows where id matches the outer record. SQL:
SELECT value FROM transactions AS txn WHERE level IN ( SELECT level FROM products AS prod WHERE prod.id = txn.id );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "value", "filter_col": "level", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_06144
train
T1
v1
Schema: invoices (alias: inv)(amount, salary, code, status) schedules(name, code, amount, date) Task: Find amount from invoices where status appears in schedules entries with matching level. SQL:
SELECT amount FROM invoices AS inv WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.level = inv.level );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_06145
train
T1
v3
Schema: employees (alias: emp)(code, id, value, amount) items(level, id, salary, type) Task: Find value from employees where amount exceeds the average value from items for the same code. SQL:
SELECT value FROM employees AS emp WHERE amount > ( SELECT COUNT(value) FROM items AS lne WHERE lne.code = emp.code );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_06146
train
T1
v2
Schema: products (alias: prod)(salary, status, type, level) schedules(salary, name, value, type) Task: Retrieve value from products that have at least one corresponding entry in schedules sharing the same level. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = prod.level );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "value", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_06147
train
T1
v3
Schema: departments (alias: dept)(name, salary, value, amount) products(status, salary, id, type) Task: Retrieve amount from departments with amount above the MIN(value) of products rows sharing the same status. SQL:
SELECT amount FROM departments AS dept WHERE amount > ( SELECT MIN(value) FROM products AS prod WHERE prod.status = dept.status );
{ "outer_table": "departments", "inner_table": "products", "outer_alias": "dept", "inner_alias": "prod", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_06148
train
T1
v2
Schema: schedules (alias: schd)(salary, name, level, id) invoices(level, name, salary, value) Task: Retrieve salary from schedules that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = schd.type );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "salary", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_06149
train
T2
v2
Schema: accounts (alias: acct)(type, value, level, salary) categories(code, amount, date, value) Task: Retrieve amount from accounts that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = acct.code );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "amount", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_06150
train
T1
v3
Schema: products (alias: prod)(level, name, type, date) warehouses(level, type, name, value) Task: Retrieve value from products with amount above the MAX(amount) of warehouses rows sharing the same status. SQL:
SELECT value FROM products AS prod WHERE amount > ( SELECT MAX(amount) FROM warehouses AS whs WHERE whs.status = prod.status );
{ "outer_table": "products", "inner_table": "warehouses", "outer_alias": "prod", "inner_alias": "whs", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_06151
train
T1
v2
Schema: orders (alias: ord)(salary, amount, status, date) transactions(status, amount, name, type) Task: Find value from orders where a matching record exists in transactions with the same type. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = ord.type );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "value", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_06152
train
T1
v1
Schema: items (alias: lne)(type, value, name, salary) accounts(level, name, salary, date) Task: Select name from items where type exists in accounts for the same id. SQL:
SELECT name FROM items AS lne WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.id = lne.id );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "name", "filter_col": "type", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_06153
train
T2
v1
Schema: transactions (alias: txn)(value, status, salary, date) requests(level, status, name, amount) Task: Select code from transactions where status exists in requests for the same type. SQL:
SELECT code FROM transactions AS txn WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.type = txn.type );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_06154
train
T1
v3
Schema: invoices (alias: inv)(value, type, salary, amount) services(id, code, level, date) Task: Find id from invoices where value exceeds the average amount from services for the same code. SQL:
SELECT id FROM invoices AS inv WHERE value > ( SELECT MIN(amount) FROM services AS srvc WHERE srvc.code = inv.code );
{ "outer_table": "invoices", "inner_table": "services", "outer_alias": "inv", "inner_alias": "srvc", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_06155
train
T1
v2
Schema: staff (alias: empl)(date, salary, type, id) transactions(id, name, salary, level) Task: Find salary from staff where a matching record exists in transactions with the same type. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = empl.type );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "salary", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_06156
train
T2
v1
Schema: items (alias: lne)(status, code, name, id) requests(salary, id, value, name) Task: Select id from items where level exists in requests for the same code. SQL:
SELECT id FROM items AS lne WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.code = lne.code );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_06157
train
T2
v1
Schema: regions (alias: rgn)(date, salary, code, value) invoices(value, level, amount, salary) Task: Retrieve code from regions whose id is found in invoices rows where type matches the outer record. SQL:
SELECT code FROM regions AS rgn WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.type = rgn.type );
{ "outer_table": "regions", "inner_table": "invoices", "outer_alias": "rgn", "inner_alias": "inv", "proj_col": "code", "filter_col": "id", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_06158
train
T2
v1
Schema: schedules (alias: schd)(name, amount, level, type) invoices(name, date, type, value) Task: Retrieve amount from schedules whose type is found in invoices rows where type matches the outer record. SQL:
SELECT amount FROM schedules AS schd WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.type = schd.type );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_06159
train
T2
v1
Schema: products (alias: prod)(date, value, amount, id) budgets(code, id, type, value) Task: Find name from products where status appears in budgets entries with matching type. SQL:
SELECT name FROM products AS prod WHERE status IN ( SELECT status FROM budgets AS budg WHERE budg.type = prod.type );
{ "outer_table": "products", "inner_table": "budgets", "outer_alias": "prod", "inner_alias": "budg", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_06160
train
T1
v2
Schema: shipments (alias: shp)(type, salary, name, code) services(salary, type, code, name) Task: Retrieve id from shipments that have at least one corresponding entry in services sharing the same code. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.code = shp.code );
{ "outer_table": "shipments", "inner_table": "services", "outer_alias": "shp", "inner_alias": "srvc", "proj_col": "id", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_06161
train
T2
v1
Schema: customers (alias: cust)(level, id, salary, status) invoices(level, status, date, code) Task: Retrieve salary from customers whose status is found in invoices rows where id matches the outer record. SQL:
SELECT salary FROM customers AS cust WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.id = cust.id );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "salary", "filter_col": "status", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_06162
train
T1
v1
Schema: staff (alias: empl)(name, type, amount, code) shipments(id, name, date, type) Task: Retrieve amount from staff whose id is found in shipments rows where id matches the outer record. SQL:
SELECT amount FROM staff AS empl WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.id = empl.id );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "amount", "filter_col": "id", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_06163
train
T2
v1
Schema: schedules (alias: schd)(date, id, type, status) shipments(name, value, amount, status) Task: Select id from schedules where code exists in shipments for the same type. SQL:
SELECT id FROM schedules AS schd WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.type = schd.type );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "id", "filter_col": "code", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_06164
train
T2
v1
Schema: warehouses (alias: whs)(code, status, date, level) products(amount, level, salary, value) Task: Find id from warehouses where code appears in products entries with matching level. SQL:
SELECT id FROM warehouses AS whs WHERE code IN ( SELECT code FROM products AS prod WHERE prod.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "products", "outer_alias": "whs", "inner_alias": "prod", "proj_col": "id", "filter_col": "code", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_06165
train
T2
v3
Schema: items (alias: lne)(name, type, salary, code) invoices(amount, level, date, salary) Task: Retrieve amount from items with salary above the MIN(amount) of invoices rows sharing the same id. SQL:
SELECT amount FROM items AS lne WHERE salary > ( SELECT MIN(amount) FROM invoices AS inv WHERE inv.id = lne.id );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_06166
train
T2
v1
Schema: items (alias: lne)(status, type, id, level) managers(code, value, date, salary) Task: Find value from items where code appears in managers entries with matching status. SQL:
SELECT value FROM items AS lne WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.status = lne.status );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_06167
train
T2
v1
Schema: regions (alias: rgn)(name, type, amount, value) warehouses(id, level, date, value) Task: Select id from regions where type exists in warehouses for the same id. SQL:
SELECT id FROM regions AS rgn WHERE type IN ( SELECT type FROM warehouses AS whs WHERE whs.id = rgn.id );
{ "outer_table": "regions", "inner_table": "warehouses", "outer_alias": "rgn", "inner_alias": "whs", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_06168
train
T2
v3
Schema: managers (alias: mgr)(id, type, name, status) products(salary, status, date, name) Task: Find value from managers where amount exceeds the average salary from products for the same type. SQL:
SELECT value FROM managers AS mgr WHERE amount > ( SELECT SUM(salary) FROM products AS prod WHERE prod.type = mgr.type );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_06169
train
T1
v2
Schema: transactions (alias: txn)(value, id, status, name) items(value, amount, type, date) Task: Find name from transactions where a matching record exists in items with the same status. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = txn.status );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "name", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_06170
train
T1
v2
Schema: departments (alias: dept)(date, code, value, status) employees(date, amount, name, value) Task: Find name from departments where a matching record exists in employees with the same level. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = dept.level );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "name", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_06171
train
T1
v3
Schema: accounts (alias: acct)(id, salary, status, type) items(value, level, type, salary) Task: Retrieve value from accounts with salary above the AVG(amount) of items rows sharing the same id. SQL:
SELECT value FROM accounts AS acct WHERE salary > ( SELECT AVG(amount) FROM items AS lne WHERE lne.id = acct.id );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_06172
train
T1
v3
Schema: accounts (alias: acct)(id, value, type, amount) orders(type, code, level, salary) Task: Find id from accounts where value exceeds the average amount from orders for the same code. SQL:
SELECT id FROM accounts AS acct WHERE value > ( SELECT SUM(amount) FROM orders AS ord WHERE ord.code = acct.code );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_06173
train
T1
v2
Schema: shipments (alias: shp)(id, amount, salary, level) categories(type, code, level, salary) Task: Find code from shipments where a matching record exists in categories with the same type. SQL:
SELECT code 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": "code", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_06174
train
T2
v3
Schema: departments (alias: dept)(status, amount, value, code) regions(status, salary, name, code) Task: Retrieve id from departments with amount above the AVG(salary) of regions rows sharing the same status. SQL:
SELECT id FROM departments AS dept WHERE amount > ( SELECT AVG(salary) FROM regions AS rgn WHERE rgn.status = dept.status );
{ "outer_table": "departments", "inner_table": "regions", "outer_alias": "dept", "inner_alias": "rgn", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_06175
train
T1
v3
Schema: transactions (alias: txn)(value, amount, level, name) items(name, status, id, type) Task: Find name from transactions where value exceeds the average amount from items for the same code. SQL:
SELECT name FROM transactions AS txn WHERE value > ( SELECT MIN(amount) FROM items AS lne WHERE lne.code = txn.code );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_06176
train
T1
v1
Schema: warehouses (alias: whs)(level, status, name, amount) regions(id, status, salary, name) Task: Retrieve name from warehouses whose id is found in regions rows where id matches the outer record. SQL:
SELECT name FROM warehouses AS whs WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "regions", "outer_alias": "whs", "inner_alias": "rgn", "proj_col": "name", "filter_col": "id", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_06177
train
T2
v2
Schema: warehouses (alias: whs)(date, code, type, salary) employees(value, amount, code, salary) Task: Find amount from warehouses where a matching record exists in employees with the same code. SQL:
SELECT amount FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "employees", "outer_alias": "whs", "inner_alias": "emp", "proj_col": "amount", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_06178
train
T2
v3
Schema: items (alias: lne)(type, value, level, status) managers(name, code, status, amount) Task: Find amount from items where amount exceeds the average salary from managers for the same status. SQL:
SELECT amount FROM items AS lne WHERE amount > ( SELECT AVG(salary) FROM managers AS mgr WHERE mgr.status = lne.status );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_06179
train
T2
v2
Schema: services (alias: srvc)(name, value, type, amount) shipments(amount, salary, type, value) Task: Find amount from services where a matching record exists in shipments with the same status. SQL:
SELECT amount FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = srvc.status );
{ "outer_table": "services", "inner_table": "shipments", "outer_alias": "srvc", "inner_alias": "shp", "proj_col": "amount", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_06180
train
T2
v2
Schema: products (alias: prod)(code, type, level, salary) managers(status, level, date, value) Task: Find code from products where a matching record exists in managers with the same status. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = prod.status );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "code", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_06181
train
T1
v1
Schema: employees (alias: emp)(date, amount, name, code) regions(status, type, date, salary) Task: Select amount from employees where status exists in regions for the same status. SQL:
SELECT amount FROM employees AS emp WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.status = emp.status );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_06182
train
T1
v3
Schema: orders (alias: ord)(date, value, level, type) employees(date, code, salary, name) Task: Find code from orders where amount exceeds the average salary from employees for the same code. SQL:
SELECT code FROM orders AS ord WHERE amount > ( SELECT MAX(salary) FROM employees AS emp WHERE emp.code = ord.code );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_06183
train
T1
v3
Schema: regions (alias: rgn)(name, level, code, date) products(code, value, date, name) Task: Retrieve code from regions with salary above the MAX(amount) of products rows sharing the same code. SQL:
SELECT code FROM regions AS rgn WHERE salary > ( SELECT MAX(amount) FROM products AS prod WHERE prod.code = rgn.code );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_06184
train
T2
v2
Schema: categories (alias: catg)(level, salary, code, status) products(type, id, level, amount) Task: Retrieve id from categories that have at least one corresponding entry in products sharing the same level. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = catg.level );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "id", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_06185
train
T2
v2
Schema: departments (alias: dept)(type, date, level, id) shipments(salary, amount, status, value) Task: Retrieve code from departments that have at least one corresponding entry in shipments sharing the same level. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = dept.level );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "code", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_06186
train
T1
v3
Schema: orders (alias: ord)(id, level, date, amount) requests(date, code, amount, value) Task: Find value from orders where amount exceeds the average value from requests for the same code. SQL:
SELECT value FROM orders AS ord WHERE amount > ( SELECT MIN(value) FROM requests AS ordr WHERE ordr.code = ord.code );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_06187
train
T1
v3
Schema: orders (alias: ord)(id, amount, level, date) schedules(amount, level, value, date) Task: Find value from orders where salary exceeds the average amount from schedules for the same id. SQL:
SELECT value FROM orders AS ord WHERE salary > ( SELECT SUM(amount) FROM schedules AS schd WHERE schd.id = ord.id );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_06188
train
T1
v2
Schema: managers (alias: mgr)(value, amount, salary, level) employees(level, id, status, name) Task: Find id from managers where a matching record exists in employees with the same type. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = mgr.type );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "id", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_06189
train
T1
v2
Schema: orders (alias: ord)(salary, code, amount, value) invoices(amount, date, status, name) Task: Retrieve amount from orders that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = ord.type );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "amount", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_06190
train
T1
v1
Schema: shipments (alias: shp)(value, amount, id, salary) orders(salary, level, name, status) Task: Select value from shipments where type exists in orders for the same level. SQL:
SELECT value FROM shipments AS shp WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.level = shp.level );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_06191
train
T2
v1
Schema: customers (alias: cust)(status, value, code, name) employees(amount, status, salary, name) Task: Find amount from customers where code appears in employees entries with matching code. SQL:
SELECT amount FROM customers AS cust WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.code = cust.code );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_06192
train
T1
v1
Schema: warehouses (alias: whs)(name, level, date, salary) categories(salary, date, id, amount) Task: Find name from warehouses where level appears in categories entries with matching status. SQL:
SELECT name FROM warehouses AS whs WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "categories", "outer_alias": "whs", "inner_alias": "catg", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_06193
train
T2
v2
Schema: accounts (alias: acct)(salary, amount, level, type) customers(id, name, code, date) Task: Find amount from accounts where a matching record exists in customers with the same type. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = acct.type );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "amount", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_06194
train
T1
v3
Schema: categories (alias: catg)(status, date, code, salary) invoices(salary, amount, level, status) Task: Find amount from categories where value exceeds the average salary from invoices for the same code. SQL:
SELECT amount FROM categories AS catg WHERE value > ( SELECT SUM(salary) FROM invoices AS inv WHERE inv.code = catg.code );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_06195
train
T2
v1
Schema: regions (alias: rgn)(amount, level, date, type) schedules(type, amount, level, status) Task: Retrieve value from regions whose code is found in schedules rows where status matches the outer record. SQL:
SELECT value FROM regions AS rgn WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.status = rgn.status );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_06196
train
T2
v3
Schema: transactions (alias: txn)(salary, amount, type, status) categories(value, date, code, level) Task: Retrieve name from transactions with salary above the SUM(value) of categories rows sharing the same type. SQL:
SELECT name FROM transactions AS txn WHERE salary > ( SELECT SUM(value) FROM categories AS catg WHERE catg.type = txn.type );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_06197
train
T1
v3
Schema: employees (alias: emp)(level, value, code, status) customers(type, code, date, status) Task: Find salary from employees where salary exceeds the average amount from customers for the same type. SQL:
SELECT salary FROM employees AS emp WHERE salary > ( SELECT AVG(amount) FROM customers AS cust WHERE cust.type = emp.type );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_06198
train
T1
v1
Schema: transactions (alias: txn)(amount, date, name, level) services(type, salary, id, date) Task: Select name from transactions where code exists in services for the same type. SQL:
SELECT name FROM transactions AS txn WHERE code IN ( SELECT code FROM services AS srvc WHERE srvc.type = txn.type );
{ "outer_table": "transactions", "inner_table": "services", "outer_alias": "txn", "inner_alias": "srvc", "proj_col": "name", "filter_col": "code", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_06199
train
T1