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: schedules (alias: schd)(type, status, code, date) items(id, level, code, salary) Task: Retrieve value from schedules that have at least one corresponding entry in items sharing the same type. SQL:
SELECT value 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": "value", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_10000
train
T2
v2
Schema: invoices (alias: inv)(id, type, value, status) budgets(id, type, name, date) Task: Retrieve code from invoices that have at least one corresponding entry in budgets sharing the same code. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.code = inv.code );
{ "outer_table": "invoices", "inner_table": "budgets", "outer_alias": "inv", "inner_alias": "budg", "proj_col": "code", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_10001
train
T1
v2
Schema: departments (alias: dept)(name, salary, status, type) services(code, type, salary, name) Task: Find value from departments where a matching record exists in services with the same type. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.type = dept.type );
{ "outer_table": "departments", "inner_table": "services", "outer_alias": "dept", "inner_alias": "srvc", "proj_col": "value", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_10002
train
T1
v3
Schema: warehouses (alias: whs)(code, id, type, name) items(code, salary, date, type) Task: Find name from warehouses where value exceeds the average value from items for the same type. SQL:
SELECT name FROM warehouses AS whs WHERE value > ( SELECT COUNT(value) FROM items AS lne WHERE lne.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "items", "outer_alias": "whs", "inner_alias": "lne", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_10003
train
T2
v2
Schema: sales (alias: sale)(value, status, level, salary) staff(type, id, name, salary) Task: Retrieve code from sales that have at least one corresponding entry in staff sharing the same id. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = sale.id );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "code", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_10004
train
T1
v1
Schema: budgets (alias: budg)(date, name, amount, value) sales(status, salary, id, name) Task: Select code from budgets where id exists in sales for the same level. SQL:
SELECT code FROM budgets AS budg WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.level = budg.level );
{ "outer_table": "budgets", "inner_table": "sales", "outer_alias": "budg", "inner_alias": "sale", "proj_col": "code", "filter_col": "id", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_10005
train
T2
v1
Schema: regions (alias: rgn)(id, amount, salary, type) orders(name, value, code, id) Task: Find salary from regions where level appears in orders entries with matching type. SQL:
SELECT salary FROM regions AS rgn WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.type = rgn.type );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "salary", "filter_col": "level", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_10006
train
T2
v2
Schema: sales (alias: sale)(name, level, salary, value) departments(salary, level, date, amount) Task: Retrieve salary from sales that have at least one corresponding entry in departments sharing the same code. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = sale.code );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "salary", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_10007
train
T1
v1
Schema: regions (alias: rgn)(name, type, id, salary) customers(type, code, amount, name) Task: Retrieve id from regions whose code is found in customers rows where status matches the outer record. SQL:
SELECT id FROM regions AS rgn WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.status = rgn.status );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_10008
train
T2
v2
Schema: orders (alias: ord)(amount, value, status, name) categories(amount, value, type, code) Task: Find code from orders where a matching record exists in categories with the same level. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = ord.level );
{ "outer_table": "orders", "inner_table": "categories", "outer_alias": "ord", "inner_alias": "catg", "proj_col": "code", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_10009
train
T1
v2
Schema: warehouses (alias: whs)(amount, level, type, status) accounts(code, date, value, id) Task: Retrieve id from warehouses that have at least one corresponding entry in accounts sharing the same status. SQL:
SELECT id FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "accounts", "outer_alias": "whs", "inner_alias": "acct", "proj_col": "id", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_10010
train
T2
v2
Schema: categories (alias: catg)(status, amount, type, name) orders(code, value, status, date) Task: Find value from categories where a matching record exists in orders with the same id. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = catg.id );
{ "outer_table": "categories", "inner_table": "orders", "outer_alias": "catg", "inner_alias": "ord", "proj_col": "value", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_10011
train
T2
v3
Schema: schedules (alias: schd)(type, name, code, level) employees(id, level, type, code) Task: Retrieve name from schedules with value above the COUNT(amount) of employees rows sharing the same type. SQL:
SELECT name FROM schedules AS schd WHERE value > ( SELECT COUNT(amount) FROM employees AS emp WHERE emp.type = schd.type );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_10012
train
T2
v2
Schema: accounts (alias: acct)(type, salary, id, date) orders(name, level, value, id) Task: Find code from accounts where a matching record exists in orders with the same status. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = acct.status );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "code", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_10013
train
T1
v1
Schema: accounts (alias: acct)(id, amount, level, type) customers(code, status, level, date) Task: Retrieve name from accounts whose id is found in customers rows where code matches the outer record. SQL:
SELECT name FROM accounts AS acct WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.code = acct.code );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_10014
train
T1
v3
Schema: accounts (alias: acct)(type, value, date, level) managers(name, level, date, value) Task: Retrieve name from accounts with salary above the AVG(salary) of managers rows sharing the same code. SQL:
SELECT name FROM accounts AS acct WHERE salary > ( SELECT AVG(salary) FROM managers AS mgr WHERE mgr.code = acct.code );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_10015
train
T1
v1
Schema: transactions (alias: txn)(salary, amount, level, name) products(status, level, name, code) Task: Select amount from transactions where code exists in products for the same type. SQL:
SELECT amount FROM transactions AS txn WHERE code IN ( SELECT code FROM products AS prod WHERE prod.type = txn.type );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_10016
train
T1
v3
Schema: budgets (alias: budg)(amount, name, salary, level) departments(salary, type, value, status) Task: Retrieve name from budgets with value above the MAX(salary) of departments rows sharing the same id. SQL:
SELECT name FROM budgets AS budg WHERE value > ( SELECT MAX(salary) FROM departments AS dept WHERE dept.id = budg.id );
{ "outer_table": "budgets", "inner_table": "departments", "outer_alias": "budg", "inner_alias": "dept", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_10017
train
T2
v3
Schema: accounts (alias: acct)(id, name, value, level) invoices(salary, name, id, date) Task: Find code from accounts where amount exceeds the average value from invoices for the same level. SQL:
SELECT code FROM accounts AS acct WHERE amount > ( SELECT COUNT(value) FROM invoices AS inv WHERE inv.level = acct.level );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_10018
train
T1
v1
Schema: accounts (alias: acct)(type, name, amount, id) schedules(date, code, id, amount) Task: Select amount from accounts where status exists in schedules for the same id. SQL:
SELECT amount FROM accounts AS acct WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.id = acct.id );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_10019
train
T1
v3
Schema: staff (alias: empl)(code, date, amount, id) managers(id, type, name, value) Task: Retrieve name from staff with amount above the SUM(value) of managers rows sharing the same status. SQL:
SELECT name FROM staff AS empl WHERE amount > ( SELECT SUM(value) FROM managers AS mgr WHERE mgr.status = empl.status );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_10020
train
T2
v3
Schema: orders (alias: ord)(value, date, code, type) invoices(code, date, amount, salary) Task: Retrieve amount from orders with value above the MIN(amount) of invoices rows sharing the same id. SQL:
SELECT amount FROM orders AS ord WHERE value > ( SELECT MIN(amount) FROM invoices AS inv WHERE inv.id = ord.id );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_10021
train
T1
v2
Schema: categories (alias: catg)(date, type, code, salary) accounts(name, value, amount, code) Task: Retrieve code from categories that have at least one corresponding entry in accounts sharing the same id. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = catg.id );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "code", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_10022
train
T2
v1
Schema: budgets (alias: budg)(level, name, date, code) departments(code, status, name, amount) Task: Select id from budgets where code exists in departments for the same id. SQL:
SELECT id FROM budgets AS budg WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.id = budg.id );
{ "outer_table": "budgets", "inner_table": "departments", "outer_alias": "budg", "inner_alias": "dept", "proj_col": "id", "filter_col": "code", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_10023
train
T2
v3
Schema: budgets (alias: budg)(amount, id, level, salary) warehouses(value, salary, amount, status) Task: Retrieve name from budgets with amount above the MAX(salary) of warehouses rows sharing the same code. SQL:
SELECT name FROM budgets AS budg WHERE amount > ( SELECT MAX(salary) FROM warehouses AS whs WHERE whs.code = budg.code );
{ "outer_table": "budgets", "inner_table": "warehouses", "outer_alias": "budg", "inner_alias": "whs", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_10024
train
T2
v2
Schema: warehouses (alias: whs)(type, id, date, value) departments(type, name, date, code) Task: Retrieve value from warehouses that have at least one corresponding entry in departments sharing the same level. SQL:
SELECT value FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "departments", "outer_alias": "whs", "inner_alias": "dept", "proj_col": "value", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_10025
train
T2
v1
Schema: transactions (alias: txn)(level, status, name, date) warehouses(status, salary, code, level) Task: Find value from transactions where id appears in warehouses entries with matching id. SQL:
SELECT value FROM transactions AS txn WHERE id IN ( SELECT id FROM warehouses AS whs WHERE whs.id = txn.id );
{ "outer_table": "transactions", "inner_table": "warehouses", "outer_alias": "txn", "inner_alias": "whs", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_10026
train
T1
v1
Schema: departments (alias: dept)(value, salary, name, id) transactions(id, level, value, amount) Task: Select amount from departments where id exists in transactions for the same level. SQL:
SELECT amount FROM departments AS dept WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.level = dept.level );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_10027
train
T1
v1
Schema: staff (alias: empl)(id, name, status, type) requests(name, status, date, code) Task: Find value from staff where code appears in requests entries with matching code. SQL:
SELECT value FROM staff AS empl WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.code = empl.code );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_10028
train
T2
v3
Schema: budgets (alias: budg)(level, code, status, amount) departments(type, level, code, date) Task: Retrieve amount from budgets with value above the MAX(amount) of departments rows sharing the same status. SQL:
SELECT amount FROM budgets AS budg WHERE value > ( SELECT MAX(amount) FROM departments AS dept WHERE dept.status = budg.status );
{ "outer_table": "budgets", "inner_table": "departments", "outer_alias": "budg", "inner_alias": "dept", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_10029
train
T2
v2
Schema: items (alias: lne)(level, id, value, type) shipments(code, date, salary, level) Task: Find salary from items where a matching record exists in shipments with the same type. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = lne.type );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "salary", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_10030
train
T2
v2
Schema: items (alias: lne)(value, code, level, amount) schedules(date, status, name, type) Task: Retrieve id from items that have at least one corresponding entry in schedules sharing the same id. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = lne.id );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "id", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_10031
train
T2
v1
Schema: products (alias: prod)(level, type, date, id) employees(name, value, id, amount) Task: Find salary from products where type appears in employees entries with matching type. SQL:
SELECT salary FROM products AS prod WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.type = prod.type );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_10032
train
T1
v1
Schema: sales (alias: sale)(status, name, value, salary) requests(code, value, id, name) Task: Select id from sales where type exists in requests for the same level. SQL:
SELECT id FROM sales AS sale WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.level = sale.level );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_10033
train
T1
v2
Schema: shipments (alias: shp)(code, status, level, salary) requests(level, code, amount, type) Task: Find id from shipments where a matching record exists in requests with the same code. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = shp.code );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "id", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_10034
train
T2
v1
Schema: regions (alias: rgn)(date, level, type, salary) employees(status, date, value, level) Task: Find value from regions where status appears in employees entries with matching id. SQL:
SELECT value FROM regions AS rgn WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.id = rgn.id );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_10035
train
T2
v3
Schema: shipments (alias: shp)(salary, name, value, date) requests(level, id, date, type) Task: Find code from shipments where value exceeds the average value from requests for the same id. SQL:
SELECT code FROM shipments AS shp WHERE value > ( SELECT MIN(value) FROM requests AS ordr WHERE ordr.id = shp.id );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_10036
train
T2
v3
Schema: warehouses (alias: whs)(status, value, code, type) sales(code, type, amount, date) Task: Find value from warehouses where salary exceeds the average amount from sales for the same status. SQL:
SELECT value FROM warehouses AS whs WHERE salary > ( SELECT SUM(amount) FROM sales AS sale WHERE sale.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "sales", "outer_alias": "whs", "inner_alias": "sale", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_10037
train
T2
v1
Schema: shipments (alias: shp)(salary, status, code, id) transactions(salary, value, date, type) Task: Find id from shipments where type appears in transactions entries with matching id. SQL:
SELECT id FROM shipments AS shp WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.id = shp.id );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_10038
train
T2
v2
Schema: managers (alias: mgr)(level, code, name, date) schedules(value, name, id, code) Task: Retrieve salary from managers that have at least one corresponding entry in schedules sharing the same id. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = mgr.id );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "salary", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_10039
train
T1
v2
Schema: departments (alias: dept)(name, id, amount, level) categories(salary, code, name, status) Task: Find name from departments where a matching record exists in categories with the same status. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = dept.status );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "name", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_10040
train
T1
v1
Schema: sales (alias: sale)(salary, status, value, level) orders(value, type, salary, status) Task: Find amount from sales where level appears in orders entries with matching level. SQL:
SELECT amount FROM sales AS sale WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.level = sale.level );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "amount", "filter_col": "level", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_10041
train
T1
v1
Schema: invoices (alias: inv)(salary, type, id, code) orders(id, salary, type, amount) Task: Find id from invoices where status appears in orders entries with matching type. SQL:
SELECT id FROM invoices AS inv WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.type = inv.type );
{ "outer_table": "invoices", "inner_table": "orders", "outer_alias": "inv", "inner_alias": "ord", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_10042
train
T1
v3
Schema: sales (alias: sale)(code, id, status, value) employees(date, status, type, code) Task: Retrieve code from sales with salary above the MIN(salary) of employees rows sharing the same id. SQL:
SELECT code FROM sales AS sale WHERE salary > ( SELECT MIN(salary) FROM employees AS emp WHERE emp.id = sale.id );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_10043
train
T1
v3
Schema: departments (alias: dept)(status, name, level, code) orders(value, status, amount, name) Task: Retrieve salary from departments with salary above the COUNT(amount) of orders rows sharing the same level. SQL:
SELECT salary FROM departments AS dept WHERE salary > ( SELECT COUNT(amount) FROM orders AS ord WHERE ord.level = dept.level );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_10044
train
T1
v1
Schema: products (alias: prod)(value, type, name, salary) schedules(name, date, code, id) Task: Find id from products where status appears in schedules entries with matching level. SQL:
SELECT id FROM products AS prod WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.level = prod.level );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "id", "filter_col": "status", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_10045
train
T1
v3
Schema: employees (alias: emp)(id, date, code, amount) customers(status, date, amount, name) Task: Find value from employees where salary exceeds the average value from customers for the same type. SQL:
SELECT value FROM employees AS emp WHERE salary > ( SELECT COUNT(value) FROM customers AS cust WHERE cust.type = emp.type );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_10046
train
T1
v3
Schema: customers (alias: cust)(code, type, value, level) managers(amount, level, type, salary) Task: Find salary from customers where value exceeds the average amount from managers for the same status. SQL:
SELECT salary FROM customers AS cust WHERE value > ( SELECT SUM(amount) FROM managers AS mgr WHERE mgr.status = cust.status );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_10047
train
T1
v3
Schema: regions (alias: rgn)(amount, type, level, name) schedules(type, amount, level, code) Task: Retrieve value from regions with amount above the COUNT(value) of schedules rows sharing the same code. SQL:
SELECT value FROM regions AS rgn WHERE amount > ( SELECT COUNT(value) FROM schedules AS schd WHERE schd.code = rgn.code );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_10048
train
T2
v3
Schema: staff (alias: empl)(amount, name, id, type) products(amount, id, date, level) Task: Retrieve amount from staff with value above the SUM(value) of products rows sharing the same level. SQL:
SELECT amount FROM staff AS empl WHERE value > ( SELECT SUM(value) FROM products AS prod WHERE prod.level = empl.level );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_10049
train
T2
v3
Schema: shipments (alias: shp)(salary, type, date, value) categories(name, date, amount, id) Task: Find value from shipments where salary exceeds the average value from categories for the same id. SQL:
SELECT value FROM shipments AS shp WHERE salary > ( SELECT SUM(value) FROM categories AS catg WHERE catg.id = shp.id );
{ "outer_table": "shipments", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "catg", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_10050
train
T2
v1
Schema: staff (alias: empl)(name, level, value, amount) departments(id, amount, code, name) Task: Select value from staff where level exists in departments for the same id. SQL:
SELECT value FROM staff AS empl WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.id = empl.id );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "value", "filter_col": "level", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_10051
train
T2
v2
Schema: accounts (alias: acct)(type, date, level, salary) managers(name, date, salary, status) Task: Retrieve name from accounts that have at least one corresponding entry in managers sharing the same code. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = acct.code );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "name", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_10052
train
T1
v2
Schema: accounts (alias: acct)(status, level, id, value) employees(level, salary, date, status) Task: Find code from accounts where a matching record exists in employees with the same level. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = acct.level );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "code", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_10053
train
T1
v1
Schema: invoices (alias: inv)(status, type, date, level) requests(date, amount, level, id) Task: Select code from invoices where status exists in requests for the same type. SQL:
SELECT code FROM invoices AS inv WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.type = inv.type );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_10054
train
T1
v2
Schema: products (alias: prod)(salary, code, status, value) shipments(status, code, id, date) Task: Find id from products where a matching record exists in shipments with the same type. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = prod.type );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "id", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_10055
train
T1
v1
Schema: invoices (alias: inv)(type, level, salary, code) products(type, id, value, name) Task: Retrieve name from invoices whose id is found in products rows where code matches the outer record. SQL:
SELECT name FROM invoices AS inv WHERE id IN ( SELECT id FROM products AS prod WHERE prod.code = inv.code );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_10056
train
T1
v2
Schema: products (alias: prod)(level, amount, name, type) managers(value, amount, level, salary) Task: Retrieve salary from products that have at least one corresponding entry in managers sharing the same code. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = prod.code );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "salary", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_10057
train
T1
v1
Schema: accounts (alias: acct)(amount, id, salary, value) managers(status, name, type, id) Task: Select amount from accounts where status exists in managers for the same type. SQL:
SELECT amount FROM accounts AS acct WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.type = acct.type );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "status", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_10058
train
T1
v1
Schema: invoices (alias: inv)(name, value, type, salary) staff(status, value, level, type) Task: Retrieve id from invoices whose type is found in staff rows where status matches the outer record. SQL:
SELECT id FROM invoices AS inv WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.status = inv.status );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "id", "filter_col": "type", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_10059
train
T1
v2
Schema: regions (alias: rgn)(value, salary, type, id) products(type, code, id, salary) Task: Retrieve amount from regions that have at least one corresponding entry in products sharing the same status. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = rgn.status );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "amount", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_10060
train
T2
v3
Schema: invoices (alias: inv)(value, id, date, name) orders(code, status, level, date) Task: Retrieve value from invoices with salary above the COUNT(amount) of orders rows sharing the same code. SQL:
SELECT value FROM invoices AS inv WHERE salary > ( SELECT COUNT(amount) FROM orders AS ord WHERE ord.code = inv.code );
{ "outer_table": "invoices", "inner_table": "orders", "outer_alias": "inv", "inner_alias": "ord", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_10061
train
T1
v3
Schema: managers (alias: mgr)(code, status, type, salary) sales(id, status, code, level) Task: Find name from managers where salary exceeds the average salary from sales for the same level. SQL:
SELECT name FROM managers AS mgr WHERE salary > ( SELECT MIN(salary) FROM sales AS sale WHERE sale.level = mgr.level );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_10062
train
T1
v3
Schema: orders (alias: ord)(id, amount, value, date) departments(value, name, status, code) Task: Retrieve salary from orders with value above the AVG(salary) of departments rows sharing the same status. SQL:
SELECT salary FROM orders AS ord WHERE value > ( SELECT AVG(salary) FROM departments AS dept WHERE dept.status = ord.status );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_10063
train
T1
v1
Schema: items (alias: lne)(name, salary, code, amount) managers(name, amount, code, level) Task: Find name from items where level appears in managers entries with matching id. SQL:
SELECT name FROM items AS lne WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.id = lne.id );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "name", "filter_col": "level", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_10064
train
T2
v3
Schema: schedules (alias: schd)(id, salary, name, value) staff(code, name, type, value) Task: Find id from schedules where value exceeds the average value from staff for the same level. SQL:
SELECT id FROM schedules AS schd WHERE value > ( SELECT MIN(value) FROM staff AS empl WHERE empl.level = schd.level );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_10065
train
T2
v3
Schema: budgets (alias: budg)(status, salary, code, id) invoices(date, code, salary, name) Task: Find id from budgets where salary exceeds the average amount from invoices for the same type. SQL:
SELECT id FROM budgets AS budg WHERE salary > ( SELECT MAX(amount) FROM invoices AS inv WHERE inv.type = budg.type );
{ "outer_table": "budgets", "inner_table": "invoices", "outer_alias": "budg", "inner_alias": "inv", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_10066
train
T2
v1
Schema: schedules (alias: schd)(level, value, id, name) departments(code, name, amount, value) Task: Find value from schedules where level appears in departments entries with matching type. SQL:
SELECT value FROM schedules AS schd WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.type = schd.type );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_10067
train
T2
v3
Schema: staff (alias: empl)(amount, date, type, code) budgets(status, id, salary, value) Task: Find code from staff where value exceeds the average value from budgets for the same status. SQL:
SELECT code FROM staff AS empl WHERE value > ( SELECT COUNT(value) FROM budgets AS budg WHERE budg.status = empl.status );
{ "outer_table": "staff", "inner_table": "budgets", "outer_alias": "empl", "inner_alias": "budg", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_10068
train
T2
v3
Schema: budgets (alias: budg)(type, date, salary, value) employees(name, salary, value, level) Task: Find name from budgets where amount exceeds the average value from employees for the same status. SQL:
SELECT name FROM budgets AS budg WHERE amount > ( SELECT COUNT(value) FROM employees AS emp WHERE emp.status = budg.status );
{ "outer_table": "budgets", "inner_table": "employees", "outer_alias": "budg", "inner_alias": "emp", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_10069
train
T2
v1
Schema: invoices (alias: inv)(value, date, amount, type) items(salary, value, id, type) Task: Retrieve amount from invoices whose status is found in items rows where id matches the outer record. SQL:
SELECT amount FROM invoices AS inv WHERE status IN ( SELECT status FROM items AS lne WHERE lne.id = inv.id );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_10070
train
T1
v2
Schema: managers (alias: mgr)(id, salary, value, amount) services(name, value, code, level) Task: Retrieve amount from managers that have at least one corresponding entry in services sharing the same id. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = mgr.id );
{ "outer_table": "managers", "inner_table": "services", "outer_alias": "mgr", "inner_alias": "srvc", "proj_col": "amount", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_10071
train
T1
v1
Schema: sales (alias: sale)(code, value, status, id) departments(value, level, amount, type) Task: Find value from sales where type appears in departments entries with matching code. SQL:
SELECT value FROM sales AS sale WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.code = sale.code );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_10072
train
T1
v3
Schema: requests (alias: ordr)(value, amount, level, type) categories(date, id, value, amount) Task: Retrieve name from requests with value above the MIN(salary) of categories rows sharing the same type. SQL:
SELECT name FROM requests AS ordr WHERE value > ( SELECT MIN(salary) FROM categories AS catg WHERE catg.type = ordr.type );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_10073
train
T2
v3
Schema: transactions (alias: txn)(level, name, code, value) employees(amount, value, level, type) Task: Find salary from transactions where amount exceeds the average value from employees for the same level. SQL:
SELECT salary FROM transactions AS txn WHERE amount > ( SELECT AVG(value) FROM employees AS emp WHERE emp.level = txn.level );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_10074
train
T1
v2
Schema: customers (alias: cust)(value, code, name, id) transactions(type, date, value, id) Task: Retrieve id from customers that have at least one corresponding entry in transactions sharing the same level. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = cust.level );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "id", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_10075
train
T1
v2
Schema: sales (alias: sale)(level, value, amount, date) requests(code, date, status, id) Task: Retrieve salary from sales that have at least one corresponding entry in requests sharing the same type. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = sale.type );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "salary", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_10076
train
T1
v3
Schema: invoices (alias: inv)(level, salary, code, status) items(id, value, type, level) Task: Retrieve id from invoices with value above the MAX(value) of items rows sharing the same id. SQL:
SELECT id FROM invoices AS inv WHERE value > ( SELECT MAX(value) FROM items AS lne WHERE lne.id = inv.id );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_10077
train
T1
v3
Schema: sales (alias: sale)(salary, type, name, amount) budgets(name, status, amount, date) Task: Find salary from sales where salary exceeds the average salary from budgets for the same code. SQL:
SELECT salary FROM sales AS sale WHERE salary > ( SELECT AVG(salary) FROM budgets AS budg WHERE budg.code = sale.code );
{ "outer_table": "sales", "inner_table": "budgets", "outer_alias": "sale", "inner_alias": "budg", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_10078
train
T1
v2
Schema: employees (alias: emp)(value, amount, salary, code) staff(type, date, amount, value) Task: Find salary from employees where a matching record exists in staff with the same level. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = emp.level );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "salary", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_10079
train
T1
v3
Schema: customers (alias: cust)(level, name, code, status) items(date, code, name, salary) Task: Retrieve code from customers with salary above the COUNT(amount) of items rows sharing the same status. SQL:
SELECT code FROM customers AS cust WHERE salary > ( SELECT COUNT(amount) FROM items AS lne WHERE lne.status = cust.status );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_10080
train
T1
v1
Schema: shipments (alias: shp)(date, name, status, id) requests(type, value, name, date) Task: Retrieve salary from shipments whose status is found in requests rows where id matches the outer record. SQL:
SELECT salary FROM shipments AS shp WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.id = shp.id );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "status", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_10081
train
T2
v2
Schema: shipments (alias: shp)(id, value, salary, level) categories(type, level, code, date) Task: Find id from shipments where a matching record exists in categories with the same code. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = shp.code );
{ "outer_table": "shipments", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "catg", "proj_col": "id", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_10082
train
T2
v1
Schema: invoices (alias: inv)(level, date, amount, status) regions(status, level, id, amount) Task: Select amount from invoices where type exists in regions for the same type. SQL:
SELECT amount FROM invoices AS inv WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.type = inv.type );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_10083
train
T1
v3
Schema: regions (alias: rgn)(amount, type, salary, code) warehouses(type, id, code, name) Task: Find name from regions where salary exceeds the average salary from warehouses for the same code. SQL:
SELECT name FROM regions AS rgn WHERE salary > ( SELECT MIN(salary) FROM warehouses AS whs WHERE whs.code = rgn.code );
{ "outer_table": "regions", "inner_table": "warehouses", "outer_alias": "rgn", "inner_alias": "whs", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_10084
train
T2
v2
Schema: shipments (alias: shp)(type, id, code, value) managers(code, value, amount, date) Task: Find amount from shipments where a matching record exists in managers with the same type. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = shp.type );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "amount", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_10085
train
T2
v3
Schema: schedules (alias: schd)(name, date, salary, value) products(name, id, code, amount) Task: Retrieve code from schedules with value above the AVG(amount) of products rows sharing the same status. SQL:
SELECT code FROM schedules AS schd WHERE value > ( SELECT AVG(amount) FROM products AS prod WHERE prod.status = schd.status );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_10086
train
T2
v1
Schema: requests (alias: ordr)(code, level, name, id) categories(amount, type, status, code) Task: Select salary from requests where id exists in categories for the same id. SQL:
SELECT salary FROM requests AS ordr WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.id = ordr.id );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_10087
train
T2
v3
Schema: items (alias: lne)(level, type, value, name) orders(id, salary, type, code) Task: Retrieve code from items with value above the COUNT(amount) of orders rows sharing the same id. SQL:
SELECT code FROM items AS lne WHERE value > ( SELECT COUNT(amount) FROM orders AS ord WHERE ord.id = lne.id );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_10088
train
T2
v2
Schema: schedules (alias: schd)(date, status, type, level) orders(type, code, value, date) Task: Retrieve name from schedules that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = schd.level );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "name", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_10089
train
T2
v3
Schema: staff (alias: empl)(code, value, type, status) schedules(level, date, salary, type) Task: Retrieve name from staff with amount above the MIN(value) of schedules rows sharing the same status. SQL:
SELECT name FROM staff AS empl WHERE amount > ( SELECT MIN(value) FROM schedules AS schd WHERE schd.status = empl.status );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_10090
train
T2
v2
Schema: staff (alias: empl)(amount, type, name, id) schedules(level, status, id, date) Task: Retrieve id from staff that have at least one corresponding entry in schedules sharing the same type. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = empl.type );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "id", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_10091
train
T2
v3
Schema: invoices (alias: inv)(id, status, type, code) orders(date, status, amount, id) Task: Find salary from invoices where salary exceeds the average amount from orders for the same status. SQL:
SELECT salary FROM invoices AS inv WHERE salary > ( SELECT AVG(amount) FROM orders AS ord WHERE ord.status = inv.status );
{ "outer_table": "invoices", "inner_table": "orders", "outer_alias": "inv", "inner_alias": "ord", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_10092
train
T1
v3
Schema: sales (alias: sale)(amount, level, value, name) services(code, salary, level, date) Task: Retrieve amount from sales with salary above the COUNT(amount) of services rows sharing the same id. SQL:
SELECT amount FROM sales AS sale WHERE salary > ( SELECT COUNT(amount) FROM services AS srvc WHERE srvc.id = sale.id );
{ "outer_table": "sales", "inner_table": "services", "outer_alias": "sale", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_10093
train
T1
v1
Schema: staff (alias: empl)(date, salary, amount, type) orders(code, salary, status, value) Task: Find salary from staff where level appears in orders entries with matching code. SQL:
SELECT salary FROM staff AS empl WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.code = empl.code );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "salary", "filter_col": "level", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_10094
train
T2
v2
Schema: schedules (alias: schd)(level, type, amount, status) accounts(value, code, amount, salary) Task: Find id from schedules where a matching record exists in accounts with the same code. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = schd.code );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "id", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_10095
train
T2
v1
Schema: products (alias: prod)(name, id, level, status) accounts(id, status, amount, date) Task: Find salary from products where id appears in accounts entries with matching code. SQL:
SELECT salary FROM products AS prod WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.code = prod.code );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_10096
train
T1
v2
Schema: warehouses (alias: whs)(value, type, level, amount) customers(salary, value, id, date) Task: Retrieve id from warehouses that have at least one corresponding entry in customers sharing the same code. SQL:
SELECT id FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "customers", "outer_alias": "whs", "inner_alias": "cust", "proj_col": "id", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_10097
train
T2
v2
Schema: requests (alias: ordr)(salary, level, status, amount) accounts(value, id, code, level) Task: Find value from requests where a matching record exists in accounts with the same code. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = ordr.code );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "value", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_10098
train
T2
v2
Schema: customers (alias: cust)(status, id, name, salary) regions(type, id, level, date) Task: Retrieve name from customers that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = cust.level );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "name", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_10099
train
T1