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: managers (alias: mgr)(name, id, value, code) requests(date, code, salary, value) Task: Find salary from managers where a matching record exists in requests with the same code. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = mgr.code );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "salary", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_04000
train
T1
v1
Schema: invoices (alias: inv)(amount, status, id, code) transactions(date, level, id, amount) Task: Select value from invoices where code exists in transactions for the same type. SQL:
SELECT value FROM invoices AS inv WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.type = inv.type );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_04001
train
T1
v3
Schema: transactions (alias: txn)(level, date, id, name) managers(code, id, salary, level) Task: Find value from transactions where salary exceeds the average salary from managers for the same status. SQL:
SELECT value FROM transactions AS txn WHERE salary > ( SELECT MAX(salary) FROM managers AS mgr WHERE mgr.status = txn.status );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_04002
train
T1
v3
Schema: budgets (alias: budg)(status, level, salary, code) regions(id, amount, code, value) Task: Retrieve name from budgets with amount above the MAX(salary) of regions rows sharing the same level. SQL:
SELECT name FROM budgets AS budg WHERE amount > ( SELECT MAX(salary) FROM regions AS rgn WHERE rgn.level = budg.level );
{ "outer_table": "budgets", "inner_table": "regions", "outer_alias": "budg", "inner_alias": "rgn", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_04003
train
T2
v1
Schema: staff (alias: empl)(type, code, id, name) products(date, level, name, type) Task: Find salary from staff where type appears in products entries with matching id. SQL:
SELECT salary FROM staff AS empl WHERE type IN ( SELECT type FROM products AS prod WHERE prod.id = empl.id );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "salary", "filter_col": "type", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_04004
train
T2
v1
Schema: departments (alias: dept)(amount, level, id, name) managers(level, value, name, id) Task: Retrieve code from departments whose status is found in managers rows where code matches the outer record. SQL:
SELECT code FROM departments AS dept WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.code = dept.code );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "code", "filter_col": "status", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_04005
train
T1
v2
Schema: orders (alias: ord)(amount, type, date, code) warehouses(date, status, id, type) Task: Find salary from orders where a matching record exists in warehouses with the same level. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.level = ord.level );
{ "outer_table": "orders", "inner_table": "warehouses", "outer_alias": "ord", "inner_alias": "whs", "proj_col": "salary", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_04006
train
T1
v1
Schema: regions (alias: rgn)(type, amount, id, status) requests(type, code, salary, amount) Task: Select amount from regions where id exists in requests for the same id. SQL:
SELECT amount FROM regions AS rgn WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.id = rgn.id );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "id", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_04007
train
T2
v1
Schema: managers (alias: mgr)(date, name, salary, type) sales(level, amount, code, value) Task: Retrieve value from managers whose level is found in sales rows where code matches the outer record. SQL:
SELECT value FROM managers AS mgr WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.code = mgr.code );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_04008
train
T1
v3
Schema: schedules (alias: schd)(level, salary, type, value) items(level, amount, id, status) Task: Find id from schedules where salary exceeds the average salary from items for the same level. SQL:
SELECT id FROM schedules AS schd WHERE salary > ( SELECT SUM(salary) FROM items AS lne WHERE lne.level = schd.level );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_04009
train
T2
v1
Schema: accounts (alias: acct)(date, value, amount, status) sales(name, id, amount, date) Task: Select name from accounts where code exists in sales for the same code. SQL:
SELECT name FROM accounts AS acct WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.code = acct.code );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_04010
train
T1
v3
Schema: services (alias: srvc)(amount, code, value, salary) warehouses(status, value, level, id) Task: Retrieve amount from services with salary above the SUM(amount) of warehouses rows sharing the same type. SQL:
SELECT amount FROM services AS srvc WHERE salary > ( SELECT SUM(amount) FROM warehouses AS whs WHERE whs.type = srvc.type );
{ "outer_table": "services", "inner_table": "warehouses", "outer_alias": "srvc", "inner_alias": "whs", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_04011
train
T2
v2
Schema: customers (alias: cust)(amount, value, status, type) employees(status, type, amount, level) Task: Find value from customers where a matching record exists in employees with the same type. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = cust.type );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "value", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_04012
train
T1
v3
Schema: warehouses (alias: whs)(salary, level, code, date) services(amount, id, type, name) Task: Find salary from warehouses where value exceeds the average salary from services for the same type. SQL:
SELECT salary FROM warehouses AS whs WHERE value > ( SELECT SUM(salary) FROM services AS srvc WHERE srvc.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "services", "outer_alias": "whs", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_04013
train
T2
v1
Schema: shipments (alias: shp)(salary, status, code, date) staff(amount, level, id, value) Task: Retrieve id from shipments whose type is found in staff rows where type matches the outer record. SQL:
SELECT id FROM shipments AS shp WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.type = shp.type );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "id", "filter_col": "type", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_04014
train
T2
v1
Schema: departments (alias: dept)(value, date, name, type) shipments(code, amount, status, date) Task: Find salary from departments where status appears in shipments entries with matching status. SQL:
SELECT salary FROM departments AS dept WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.status = dept.status );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_04015
train
T1
v1
Schema: employees (alias: emp)(type, status, id, level) categories(name, amount, level, code) Task: Select value from employees where id exists in categories for the same status. SQL:
SELECT value FROM employees AS emp WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.status = emp.status );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_04016
train
T1
v2
Schema: budgets (alias: budg)(amount, value, type, code) customers(value, name, id, amount) Task: Find amount from budgets where a matching record exists in customers with the same id. SQL:
SELECT amount FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = budg.id );
{ "outer_table": "budgets", "inner_table": "customers", "outer_alias": "budg", "inner_alias": "cust", "proj_col": "amount", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_04017
train
T2
v1
Schema: employees (alias: emp)(status, date, amount, name) services(value, level, code, type) Task: Find salary from employees where status appears in services entries with matching code. SQL:
SELECT salary FROM employees AS emp WHERE status IN ( SELECT status FROM services AS srvc WHERE srvc.code = emp.code );
{ "outer_table": "employees", "inner_table": "services", "outer_alias": "emp", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_04018
train
T1
v1
Schema: staff (alias: empl)(code, id, salary, date) employees(status, amount, type, id) Task: Select amount from staff where id exists in employees for the same code. SQL:
SELECT amount FROM staff AS empl WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.code = empl.code );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_04019
train
T2
v1
Schema: accounts (alias: acct)(level, id, status, date) employees(type, status, id, level) Task: Retrieve amount from accounts whose id is found in employees rows where type matches the outer record. SQL:
SELECT amount FROM accounts AS acct WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.type = acct.type );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_04020
train
T1
v3
Schema: sales (alias: sale)(value, id, date, type) departments(id, status, date, name) Task: Find salary from sales where salary exceeds the average amount from departments for the same id. SQL:
SELECT salary FROM sales AS sale WHERE salary > ( SELECT MAX(amount) FROM departments AS dept WHERE dept.id = sale.id );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_04021
train
T1
v2
Schema: budgets (alias: budg)(status, code, name, date) products(id, type, salary, date) Task: Retrieve name from budgets that have at least one corresponding entry in products sharing the same code. SQL:
SELECT name FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = budg.code );
{ "outer_table": "budgets", "inner_table": "products", "outer_alias": "budg", "inner_alias": "prod", "proj_col": "name", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_04022
train
T2
v2
Schema: managers (alias: mgr)(date, name, salary, level) orders(status, type, salary, value) Task: Find name from managers where a matching record exists in orders with the same level. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = mgr.level );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "name", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_04023
train
T1
v2
Schema: sales (alias: sale)(code, type, name, status) managers(value, type, name, status) Task: Find amount from sales where a matching record exists in managers with the same level. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = sale.level );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "amount", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_04024
train
T1
v3
Schema: managers (alias: mgr)(level, name, type, code) departments(status, date, amount, name) Task: Find name from managers where salary exceeds the average amount from departments for the same type. SQL:
SELECT name FROM managers AS mgr WHERE salary > ( SELECT MIN(amount) FROM departments AS dept WHERE dept.type = mgr.type );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_04025
train
T1
v2
Schema: budgets (alias: budg)(status, id, value, type) sales(name, salary, date, amount) Task: Retrieve value from budgets that have at least one corresponding entry in sales sharing the same id. SQL:
SELECT value FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = budg.id );
{ "outer_table": "budgets", "inner_table": "sales", "outer_alias": "budg", "inner_alias": "sale", "proj_col": "value", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_04026
train
T2
v1
Schema: transactions (alias: txn)(type, amount, status, salary) warehouses(name, amount, date, id) Task: Retrieve amount from transactions whose id is found in warehouses rows where status matches the outer record. SQL:
SELECT amount FROM transactions AS txn WHERE id IN ( SELECT id FROM warehouses AS whs WHERE whs.status = txn.status );
{ "outer_table": "transactions", "inner_table": "warehouses", "outer_alias": "txn", "inner_alias": "whs", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_04027
train
T1
v3
Schema: staff (alias: empl)(type, salary, date, status) items(status, date, value, salary) Task: Find amount from staff where amount exceeds the average salary from items for the same code. SQL:
SELECT amount FROM staff AS empl WHERE amount > ( SELECT MIN(salary) FROM items AS lne WHERE lne.code = empl.code );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_04028
train
T2
v2
Schema: products (alias: prod)(salary, code, type, id) accounts(level, date, status, type) Task: Find amount from products where a matching record exists in accounts with the same id. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = prod.id );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "amount", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_04029
train
T1
v1
Schema: services (alias: srvc)(status, amount, value, salary) schedules(salary, code, id, type) Task: Find id from services where type appears in schedules entries with matching code. SQL:
SELECT id FROM services AS srvc WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.code = srvc.code );
{ "outer_table": "services", "inner_table": "schedules", "outer_alias": "srvc", "inner_alias": "schd", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_04030
train
T2
v2
Schema: categories (alias: catg)(value, id, level, salary) warehouses(type, amount, salary, name) Task: Retrieve amount from categories that have at least one corresponding entry in warehouses sharing the same code. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.code = catg.code );
{ "outer_table": "categories", "inner_table": "warehouses", "outer_alias": "catg", "inner_alias": "whs", "proj_col": "amount", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_04031
train
T2
v2
Schema: items (alias: lne)(name, salary, value, code) warehouses(level, date, type, name) Task: Find name from items where a matching record exists in warehouses with the same level. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.level = lne.level );
{ "outer_table": "items", "inner_table": "warehouses", "outer_alias": "lne", "inner_alias": "whs", "proj_col": "name", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_04032
train
T2
v3
Schema: invoices (alias: inv)(type, name, salary, id) schedules(value, id, type, code) Task: Find name from invoices where salary exceeds the average salary from schedules for the same code. SQL:
SELECT name FROM invoices AS inv WHERE salary > ( SELECT MAX(salary) FROM schedules AS schd WHERE schd.code = inv.code );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_04033
train
T1
v2
Schema: transactions (alias: txn)(status, type, date, amount) accounts(id, amount, value, date) Task: Find name from transactions where a matching record exists in accounts with the same type. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = txn.type );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "name", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_04034
train
T1
v1
Schema: categories (alias: catg)(code, name, status, id) staff(id, level, date, status) Task: Find salary from categories where status appears in staff entries with matching level. SQL:
SELECT salary FROM categories AS catg WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.level = catg.level );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_04035
train
T2
v1
Schema: accounts (alias: acct)(amount, code, salary, id) shipments(amount, level, name, value) Task: Find name from accounts where status appears in shipments entries with matching type. SQL:
SELECT name FROM accounts AS acct WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.type = acct.type );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_04036
train
T1
v2
Schema: invoices (alias: inv)(id, status, code, name) employees(id, date, name, level) Task: Find value from invoices where a matching record exists in employees with the same status. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = inv.status );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "value", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_04037
train
T1
v3
Schema: budgets (alias: budg)(code, status, salary, level) transactions(code, status, level, type) Task: Find id from budgets where value exceeds the average salary from transactions for the same code. SQL:
SELECT id FROM budgets AS budg WHERE value > ( SELECT COUNT(salary) FROM transactions AS txn WHERE txn.code = budg.code );
{ "outer_table": "budgets", "inner_table": "transactions", "outer_alias": "budg", "inner_alias": "txn", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_04038
train
T2
v1
Schema: customers (alias: cust)(status, code, type, amount) orders(level, code, value, name) Task: Retrieve salary from customers whose code is found in orders rows where type matches the outer record. SQL:
SELECT salary FROM customers AS cust WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.type = cust.type );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_04039
train
T1
v1
Schema: products (alias: prod)(name, type, salary, code) requests(id, value, salary, amount) Task: Retrieve id from products whose level is found in requests rows where id matches the outer record. SQL:
SELECT id FROM products AS prod WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.id = prod.id );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_04040
train
T1
v2
Schema: warehouses (alias: whs)(id, name, amount, type) sales(type, name, id, amount) Task: Retrieve name from warehouses that have at least one corresponding entry in sales sharing the same status. SQL:
SELECT name FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "sales", "outer_alias": "whs", "inner_alias": "sale", "proj_col": "name", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_04041
train
T2
v1
Schema: shipments (alias: shp)(date, salary, type, value) accounts(type, date, code, value) Task: Find code from shipments where id appears in accounts entries with matching type. SQL:
SELECT code FROM shipments AS shp WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.type = shp.type );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "code", "filter_col": "id", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_04042
train
T2
v2
Schema: warehouses (alias: whs)(id, status, code, amount) items(type, id, date, value) Task: Retrieve code from warehouses that have at least one corresponding entry in items sharing the same type. SQL:
SELECT code FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "items", "outer_alias": "whs", "inner_alias": "lne", "proj_col": "code", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_04043
train
T2
v2
Schema: schedules (alias: schd)(amount, code, id, name) managers(value, code, salary, amount) Task: Find salary from schedules where a matching record exists in managers with the same level. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = schd.level );
{ "outer_table": "schedules", "inner_table": "managers", "outer_alias": "schd", "inner_alias": "mgr", "proj_col": "salary", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_04044
train
T2
v3
Schema: warehouses (alias: whs)(salary, type, value, status) items(code, date, value, level) Task: Find amount from warehouses where salary exceeds the average value from items for the same code. SQL:
SELECT amount FROM warehouses AS whs WHERE salary > ( SELECT MAX(value) FROM items AS lne WHERE lne.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "items", "outer_alias": "whs", "inner_alias": "lne", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_04045
train
T2
v2
Schema: budgets (alias: budg)(id, type, date, status) regions(amount, type, value, id) Task: Retrieve value from budgets that have at least one corresponding entry in regions sharing the same id. SQL:
SELECT value FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = budg.id );
{ "outer_table": "budgets", "inner_table": "regions", "outer_alias": "budg", "inner_alias": "rgn", "proj_col": "value", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_04046
train
T2
v1
Schema: categories (alias: catg)(amount, date, name, value) staff(status, salary, id, value) Task: Find name from categories where code appears in staff entries with matching status. SQL:
SELECT name FROM categories AS catg WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.status = catg.status );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_04047
train
T2
v3
Schema: categories (alias: catg)(level, code, id, status) managers(code, salary, type, level) Task: Find salary from categories where value exceeds the average salary from managers for the same type. SQL:
SELECT salary FROM categories AS catg WHERE value > ( SELECT SUM(salary) FROM managers AS mgr WHERE mgr.type = catg.type );
{ "outer_table": "categories", "inner_table": "managers", "outer_alias": "catg", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_04048
train
T2
v3
Schema: requests (alias: ordr)(status, code, salary, type) services(id, level, date, name) Task: Find code from requests where salary exceeds the average salary from services for the same status. SQL:
SELECT code FROM requests AS ordr WHERE salary > ( SELECT MIN(salary) FROM services AS srvc WHERE srvc.status = ordr.status );
{ "outer_table": "requests", "inner_table": "services", "outer_alias": "ordr", "inner_alias": "srvc", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_04049
train
T2
v1
Schema: departments (alias: dept)(value, name, date, id) customers(salary, id, amount, type) Task: Retrieve value from departments whose code is found in customers rows where id matches the outer record. SQL:
SELECT value FROM departments AS dept WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.id = dept.id );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_04050
train
T1
v1
Schema: shipments (alias: shp)(salary, amount, status, value) products(code, value, level, amount) Task: Find amount from shipments where code appears in products entries with matching code. SQL:
SELECT amount FROM shipments AS shp WHERE code IN ( SELECT code FROM products AS prod WHERE prod.code = shp.code );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_04051
train
T2
v1
Schema: departments (alias: dept)(salary, date, name, status) schedules(code, name, type, level) Task: Select name from departments where id exists in schedules for the same status. SQL:
SELECT name FROM departments AS dept WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.status = dept.status );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "name", "filter_col": "id", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_04052
train
T1
v3
Schema: accounts (alias: acct)(name, status, salary, amount) staff(date, code, id, type) Task: Find id from accounts where salary exceeds the average salary from staff for the same type. SQL:
SELECT id FROM accounts AS acct WHERE salary > ( SELECT MAX(salary) FROM staff AS empl WHERE empl.type = acct.type );
{ "outer_table": "accounts", "inner_table": "staff", "outer_alias": "acct", "inner_alias": "empl", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_04053
train
T1
v1
Schema: products (alias: prod)(status, type, value, salary) sales(id, amount, value, status) Task: Retrieve amount from products whose code is found in sales rows where type matches the outer record. SQL:
SELECT amount FROM products AS prod WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.type = prod.type );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_04054
train
T1
v3
Schema: regions (alias: rgn)(value, level, code, amount) warehouses(id, name, level, code) Task: Retrieve code from regions with amount above the AVG(amount) of warehouses rows sharing the same type. SQL:
SELECT code FROM regions AS rgn WHERE amount > ( SELECT AVG(amount) FROM warehouses AS whs WHERE whs.type = rgn.type );
{ "outer_table": "regions", "inner_table": "warehouses", "outer_alias": "rgn", "inner_alias": "whs", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_04055
train
T2
v2
Schema: customers (alias: cust)(id, code, name, date) categories(date, salary, status, id) Task: Find code from customers where a matching record exists in categories with the same level. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = cust.level );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "code", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_04056
train
T1
v2
Schema: customers (alias: cust)(salary, level, code, type) managers(type, value, date, amount) Task: Retrieve value from customers that have at least one corresponding entry in managers sharing the same type. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = cust.type );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "value", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_04057
train
T1
v1
Schema: schedules (alias: schd)(amount, id, type, date) services(code, status, amount, id) Task: Retrieve amount from schedules whose level is found in services rows where status matches the outer record. SQL:
SELECT amount FROM schedules AS schd WHERE level IN ( SELECT level FROM services AS srvc WHERE srvc.status = schd.status );
{ "outer_table": "schedules", "inner_table": "services", "outer_alias": "schd", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_04058
train
T2
v1
Schema: warehouses (alias: whs)(amount, name, value, level) managers(value, status, code, id) Task: Select code from warehouses where id exists in managers for the same id. SQL:
SELECT code FROM warehouses AS whs WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "managers", "outer_alias": "whs", "inner_alias": "mgr", "proj_col": "code", "filter_col": "id", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_04059
train
T2
v3
Schema: customers (alias: cust)(amount, value, name, id) services(status, date, name, code) Task: Retrieve amount from customers with amount above the SUM(salary) of services rows sharing the same type. SQL:
SELECT amount FROM customers AS cust WHERE amount > ( SELECT SUM(salary) FROM services AS srvc WHERE srvc.type = cust.type );
{ "outer_table": "customers", "inner_table": "services", "outer_alias": "cust", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_04060
train
T1
v3
Schema: departments (alias: dept)(level, date, name, id) invoices(date, status, level, amount) Task: Find salary from departments where salary exceeds the average salary from invoices for the same type. SQL:
SELECT salary FROM departments AS dept WHERE salary > ( SELECT COUNT(salary) FROM invoices AS inv WHERE inv.type = dept.type );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_04061
train
T1
v3
Schema: products (alias: prod)(id, name, date, level) services(id, amount, type, code) Task: Retrieve salary from products with value above the MIN(value) of services rows sharing the same id. SQL:
SELECT salary FROM products AS prod WHERE value > ( SELECT MIN(value) FROM services AS srvc WHERE srvc.id = prod.id );
{ "outer_table": "products", "inner_table": "services", "outer_alias": "prod", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_04062
train
T1
v3
Schema: customers (alias: cust)(id, salary, amount, name) categories(name, level, value, id) Task: Retrieve code from customers with salary above the MIN(amount) of categories rows sharing the same status. SQL:
SELECT code FROM customers AS cust WHERE salary > ( SELECT MIN(amount) FROM categories AS catg WHERE catg.status = cust.status );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_04063
train
T1
v1
Schema: managers (alias: mgr)(salary, value, status, amount) invoices(id, date, amount, salary) Task: Select code from managers where type exists in invoices for the same status. SQL:
SELECT code FROM managers AS mgr WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.status = mgr.status );
{ "outer_table": "managers", "inner_table": "invoices", "outer_alias": "mgr", "inner_alias": "inv", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_04064
train
T1
v1
Schema: schedules (alias: schd)(amount, status, salary, code) departments(name, type, amount, date) Task: Select code from schedules where type exists in departments for the same id. SQL:
SELECT code FROM schedules AS schd WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.id = schd.id );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "code", "filter_col": "type", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_04065
train
T2
v3
Schema: departments (alias: dept)(id, status, date, level) employees(code, name, value, id) Task: Find value from departments where salary exceeds the average amount from employees for the same level. SQL:
SELECT value FROM departments AS dept WHERE salary > ( SELECT MIN(amount) FROM employees AS emp WHERE emp.level = dept.level );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_04066
train
T1
v1
Schema: schedules (alias: schd)(salary, name, type, value) departments(salary, id, status, name) Task: Find name from schedules where type appears in departments entries with matching id. SQL:
SELECT name FROM schedules AS schd WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.id = schd.id );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "name", "filter_col": "type", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_04067
train
T2
v2
Schema: employees (alias: emp)(id, salary, amount, level) departments(status, salary, type, value) Task: Find name from employees where a matching record exists in departments with the same level. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = emp.level );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "name", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_04068
train
T1
v3
Schema: categories (alias: catg)(id, salary, amount, code) schedules(salary, amount, id, name) Task: Find salary from categories where value exceeds the average amount from schedules for the same id. SQL:
SELECT salary FROM categories AS catg WHERE value > ( SELECT COUNT(amount) FROM schedules AS schd WHERE schd.id = catg.id );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_04069
train
T2
v1
Schema: orders (alias: ord)(date, value, code, salary) accounts(name, value, code, salary) Task: Retrieve code from orders whose status is found in accounts rows where id matches the outer record. SQL:
SELECT code FROM orders AS ord WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.id = ord.id );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_04070
train
T1
v1
Schema: accounts (alias: acct)(status, code, level, id) transactions(level, name, amount, salary) Task: Retrieve amount from accounts whose type is found in transactions rows where code matches the outer record. SQL:
SELECT amount FROM accounts AS acct WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.code = acct.code );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "amount", "filter_col": "type", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_04071
train
T1
v2
Schema: warehouses (alias: whs)(salary, amount, name, type) requests(name, amount, value, code) Task: Find value from warehouses where a matching record exists in requests with the same level. SQL:
SELECT value FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "requests", "outer_alias": "whs", "inner_alias": "ordr", "proj_col": "value", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_04072
train
T2
v3
Schema: regions (alias: rgn)(level, type, status, amount) staff(name, id, level, type) Task: Retrieve code from regions with salary above the MIN(salary) of staff rows sharing the same status. SQL:
SELECT code FROM regions AS rgn WHERE salary > ( SELECT MIN(salary) FROM staff AS empl WHERE empl.status = rgn.status );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_04073
train
T2
v1
Schema: customers (alias: cust)(amount, name, value, type) schedules(code, value, date, salary) Task: Find name from customers where id appears in schedules entries with matching type. SQL:
SELECT name FROM customers AS cust WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.type = cust.type );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "name", "filter_col": "id", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_04074
train
T1
v3
Schema: orders (alias: ord)(id, date, amount, code) invoices(id, code, salary, amount) Task: Find code from orders where value exceeds the average amount from invoices for the same status. SQL:
SELECT code FROM orders AS ord WHERE value > ( SELECT SUM(amount) FROM invoices AS inv WHERE inv.status = ord.status );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_04075
train
T1
v3
Schema: transactions (alias: txn)(date, salary, name, amount) customers(type, date, level, amount) Task: Retrieve value from transactions with value above the SUM(value) of customers rows sharing the same level. SQL:
SELECT value FROM transactions AS txn WHERE value > ( SELECT SUM(value) FROM customers AS cust WHERE cust.level = txn.level );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_04076
train
T1
v1
Schema: customers (alias: cust)(type, code, level, status) budgets(date, code, status, name) Task: Retrieve value from customers whose status is found in budgets rows where type matches the outer record. SQL:
SELECT value FROM customers AS cust WHERE status IN ( SELECT status FROM budgets AS budg WHERE budg.type = cust.type );
{ "outer_table": "customers", "inner_table": "budgets", "outer_alias": "cust", "inner_alias": "budg", "proj_col": "value", "filter_col": "status", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_04077
train
T1
v1
Schema: staff (alias: empl)(code, value, date, salary) requests(name, date, id, amount) Task: Find name from staff where status appears in requests entries with matching status. SQL:
SELECT name FROM staff AS empl WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.status = empl.status );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_04078
train
T2
v3
Schema: staff (alias: empl)(amount, status, level, date) items(amount, type, value, code) Task: Find id from staff where salary exceeds the average amount from items for the same id. SQL:
SELECT id FROM staff AS empl WHERE salary > ( SELECT SUM(amount) FROM items AS lne WHERE lne.id = empl.id );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_04079
train
T2
v3
Schema: items (alias: lne)(type, status, salary, id) orders(salary, date, code, amount) Task: Find amount from items where value exceeds the average amount from orders for the same id. SQL:
SELECT amount FROM items AS lne WHERE value > ( SELECT SUM(amount) FROM orders AS ord WHERE ord.id = lne.id );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_04080
train
T2
v1
Schema: invoices (alias: inv)(amount, id, type, code) warehouses(value, type, id, level) Task: Retrieve value from invoices whose type is found in warehouses rows where code matches the outer record. SQL:
SELECT value FROM invoices AS inv WHERE type IN ( SELECT type FROM warehouses AS whs WHERE whs.code = inv.code );
{ "outer_table": "invoices", "inner_table": "warehouses", "outer_alias": "inv", "inner_alias": "whs", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_04081
train
T1
v3
Schema: invoices (alias: inv)(code, type, date, id) products(type, amount, salary, value) Task: Retrieve amount from invoices with salary above the MAX(salary) of products rows sharing the same type. SQL:
SELECT amount FROM invoices AS inv WHERE salary > ( SELECT MAX(salary) FROM products AS prod WHERE prod.type = inv.type );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_04082
train
T1
v3
Schema: warehouses (alias: whs)(status, date, salary, code) departments(id, status, name, code) Task: Find code from warehouses where value exceeds the average value from departments for the same level. SQL:
SELECT code FROM warehouses AS whs WHERE value > ( SELECT COUNT(value) FROM departments AS dept WHERE dept.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "departments", "outer_alias": "whs", "inner_alias": "dept", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_04083
train
T2
v2
Schema: products (alias: prod)(salary, date, id, level) departments(salary, id, status, level) Task: Retrieve value from products that have at least one corresponding entry in departments sharing the same level. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = prod.level );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "value", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_04084
train
T1
v3
Schema: transactions (alias: txn)(code, id, status, value) regions(code, id, name, type) Task: Find id from transactions where value exceeds the average salary from regions for the same type. SQL:
SELECT id FROM transactions AS txn WHERE value > ( SELECT MIN(salary) FROM regions AS rgn WHERE rgn.type = txn.type );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_04085
train
T1
v3
Schema: warehouses (alias: whs)(level, type, value, amount) employees(level, date, id, value) Task: Find code from warehouses where value exceeds the average salary from employees for the same id. SQL:
SELECT code FROM warehouses AS whs WHERE value > ( SELECT AVG(salary) FROM employees AS emp WHERE emp.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "employees", "outer_alias": "whs", "inner_alias": "emp", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_04086
train
T2
v3
Schema: shipments (alias: shp)(amount, level, code, value) budgets(amount, id, status, level) Task: Retrieve id from shipments with salary above the MAX(amount) of budgets rows sharing the same level. SQL:
SELECT id FROM shipments AS shp WHERE salary > ( SELECT MAX(amount) FROM budgets AS budg WHERE budg.level = shp.level );
{ "outer_table": "shipments", "inner_table": "budgets", "outer_alias": "shp", "inner_alias": "budg", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_04087
train
T2
v2
Schema: warehouses (alias: whs)(type, name, salary, code) budgets(date, name, salary, code) Task: Retrieve name from warehouses that have at least one corresponding entry in budgets sharing the same id. SQL:
SELECT name FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "budgets", "outer_alias": "whs", "inner_alias": "budg", "proj_col": "name", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_04088
train
T2
v1
Schema: departments (alias: dept)(value, status, level, id) sales(type, code, level, name) Task: Retrieve name from departments whose status is found in sales rows where code matches the outer record. SQL:
SELECT name FROM departments AS dept WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.code = dept.code );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_04089
train
T1
v3
Schema: staff (alias: empl)(name, date, amount, code) services(amount, name, id, type) Task: Find value from staff where salary exceeds the average salary from services for the same level. SQL:
SELECT value FROM staff AS empl WHERE salary > ( SELECT AVG(salary) FROM services AS srvc WHERE srvc.level = empl.level );
{ "outer_table": "staff", "inner_table": "services", "outer_alias": "empl", "inner_alias": "srvc", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_04090
train
T2
v1
Schema: requests (alias: ordr)(date, status, id, type) managers(name, amount, code, type) Task: Find name from requests where status appears in managers entries with matching id. SQL:
SELECT name FROM requests AS ordr WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.id = ordr.id );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_04091
train
T2
v1
Schema: budgets (alias: budg)(type, level, value, salary) categories(salary, date, value, type) Task: Select salary from budgets where type exists in categories for the same type. SQL:
SELECT salary FROM budgets AS budg WHERE type IN ( SELECT type 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": "type", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_04092
train
T2
v2
Schema: accounts (alias: acct)(date, type, amount, code) shipments(salary, id, name, amount) Task: Find amount from accounts where a matching record exists in shipments with the same type. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = acct.type );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "amount", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_04093
train
T1
v3
Schema: products (alias: prod)(name, level, type, value) orders(amount, name, status, salary) Task: Find value from products where amount exceeds the average salary from orders for the same type. SQL:
SELECT value FROM products AS prod WHERE amount > ( SELECT COUNT(salary) FROM orders AS ord WHERE ord.type = prod.type );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_04094
train
T1
v2
Schema: requests (alias: ordr)(level, date, salary, status) budgets(type, name, id, level) Task: Find code from requests where a matching record exists in budgets with the same status. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.status = ordr.status );
{ "outer_table": "requests", "inner_table": "budgets", "outer_alias": "ordr", "inner_alias": "budg", "proj_col": "code", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_04095
train
T2
v3
Schema: items (alias: lne)(name, type, salary, amount) requests(salary, status, name, code) Task: Retrieve id from items with amount above the AVG(value) of requests rows sharing the same id. SQL:
SELECT id FROM items AS lne WHERE amount > ( SELECT AVG(value) FROM requests AS ordr WHERE ordr.id = lne.id );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_04096
train
T2
v1
Schema: budgets (alias: budg)(salary, id, value, amount) sales(type, value, level, date) Task: Find code from budgets where id appears in sales entries with matching 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_04097
train
T2
v3
Schema: orders (alias: ord)(code, salary, name, id) schedules(value, code, status, salary) Task: Retrieve value from orders with value above the SUM(salary) of schedules rows sharing the same code. SQL:
SELECT value FROM orders AS ord WHERE value > ( SELECT SUM(salary) FROM schedules AS schd WHERE schd.code = ord.code );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_04098
train
T1
v1
Schema: shipments (alias: shp)(level, type, value, status) managers(salary, name, status, level) Task: Retrieve amount from shipments whose level is found in managers rows where status matches the outer record. SQL:
SELECT amount FROM shipments AS shp WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.status = shp.status );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_04099
train
T2