variant
stringclasses
3 values
prompt
stringlengths
163
237
sql
stringlengths
103
143
metadata
unknown
id
stringlengths
21
21
split
stringclasses
1 value
token_group
stringclasses
2 values
v2
Schema: products (alias: prod)(amount, salary, id, type) staff(amount, name, code, salary) Task: Retrieve name from products that have at least one corresponding entry in staff sharing the same id. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = prod.id );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "name", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_07000
train
T1
v1
Schema: items (alias: lne)(status, code, amount, level) departments(name, amount, level, type) Task: Find code from items where id appears in departments entries with matching level. SQL:
SELECT code FROM items AS lne WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.level = lne.level );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "code", "filter_col": "id", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_07001
train
T2
v2
Schema: budgets (alias: budg)(value, salary, level, name) requests(id, name, code, amount) Task: Retrieve id from budgets that have at least one corresponding entry in requests sharing the same level. SQL:
SELECT id FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = budg.level );
{ "outer_table": "budgets", "inner_table": "requests", "outer_alias": "budg", "inner_alias": "ordr", "proj_col": "id", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_07002
train
T2
v2
Schema: categories (alias: catg)(amount, name, level, value) products(amount, salary, level, status) Task: Find salary from categories where a matching record exists in products with the same id. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = catg.id );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "salary", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_07003
train
T2
v3
Schema: departments (alias: dept)(salary, amount, status, date) warehouses(amount, id, type, code) Task: Find id from departments where salary exceeds the average value from warehouses for the same code. SQL:
SELECT id FROM departments AS dept WHERE salary > ( SELECT COUNT(value) FROM warehouses AS whs WHERE whs.code = dept.code );
{ "outer_table": "departments", "inner_table": "warehouses", "outer_alias": "dept", "inner_alias": "whs", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_07004
train
T1
v3
Schema: employees (alias: emp)(date, value, code, name) departments(salary, id, type, value) Task: Retrieve name from employees with salary above the MIN(amount) of departments rows sharing the same level. SQL:
SELECT name FROM employees AS emp WHERE salary > ( SELECT MIN(amount) FROM departments AS dept WHERE dept.level = emp.level );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_07005
train
T1
v1
Schema: categories (alias: catg)(name, id, date, amount) services(amount, code, value, level) Task: Retrieve value from categories whose type is found in services rows where type matches the outer record. SQL:
SELECT value FROM categories AS catg WHERE type IN ( SELECT type FROM services AS srvc WHERE srvc.type = catg.type );
{ "outer_table": "categories", "inner_table": "services", "outer_alias": "catg", "inner_alias": "srvc", "proj_col": "value", "filter_col": "type", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_07006
train
T2
v3
Schema: budgets (alias: budg)(date, code, amount, id) warehouses(value, salary, type, status) Task: Retrieve code from budgets with salary above the AVG(salary) of warehouses rows sharing the same code. SQL:
SELECT code FROM budgets AS budg WHERE salary > ( SELECT AVG(salary) FROM warehouses AS whs WHERE whs.code = budg.code );
{ "outer_table": "budgets", "inner_table": "warehouses", "outer_alias": "budg", "inner_alias": "whs", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_07007
train
T2
v3
Schema: shipments (alias: shp)(id, level, code, status) departments(name, date, amount, type) Task: Retrieve amount from shipments with salary above the COUNT(salary) of departments rows sharing the same type. SQL:
SELECT amount FROM shipments AS shp WHERE salary > ( SELECT COUNT(salary) FROM departments AS dept WHERE dept.type = shp.type );
{ "outer_table": "shipments", "inner_table": "departments", "outer_alias": "shp", "inner_alias": "dept", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_07008
train
T2
v2
Schema: transactions (alias: txn)(amount, id, code, level) staff(level, type, date, salary) Task: Find name from transactions where a matching record exists in staff with the same id. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = txn.id );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "name", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_07009
train
T1
v2
Schema: regions (alias: rgn)(amount, date, name, status) departments(id, status, code, name) Task: Retrieve salary from regions that have at least one corresponding entry in departments sharing the same type. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = rgn.type );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "salary", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_07010
train
T2
v1
Schema: invoices (alias: inv)(date, value, level, id) staff(value, status, id, date) Task: Select name from invoices where id exists in staff for the same type. SQL:
SELECT name FROM invoices AS inv WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.type = inv.type );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "name", "filter_col": "id", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_07011
train
T1
v1
Schema: invoices (alias: inv)(name, type, date, amount) shipments(id, name, level, date) Task: Retrieve name from invoices whose status is found in shipments rows where level matches the outer record. SQL:
SELECT name FROM invoices AS inv WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.level = inv.level );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_07012
train
T1
v3
Schema: schedules (alias: schd)(amount, value, code, date) shipments(name, amount, id, salary) Task: Find value from schedules where amount exceeds the average salary from shipments for the same code. SQL:
SELECT value FROM schedules AS schd WHERE amount > ( SELECT COUNT(salary) FROM shipments AS shp WHERE shp.code = schd.code );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_07013
train
T2
v2
Schema: orders (alias: ord)(value, salary, name, code) staff(status, name, type, salary) Task: Find code from orders where a matching record exists in staff with the same status. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = ord.status );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "code", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_07014
train
T1
v1
Schema: regions (alias: rgn)(status, name, id, date) staff(value, code, level, name) Task: Find name from regions where code appears in staff entries with matching status. SQL:
SELECT name FROM regions AS rgn WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.status = rgn.status );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_07015
train
T2
v1
Schema: customers (alias: cust)(name, code, amount, status) requests(amount, name, value, date) Task: Select code from customers where status exists in requests for the same type. SQL:
SELECT code FROM customers AS cust WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.type = cust.type );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_07016
train
T1
v2
Schema: requests (alias: ordr)(name, code, value, amount) schedules(type, name, date, status) Task: Find value from requests where a matching record exists in schedules with the same type. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = ordr.type );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "value", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_07017
train
T2
v3
Schema: warehouses (alias: whs)(amount, type, value, date) requests(salary, status, date, id) Task: Find salary from warehouses where amount exceeds the average amount from requests for the same status. SQL:
SELECT salary FROM warehouses AS whs WHERE amount > ( SELECT MIN(amount) FROM requests AS ordr WHERE ordr.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "requests", "outer_alias": "whs", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_07018
train
T2
v1
Schema: services (alias: srvc)(date, id, value, type) orders(status, type, value, code) Task: Find id from services where code appears in orders entries with matching id. SQL:
SELECT id FROM services AS srvc WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.id = srvc.id );
{ "outer_table": "services", "inner_table": "orders", "outer_alias": "srvc", "inner_alias": "ord", "proj_col": "id", "filter_col": "code", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_07019
train
T2
v2
Schema: services (alias: srvc)(type, code, date, amount) employees(date, name, amount, salary) Task: Find id from services where a matching record exists in employees with the same id. SQL:
SELECT id FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = srvc.id );
{ "outer_table": "services", "inner_table": "employees", "outer_alias": "srvc", "inner_alias": "emp", "proj_col": "id", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_07020
train
T2
v1
Schema: services (alias: srvc)(salary, code, name, type) employees(date, status, amount, salary) Task: Retrieve code from services whose status is found in employees rows where code matches the outer record. SQL:
SELECT code FROM services AS srvc WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.code = srvc.code );
{ "outer_table": "services", "inner_table": "employees", "outer_alias": "srvc", "inner_alias": "emp", "proj_col": "code", "filter_col": "status", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_07021
train
T2
v1
Schema: schedules (alias: schd)(level, name, amount, value) categories(amount, date, status, type) Task: Find name from schedules where id appears in categories entries with matching code. SQL:
SELECT name FROM schedules AS schd WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.code = schd.code );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_07022
train
T2
v1
Schema: schedules (alias: schd)(code, level, type, status) warehouses(type, value, status, salary) Task: Select amount from schedules where id exists in warehouses for the same code. SQL:
SELECT amount FROM schedules AS schd WHERE id IN ( SELECT id FROM warehouses AS whs WHERE whs.code = schd.code );
{ "outer_table": "schedules", "inner_table": "warehouses", "outer_alias": "schd", "inner_alias": "whs", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_07023
train
T2
v3
Schema: products (alias: prod)(salary, level, type, status) invoices(name, type, amount, id) Task: Retrieve value from products with amount above the MIN(salary) of invoices rows sharing the same code. SQL:
SELECT value FROM products AS prod WHERE amount > ( SELECT MIN(salary) FROM invoices AS inv WHERE inv.code = prod.code );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_07024
train
T1
v2
Schema: shipments (alias: shp)(value, id, date, level) invoices(level, date, amount, value) Task: Find amount from shipments where a matching record exists in invoices with the same type. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = shp.type );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "amount", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_07025
train
T2
v2
Schema: schedules (alias: schd)(amount, name, status, date) products(type, status, code, value) Task: Find code from schedules where a matching record exists in products with the same level. SQL:
SELECT code FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = schd.level );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "code", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_07026
train
T2
v2
Schema: sales (alias: sale)(value, date, type, code) regions(name, id, type, level) Task: Find name from sales where a matching record exists in regions with the same id. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = sale.id );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "name", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_07027
train
T1
v1
Schema: warehouses (alias: whs)(amount, id, level, status) shipments(name, status, level, type) Task: Select salary from warehouses where status exists in shipments for the same code. SQL:
SELECT salary FROM warehouses AS whs WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "shipments", "outer_alias": "whs", "inner_alias": "shp", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_07028
train
T2
v1
Schema: requests (alias: ordr)(value, amount, status, type) staff(status, level, amount, name) Task: Select amount from requests where level exists in staff for the same status. SQL:
SELECT amount FROM requests AS ordr WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.status = ordr.status );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_07029
train
T2
v1
Schema: budgets (alias: budg)(value, id, code, status) services(level, amount, status, salary) Task: Find code from budgets where id appears in services entries with matching status. SQL:
SELECT code FROM budgets AS budg WHERE id IN ( SELECT id FROM services AS srvc WHERE srvc.status = budg.status );
{ "outer_table": "budgets", "inner_table": "services", "outer_alias": "budg", "inner_alias": "srvc", "proj_col": "code", "filter_col": "id", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_07030
train
T2
v2
Schema: invoices (alias: inv)(code, status, id, salary) products(date, status, type, level) Task: Retrieve id from invoices that have at least one corresponding entry in products sharing the same code. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = inv.code );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "id", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_07031
train
T1
v2
Schema: warehouses (alias: whs)(date, name, status, value) services(id, salary, code, status) Task: Retrieve id from warehouses that have at least one corresponding entry in services sharing the same type. SQL:
SELECT id FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "services", "outer_alias": "whs", "inner_alias": "srvc", "proj_col": "id", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_07032
train
T2
v3
Schema: budgets (alias: budg)(name, type, value, id) categories(date, name, salary, status) Task: Retrieve salary from budgets with salary above the MAX(value) of categories rows sharing the same type. SQL:
SELECT salary FROM budgets AS budg WHERE salary > ( SELECT MAX(value) FROM categories AS catg WHERE catg.type = budg.type );
{ "outer_table": "budgets", "inner_table": "categories", "outer_alias": "budg", "inner_alias": "catg", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_07033
train
T2
v2
Schema: sales (alias: sale)(type, status, date, code) warehouses(level, name, type, id) Task: Find amount from sales where a matching record exists in warehouses with the same code. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.code = sale.code );
{ "outer_table": "sales", "inner_table": "warehouses", "outer_alias": "sale", "inner_alias": "whs", "proj_col": "amount", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_07034
train
T1
v3
Schema: schedules (alias: schd)(salary, code, date, name) warehouses(value, code, id, status) Task: Retrieve value from schedules with salary above the SUM(value) of warehouses rows sharing the same type. SQL:
SELECT value FROM schedules AS schd WHERE salary > ( SELECT SUM(value) FROM warehouses AS whs WHERE whs.type = schd.type );
{ "outer_table": "schedules", "inner_table": "warehouses", "outer_alias": "schd", "inner_alias": "whs", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_07035
train
T2
v2
Schema: items (alias: lne)(date, status, salary, value) transactions(code, status, name, value) Task: Find salary from items where a matching record exists in transactions with the same type. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = lne.type );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "salary", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_07036
train
T2
v2
Schema: accounts (alias: acct)(amount, id, value, date) schedules(value, id, level, amount) Task: Retrieve name from accounts that have at least one corresponding entry in schedules sharing the same id. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = acct.id );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "name", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_07037
train
T1
v1
Schema: services (alias: srvc)(date, status, id, value) warehouses(amount, name, level, salary) Task: Find code from services where code appears in warehouses entries with matching id. SQL:
SELECT code FROM services AS srvc WHERE code IN ( SELECT code FROM warehouses AS whs WHERE whs.id = srvc.id );
{ "outer_table": "services", "inner_table": "warehouses", "outer_alias": "srvc", "inner_alias": "whs", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_07038
train
T2
v3
Schema: transactions (alias: txn)(value, salary, date, level) items(salary, type, name, amount) Task: Retrieve id from transactions with salary above the SUM(salary) of items rows sharing the same id. SQL:
SELECT id FROM transactions AS txn WHERE salary > ( SELECT SUM(salary) FROM items AS lne WHERE lne.id = txn.id );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_07039
train
T1
v3
Schema: budgets (alias: budg)(code, amount, id, level) schedules(code, date, value, amount) Task: Retrieve amount from budgets with salary above the AVG(salary) of schedules rows sharing the same status. SQL:
SELECT amount FROM budgets AS budg WHERE salary > ( SELECT AVG(salary) FROM schedules AS schd WHERE schd.status = budg.status );
{ "outer_table": "budgets", "inner_table": "schedules", "outer_alias": "budg", "inner_alias": "schd", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_07040
train
T2
v2
Schema: accounts (alias: acct)(type, id, status, code) invoices(value, type, level, amount) Task: Retrieve amount from accounts that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = acct.id );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "amount", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_07041
train
T1
v2
Schema: schedules (alias: schd)(salary, amount, type, value) products(name, date, status, code) Task: Retrieve code from schedules that have at least one corresponding entry in products sharing the same status. SQL:
SELECT code FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = schd.status );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "code", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_07042
train
T2
v1
Schema: departments (alias: dept)(type, code, value, level) staff(value, status, date, amount) Task: Retrieve id from departments whose level is found in staff rows where type matches the outer record. SQL:
SELECT id FROM departments AS dept WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.type = dept.type );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_07043
train
T1
v2
Schema: departments (alias: dept)(salary, name, id, amount) orders(code, name, date, value) Task: Find code from departments where a matching record exists in orders with the same type. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = dept.type );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "code", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_07044
train
T1
v2
Schema: shipments (alias: shp)(status, code, name, level) invoices(type, status, id, code) Task: Retrieve salary from shipments that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = shp.id );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "salary", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_07045
train
T2
v1
Schema: transactions (alias: txn)(level, type, code, amount) sales(id, code, name, status) Task: Find code from transactions where code appears in sales entries with matching id. SQL:
SELECT code FROM transactions AS txn WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.id = txn.id );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_07046
train
T1
v1
Schema: invoices (alias: inv)(level, amount, salary, name) managers(type, value, amount, name) Task: Select code from invoices where code exists in managers for the same id. SQL:
SELECT code FROM invoices AS inv WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.id = inv.id );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_07047
train
T1
v2
Schema: categories (alias: catg)(date, amount, type, code) staff(salary, status, value, level) Task: Retrieve value from categories that have at least one corresponding entry in staff sharing the same level. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = catg.level );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "value", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_07048
train
T2
v3
Schema: warehouses (alias: whs)(amount, date, status, code) accounts(id, name, amount, salary) Task: Retrieve id from warehouses with value above the AVG(value) of accounts rows sharing the same level. SQL:
SELECT id FROM warehouses AS whs WHERE value > ( SELECT AVG(value) FROM accounts AS acct WHERE acct.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "accounts", "outer_alias": "whs", "inner_alias": "acct", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_07049
train
T2
v2
Schema: orders (alias: ord)(code, date, id, level) budgets(date, level, value, type) Task: Find amount from orders where a matching record exists in budgets with the same id. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.id = ord.id );
{ "outer_table": "orders", "inner_table": "budgets", "outer_alias": "ord", "inner_alias": "budg", "proj_col": "amount", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_07050
train
T1
v2
Schema: transactions (alias: txn)(status, value, name, salary) warehouses(salary, type, date, amount) Task: Find id from transactions where a matching record exists in warehouses with the same status. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.status = txn.status );
{ "outer_table": "transactions", "inner_table": "warehouses", "outer_alias": "txn", "inner_alias": "whs", "proj_col": "id", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_07051
train
T1
v2
Schema: items (alias: lne)(salary, type, amount, name) budgets(value, amount, status, id) Task: Retrieve id from items that have at least one corresponding entry in budgets sharing the same type. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.type = lne.type );
{ "outer_table": "items", "inner_table": "budgets", "outer_alias": "lne", "inner_alias": "budg", "proj_col": "id", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_07052
train
T2
v1
Schema: services (alias: srvc)(status, value, name, date) staff(status, value, date, level) Task: Find amount from services where id appears in staff entries with matching type. SQL:
SELECT amount FROM services AS srvc WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.type = srvc.type );
{ "outer_table": "services", "inner_table": "staff", "outer_alias": "srvc", "inner_alias": "empl", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_07053
train
T2
v3
Schema: items (alias: lne)(type, status, code, salary) accounts(id, code, value, name) Task: Retrieve name from items with amount above the MIN(value) of accounts rows sharing the same id. SQL:
SELECT name FROM items AS lne WHERE amount > ( SELECT MIN(value) 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": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_07054
train
T2
v2
Schema: customers (alias: cust)(code, amount, level, name) accounts(type, date, value, status) Task: Retrieve id from customers that have at least one corresponding entry in accounts sharing the same code. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = cust.code );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "id", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_07055
train
T1
v3
Schema: warehouses (alias: whs)(code, salary, type, value) budgets(amount, code, type, status) Task: Find code from warehouses where value exceeds the average value from budgets for the same id. SQL:
SELECT code FROM warehouses AS whs WHERE value > ( SELECT COUNT(value) FROM budgets AS budg WHERE budg.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "budgets", "outer_alias": "whs", "inner_alias": "budg", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_07056
train
T2
v3
Schema: customers (alias: cust)(id, date, status, code) services(status, code, amount, name) Task: Retrieve amount from customers with value above the MIN(salary) of services rows sharing the same level. SQL:
SELECT amount FROM customers AS cust WHERE value > ( SELECT MIN(salary) FROM services AS srvc WHERE srvc.level = cust.level );
{ "outer_table": "customers", "inner_table": "services", "outer_alias": "cust", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_07057
train
T1
v1
Schema: categories (alias: catg)(date, salary, status, type) warehouses(status, level, code, type) Task: Retrieve name from categories whose type is found in warehouses rows where code matches the outer record. SQL:
SELECT name FROM categories AS catg WHERE type IN ( SELECT type FROM warehouses AS whs WHERE whs.code = catg.code );
{ "outer_table": "categories", "inner_table": "warehouses", "outer_alias": "catg", "inner_alias": "whs", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_07058
train
T2
v1
Schema: departments (alias: dept)(salary, value, code, name) transactions(name, id, level, code) Task: Retrieve code from departments whose type is found in transactions rows where type matches the outer record. SQL:
SELECT code FROM departments AS dept WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.type = dept.type );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "code", "filter_col": "type", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_07059
train
T1
v1
Schema: products (alias: prod)(value, type, name, code) transactions(amount, value, code, type) Task: Select salary from products where level exists in transactions for the same id. SQL:
SELECT salary FROM products AS prod WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.id = prod.id );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "salary", "filter_col": "level", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_07060
train
T1
v3
Schema: budgets (alias: budg)(status, amount, name, date) customers(salary, type, id, code) Task: Retrieve amount from budgets with value above the MIN(value) of customers rows sharing the same type. SQL:
SELECT amount FROM budgets AS budg WHERE value > ( SELECT MIN(value) FROM customers AS cust WHERE cust.type = budg.type );
{ "outer_table": "budgets", "inner_table": "customers", "outer_alias": "budg", "inner_alias": "cust", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_07061
train
T2
v1
Schema: warehouses (alias: whs)(code, level, status, amount) requests(code, name, type, value) Task: Find amount from warehouses where code appears in requests entries with matching type. SQL:
SELECT amount FROM warehouses AS whs WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "requests", "outer_alias": "whs", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_07062
train
T2
v1
Schema: departments (alias: dept)(date, status, name, salary) items(code, salary, status, type) Task: Retrieve id from departments whose id is found in items rows where code matches the outer record. SQL:
SELECT id FROM departments AS dept WHERE id IN ( SELECT id FROM items AS lne WHERE lne.code = dept.code );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "id", "filter_col": "id", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_07063
train
T1
v3
Schema: services (alias: srvc)(level, id, amount, type) categories(salary, date, id, name) Task: Find value from services where salary exceeds the average value from categories for the same id. SQL:
SELECT value FROM services AS srvc WHERE salary > ( SELECT MIN(value) FROM categories AS catg WHERE catg.id = srvc.id );
{ "outer_table": "services", "inner_table": "categories", "outer_alias": "srvc", "inner_alias": "catg", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_07064
train
T2
v3
Schema: staff (alias: empl)(status, date, value, code) customers(id, salary, date, name) Task: Find value from staff where amount exceeds the average amount from customers for the same status. SQL:
SELECT value FROM staff AS empl WHERE amount > ( SELECT MIN(amount) FROM customers AS cust WHERE cust.status = empl.status );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_07065
train
T2
v3
Schema: services (alias: srvc)(value, code, date, amount) sales(status, amount, name, type) Task: Find name from services where value exceeds the average salary from sales for the same level. SQL:
SELECT name FROM services AS srvc WHERE value > ( SELECT COUNT(salary) FROM sales AS sale WHERE sale.level = srvc.level );
{ "outer_table": "services", "inner_table": "sales", "outer_alias": "srvc", "inner_alias": "sale", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_07066
train
T2
v2
Schema: schedules (alias: schd)(type, salary, level, id) staff(id, date, level, salary) Task: Find id from schedules where a matching record exists in staff with the same status. SQL:
SELECT id 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": "id", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_07067
train
T2
v2
Schema: managers (alias: mgr)(date, status, type, code) accounts(level, type, amount, value) Task: Retrieve name from managers that have at least one corresponding entry in accounts sharing the same type. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = mgr.type );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "name", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_07068
train
T1
v1
Schema: products (alias: prod)(code, level, id, value) schedules(code, name, amount, value) Task: Retrieve amount from products whose type is found in schedules rows where level matches the outer record. SQL:
SELECT amount FROM products AS prod WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.level = prod.level );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_07069
train
T1
v2
Schema: invoices (alias: inv)(date, code, salary, id) requests(amount, salary, type, id) Task: Retrieve value from invoices that have at least one corresponding entry in requests sharing the same level. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = inv.level );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "value", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_07070
train
T1
v3
Schema: shipments (alias: shp)(level, amount, salary, code) requests(name, code, salary, value) Task: Retrieve code from shipments with salary above the MAX(salary) of requests rows sharing the same status. SQL:
SELECT code FROM shipments AS shp WHERE salary > ( SELECT MAX(salary) FROM requests AS ordr WHERE ordr.status = shp.status );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_07071
train
T2
v1
Schema: products (alias: prod)(salary, name, amount, value) managers(status, type, name, code) Task: Retrieve id from products whose status is found in managers rows where status matches the outer record. SQL:
SELECT id FROM products AS prod WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.status = prod.status );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_07072
train
T1
v2
Schema: orders (alias: ord)(status, salary, id, date) shipments(code, name, status, level) Task: Retrieve amount from orders that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = ord.status );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "amount", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_07073
train
T1
v1
Schema: sales (alias: sale)(level, id, salary, amount) items(name, type, salary, level) Task: Select value from sales where type exists in items for the same level. SQL:
SELECT value FROM sales AS sale WHERE type IN ( SELECT type FROM items AS lne WHERE lne.level = sale.level );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_07074
train
T1
v3
Schema: items (alias: lne)(value, salary, code, amount) sales(type, amount, salary, status) Task: Find name from items where amount exceeds the average value from sales for the same level. SQL:
SELECT name FROM items AS lne WHERE amount > ( SELECT AVG(value) FROM sales AS sale WHERE sale.level = lne.level );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_07075
train
T2
v1
Schema: managers (alias: mgr)(level, value, id, amount) orders(id, value, salary, type) Task: Retrieve salary from managers whose level is found in orders rows where status matches the outer record. SQL:
SELECT salary FROM managers AS mgr WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.status = mgr.status );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "salary", "filter_col": "level", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_07076
train
T1
v2
Schema: accounts (alias: acct)(status, value, amount, level) employees(salary, status, date, level) Task: Retrieve value from accounts that have at least one corresponding entry in employees sharing the same id. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = acct.id );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "value", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_07077
train
T1
v2
Schema: accounts (alias: acct)(type, value, name, amount) services(status, type, name, salary) Task: Find code from accounts where a matching record exists in services with the same id. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = acct.id );
{ "outer_table": "accounts", "inner_table": "services", "outer_alias": "acct", "inner_alias": "srvc", "proj_col": "code", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_07078
train
T1
v3
Schema: accounts (alias: acct)(salary, id, amount, type) regions(id, name, salary, date) Task: Find salary from accounts where amount exceeds the average amount from regions for the same level. SQL:
SELECT salary FROM accounts AS acct WHERE amount > ( SELECT COUNT(amount) FROM regions AS rgn WHERE rgn.level = acct.level );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_07079
train
T1
v1
Schema: items (alias: lne)(type, code, value, level) customers(value, id, level, code) Task: Select id from items where id exists in customers for the same id. SQL:
SELECT id FROM items AS lne WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.id = lne.id );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_07080
train
T2
v1
Schema: customers (alias: cust)(value, amount, date, type) budgets(status, amount, type, salary) Task: Find id from customers where status appears in budgets entries with matching id. SQL:
SELECT id FROM customers AS cust WHERE status IN ( SELECT status FROM budgets AS budg WHERE budg.id = cust.id );
{ "outer_table": "customers", "inner_table": "budgets", "outer_alias": "cust", "inner_alias": "budg", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_07081
train
T1
v3
Schema: orders (alias: ord)(type, salary, name, date) sales(date, level, type, salary) Task: Retrieve name from orders with salary above the MIN(salary) of sales rows sharing the same type. SQL:
SELECT name FROM orders AS ord WHERE salary > ( SELECT MIN(salary) FROM sales AS sale WHERE sale.type = ord.type );
{ "outer_table": "orders", "inner_table": "sales", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_07082
train
T1
v1
Schema: sales (alias: sale)(amount, salary, type, value) orders(amount, date, id, name) Task: Retrieve value from sales whose code is found in orders rows where code matches the outer record. SQL:
SELECT value FROM sales AS sale WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.code = sale.code );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_07083
train
T1
v3
Schema: categories (alias: catg)(id, level, value, code) staff(code, date, status, salary) Task: Find code from categories where value exceeds the average value from staff for the same code. SQL:
SELECT code FROM categories AS catg WHERE value > ( SELECT COUNT(value) FROM staff AS empl WHERE empl.code = catg.code );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_07084
train
T2
v2
Schema: schedules (alias: schd)(value, name, salary, type) services(level, date, code, amount) Task: Find id from schedules where a matching record exists in services with the same type. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.type = schd.type );
{ "outer_table": "schedules", "inner_table": "services", "outer_alias": "schd", "inner_alias": "srvc", "proj_col": "id", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_07085
train
T2
v3
Schema: accounts (alias: acct)(salary, id, name, date) customers(level, date, status, code) Task: Retrieve salary from accounts with salary above the COUNT(salary) of customers rows sharing the same type. SQL:
SELECT salary FROM accounts AS acct WHERE salary > ( SELECT COUNT(salary) FROM customers AS cust WHERE cust.type = acct.type );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_07086
train
T1
v1
Schema: requests (alias: ordr)(value, code, name, type) transactions(code, value, type, amount) Task: Select code from requests where id exists in transactions for the same type. SQL:
SELECT code FROM requests AS ordr WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.type = ordr.type );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "code", "filter_col": "id", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_07087
train
T2
v1
Schema: warehouses (alias: whs)(level, type, salary, code) employees(id, date, code, salary) Task: Retrieve value from warehouses whose type is found in employees rows where code matches the outer record. SQL:
SELECT value FROM warehouses AS whs WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "employees", "outer_alias": "whs", "inner_alias": "emp", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_07088
train
T2
v2
Schema: departments (alias: dept)(date, id, amount, status) warehouses(value, date, id, name) Task: Retrieve name from departments that have at least one corresponding entry in warehouses sharing the same code. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.code = dept.code );
{ "outer_table": "departments", "inner_table": "warehouses", "outer_alias": "dept", "inner_alias": "whs", "proj_col": "name", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_07089
train
T1
v2
Schema: customers (alias: cust)(name, level, status, salary) shipments(level, date, salary, value) Task: Retrieve code from customers that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = cust.status );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "code", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_07090
train
T1
v1
Schema: budgets (alias: budg)(id, name, level, amount) regions(date, name, amount, status) Task: Retrieve id from budgets whose code is found in regions rows where status matches the outer record. SQL:
SELECT id FROM budgets AS budg WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.status = budg.status );
{ "outer_table": "budgets", "inner_table": "regions", "outer_alias": "budg", "inner_alias": "rgn", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_07091
train
T2
v2
Schema: regions (alias: rgn)(level, code, date, amount) sales(code, value, date, amount) Task: Find code from regions where a matching record exists in sales with the same code. SQL:
SELECT code FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = rgn.code );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "code", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_07092
train
T2
v1
Schema: shipments (alias: shp)(type, amount, id, code) budgets(date, level, type, code) Task: Select name from shipments where level exists in budgets for the same status. SQL:
SELECT name FROM shipments AS shp WHERE level IN ( SELECT level FROM budgets AS budg WHERE budg.status = shp.status );
{ "outer_table": "shipments", "inner_table": "budgets", "outer_alias": "shp", "inner_alias": "budg", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_07093
train
T2
v1
Schema: categories (alias: catg)(type, code, date, value) budgets(type, level, salary, code) Task: Find code from categories where status appears in budgets entries with matching level. SQL:
SELECT code FROM categories AS catg WHERE status IN ( SELECT status FROM budgets AS budg WHERE budg.level = catg.level );
{ "outer_table": "categories", "inner_table": "budgets", "outer_alias": "catg", "inner_alias": "budg", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_07094
train
T2
v1
Schema: orders (alias: ord)(status, name, salary, type) products(type, id, salary, date) Task: Retrieve name from orders whose status is found in products rows where code matches the outer record. SQL:
SELECT name FROM orders AS ord WHERE status IN ( SELECT status FROM products AS prod WHERE prod.code = ord.code );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_07095
train
T1
v2
Schema: budgets (alias: budg)(date, level, id, code) schedules(status, value, type, id) Task: Find value from budgets where a matching record exists in schedules with the same level. SQL:
SELECT value FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = budg.level );
{ "outer_table": "budgets", "inner_table": "schedules", "outer_alias": "budg", "inner_alias": "schd", "proj_col": "value", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_07096
train
T2
v1
Schema: budgets (alias: budg)(value, id, level, date) customers(id, code, value, level) Task: Find salary from budgets where level appears in customers entries with matching id. SQL:
SELECT salary FROM budgets AS budg WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.id = budg.id );
{ "outer_table": "budgets", "inner_table": "customers", "outer_alias": "budg", "inner_alias": "cust", "proj_col": "salary", "filter_col": "level", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_07097
train
T2
v2
Schema: schedules (alias: schd)(code, type, salary, amount) items(name, amount, status, code) Task: Retrieve name from schedules that have at least one corresponding entry in items sharing the same type. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = schd.type );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "name", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_07098
train
T2
v2
Schema: regions (alias: rgn)(type, name, date, amount) items(value, date, type, status) Task: Retrieve amount from regions that have at least one corresponding entry in items sharing the same code. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = rgn.code );
{ "outer_table": "regions", "inner_table": "items", "outer_alias": "rgn", "inner_alias": "lne", "proj_col": "amount", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_07099
train
T2