variant
stringclasses
3 values
prompt
stringlengths
163
237
sql
stringlengths
103
143
metadata
unknown
id
stringlengths
21
21
split
stringclasses
1 value
token_group
stringclasses
2 values
v1
Schema: accounts (alias: acct)(level, id, value, name) schedules(date, value, name, code) Task: Select code from accounts where type exists in schedules for the same code. SQL:
SELECT code FROM accounts AS acct WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.code = acct.code );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_00700
train
T1
v3
Schema: schedules (alias: schd)(value, type, amount, salary) invoices(level, code, name, salary) Task: Retrieve salary from schedules with value above the AVG(salary) of invoices rows sharing the same status. SQL:
SELECT salary FROM schedules AS schd WHERE value > ( SELECT AVG(salary) FROM invoices AS inv WHERE inv.status = schd.status );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_00701
train
T2
v1
Schema: departments (alias: dept)(type, id, amount, code) budgets(name, type, salary, amount) Task: Find name from departments where code appears in budgets entries with matching level. SQL:
SELECT name FROM departments AS dept WHERE code IN ( SELECT code FROM budgets AS budg WHERE budg.level = dept.level );
{ "outer_table": "departments", "inner_table": "budgets", "outer_alias": "dept", "inner_alias": "budg", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_00702
train
T1
v1
Schema: items (alias: lne)(value, name, type, date) transactions(name, value, status, id) Task: Select value from items where id exists in transactions for the same level. SQL:
SELECT value FROM items AS lne WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.level = lne.level );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_00703
train
T2
v1
Schema: transactions (alias: txn)(value, amount, date, type) departments(type, date, status, name) Task: Select amount from transactions where status exists in departments for the same id. SQL:
SELECT amount FROM transactions AS txn WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.id = txn.id );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_00704
train
T1
v1
Schema: budgets (alias: budg)(status, type, name, salary) staff(code, id, date, level) Task: Find salary from budgets where code appears in staff entries with matching id. SQL:
SELECT salary FROM budgets AS budg WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.id = budg.id );
{ "outer_table": "budgets", "inner_table": "staff", "outer_alias": "budg", "inner_alias": "empl", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_00705
train
T2
v1
Schema: shipments (alias: shp)(level, code, type, value) invoices(salary, level, value, status) Task: Select value from shipments where type exists in invoices for the same type. SQL:
SELECT value FROM shipments AS shp WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.type = shp.type );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "value", "filter_col": "type", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_00706
train
T2
v1
Schema: transactions (alias: txn)(type, name, id, salary) warehouses(name, level, value, status) Task: Find code from transactions where code appears in warehouses entries with matching code. SQL:
SELECT code FROM transactions AS txn WHERE code IN ( SELECT code FROM warehouses AS whs WHERE whs.code = txn.code );
{ "outer_table": "transactions", "inner_table": "warehouses", "outer_alias": "txn", "inner_alias": "whs", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_00707
train
T1
v3
Schema: regions (alias: rgn)(code, type, amount, date) schedules(type, code, value, name) Task: Find id from regions where value exceeds the average amount from schedules for the same status. SQL:
SELECT id FROM regions AS rgn WHERE value > ( SELECT COUNT(amount) FROM schedules AS schd WHERE schd.status = rgn.status );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_00708
train
T2
v2
Schema: invoices (alias: inv)(date, value, status, level) departments(salary, status, code, level) Task: Find amount from invoices where a matching record exists in departments with the same level. SQL:
SELECT amount 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": "amount", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_00709
train
T1
v3
Schema: budgets (alias: budg)(id, amount, value, level) orders(id, status, code, value) Task: Find id from budgets where salary exceeds the average value from orders for the same code. SQL:
SELECT id FROM budgets AS budg WHERE salary > ( SELECT MIN(value) FROM orders AS ord WHERE ord.code = budg.code );
{ "outer_table": "budgets", "inner_table": "orders", "outer_alias": "budg", "inner_alias": "ord", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_00710
train
T2
v1
Schema: services (alias: srvc)(id, code, status, amount) budgets(salary, level, value, status) Task: Select code from services where level exists in budgets for the same level. SQL:
SELECT code FROM services AS srvc WHERE level IN ( SELECT level FROM budgets AS budg WHERE budg.level = srvc.level );
{ "outer_table": "services", "inner_table": "budgets", "outer_alias": "srvc", "inner_alias": "budg", "proj_col": "code", "filter_col": "level", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_00711
train
T2
v1
Schema: departments (alias: dept)(amount, type, salary, name) schedules(salary, value, type, level) Task: Find salary from departments where level appears in schedules entries with matching code. SQL:
SELECT salary FROM departments AS dept WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.code = dept.code );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "salary", "filter_col": "level", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_00712
train
T1
v3
Schema: departments (alias: dept)(name, code, value, date) orders(level, status, value, date) Task: Find amount from departments where salary exceeds the average value from orders for the same type. SQL:
SELECT amount FROM departments AS dept WHERE salary > ( SELECT MAX(value) FROM orders AS ord WHERE ord.type = dept.type );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_00713
train
T1
v2
Schema: orders (alias: ord)(amount, code, status, level) warehouses(status, amount, name, level) Task: Find value from orders where a matching record exists in warehouses with the same level. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.level = ord.level );
{ "outer_table": "orders", "inner_table": "warehouses", "outer_alias": "ord", "inner_alias": "whs", "proj_col": "value", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_00714
train
T1
v3
Schema: transactions (alias: txn)(value, code, id, status) managers(id, value, type, amount) Task: Find value from transactions where salary exceeds the average salary from managers for the same type. SQL:
SELECT value FROM transactions AS txn WHERE salary > ( SELECT AVG(salary) FROM managers AS mgr WHERE mgr.type = txn.type );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_00715
train
T1
v1
Schema: sales (alias: sale)(salary, type, level, status) accounts(date, salary, id, level) Task: Find id from sales where level appears in accounts entries with matching level. SQL:
SELECT id FROM sales AS sale WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.level = sale.level );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_00716
train
T1
v1
Schema: budgets (alias: budg)(date, id, value, code) accounts(value, id, date, name) Task: Find name from budgets where type appears in accounts entries with matching id. SQL:
SELECT name FROM budgets AS budg WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.id = budg.id );
{ "outer_table": "budgets", "inner_table": "accounts", "outer_alias": "budg", "inner_alias": "acct", "proj_col": "name", "filter_col": "type", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_00717
train
T2
v3
Schema: products (alias: prod)(level, amount, name, type) categories(id, type, name, status) Task: Retrieve id from products with salary above the AVG(amount) of categories rows sharing the same id. SQL:
SELECT id FROM products AS prod WHERE salary > ( SELECT AVG(amount) FROM categories AS catg WHERE catg.id = prod.id );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_00718
train
T1
v1
Schema: managers (alias: mgr)(code, value, status, type) orders(id, value, status, type) Task: Retrieve code from managers whose code is found in orders rows where status matches the outer record. SQL:
SELECT code FROM managers AS mgr WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.status = mgr.status );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "code", "filter_col": "code", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_00719
train
T1
v3
Schema: requests (alias: ordr)(code, name, id, salary) invoices(name, value, code, salary) Task: Find salary from requests where amount exceeds the average salary from invoices for the same code. SQL:
SELECT salary FROM requests AS ordr WHERE amount > ( SELECT MAX(salary) FROM invoices AS inv WHERE inv.code = ordr.code );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_00720
train
T2
v1
Schema: managers (alias: mgr)(value, date, level, status) staff(amount, id, type, value) Task: Retrieve name from managers whose status is found in staff rows where id matches the outer record. SQL:
SELECT name FROM managers AS mgr WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.id = mgr.id );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_00721
train
T1
v2
Schema: budgets (alias: budg)(amount, salary, value, status) transactions(code, name, level, amount) Task: Retrieve id from budgets that have at least one corresponding entry in transactions sharing the same type. SQL:
SELECT id FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = budg.type );
{ "outer_table": "budgets", "inner_table": "transactions", "outer_alias": "budg", "inner_alias": "txn", "proj_col": "id", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_00722
train
T2
v2
Schema: invoices (alias: inv)(type, date, name, status) managers(type, amount, value, date) Task: Retrieve value from invoices that have at least one corresponding entry in managers sharing the same status. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = inv.status );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "value", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_00723
train
T1
v1
Schema: orders (alias: ord)(type, date, name, level) managers(salary, date, name, amount) Task: Select salary from orders where type exists in managers for the same level. SQL:
SELECT salary FROM orders AS ord WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.level = ord.level );
{ "outer_table": "orders", "inner_table": "managers", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "type", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_00724
train
T1
v3
Schema: schedules (alias: schd)(value, salary, type, date) requests(salary, amount, type, code) Task: Find code from schedules where amount exceeds the average amount from requests for the same id. SQL:
SELECT code FROM schedules AS schd WHERE amount > ( SELECT SUM(amount) FROM requests AS ordr WHERE ordr.id = schd.id );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_00725
train
T2
v2
Schema: items (alias: lne)(code, value, name, level) warehouses(amount, type, status, date) Task: Find name from items where a matching record exists in warehouses with the same code. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.code = lne.code );
{ "outer_table": "items", "inner_table": "warehouses", "outer_alias": "lne", "inner_alias": "whs", "proj_col": "name", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_00726
train
T2
v1
Schema: transactions (alias: txn)(id, amount, type, date) warehouses(name, level, amount, status) Task: Select value from transactions where level exists in warehouses for the same type. SQL:
SELECT value FROM transactions AS txn WHERE level IN ( SELECT level FROM warehouses AS whs WHERE whs.type = txn.type );
{ "outer_table": "transactions", "inner_table": "warehouses", "outer_alias": "txn", "inner_alias": "whs", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_00727
train
T1
v1
Schema: warehouses (alias: whs)(date, name, salary, value) requests(name, value, level, salary) Task: Find id from warehouses where type appears in requests entries with matching id. SQL:
SELECT id FROM warehouses AS whs WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "requests", "outer_alias": "whs", "inner_alias": "ordr", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_00728
train
T2
v2
Schema: schedules (alias: schd)(code, salary, id, name) regions(level, id, name, value) Task: Find salary from schedules where a matching record exists in regions with the same code. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = schd.code );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "salary", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_00729
train
T2
v3
Schema: departments (alias: dept)(salary, status, level, date) transactions(value, type, id, level) Task: Retrieve value from departments with value above the MAX(salary) of transactions rows sharing the same id. SQL:
SELECT value FROM departments AS dept WHERE value > ( SELECT MAX(salary) FROM transactions AS txn WHERE txn.id = dept.id );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_00730
train
T1
v1
Schema: orders (alias: ord)(level, value, amount, date) invoices(code, date, name, value) Task: Find code from orders where code appears in invoices entries with matching id. SQL:
SELECT code FROM orders AS ord WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.id = ord.id );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_00731
train
T1
v3
Schema: shipments (alias: shp)(name, level, status, salary) products(date, id, type, salary) Task: Retrieve value from shipments with amount above the COUNT(amount) of products rows sharing the same level. SQL:
SELECT value FROM shipments AS shp WHERE amount > ( SELECT COUNT(amount) FROM products AS prod WHERE prod.level = shp.level );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_00732
train
T2
v1
Schema: invoices (alias: inv)(status, id, name, date) items(date, name, value, status) Task: Retrieve code from invoices whose level is found in items rows where level matches the outer record. SQL:
SELECT code FROM invoices AS inv WHERE level IN ( SELECT level FROM items AS lne WHERE lne.level = inv.level );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "code", "filter_col": "level", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_00733
train
T1
v2
Schema: schedules (alias: schd)(type, value, id, amount) services(id, code, salary, date) Task: Retrieve amount from schedules that have at least one corresponding entry in services sharing the same level. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.level = schd.level );
{ "outer_table": "schedules", "inner_table": "services", "outer_alias": "schd", "inner_alias": "srvc", "proj_col": "amount", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_00734
train
T2
v1
Schema: sales (alias: sale)(type, value, name, status) categories(level, amount, code, date) Task: Select amount from sales where id exists in categories for the same type. SQL:
SELECT amount FROM sales AS sale WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.type = sale.type );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_00735
train
T1
v1
Schema: regions (alias: rgn)(amount, date, code, status) invoices(code, value, amount, type) Task: Find code from regions where status appears in invoices entries with matching level. SQL:
SELECT code FROM regions AS rgn WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.level = rgn.level );
{ "outer_table": "regions", "inner_table": "invoices", "outer_alias": "rgn", "inner_alias": "inv", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_00736
train
T2
v1
Schema: schedules (alias: schd)(status, date, amount, code) orders(value, status, date, salary) Task: Find amount from schedules where code appears in orders entries with matching type. SQL:
SELECT amount FROM schedules AS schd WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.type = schd.type );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_00737
train
T2
v1
Schema: products (alias: prod)(id, value, amount, status) requests(id, level, salary, status) Task: Select code from products where code exists in requests for the same type. SQL:
SELECT code FROM products AS prod WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.type = prod.type );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "code", "filter_col": "code", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_00738
train
T1
v2
Schema: transactions (alias: txn)(name, amount, id, date) warehouses(salary, value, date, status) Task: Find name from transactions where a matching record exists in warehouses with the same id. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.id = txn.id );
{ "outer_table": "transactions", "inner_table": "warehouses", "outer_alias": "txn", "inner_alias": "whs", "proj_col": "name", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_00739
train
T1
v3
Schema: regions (alias: rgn)(status, code, date, amount) budgets(level, name, type, amount) Task: Retrieve amount from regions with salary above the SUM(value) of budgets rows sharing the same id. SQL:
SELECT amount FROM regions AS rgn WHERE salary > ( SELECT SUM(value) FROM budgets AS budg WHERE budg.id = rgn.id );
{ "outer_table": "regions", "inner_table": "budgets", "outer_alias": "rgn", "inner_alias": "budg", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_00740
train
T2
v3
Schema: invoices (alias: inv)(salary, type, name, date) departments(amount, salary, value, status) Task: Find value from invoices where amount exceeds the average salary from departments for the same level. SQL:
SELECT value FROM invoices AS inv WHERE amount > ( SELECT AVG(salary) FROM departments AS dept WHERE dept.level = inv.level );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_00741
train
T1
v3
Schema: shipments (alias: shp)(status, code, salary, level) employees(level, date, salary, type) Task: Retrieve amount from shipments with value above the COUNT(salary) of employees rows sharing the same level. SQL:
SELECT amount FROM shipments AS shp WHERE value > ( SELECT COUNT(salary) FROM employees AS emp WHERE emp.level = shp.level );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_00742
train
T2
v3
Schema: budgets (alias: budg)(value, code, status, name) requests(name, type, salary, code) Task: Retrieve code from budgets with amount above the MIN(salary) of requests rows sharing the same code. SQL:
SELECT code FROM budgets AS budg WHERE amount > ( SELECT MIN(salary) FROM requests AS ordr WHERE ordr.code = budg.code );
{ "outer_table": "budgets", "inner_table": "requests", "outer_alias": "budg", "inner_alias": "ordr", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_00743
train
T2
v1
Schema: regions (alias: rgn)(amount, status, date, code) items(code, id, amount, type) Task: Retrieve name from regions whose level is found in items rows where level matches the outer record. SQL:
SELECT name FROM regions AS rgn WHERE level IN ( SELECT level FROM items AS lne WHERE lne.level = rgn.level );
{ "outer_table": "regions", "inner_table": "items", "outer_alias": "rgn", "inner_alias": "lne", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_00744
train
T2
v1
Schema: staff (alias: empl)(type, amount, value, status) transactions(type, salary, value, date) Task: Find amount from staff where type appears in transactions entries with matching type. SQL:
SELECT amount FROM staff AS empl WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.type = empl.type );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_00745
train
T2
v2
Schema: shipments (alias: shp)(type, level, date, id) staff(code, date, type, value) Task: Retrieve id from shipments that have at least one corresponding entry in staff sharing the same id. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = shp.id );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "id", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_00746
train
T2
v2
Schema: categories (alias: catg)(date, name, status, level) employees(amount, date, id, level) Task: Find value from categories where a matching record exists in employees with the same level. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = catg.level );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "value", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_00747
train
T2
v1
Schema: categories (alias: catg)(name, id, date, amount) accounts(amount, type, value, date) Task: Retrieve salary from categories whose status is found in accounts rows where level matches the outer record. SQL:
SELECT salary FROM categories AS catg WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.level = catg.level );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_00748
train
T2
v2
Schema: shipments (alias: shp)(amount, date, type, status) accounts(date, value, amount, name) Task: Find salary from shipments where a matching record exists in accounts with the same status. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = shp.status );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "salary", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_00749
train
T2
v1
Schema: staff (alias: empl)(id, type, status, level) shipments(code, status, date, level) Task: Find id from staff where level appears in shipments entries with matching status. SQL:
SELECT id FROM staff AS empl WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.status = empl.status );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_00750
train
T2
v3
Schema: staff (alias: empl)(salary, status, value, date) invoices(code, level, date, name) Task: Find name from staff where amount exceeds the average amount from invoices for the same status. SQL:
SELECT name FROM staff AS empl WHERE amount > ( SELECT AVG(amount) FROM invoices AS inv WHERE inv.status = empl.status );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_00751
train
T2
v2
Schema: transactions (alias: txn)(name, id, amount, status) orders(date, value, code, status) Task: Find code from transactions where a matching record exists in orders with the same id. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = txn.id );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "code", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_00752
train
T1
v1
Schema: invoices (alias: inv)(amount, value, date, name) transactions(status, salary, name, amount) Task: Select value from invoices where level exists in transactions for the same code. SQL:
SELECT value FROM invoices AS inv WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.code = inv.code );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_00753
train
T1
v2
Schema: categories (alias: catg)(code, type, name, level) invoices(amount, salary, status, code) Task: Find value from categories where a matching record exists in invoices with the same level. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = catg.level );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "value", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_00754
train
T2
v2
Schema: schedules (alias: schd)(id, name, status, amount) staff(salary, value, name, status) Task: Find name from schedules where a matching record exists in staff with the same status. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = schd.status );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "name", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_00755
train
T2
v2
Schema: transactions (alias: txn)(value, id, date, status) staff(salary, level, date, code) Task: Find amount from transactions where a matching record exists in staff with the same status. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = txn.status );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "amount", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_00756
train
T1
v1
Schema: regions (alias: rgn)(amount, name, type, value) customers(id, code, date, amount) Task: Find code from regions where type appears in customers entries with matching id. SQL:
SELECT code FROM regions AS rgn WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.id = rgn.id );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "code", "filter_col": "type", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_00757
train
T2
v2
Schema: items (alias: lne)(name, date, value, code) customers(salary, value, status, code) Task: Retrieve salary from items that have at least one corresponding entry in customers sharing the same type. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = lne.type );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "salary", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_00758
train
T2
v1
Schema: products (alias: prod)(amount, id, level, code) transactions(amount, value, salary, status) Task: Find code from products where code appears in transactions entries with matching status. SQL:
SELECT code FROM products AS prod WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.status = prod.status );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "code", "filter_col": "code", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_00759
train
T1
v2
Schema: orders (alias: ord)(amount, code, value, level) transactions(date, type, value, level) Task: Retrieve code from orders that have at least one corresponding entry in transactions sharing the same id. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = ord.id );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "code", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_00760
train
T1
v1
Schema: invoices (alias: inv)(code, type, salary, id) employees(value, status, type, id) Task: Find name from invoices where level appears in employees entries with matching status. SQL:
SELECT name FROM invoices AS inv WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.status = inv.status );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_00761
train
T1
v3
Schema: orders (alias: ord)(name, amount, status, date) departments(status, type, value, amount) Task: Retrieve value from orders with salary above the MIN(salary) of departments rows sharing the same status. SQL:
SELECT value FROM orders AS ord WHERE salary > ( SELECT MIN(salary) FROM departments AS dept WHERE dept.status = ord.status );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_00762
train
T1
v1
Schema: managers (alias: mgr)(id, name, salary, date) items(type, status, amount, name) Task: Retrieve salary from managers whose level is found in items rows where type matches the outer record. SQL:
SELECT salary FROM managers AS mgr WHERE level IN ( SELECT level FROM items AS lne WHERE lne.type = mgr.type );
{ "outer_table": "managers", "inner_table": "items", "outer_alias": "mgr", "inner_alias": "lne", "proj_col": "salary", "filter_col": "level", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_00763
train
T1
v2
Schema: products (alias: prod)(value, id, status, name) requests(code, value, date, level) Task: Find value from products where a matching record exists in requests with the same code. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = prod.code );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "value", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_00764
train
T1
v3
Schema: orders (alias: ord)(id, type, status, value) managers(name, type, status, level) Task: Find id from orders where amount exceeds the average amount from managers for the same status. SQL:
SELECT id FROM orders AS ord WHERE amount > ( SELECT SUM(amount) FROM managers AS mgr WHERE mgr.status = ord.status );
{ "outer_table": "orders", "inner_table": "managers", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_00765
train
T1
v3
Schema: customers (alias: cust)(amount, date, value, code) managers(salary, amount, id, level) Task: Retrieve salary from customers with amount above the COUNT(amount) of managers rows sharing the same level. SQL:
SELECT salary FROM customers AS cust WHERE amount > ( SELECT COUNT(amount) FROM managers AS mgr WHERE mgr.level = cust.level );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_00766
train
T1
v3
Schema: products (alias: prod)(level, salary, date, amount) transactions(amount, date, salary, id) Task: Retrieve value from products with salary above the COUNT(amount) of transactions rows sharing the same status. SQL:
SELECT value FROM products AS prod WHERE salary > ( SELECT COUNT(amount) FROM transactions AS txn WHERE txn.status = prod.status );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_00767
train
T1
v3
Schema: categories (alias: catg)(value, date, salary, id) transactions(date, level, type, amount) Task: Retrieve code from categories with amount above the COUNT(value) of transactions rows sharing the same code. SQL:
SELECT code FROM categories AS catg WHERE amount > ( SELECT COUNT(value) FROM transactions AS txn WHERE txn.code = catg.code );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_00768
train
T2
v3
Schema: transactions (alias: txn)(status, amount, date, type) orders(status, code, amount, name) Task: Find code from transactions where amount exceeds the average salary from orders for the same id. SQL:
SELECT code FROM transactions AS txn WHERE amount > ( SELECT MIN(salary) FROM orders AS ord WHERE ord.id = txn.id );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_00769
train
T1
v1
Schema: employees (alias: emp)(salary, value, amount, id) requests(type, date, salary, name) Task: Select id from employees where status exists in requests for the same type. SQL:
SELECT id FROM employees AS emp WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.type = emp.type );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_00770
train
T1
v2
Schema: items (alias: lne)(salary, type, code, name) schedules(amount, salary, code, type) Task: Find code from items where a matching record exists in schedules with the same status. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = lne.status );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "code", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_00771
train
T2
v1
Schema: schedules (alias: schd)(id, amount, salary, name) warehouses(id, amount, level, type) Task: Find id from schedules where level appears in warehouses entries with matching type. SQL:
SELECT id FROM schedules AS schd WHERE level IN ( SELECT level FROM warehouses AS whs WHERE whs.type = schd.type );
{ "outer_table": "schedules", "inner_table": "warehouses", "outer_alias": "schd", "inner_alias": "whs", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_00772
train
T2
v2
Schema: regions (alias: rgn)(type, date, amount, name) customers(salary, code, status, level) Task: Find code from regions where a matching record exists in customers with the same status. SQL:
SELECT code 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": "code", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_00773
train
T2
v3
Schema: schedules (alias: schd)(id, status, date, code) employees(date, name, code, value) Task: Find id from schedules where amount exceeds the average value from employees for the same id. SQL:
SELECT id FROM schedules AS schd WHERE amount > ( SELECT MAX(value) FROM employees AS emp WHERE emp.id = schd.id );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_00774
train
T2
v3
Schema: services (alias: srvc)(amount, date, value, salary) products(id, name, level, type) Task: Retrieve amount from services with value above the SUM(salary) of products rows sharing the same code. SQL:
SELECT amount FROM services AS srvc WHERE value > ( SELECT SUM(salary) FROM products AS prod WHERE prod.code = srvc.code );
{ "outer_table": "services", "inner_table": "products", "outer_alias": "srvc", "inner_alias": "prod", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_00775
train
T2
v3
Schema: accounts (alias: acct)(status, type, level, id) sales(status, code, level, name) Task: Find salary from accounts where amount exceeds the average salary from sales for the same level. SQL:
SELECT salary FROM accounts AS acct WHERE amount > ( SELECT MIN(salary) FROM sales AS sale WHERE sale.level = acct.level );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_00776
train
T1
v1
Schema: staff (alias: empl)(date, id, level, status) invoices(salary, status, name, date) Task: Retrieve name from staff whose code is found in invoices rows where level matches the outer record. SQL:
SELECT name FROM staff AS empl WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.level = empl.level );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_00777
train
T2
v2
Schema: invoices (alias: inv)(amount, id, value, type) warehouses(salary, type, code, amount) Task: Retrieve salary from invoices that have at least one corresponding entry in warehouses sharing the same id. SQL:
SELECT salary FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.id = inv.id );
{ "outer_table": "invoices", "inner_table": "warehouses", "outer_alias": "inv", "inner_alias": "whs", "proj_col": "salary", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_00778
train
T1
v3
Schema: invoices (alias: inv)(name, type, code, amount) items(status, level, name, id) Task: Find id from invoices where amount exceeds the average salary from items for the same code. SQL:
SELECT id FROM invoices AS inv WHERE amount > ( SELECT COUNT(salary) FROM items AS lne WHERE lne.code = inv.code );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_00779
train
T1
v3
Schema: invoices (alias: inv)(code, id, date, salary) customers(status, amount, type, level) Task: Find amount from invoices where amount exceeds the average value from customers for the same id. SQL:
SELECT amount FROM invoices AS inv WHERE amount > ( SELECT MIN(value) FROM customers AS cust WHERE cust.id = inv.id );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_00780
train
T1
v2
Schema: categories (alias: catg)(id, name, amount, type) shipments(level, status, date, name) Task: Find name from categories where a matching record exists in shipments with the same level. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = catg.level );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "catg", "inner_alias": "shp", "proj_col": "name", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_00781
train
T2
v3
Schema: staff (alias: empl)(name, status, id, amount) invoices(salary, name, date, amount) Task: Retrieve value from staff with amount above the MAX(value) of invoices rows sharing the same code. SQL:
SELECT value FROM staff AS empl WHERE amount > ( SELECT MAX(value) FROM invoices AS inv WHERE inv.code = empl.code );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_00782
train
T2
v2
Schema: invoices (alias: inv)(type, id, amount, name) schedules(date, level, salary, code) Task: Retrieve name from invoices that have at least one corresponding entry in schedules sharing the same code. SQL:
SELECT name FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = inv.code );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "name", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_00783
train
T1
v3
Schema: departments (alias: dept)(amount, date, code, level) staff(salary, status, code, amount) Task: Retrieve code from departments with salary above the MIN(value) of staff rows sharing the same type. SQL:
SELECT code FROM departments AS dept WHERE salary > ( SELECT MIN(value) FROM staff AS empl WHERE empl.type = dept.type );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_00784
train
T1
v1
Schema: budgets (alias: budg)(salary, date, status, code) shipments(name, salary, date, status) Task: Find name from budgets where code appears in shipments entries with matching code. SQL:
SELECT name FROM budgets AS budg WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.code = budg.code );
{ "outer_table": "budgets", "inner_table": "shipments", "outer_alias": "budg", "inner_alias": "shp", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_00785
train
T2
v2
Schema: budgets (alias: budg)(status, code, type, value) managers(amount, date, code, level) Task: Find id from budgets where a matching record exists in managers with the same status. SQL:
SELECT id FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = budg.status );
{ "outer_table": "budgets", "inner_table": "managers", "outer_alias": "budg", "inner_alias": "mgr", "proj_col": "id", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_00786
train
T2
v3
Schema: customers (alias: cust)(id, salary, status, value) requests(id, date, level, status) Task: Find value from customers where value exceeds the average salary from requests for the same level. SQL:
SELECT value FROM customers AS cust WHERE value > ( SELECT AVG(salary) FROM requests AS ordr WHERE ordr.level = cust.level );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_00787
train
T1
v2
Schema: products (alias: prod)(salary, level, amount, code) accounts(type, amount, name, level) Task: Find name from products where a matching record exists in accounts with the same code. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = prod.code );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "name", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_00788
train
T1
v2
Schema: regions (alias: rgn)(value, code, date, amount) products(name, value, level, status) Task: Find id from regions where a matching record exists in products with the same type. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = rgn.type );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "id", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_00789
train
T2
v2
Schema: budgets (alias: budg)(date, type, level, id) departments(name, date, status, type) Task: Find amount from budgets where a matching record exists in departments with the same type. SQL:
SELECT amount 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": "amount", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_00790
train
T2
v3
Schema: invoices (alias: inv)(salary, status, code, date) warehouses(code, value, id, type) Task: Retrieve salary from invoices with value above the COUNT(salary) of warehouses rows sharing the same id. SQL:
SELECT salary FROM invoices AS inv WHERE value > ( SELECT COUNT(salary) FROM warehouses AS whs WHERE whs.id = inv.id );
{ "outer_table": "invoices", "inner_table": "warehouses", "outer_alias": "inv", "inner_alias": "whs", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_00791
train
T1
v3
Schema: invoices (alias: inv)(salary, level, code, type) managers(id, type, date, salary) Task: Find amount from invoices where value exceeds the average value from managers for the same code. SQL:
SELECT amount FROM invoices AS inv WHERE value > ( SELECT COUNT(value) FROM managers AS mgr WHERE mgr.code = inv.code );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_00792
train
T1
v1
Schema: items (alias: lne)(code, salary, level, id) categories(date, code, status, id) Task: Retrieve name from items whose level is found in categories rows where code matches the outer record. SQL:
SELECT name FROM items AS lne WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.code = lne.code );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_00793
train
T2
v1
Schema: requests (alias: ordr)(id, value, salary, type) orders(name, date, amount, code) Task: Select salary from requests where code exists in orders for the same type. SQL:
SELECT salary FROM requests AS ordr WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.type = ordr.type );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_00794
train
T2
v2
Schema: invoices (alias: inv)(date, amount, value, code) budgets(status, id, name, level) Task: Retrieve id from invoices that have at least one corresponding entry in budgets sharing the same status. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.status = inv.status );
{ "outer_table": "invoices", "inner_table": "budgets", "outer_alias": "inv", "inner_alias": "budg", "proj_col": "id", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_00795
train
T1
v2
Schema: budgets (alias: budg)(value, level, code, date) employees(status, date, salary, level) Task: Retrieve salary from budgets that have at least one corresponding entry in employees sharing the same type. SQL:
SELECT salary FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = budg.type );
{ "outer_table": "budgets", "inner_table": "employees", "outer_alias": "budg", "inner_alias": "emp", "proj_col": "salary", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_00796
train
T2
v2
Schema: shipments (alias: shp)(salary, id, amount, type) services(status, id, code, amount) Task: Find salary from shipments where a matching record exists in services with the same status. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.status = shp.status );
{ "outer_table": "shipments", "inner_table": "services", "outer_alias": "shp", "inner_alias": "srvc", "proj_col": "salary", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_00797
train
T2
v3
Schema: services (alias: srvc)(id, level, status, code) employees(level, amount, salary, status) Task: Retrieve value from services with salary above the SUM(amount) of employees rows sharing the same type. SQL:
SELECT value FROM services AS srvc WHERE salary > ( SELECT SUM(amount) FROM employees AS emp WHERE emp.type = srvc.type );
{ "outer_table": "services", "inner_table": "employees", "outer_alias": "srvc", "inner_alias": "emp", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_00798
train
T2
v2
Schema: accounts (alias: acct)(code, status, date, id) transactions(status, id, name, type) Task: Find code from accounts where a matching record exists in transactions with the same level. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = acct.level );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "code", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_00799
train
T1