variant
stringclasses
3 values
prompt
stringlengths
163
237
sql
stringlengths
103
143
metadata
unknown
id
stringlengths
21
21
split
stringclasses
1 value
token_group
stringclasses
2 values
v3
Schema: transactions (alias: txn)(status, date, amount, name) staff(value, name, code, date) Task: Find value from transactions where amount exceeds the average value from staff for the same type. SQL:
SELECT value FROM transactions AS txn WHERE amount > ( SELECT COUNT(value) FROM staff AS empl WHERE empl.type = txn.type );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_03200
train
T1
v3
Schema: accounts (alias: acct)(status, type, name, amount) orders(id, level, type, date) Task: Retrieve id from accounts with amount above the MIN(salary) of orders rows sharing the same level. SQL:
SELECT id FROM accounts AS acct WHERE amount > ( SELECT MIN(salary) FROM orders AS ord WHERE ord.level = acct.level );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_03201
train
T1
v2
Schema: services (alias: srvc)(id, code, level, date) shipments(date, id, code, value) Task: Retrieve amount from services that have at least one corresponding entry in shipments sharing the same code. SQL:
SELECT amount FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = srvc.code );
{ "outer_table": "services", "inner_table": "shipments", "outer_alias": "srvc", "inner_alias": "shp", "proj_col": "amount", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_03202
train
T2
v3
Schema: sales (alias: sale)(id, date, status, amount) categories(name, value, salary, id) Task: Find code from sales where amount exceeds the average amount from categories for the same level. SQL:
SELECT code FROM sales AS sale WHERE amount > ( SELECT MIN(amount) FROM categories AS catg WHERE catg.level = sale.level );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_03203
train
T1
v3
Schema: departments (alias: dept)(value, amount, salary, type) orders(name, level, date, id) Task: Find name from departments where amount exceeds the average value from orders for the same type. SQL:
SELECT name FROM departments AS dept WHERE amount > ( SELECT MIN(value) FROM orders AS ord WHERE ord.type = dept.type );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_03204
train
T1
v3
Schema: requests (alias: ordr)(date, code, salary, value) services(amount, id, type, name) Task: Retrieve code from requests with value above the SUM(amount) of services rows sharing the same status. SQL:
SELECT code FROM requests AS ordr WHERE value > ( SELECT SUM(amount) 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": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_03205
train
T2
v1
Schema: departments (alias: dept)(date, id, value, salary) warehouses(level, value, code, name) Task: Retrieve amount from departments whose type is found in warehouses rows where code matches the outer record. SQL:
SELECT amount FROM departments AS dept WHERE type IN ( SELECT type FROM warehouses AS whs WHERE whs.code = dept.code );
{ "outer_table": "departments", "inner_table": "warehouses", "outer_alias": "dept", "inner_alias": "whs", "proj_col": "amount", "filter_col": "type", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_03206
train
T1
v2
Schema: budgets (alias: budg)(type, salary, id, amount) services(type, id, status, name) Task: Retrieve name from budgets that have at least one corresponding entry in services sharing the same code. SQL:
SELECT name FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.code = budg.code );
{ "outer_table": "budgets", "inner_table": "services", "outer_alias": "budg", "inner_alias": "srvc", "proj_col": "name", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_03207
train
T2
v1
Schema: categories (alias: catg)(type, name, value, salary) requests(amount, date, level, code) Task: Retrieve id from categories whose status is found in requests rows where code matches the outer record. SQL:
SELECT id FROM categories AS catg WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.code = catg.code );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_03208
train
T2
v3
Schema: regions (alias: rgn)(level, value, type, date) sales(value, level, id, type) Task: Find value from regions where amount exceeds the average value from sales for the same code. SQL:
SELECT value FROM regions AS rgn WHERE amount > ( SELECT COUNT(value) FROM sales AS sale WHERE sale.code = rgn.code );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "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_03209
train
T2
v2
Schema: categories (alias: catg)(status, id, level, code) invoices(name, code, date, status) Task: Find code from categories where a matching record exists in invoices with the same type. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = catg.type );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "code", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_03210
train
T2
v1
Schema: accounts (alias: acct)(code, level, type, amount) schedules(status, date, name, code) Task: Select amount from accounts where level exists in schedules for the same code. SQL:
SELECT amount FROM accounts AS acct WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.code = acct.code );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_03211
train
T1
v1
Schema: departments (alias: dept)(type, code, level, value) regions(level, code, name, date) Task: Find name from departments where code appears in regions entries with matching type. SQL:
SELECT name FROM departments AS dept WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.type = dept.type );
{ "outer_table": "departments", "inner_table": "regions", "outer_alias": "dept", "inner_alias": "rgn", "proj_col": "name", "filter_col": "code", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_03212
train
T1
v2
Schema: staff (alias: empl)(id, date, code, status) products(name, salary, type, id) Task: Find id from staff where a matching record exists in products with the same id. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = empl.id );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "id", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_03213
train
T2
v2
Schema: warehouses (alias: whs)(date, name, value, level) customers(code, name, status, value) Task: Find id from warehouses where a matching record exists in customers with the same status. SQL:
SELECT id FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "customers", "outer_alias": "whs", "inner_alias": "cust", "proj_col": "id", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_03214
train
T2
v1
Schema: employees (alias: emp)(date, type, value, status) items(code, salary, date, value) Task: Find amount from employees where code appears in items entries with matching type. SQL:
SELECT amount FROM employees AS emp WHERE code IN ( SELECT code FROM items AS lne WHERE lne.type = emp.type );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_03215
train
T1
v2
Schema: warehouses (alias: whs)(salary, date, level, value) budgets(status, value, level, type) Task: Retrieve salary from warehouses that have at least one corresponding entry in budgets sharing the same id. SQL:
SELECT salary 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": "salary", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_03216
train
T2
v3
Schema: products (alias: prod)(status, name, value, date) budgets(level, date, value, amount) Task: Retrieve value from products with salary above the SUM(value) of budgets rows sharing the same level. SQL:
SELECT value FROM products AS prod WHERE salary > ( SELECT SUM(value) FROM budgets AS budg WHERE budg.level = prod.level );
{ "outer_table": "products", "inner_table": "budgets", "outer_alias": "prod", "inner_alias": "budg", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_03217
train
T1
v1
Schema: accounts (alias: acct)(name, salary, type, amount) warehouses(code, status, type, level) Task: Select name from accounts where id exists in warehouses for the same type. SQL:
SELECT name FROM accounts AS acct WHERE id IN ( SELECT id FROM warehouses AS whs WHERE whs.type = acct.type );
{ "outer_table": "accounts", "inner_table": "warehouses", "outer_alias": "acct", "inner_alias": "whs", "proj_col": "name", "filter_col": "id", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_03218
train
T1
v1
Schema: departments (alias: dept)(salary, id, level, name) regions(level, id, name, value) Task: Select value from departments where code exists in regions for the same level. SQL:
SELECT value FROM departments AS dept WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.level = dept.level );
{ "outer_table": "departments", "inner_table": "regions", "outer_alias": "dept", "inner_alias": "rgn", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_03219
train
T1
v3
Schema: employees (alias: emp)(id, value, name, type) budgets(type, amount, id, code) Task: Retrieve id from employees with value above the COUNT(amount) of budgets rows sharing the same status. SQL:
SELECT id FROM employees AS emp WHERE value > ( SELECT COUNT(amount) FROM budgets AS budg WHERE budg.status = emp.status );
{ "outer_table": "employees", "inner_table": "budgets", "outer_alias": "emp", "inner_alias": "budg", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_03220
train
T1
v3
Schema: orders (alias: ord)(amount, id, value, code) managers(type, name, status, salary) Task: Retrieve salary from orders with value above the SUM(value) of managers rows sharing the same code. SQL:
SELECT salary FROM orders AS ord WHERE value > ( SELECT SUM(value) FROM managers AS mgr WHERE mgr.code = ord.code );
{ "outer_table": "orders", "inner_table": "managers", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_03221
train
T1
v2
Schema: accounts (alias: acct)(level, name, type, value) schedules(code, status, type, value) Task: Find id from accounts where a matching record exists in schedules with the same type. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = acct.type );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "id", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_03222
train
T1
v1
Schema: accounts (alias: acct)(amount, type, salary, status) shipments(level, id, status, code) Task: Find salary from accounts where status appears in shipments entries with matching type. SQL:
SELECT salary 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": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_03223
train
T1
v3
Schema: requests (alias: ordr)(id, status, salary, level) employees(status, date, level, type) Task: Retrieve value from requests with amount above the SUM(amount) of employees rows sharing the same level. SQL:
SELECT value FROM requests AS ordr WHERE amount > ( SELECT SUM(amount) FROM employees AS emp WHERE emp.level = ordr.level );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_03224
train
T2
v1
Schema: transactions (alias: txn)(amount, salary, code, status) regions(code, value, level, amount) Task: Retrieve value from transactions whose type is found in regions rows where status matches the outer record. SQL:
SELECT value FROM transactions AS txn WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.status = txn.status );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_03225
train
T1
v2
Schema: transactions (alias: txn)(id, salary, status, value) budgets(value, type, id, status) Task: Retrieve salary from transactions that have at least one corresponding entry in budgets sharing the same level. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.level = txn.level );
{ "outer_table": "transactions", "inner_table": "budgets", "outer_alias": "txn", "inner_alias": "budg", "proj_col": "salary", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_03226
train
T1
v3
Schema: managers (alias: mgr)(name, status, type, id) warehouses(date, value, amount, id) Task: Retrieve id from managers with salary above the AVG(value) of warehouses rows sharing the same type. SQL:
SELECT id FROM managers AS mgr WHERE salary > ( SELECT AVG(value) FROM warehouses AS whs WHERE whs.type = mgr.type );
{ "outer_table": "managers", "inner_table": "warehouses", "outer_alias": "mgr", "inner_alias": "whs", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_03227
train
T1
v3
Schema: sales (alias: sale)(date, status, value, amount) items(code, status, amount, value) Task: Retrieve id from sales with amount above the COUNT(salary) of items rows sharing the same code. SQL:
SELECT id FROM sales AS sale WHERE amount > ( SELECT COUNT(salary) FROM items AS lne WHERE lne.code = sale.code );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_03228
train
T1
v2
Schema: requests (alias: ordr)(amount, type, salary, id) warehouses(status, date, amount, id) Task: Retrieve value from requests that have at least one corresponding entry in warehouses sharing the same status. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.status = ordr.status );
{ "outer_table": "requests", "inner_table": "warehouses", "outer_alias": "ordr", "inner_alias": "whs", "proj_col": "value", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_03229
train
T2
v1
Schema: categories (alias: catg)(id, name, status, salary) departments(type, date, salary, code) Task: Select id from categories where status exists in departments for the same code. SQL:
SELECT id FROM categories AS catg WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.code = catg.code );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_03230
train
T2
v3
Schema: staff (alias: empl)(id, salary, value, date) accounts(salary, type, name, code) Task: Find value from staff where amount exceeds the average value from accounts for the same type. SQL:
SELECT value FROM staff AS empl WHERE amount > ( SELECT MAX(value) FROM accounts AS acct WHERE acct.type = empl.type );
{ "outer_table": "staff", "inner_table": "accounts", "outer_alias": "empl", "inner_alias": "acct", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_03231
train
T2
v1
Schema: departments (alias: dept)(salary, value, type, amount) services(code, value, name, level) Task: Retrieve salary from departments whose type is found in services rows where status matches the outer record. SQL:
SELECT salary FROM departments AS dept WHERE type IN ( SELECT type FROM services AS srvc WHERE srvc.status = dept.status );
{ "outer_table": "departments", "inner_table": "services", "outer_alias": "dept", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "type", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_03232
train
T1
v3
Schema: services (alias: srvc)(id, name, amount, salary) schedules(date, id, code, name) Task: Retrieve value from services with value above the AVG(value) of schedules rows sharing the same status. SQL:
SELECT value FROM services AS srvc WHERE value > ( SELECT AVG(value) FROM schedules AS schd WHERE schd.status = srvc.status );
{ "outer_table": "services", "inner_table": "schedules", "outer_alias": "srvc", "inner_alias": "schd", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_03233
train
T2
v2
Schema: accounts (alias: acct)(amount, name, date, code) orders(amount, name, date, status) Task: Find id from accounts where a matching record exists in orders with the same level. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = acct.level );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "id", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_03234
train
T1
v3
Schema: customers (alias: cust)(name, level, id, salary) products(type, name, salary, code) Task: Retrieve value from customers with salary above the SUM(value) of products rows sharing the same code. SQL:
SELECT value FROM customers AS cust WHERE salary > ( SELECT SUM(value) FROM products AS prod WHERE prod.code = cust.code );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_03235
train
T1
v1
Schema: employees (alias: emp)(status, salary, name, code) shipments(type, code, amount, date) Task: Find code from employees where level appears in shipments entries with matching code. SQL:
SELECT code FROM employees AS emp WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.code = emp.code );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_03236
train
T1
v3
Schema: categories (alias: catg)(id, code, value, type) warehouses(level, name, status, date) Task: Retrieve salary from categories with amount above the MIN(amount) of warehouses rows sharing the same code. SQL:
SELECT salary FROM categories AS catg WHERE amount > ( SELECT MIN(amount) FROM warehouses AS whs WHERE whs.code = catg.code );
{ "outer_table": "categories", "inner_table": "warehouses", "outer_alias": "catg", "inner_alias": "whs", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_03237
train
T2
v2
Schema: orders (alias: ord)(code, amount, level, salary) transactions(level, name, date, id) Task: Retrieve id from orders that have at least one corresponding entry in transactions sharing the same type. SQL:
SELECT id FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = ord.type );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "id", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_03238
train
T1
v2
Schema: requests (alias: ordr)(code, date, name, salary) schedules(id, type, status, value) Task: Retrieve salary from requests that have at least one corresponding entry in schedules sharing the same id. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = ordr.id );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "salary", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_03239
train
T2
v2
Schema: warehouses (alias: whs)(status, amount, date, id) invoices(date, level, salary, code) Task: Retrieve salary from warehouses that have at least one corresponding entry in invoices sharing the same code. SQL:
SELECT salary FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "invoices", "outer_alias": "whs", "inner_alias": "inv", "proj_col": "salary", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_03240
train
T2
v1
Schema: shipments (alias: shp)(name, level, value, amount) invoices(name, level, type, code) Task: Select id from shipments where code exists in invoices for the same type. SQL:
SELECT id FROM shipments AS shp WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.type = shp.type );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "id", "filter_col": "code", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_03241
train
T2
v3
Schema: products (alias: prod)(level, name, value, salary) transactions(value, type, name, code) Task: Retrieve amount from products with value above the COUNT(salary) of transactions rows sharing the same type. SQL:
SELECT amount FROM products AS prod WHERE value > ( SELECT COUNT(salary) FROM transactions AS txn WHERE txn.type = prod.type );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_03242
train
T1
v3
Schema: products (alias: prod)(status, id, value, level) sales(id, amount, type, level) Task: Find name from products where value exceeds the average amount from sales for the same status. SQL:
SELECT name FROM products AS prod WHERE value > ( SELECT AVG(amount) FROM sales AS sale WHERE sale.status = prod.status );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_03243
train
T1
v2
Schema: transactions (alias: txn)(status, salary, id, code) schedules(level, salary, date, type) Task: Retrieve salary from transactions that have at least one corresponding entry in schedules sharing the same type. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = txn.type );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "salary", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_03244
train
T1
v3
Schema: employees (alias: emp)(value, date, status, type) staff(salary, value, code, type) Task: Retrieve id from employees with amount above the AVG(salary) of staff rows sharing the same id. SQL:
SELECT id FROM employees AS emp WHERE amount > ( SELECT AVG(salary) FROM staff AS empl WHERE empl.id = emp.id );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_03245
train
T1
v2
Schema: products (alias: prod)(name, code, salary, type) warehouses(date, salary, code, name) Task: Retrieve code from products that have at least one corresponding entry in warehouses sharing the same id. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.id = prod.id );
{ "outer_table": "products", "inner_table": "warehouses", "outer_alias": "prod", "inner_alias": "whs", "proj_col": "code", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_03246
train
T1
v1
Schema: departments (alias: dept)(code, value, level, id) warehouses(code, name, status, amount) Task: Retrieve name from departments whose status is found in warehouses rows where status matches the outer record. SQL:
SELECT name FROM departments AS dept WHERE status IN ( SELECT status FROM warehouses AS whs WHERE whs.status = dept.status );
{ "outer_table": "departments", "inner_table": "warehouses", "outer_alias": "dept", "inner_alias": "whs", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_03247
train
T1
v3
Schema: items (alias: lne)(date, amount, status, salary) staff(id, date, status, code) Task: Retrieve name from items with value above the AVG(value) of staff rows sharing the same level. SQL:
SELECT name FROM items AS lne WHERE value > ( SELECT AVG(value) FROM staff AS empl WHERE empl.level = lne.level );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_03248
train
T2
v1
Schema: categories (alias: catg)(salary, amount, id, code) sales(id, salary, code, value) Task: Retrieve name from categories whose id is found in sales rows where id matches the outer record. SQL:
SELECT name FROM categories AS catg WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.id = catg.id );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "name", "filter_col": "id", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_03249
train
T2
v1
Schema: managers (alias: mgr)(name, amount, value, type) shipments(type, id, level, name) Task: Select salary from managers where type exists in shipments for the same level. SQL:
SELECT salary FROM managers AS mgr WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.level = mgr.level );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "salary", "filter_col": "type", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_03250
train
T1
v1
Schema: warehouses (alias: whs)(level, name, type, status) sales(level, id, amount, type) Task: Select name from warehouses where code exists in sales for the same level. SQL:
SELECT name FROM warehouses AS whs WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "sales", "outer_alias": "whs", "inner_alias": "sale", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_03251
train
T2
v3
Schema: staff (alias: empl)(amount, name, id, salary) sales(salary, name, type, status) Task: Find salary from staff where amount exceeds the average value from sales for the same id. SQL:
SELECT salary FROM staff AS empl WHERE amount > ( SELECT COUNT(value) FROM sales AS sale WHERE sale.id = empl.id );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_03252
train
T2
v2
Schema: regions (alias: rgn)(type, value, name, id) services(salary, code, status, value) Task: Find code from regions where a matching record exists in services with the same level. SQL:
SELECT code FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.level = rgn.level );
{ "outer_table": "regions", "inner_table": "services", "outer_alias": "rgn", "inner_alias": "srvc", "proj_col": "code", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_03253
train
T2
v1
Schema: customers (alias: cust)(status, level, amount, type) managers(amount, value, id, date) Task: Retrieve name from customers whose status is found in managers rows where type matches the outer record. SQL:
SELECT name FROM customers AS cust WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.type = cust.type );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_03254
train
T1
v1
Schema: staff (alias: empl)(amount, value, name, id) warehouses(value, amount, date, status) Task: Select value from staff where type exists in warehouses for the same type. SQL:
SELECT value FROM staff AS empl WHERE type IN ( SELECT type FROM warehouses AS whs WHERE whs.type = empl.type );
{ "outer_table": "staff", "inner_table": "warehouses", "outer_alias": "empl", "inner_alias": "whs", "proj_col": "value", "filter_col": "type", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_03255
train
T2
v2
Schema: transactions (alias: txn)(type, value, date, level) products(salary, value, id, level) Task: Find salary from transactions where a matching record exists in products with the same status. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = txn.status );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "salary", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_03256
train
T1
v3
Schema: categories (alias: catg)(type, salary, level, amount) departments(level, name, type, amount) Task: Find name from categories where amount exceeds the average amount from departments for the same status. SQL:
SELECT name FROM categories AS catg WHERE amount > ( SELECT COUNT(amount) FROM departments AS dept WHERE dept.status = catg.status );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_03257
train
T2
v3
Schema: schedules (alias: schd)(level, date, type, salary) requests(status, salary, value, code) Task: Retrieve value from schedules with salary above the SUM(salary) of requests rows sharing the same code. SQL:
SELECT value FROM schedules AS schd WHERE salary > ( SELECT SUM(salary) FROM requests AS ordr WHERE ordr.code = schd.code );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_03258
train
T2
v2
Schema: employees (alias: emp)(status, name, code, salary) items(salary, value, id, type) Task: Find salary from employees where a matching record exists in items with the same status. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = emp.status );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "salary", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_03259
train
T1
v3
Schema: shipments (alias: shp)(salary, id, value, code) services(level, status, amount, code) Task: Find code from shipments where amount exceeds the average salary from services for the same level. SQL:
SELECT code FROM shipments AS shp WHERE amount > ( SELECT SUM(salary) FROM services AS srvc WHERE srvc.level = shp.level );
{ "outer_table": "shipments", "inner_table": "services", "outer_alias": "shp", "inner_alias": "srvc", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_03260
train
T2
v2
Schema: budgets (alias: budg)(salary, name, type, code) shipments(amount, id, status, code) Task: Retrieve salary from budgets that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT salary FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = budg.status );
{ "outer_table": "budgets", "inner_table": "shipments", "outer_alias": "budg", "inner_alias": "shp", "proj_col": "salary", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_03261
train
T2
v3
Schema: transactions (alias: txn)(value, type, name, status) managers(code, amount, date, status) Task: Find id from transactions where salary exceeds the average salary from managers for the same status. SQL:
SELECT id FROM transactions AS txn WHERE salary > ( SELECT MIN(salary) FROM managers AS mgr WHERE mgr.status = txn.status );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_03262
train
T1
v3
Schema: accounts (alias: acct)(code, salary, amount, name) transactions(status, type, salary, name) Task: Find salary from accounts where amount exceeds the average value from transactions for the same id. SQL:
SELECT salary FROM accounts AS acct WHERE amount > ( SELECT MAX(value) FROM transactions AS txn WHERE txn.id = acct.id );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_03263
train
T1
v3
Schema: departments (alias: dept)(code, type, name, value) products(code, status, date, type) Task: Find value from departments where salary exceeds the average salary from products for the same code. SQL:
SELECT value FROM departments AS dept WHERE salary > ( SELECT MIN(salary) FROM products AS prod WHERE prod.code = dept.code );
{ "outer_table": "departments", "inner_table": "products", "outer_alias": "dept", "inner_alias": "prod", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_03264
train
T1
v1
Schema: categories (alias: catg)(status, id, type, code) accounts(code, status, date, id) Task: Select salary from categories where id exists in accounts for the same status. SQL:
SELECT salary FROM categories AS catg WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.status = catg.status );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_03265
train
T2
v3
Schema: categories (alias: catg)(salary, type, name, status) invoices(salary, status, date, type) Task: Find id from categories where amount exceeds the average amount from invoices for the same code. SQL:
SELECT id FROM categories AS catg WHERE amount > ( SELECT AVG(amount) FROM invoices AS inv WHERE inv.code = catg.code );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_03266
train
T2
v3
Schema: employees (alias: emp)(level, status, date, salary) sales(status, level, amount, code) Task: Find value from employees where salary exceeds the average value from sales for the same code. SQL:
SELECT value FROM employees AS emp WHERE salary > ( SELECT SUM(value) FROM sales AS sale WHERE sale.code = emp.code );
{ "outer_table": "employees", "inner_table": "sales", "outer_alias": "emp", "inner_alias": "sale", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_03267
train
T1
v3
Schema: shipments (alias: shp)(level, date, status, salary) categories(value, code, name, salary) Task: Retrieve name from shipments with value above the MAX(amount) of categories rows sharing the same type. SQL:
SELECT name FROM shipments AS shp WHERE value > ( SELECT MAX(amount) FROM categories AS catg WHERE catg.type = shp.type );
{ "outer_table": "shipments", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "catg", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_03268
train
T2
v3
Schema: items (alias: lne)(type, salary, date, value) customers(value, date, amount, level) Task: Find name from items where amount exceeds the average value from customers for the same id. SQL:
SELECT name FROM items AS lne WHERE amount > ( SELECT MAX(value) FROM customers AS cust WHERE cust.id = lne.id );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_03269
train
T2
v1
Schema: warehouses (alias: whs)(amount, value, level, id) transactions(date, salary, name, level) Task: Select name from warehouses where level exists in transactions for the same id. SQL:
SELECT name FROM warehouses AS whs WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "transactions", "outer_alias": "whs", "inner_alias": "txn", "proj_col": "name", "filter_col": "level", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_03270
train
T2
v2
Schema: products (alias: prod)(name, salary, status, level) services(status, amount, level, name) Task: Retrieve salary from products that have at least one corresponding entry in services sharing the same level. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.level = prod.level );
{ "outer_table": "products", "inner_table": "services", "outer_alias": "prod", "inner_alias": "srvc", "proj_col": "salary", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_03271
train
T1
v1
Schema: products (alias: prod)(type, value, level, date) shipments(status, name, value, id) Task: Find id from products where code appears in shipments entries with matching status. SQL:
SELECT id FROM products AS prod WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.status = prod.status );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_03272
train
T1
v1
Schema: staff (alias: empl)(amount, level, name, code) departments(code, name, date, id) Task: Select amount from staff where status exists in departments for the same status. SQL:
SELECT amount FROM staff AS empl WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.status = empl.status );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_03273
train
T2
v2
Schema: transactions (alias: txn)(id, level, salary, amount) sales(value, code, date, type) Task: Find value from transactions where a matching record exists in sales with the same id. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = txn.id );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "value", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_03274
train
T1
v3
Schema: departments (alias: dept)(name, type, status, amount) schedules(status, date, amount, code) Task: Retrieve value from departments with amount above the MAX(amount) of schedules rows sharing the same id. SQL:
SELECT value FROM departments AS dept WHERE amount > ( SELECT MAX(amount) FROM schedules AS schd WHERE schd.id = dept.id );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_03275
train
T1
v3
Schema: managers (alias: mgr)(code, level, value, amount) budgets(date, name, level, id) Task: Find salary from managers where value exceeds the average salary from budgets for the same status. SQL:
SELECT salary FROM managers AS mgr WHERE value > ( SELECT COUNT(salary) FROM budgets AS budg WHERE budg.status = mgr.status );
{ "outer_table": "managers", "inner_table": "budgets", "outer_alias": "mgr", "inner_alias": "budg", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_03276
train
T1
v1
Schema: transactions (alias: txn)(salary, date, value, type) accounts(salary, type, value, level) Task: Retrieve id from transactions whose level is found in accounts rows where code matches the outer record. SQL:
SELECT id FROM transactions AS txn WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.code = txn.code );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_03277
train
T1
v3
Schema: staff (alias: empl)(id, type, name, status) customers(date, type, code, level) Task: Find value from staff where salary exceeds the average amount from customers for the same type. SQL:
SELECT value FROM staff AS empl WHERE salary > ( SELECT MIN(amount) FROM customers AS cust WHERE cust.type = empl.type );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_03278
train
T2
v1
Schema: staff (alias: empl)(salary, amount, id, status) customers(level, value, date, amount) Task: Retrieve amount from staff whose type is found in customers rows where level matches the outer record. SQL:
SELECT amount FROM staff AS empl WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.level = empl.level );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_03279
train
T2
v1
Schema: customers (alias: cust)(status, date, value, amount) orders(name, code, salary, amount) Task: Find code from customers where level appears in orders entries with matching code. SQL:
SELECT code FROM customers AS cust WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.code = cust.code );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_03280
train
T1
v1
Schema: orders (alias: ord)(id, salary, name, status) categories(type, id, level, code) Task: Retrieve id from orders whose status is found in categories rows where level matches the outer record. SQL:
SELECT id FROM orders AS ord WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.level = ord.level );
{ "outer_table": "orders", "inner_table": "categories", "outer_alias": "ord", "inner_alias": "catg", "proj_col": "id", "filter_col": "status", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_03281
train
T1
v2
Schema: items (alias: lne)(status, amount, value, date) orders(id, level, salary, amount) Task: Retrieve name from items that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = lne.level );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "name", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_03282
train
T2
v1
Schema: budgets (alias: budg)(salary, date, type, level) transactions(date, value, salary, status) Task: Select amount from budgets where level exists in transactions for the same code. SQL:
SELECT amount FROM budgets AS budg WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.code = budg.code );
{ "outer_table": "budgets", "inner_table": "transactions", "outer_alias": "budg", "inner_alias": "txn", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_03283
train
T2
v2
Schema: shipments (alias: shp)(name, status, date, salary) services(amount, salary, name, date) Task: Retrieve id from shipments that have at least one corresponding entry in services sharing the same type. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.type = shp.type );
{ "outer_table": "shipments", "inner_table": "services", "outer_alias": "shp", "inner_alias": "srvc", "proj_col": "id", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_03284
train
T2
v3
Schema: invoices (alias: inv)(amount, type, status, date) transactions(name, code, status, id) Task: Retrieve value from invoices with value above the MIN(amount) of transactions rows sharing the same level. SQL:
SELECT value FROM invoices AS inv WHERE value > ( SELECT MIN(amount) FROM transactions AS txn WHERE txn.level = inv.level );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_03285
train
T1
v2
Schema: regions (alias: rgn)(amount, code, name, id) budgets(name, status, type, id) Task: Find name from regions where a matching record exists in budgets with the same status. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.status = rgn.status );
{ "outer_table": "regions", "inner_table": "budgets", "outer_alias": "rgn", "inner_alias": "budg", "proj_col": "name", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_03286
train
T2
v3
Schema: accounts (alias: acct)(value, amount, name, status) invoices(type, amount, status, name) Task: Find amount from accounts where value exceeds the average amount from invoices for the same type. SQL:
SELECT amount FROM accounts AS acct WHERE value > ( SELECT AVG(amount) FROM invoices AS inv WHERE inv.type = acct.type );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_03287
train
T1
v3
Schema: managers (alias: mgr)(amount, value, salary, type) budgets(type, level, date, id) Task: Retrieve amount from managers with value above the COUNT(amount) of budgets rows sharing the same id. SQL:
SELECT amount FROM managers AS mgr WHERE value > ( SELECT COUNT(amount) FROM budgets AS budg WHERE budg.id = mgr.id );
{ "outer_table": "managers", "inner_table": "budgets", "outer_alias": "mgr", "inner_alias": "budg", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_03288
train
T1
v2
Schema: orders (alias: ord)(type, name, code, salary) regions(value, status, code, name) Task: Retrieve name from orders that have at least one corresponding entry in regions sharing the same code. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = ord.code );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "name", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_03289
train
T1
v3
Schema: items (alias: lne)(level, id, name, date) orders(code, type, salary, amount) Task: Retrieve name from items with amount above the AVG(value) of orders rows sharing the same status. SQL:
SELECT name FROM items AS lne WHERE amount > ( SELECT AVG(value) FROM orders AS ord WHERE ord.status = lne.status );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_03290
train
T2
v3
Schema: employees (alias: emp)(name, amount, level, type) shipments(value, salary, date, code) Task: Retrieve value from employees with amount above the SUM(salary) of shipments rows sharing the same type. SQL:
SELECT value FROM employees AS emp WHERE amount > ( SELECT SUM(salary) FROM shipments AS shp WHERE shp.type = emp.type );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_03291
train
T1
v2
Schema: items (alias: lne)(level, date, amount, name) invoices(id, date, level, value) Task: Retrieve name from items that have at least one corresponding entry in invoices sharing the same status. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = lne.status );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "name", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_03292
train
T2
v1
Schema: products (alias: prod)(amount, type, name, code) services(status, value, id, code) Task: Find value from products where code appears in services entries with matching code. SQL:
SELECT value FROM products AS prod WHERE code IN ( SELECT code FROM services AS srvc WHERE srvc.code = prod.code );
{ "outer_table": "products", "inner_table": "services", "outer_alias": "prod", "inner_alias": "srvc", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_03293
train
T1
v3
Schema: managers (alias: mgr)(id, amount, value, status) products(date, name, type, salary) Task: Find salary from managers where value exceeds the average amount from products for the same code. SQL:
SELECT salary FROM managers AS mgr WHERE value > ( SELECT COUNT(amount) FROM products AS prod WHERE prod.code = mgr.code );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_03294
train
T1
v3
Schema: sales (alias: sale)(code, date, id, salary) accounts(salary, amount, value, status) Task: Find salary from sales where value exceeds the average salary from accounts for the same id. SQL:
SELECT salary FROM sales AS sale WHERE value > ( SELECT AVG(salary) FROM accounts AS acct WHERE acct.id = sale.id );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_03295
train
T1
v1
Schema: sales (alias: sale)(id, code, type, salary) budgets(code, status, value, type) Task: Select code from sales where id exists in budgets for the same status. SQL:
SELECT code FROM sales AS sale WHERE id IN ( SELECT id FROM budgets AS budg WHERE budg.status = sale.status );
{ "outer_table": "sales", "inner_table": "budgets", "outer_alias": "sale", "inner_alias": "budg", "proj_col": "code", "filter_col": "id", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_03296
train
T1
v3
Schema: employees (alias: emp)(value, salary, id, status) items(code, date, id, value) Task: Retrieve id from employees with amount above the MAX(amount) of items rows sharing the same status. SQL:
SELECT id FROM employees AS emp WHERE amount > ( SELECT MAX(amount) FROM items AS lne WHERE lne.status = emp.status );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_03297
train
T1
v3
Schema: orders (alias: ord)(status, salary, code, value) sales(salary, status, code, amount) Task: Retrieve id from orders with value above the SUM(amount) of sales rows sharing the same code. SQL:
SELECT id FROM orders AS ord WHERE value > ( SELECT SUM(amount) FROM sales AS sale WHERE sale.code = ord.code );
{ "outer_table": "orders", "inner_table": "sales", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_03298
train
T1
v2
Schema: schedules (alias: schd)(date, amount, value, code) products(name, id, type, level) Task: Find amount from schedules where a matching record exists in products with the same type. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = schd.type );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "amount", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_03299
train
T2