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: categories (alias: catg)(date, type, value, name) budgets(amount, type, status, name) Task: Find id from categories where amount exceeds the average salary from budgets for the same level. SQL:
SELECT id FROM categories AS catg WHERE amount > ( SELECT COUNT(salary) FROM budgets AS budg WHERE budg.level = catg.level );
{ "outer_table": "categories", "inner_table": "budgets", "outer_alias": "catg", "inner_alias": "budg", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_01200
train
T2
v3
Schema: products (alias: prod)(status, amount, salary, code) accounts(value, date, amount, code) Task: Retrieve id from products with amount above the COUNT(value) of accounts rows sharing the same level. SQL:
SELECT id FROM products AS prod WHERE amount > ( SELECT COUNT(value) FROM accounts AS acct WHERE acct.level = prod.level );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_01201
train
T1
v3
Schema: sales (alias: sale)(name, value, salary, id) transactions(status, amount, date, type) Task: Find code from sales where salary exceeds the average amount from transactions for the same id. SQL:
SELECT code FROM sales AS sale WHERE salary > ( SELECT SUM(amount) FROM transactions AS txn WHERE txn.id = sale.id );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_01202
train
T1
v3
Schema: services (alias: srvc)(id, code, level, date) departments(id, code, amount, date) Task: Find name from services where value exceeds the average salary from departments for the same status. SQL:
SELECT name FROM services AS srvc WHERE value > ( SELECT COUNT(salary) FROM departments AS dept WHERE dept.status = srvc.status );
{ "outer_table": "services", "inner_table": "departments", "outer_alias": "srvc", "inner_alias": "dept", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_01203
train
T2
v3
Schema: invoices (alias: inv)(date, value, code, salary) schedules(value, code, id, level) Task: Retrieve code from invoices with value above the MIN(salary) of schedules rows sharing the same type. SQL:
SELECT code FROM invoices AS inv WHERE value > ( SELECT MIN(salary) FROM schedules AS schd WHERE schd.type = inv.type );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_01204
train
T1
v3
Schema: orders (alias: ord)(salary, level, type, name) managers(name, type, level, value) Task: Retrieve id from orders with salary above the AVG(salary) of managers rows sharing the same code. SQL:
SELECT id FROM orders AS ord WHERE salary > ( SELECT AVG(salary) FROM managers AS mgr WHERE mgr.code = ord.code );
{ "outer_table": "orders", "inner_table": "managers", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_01205
train
T1
v2
Schema: invoices (alias: inv)(level, name, salary, id) departments(salary, date, status, amount) Task: Find amount from invoices where a matching record exists in departments with the same level. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = inv.level );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "amount", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_01206
train
T1
v1
Schema: categories (alias: catg)(name, value, date, type) warehouses(status, name, type, amount) Task: Find id from categories where type appears in warehouses entries with matching code. SQL:
SELECT id FROM categories AS catg WHERE type IN ( SELECT type FROM warehouses AS whs WHERE whs.code = catg.code );
{ "outer_table": "categories", "inner_table": "warehouses", "outer_alias": "catg", "inner_alias": "whs", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_01207
train
T2
v2
Schema: accounts (alias: acct)(salary, date, id, value) schedules(type, amount, status, salary) Task: Retrieve salary from accounts that have at least one corresponding entry in schedules sharing the same status. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = acct.status );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "salary", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_01208
train
T1
v3
Schema: orders (alias: ord)(salary, status, level, type) regions(id, name, amount, type) Task: Retrieve salary from orders with amount above the AVG(salary) of regions rows sharing the same type. SQL:
SELECT salary FROM orders AS ord WHERE amount > ( SELECT AVG(salary) FROM regions AS rgn WHERE rgn.type = ord.type );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_01209
train
T1
v1
Schema: customers (alias: cust)(code, salary, name, level) products(id, code, type, amount) Task: Select salary from customers where id exists in products for the same status. SQL:
SELECT salary FROM customers AS cust WHERE id IN ( SELECT id FROM products AS prod WHERE prod.status = cust.status );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_01210
train
T1
v3
Schema: managers (alias: mgr)(type, amount, date, level) regions(name, code, id, type) Task: Find value from managers where amount exceeds the average value from regions for the same id. SQL:
SELECT value FROM managers AS mgr WHERE amount > ( SELECT SUM(value) FROM regions AS rgn WHERE rgn.id = mgr.id );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_01211
train
T1
v1
Schema: employees (alias: emp)(code, status, id, value) schedules(level, status, salary, code) Task: Select id from employees where type exists in schedules for the same level. SQL:
SELECT id FROM employees AS emp WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.level = emp.level );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_01212
train
T1
v3
Schema: products (alias: prod)(status, value, code, type) items(salary, status, type, code) Task: Find code from products where value exceeds the average salary from items for the same status. SQL:
SELECT code FROM products AS prod WHERE value > ( SELECT AVG(salary) FROM items AS lne WHERE lne.status = prod.status );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_01213
train
T1
v1
Schema: customers (alias: cust)(status, type, salary, name) warehouses(code, salary, id, level) Task: Select code from customers where id exists in warehouses for the same level. SQL:
SELECT code FROM customers AS cust WHERE id IN ( SELECT id FROM warehouses AS whs WHERE whs.level = cust.level );
{ "outer_table": "customers", "inner_table": "warehouses", "outer_alias": "cust", "inner_alias": "whs", "proj_col": "code", "filter_col": "id", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_01214
train
T1
v1
Schema: categories (alias: catg)(id, level, salary, name) schedules(code, value, status, date) Task: Find name from categories where status appears in schedules entries with matching code. SQL:
SELECT name FROM categories AS catg WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.code = catg.code );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_01215
train
T2
v1
Schema: staff (alias: empl)(date, amount, level, type) services(type, amount, salary, date) Task: Find value from staff where type appears in services entries with matching status. SQL:
SELECT value FROM staff AS empl WHERE type IN ( SELECT type FROM services AS srvc WHERE srvc.status = empl.status );
{ "outer_table": "staff", "inner_table": "services", "outer_alias": "empl", "inner_alias": "srvc", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_01216
train
T2
v3
Schema: accounts (alias: acct)(id, amount, code, date) budgets(code, level, salary, date) Task: Find name from accounts where value exceeds the average value from budgets for the same status. SQL:
SELECT name FROM accounts AS acct WHERE value > ( SELECT MIN(value) FROM budgets AS budg WHERE budg.status = acct.status );
{ "outer_table": "accounts", "inner_table": "budgets", "outer_alias": "acct", "inner_alias": "budg", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_01217
train
T1
v3
Schema: sales (alias: sale)(level, value, code, name) regions(code, type, value, amount) Task: Find name from sales where amount exceeds the average amount from regions for the same level. SQL:
SELECT name FROM sales AS sale WHERE amount > ( SELECT MIN(amount) FROM regions AS rgn WHERE rgn.level = sale.level );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_01218
train
T1
v3
Schema: staff (alias: empl)(status, level, name, id) customers(date, name, code, value) Task: Find id from staff where salary exceeds the average amount from customers for the same code. SQL:
SELECT id FROM staff AS empl WHERE salary > ( SELECT COUNT(amount) FROM customers AS cust WHERE cust.code = empl.code );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_01219
train
T2
v1
Schema: staff (alias: empl)(type, status, amount, value) sales(type, date, id, code) Task: Find amount from staff where id appears in sales entries with matching status. SQL:
SELECT amount FROM staff AS empl WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.status = empl.status );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_01220
train
T2
v2
Schema: employees (alias: emp)(amount, name, value, level) transactions(salary, id, amount, status) Task: Find value from employees where a matching record exists in transactions with the same type. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = emp.type );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "value", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_01221
train
T1
v2
Schema: invoices (alias: inv)(date, code, level, name) transactions(value, id, code, date) Task: Find id from invoices where a matching record exists in transactions with the same type. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = inv.type );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "id", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_01222
train
T1
v3
Schema: services (alias: srvc)(type, name, level, code) budgets(date, code, salary, level) Task: Find value from services where amount exceeds the average salary from budgets for the same id. SQL:
SELECT value FROM services AS srvc WHERE amount > ( SELECT AVG(salary) FROM budgets AS budg WHERE budg.id = srvc.id );
{ "outer_table": "services", "inner_table": "budgets", "outer_alias": "srvc", "inner_alias": "budg", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_01223
train
T2
v3
Schema: items (alias: lne)(level, value, name, type) regions(code, name, level, status) Task: Find salary from items where amount exceeds the average amount from regions for the same id. SQL:
SELECT salary FROM items AS lne WHERE amount > ( SELECT MAX(amount) FROM regions AS rgn WHERE rgn.id = lne.id );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_01224
train
T2
v2
Schema: budgets (alias: budg)(amount, salary, status, code) staff(type, level, salary, code) Task: Find code from budgets where a matching record exists in staff with the same id. SQL:
SELECT code FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = budg.id );
{ "outer_table": "budgets", "inner_table": "staff", "outer_alias": "budg", "inner_alias": "empl", "proj_col": "code", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_01225
train
T2
v1
Schema: staff (alias: empl)(salary, type, value, amount) orders(level, code, type, value) Task: Retrieve name from staff whose id is found in orders rows where code matches the outer record. SQL:
SELECT name FROM staff AS empl WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.code = empl.code );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_01226
train
T2
v2
Schema: invoices (alias: inv)(level, amount, code, status) managers(code, value, amount, date) Task: Find amount from invoices where a matching record exists in managers with the same level. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = inv.level );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "amount", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_01227
train
T1
v1
Schema: shipments (alias: shp)(name, code, value, amount) requests(name, type, salary, code) Task: Select amount from shipments where code exists in requests for the same type. SQL:
SELECT amount FROM shipments AS shp WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.type = shp.type );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_01228
train
T2
v1
Schema: warehouses (alias: whs)(status, name, type, value) employees(type, amount, value, salary) Task: Select id from warehouses where type exists in employees for the same level. SQL:
SELECT id FROM warehouses AS whs WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "employees", "outer_alias": "whs", "inner_alias": "emp", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_01229
train
T2
v2
Schema: services (alias: srvc)(name, level, type, value) budgets(value, salary, type, id) Task: Retrieve id from services that have at least one corresponding entry in budgets sharing the same type. SQL:
SELECT id FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.type = srvc.type );
{ "outer_table": "services", "inner_table": "budgets", "outer_alias": "srvc", "inner_alias": "budg", "proj_col": "id", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_01230
train
T2
v1
Schema: warehouses (alias: whs)(status, amount, id, code) requests(salary, date, value, level) Task: Find salary from warehouses where type appears in requests entries with matching type. SQL:
SELECT salary FROM warehouses AS whs WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "requests", "outer_alias": "whs", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_01231
train
T2
v3
Schema: categories (alias: catg)(code, value, status, level) products(salary, type, name, level) Task: Retrieve salary from categories with value above the AVG(value) of products rows sharing the same code. SQL:
SELECT salary FROM categories AS catg WHERE value > ( SELECT AVG(value) FROM products AS prod WHERE prod.code = catg.code );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_01232
train
T2
v2
Schema: products (alias: prod)(amount, code, level, status) categories(type, code, date, value) Task: Retrieve name from products that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = prod.code );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "name", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_01233
train
T1
v2
Schema: categories (alias: catg)(status, level, value, amount) items(id, amount, name, type) Task: Retrieve amount from categories that have at least one corresponding entry in items sharing the same code. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = catg.code );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "amount", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_01234
train
T2
v1
Schema: transactions (alias: txn)(id, name, type, code) categories(date, code, name, id) Task: Select code from transactions where code exists in categories for the same type. SQL:
SELECT code FROM transactions AS txn WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.type = txn.type );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "code", "filter_col": "code", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_01235
train
T1
v2
Schema: staff (alias: empl)(name, type, status, amount) regions(type, salary, level, code) Task: Find code from staff where a matching record exists in regions with the same code. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = empl.code );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "code", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_01236
train
T2
v1
Schema: orders (alias: ord)(type, id, status, salary) invoices(value, code, name, level) Task: Select salary from orders where level exists in invoices for the same type. SQL:
SELECT salary FROM orders AS ord WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.type = ord.type );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "salary", "filter_col": "level", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_01237
train
T1
v3
Schema: items (alias: lne)(name, id, amount, value) warehouses(type, code, id, status) Task: Find name from items where amount exceeds the average salary from warehouses for the same type. SQL:
SELECT name FROM items AS lne WHERE amount > ( SELECT AVG(salary) FROM warehouses AS whs WHERE whs.type = lne.type );
{ "outer_table": "items", "inner_table": "warehouses", "outer_alias": "lne", "inner_alias": "whs", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_01238
train
T2
v3
Schema: orders (alias: ord)(value, id, status, level) invoices(status, code, id, level) Task: Find code from orders where amount exceeds the average value from invoices for the same type. SQL:
SELECT code FROM orders AS ord WHERE amount > ( SELECT SUM(value) FROM invoices AS inv WHERE inv.type = ord.type );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_01239
train
T1
v3
Schema: requests (alias: ordr)(value, code, status, name) regions(code, salary, date, amount) Task: Retrieve id from requests with amount above the COUNT(value) of regions rows sharing the same type. SQL:
SELECT id FROM requests AS ordr WHERE amount > ( SELECT COUNT(value) FROM regions AS rgn WHERE rgn.type = ordr.type );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_01240
train
T2
v3
Schema: orders (alias: ord)(value, date, salary, name) employees(name, type, salary, level) Task: Find name from orders where value exceeds the average value from employees for the same status. SQL:
SELECT name FROM orders AS ord WHERE value > ( SELECT MIN(value) FROM employees AS emp WHERE emp.status = ord.status );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_01241
train
T1
v2
Schema: transactions (alias: txn)(code, date, level, value) managers(salary, name, amount, code) Task: Find amount from transactions where a matching record exists in managers with the same id. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = txn.id );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "amount", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_01242
train
T1
v3
Schema: invoices (alias: inv)(level, type, value, status) transactions(date, id, amount, name) Task: Retrieve salary from invoices with amount above the MAX(value) of transactions rows sharing the same level. SQL:
SELECT salary FROM invoices AS inv WHERE amount > ( SELECT MAX(value) FROM transactions AS txn WHERE txn.level = inv.level );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_01243
train
T1
v2
Schema: shipments (alias: shp)(level, date, code, value) items(value, level, amount, salary) Task: Retrieve code from shipments that have at least one corresponding entry in items sharing the same code. SQL:
SELECT code FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = shp.code );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "code", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_01244
train
T2
v2
Schema: staff (alias: empl)(status, name, amount, id) customers(code, salary, name, level) Task: Find id from staff where a matching record exists in customers with the same code. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = empl.code );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "id", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_01245
train
T2
v1
Schema: transactions (alias: txn)(status, value, salary, level) items(amount, salary, type, date) Task: Find amount from transactions where code appears in items entries with matching code. SQL:
SELECT amount FROM transactions AS txn WHERE code IN ( SELECT code FROM items AS lne WHERE lne.code = txn.code );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_01246
train
T1
v1
Schema: items (alias: lne)(type, id, amount, value) products(id, amount, salary, value) Task: Retrieve amount from items whose level is found in products rows where id matches the outer record. SQL:
SELECT amount FROM items AS lne WHERE level IN ( SELECT level FROM products AS prod WHERE prod.id = lne.id );
{ "outer_table": "items", "inner_table": "products", "outer_alias": "lne", "inner_alias": "prod", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_01247
train
T2
v1
Schema: invoices (alias: inv)(name, value, type, level) schedules(id, code, date, value) Task: Find name from invoices where code appears in schedules entries with matching id. SQL:
SELECT name FROM invoices AS inv WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.id = inv.id );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_01248
train
T1
v2
Schema: staff (alias: empl)(amount, salary, id, status) employees(status, type, date, salary) Task: Find amount from staff where a matching record exists in employees with the same type. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = empl.type );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "amount", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_01249
train
T2
v2
Schema: orders (alias: ord)(status, type, amount, id) shipments(name, status, level, code) Task: Find value from orders where a matching record exists in shipments with the same level. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = ord.level );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "value", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_01250
train
T1
v1
Schema: requests (alias: ordr)(amount, date, id, value) staff(id, level, value, date) Task: Retrieve code from requests whose level is found in staff rows where id matches the outer record. SQL:
SELECT code FROM requests AS ordr WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.id = ordr.id );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "code", "filter_col": "level", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_01251
train
T2
v3
Schema: employees (alias: emp)(id, code, level, status) products(id, level, value, amount) Task: Find name from employees where amount exceeds the average value from products for the same id. SQL:
SELECT name FROM employees AS emp WHERE amount > ( SELECT MAX(value) FROM products AS prod WHERE prod.id = emp.id );
{ "outer_table": "employees", "inner_table": "products", "outer_alias": "emp", "inner_alias": "prod", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_01252
train
T1
v1
Schema: departments (alias: dept)(type, status, salary, amount) invoices(level, id, type, value) Task: Select value from departments where status exists in invoices for the same id. SQL:
SELECT value FROM departments AS dept WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.id = dept.id );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_01253
train
T1
v3
Schema: products (alias: prod)(level, salary, amount, id) orders(code, id, status, type) Task: Find id from products where salary exceeds the average amount from orders for the same status. SQL:
SELECT id FROM products AS prod WHERE salary > ( SELECT COUNT(amount) FROM orders AS ord WHERE ord.status = prod.status );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_01254
train
T1
v2
Schema: items (alias: lne)(status, level, code, type) shipments(status, level, id, code) Task: Retrieve name from items that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = lne.id );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "name", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_01255
train
T2
v2
Schema: accounts (alias: acct)(code, level, type, date) invoices(code, date, amount, level) Task: Retrieve code from accounts that have at least one corresponding entry in invoices sharing the same level. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = acct.level );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "code", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_01256
train
T1
v1
Schema: customers (alias: cust)(date, value, salary, status) products(code, level, date, type) Task: Find value from customers where code appears in products entries with matching type. SQL:
SELECT value FROM customers AS cust WHERE code IN ( SELECT code FROM products AS prod WHERE prod.type = cust.type );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_01257
train
T1
v1
Schema: customers (alias: cust)(type, value, salary, code) regions(code, level, id, status) Task: Find value from customers where code appears in regions entries with matching status. SQL:
SELECT value FROM customers AS cust WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.status = cust.status );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_01258
train
T1
v2
Schema: services (alias: srvc)(code, type, value, salary) regions(date, id, level, salary) Task: Find code from services where a matching record exists in regions with the same status. SQL:
SELECT code FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = srvc.status );
{ "outer_table": "services", "inner_table": "regions", "outer_alias": "srvc", "inner_alias": "rgn", "proj_col": "code", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_01259
train
T2
v2
Schema: schedules (alias: schd)(type, date, level, name) items(amount, date, code, status) Task: Find id from schedules where a matching record exists in items with the same status. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = schd.status );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "id", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_01260
train
T2
v2
Schema: warehouses (alias: whs)(amount, date, name, code) orders(salary, amount, type, id) Task: Retrieve salary from warehouses that have at least one corresponding entry in orders sharing the same type. SQL:
SELECT salary FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "orders", "outer_alias": "whs", "inner_alias": "ord", "proj_col": "salary", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_01261
train
T2
v2
Schema: shipments (alias: shp)(code, level, date, amount) budgets(name, code, level, id) Task: Find code from shipments where a matching record exists in budgets with the same type. SQL:
SELECT code FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.type = shp.type );
{ "outer_table": "shipments", "inner_table": "budgets", "outer_alias": "shp", "inner_alias": "budg", "proj_col": "code", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_01262
train
T2
v3
Schema: budgets (alias: budg)(date, level, amount, type) employees(id, value, date, amount) Task: Find value from budgets where salary exceeds the average value from employees for the same type. SQL:
SELECT value FROM budgets AS budg WHERE salary > ( SELECT AVG(value) FROM employees AS emp WHERE emp.type = budg.type );
{ "outer_table": "budgets", "inner_table": "employees", "outer_alias": "budg", "inner_alias": "emp", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_01263
train
T2
v2
Schema: categories (alias: catg)(status, date, code, amount) shipments(amount, value, salary, id) Task: Find value from categories where a matching record exists in shipments with the same level. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = catg.level );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "catg", "inner_alias": "shp", "proj_col": "value", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_01264
train
T2
v3
Schema: sales (alias: sale)(date, code, type, status) categories(level, date, amount, status) Task: Find amount from sales where salary exceeds the average value from categories for the same type. SQL:
SELECT amount FROM sales AS sale WHERE salary > ( SELECT COUNT(value) FROM categories AS catg WHERE catg.type = sale.type );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_01265
train
T1
v3
Schema: accounts (alias: acct)(code, status, type, id) warehouses(value, code, id, status) Task: Find code from accounts where salary exceeds the average value from warehouses for the same type. SQL:
SELECT code FROM accounts AS acct WHERE salary > ( SELECT SUM(value) FROM warehouses AS whs WHERE whs.type = acct.type );
{ "outer_table": "accounts", "inner_table": "warehouses", "outer_alias": "acct", "inner_alias": "whs", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_01266
train
T1
v3
Schema: categories (alias: catg)(date, value, level, amount) regions(type, amount, level, code) Task: Retrieve value from categories with value above the AVG(value) of regions rows sharing the same id. SQL:
SELECT value FROM categories AS catg WHERE value > ( SELECT AVG(value) FROM regions AS rgn WHERE rgn.id = catg.id );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_01267
train
T2
v3
Schema: departments (alias: dept)(value, salary, status, amount) invoices(id, level, date, type) Task: Retrieve code from departments with salary above the AVG(value) of invoices rows sharing the same level. SQL:
SELECT code FROM departments AS dept WHERE salary > ( SELECT AVG(value) FROM invoices AS inv WHERE inv.level = dept.level );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_01268
train
T1
v3
Schema: departments (alias: dept)(value, name, amount, salary) employees(name, status, amount, level) Task: Retrieve code from departments with value above the SUM(amount) of employees rows sharing the same code. SQL:
SELECT code FROM departments AS dept WHERE value > ( SELECT SUM(amount) FROM employees AS emp WHERE emp.code = dept.code );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_01269
train
T1
v2
Schema: requests (alias: ordr)(status, date, value, name) warehouses(salary, status, date, level) Task: Retrieve salary from requests that have at least one corresponding entry in warehouses sharing the same status. SQL:
SELECT salary 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": "salary", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_01270
train
T2
v1
Schema: transactions (alias: txn)(status, amount, name, value) customers(id, type, date, level) Task: Retrieve amount from transactions whose type is found in customers rows where code matches the outer record. SQL:
SELECT amount FROM transactions AS txn WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.code = txn.code );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "amount", "filter_col": "type", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_01271
train
T1
v1
Schema: shipments (alias: shp)(level, date, id, name) sales(value, date, id, amount) Task: Select id from shipments where id exists in sales for the same type. SQL:
SELECT id FROM shipments AS shp WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.type = shp.type );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_01272
train
T2
v3
Schema: products (alias: prod)(type, salary, id, name) staff(level, value, amount, name) Task: Find name from products where amount exceeds the average amount from staff for the same type. SQL:
SELECT name FROM products AS prod WHERE amount > ( SELECT SUM(amount) FROM staff AS empl WHERE empl.type = prod.type );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_01273
train
T1
v3
Schema: regions (alias: rgn)(status, name, salary, id) shipments(date, amount, salary, level) Task: Retrieve amount from regions with salary above the MAX(amount) of shipments rows sharing the same id. SQL:
SELECT amount FROM regions AS rgn WHERE salary > ( SELECT MAX(amount) FROM shipments AS shp WHERE shp.id = rgn.id );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_01274
train
T2
v1
Schema: managers (alias: mgr)(amount, status, salary, code) budgets(id, salary, value, level) Task: Select id from managers where status exists in budgets for the same level. SQL:
SELECT id FROM managers AS mgr WHERE status IN ( SELECT status FROM budgets AS budg WHERE budg.level = mgr.level );
{ "outer_table": "managers", "inner_table": "budgets", "outer_alias": "mgr", "inner_alias": "budg", "proj_col": "id", "filter_col": "status", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_01275
train
T1
v2
Schema: warehouses (alias: whs)(status, name, date, salary) departments(amount, status, name, code) Task: Retrieve id from warehouses that have at least one corresponding entry in departments sharing the same type. SQL:
SELECT id FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "departments", "outer_alias": "whs", "inner_alias": "dept", "proj_col": "id", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_01276
train
T2
v1
Schema: transactions (alias: txn)(status, salary, amount, type) orders(code, type, amount, value) Task: Retrieve code from transactions whose id is found in orders rows where status matches the outer record. SQL:
SELECT code FROM transactions AS txn WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.status = txn.status );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "code", "filter_col": "id", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_01277
train
T1
v1
Schema: invoices (alias: inv)(level, status, amount, date) services(salary, code, type, status) Task: Find salary from invoices where id appears in services entries with matching type. SQL:
SELECT salary FROM invoices AS inv WHERE id IN ( SELECT id FROM services AS srvc WHERE srvc.type = inv.type );
{ "outer_table": "invoices", "inner_table": "services", "outer_alias": "inv", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "id", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_01278
train
T1
v1
Schema: products (alias: prod)(salary, id, type, code) schedules(id, date, type, salary) Task: Find amount from products where type appears in schedules entries with matching code. SQL:
SELECT amount FROM products AS prod WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.code = prod.code );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "amount", "filter_col": "type", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_01279
train
T1
v2
Schema: customers (alias: cust)(status, name, code, amount) warehouses(status, name, date, value) Task: Retrieve value from customers that have at least one corresponding entry in warehouses sharing the same level. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.level = cust.level );
{ "outer_table": "customers", "inner_table": "warehouses", "outer_alias": "cust", "inner_alias": "whs", "proj_col": "value", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_01280
train
T1
v1
Schema: managers (alias: mgr)(name, salary, type, code) schedules(type, code, amount, level) Task: Select salary from managers where type exists in schedules for the same level. SQL:
SELECT salary FROM managers AS mgr WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.level = mgr.level );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "salary", "filter_col": "type", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_01281
train
T1
v3
Schema: accounts (alias: acct)(code, name, date, id) regions(status, type, amount, name) Task: Find id from accounts where salary exceeds the average value from regions for the same id. SQL:
SELECT id FROM accounts AS acct WHERE salary > ( SELECT COUNT(value) FROM regions AS rgn WHERE rgn.id = acct.id );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_01282
train
T1
v1
Schema: shipments (alias: shp)(id, name, code, value) employees(date, value, id, amount) Task: Select code from shipments where status exists in employees for the same status. SQL:
SELECT code FROM shipments AS shp WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.status = shp.status );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "code", "filter_col": "status", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_01283
train
T2
v3
Schema: shipments (alias: shp)(name, level, status, salary) items(date, level, status, id) Task: Retrieve value from shipments with amount above the AVG(salary) of items rows sharing the same type. SQL:
SELECT value FROM shipments AS shp WHERE amount > ( SELECT AVG(salary) FROM items AS lne WHERE lne.type = shp.type );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_01284
train
T2
v2
Schema: orders (alias: ord)(type, code, date, id) departments(date, value, amount, code) Task: Retrieve salary from orders that have at least one corresponding entry in departments sharing the same status. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = ord.status );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "salary", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_01285
train
T1
v3
Schema: services (alias: srvc)(date, amount, id, type) transactions(name, code, id, amount) Task: Retrieve amount from services with amount above the MAX(salary) of transactions rows sharing the same type. SQL:
SELECT amount FROM services AS srvc WHERE amount > ( SELECT MAX(salary) FROM transactions AS txn WHERE txn.type = srvc.type );
{ "outer_table": "services", "inner_table": "transactions", "outer_alias": "srvc", "inner_alias": "txn", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_01286
train
T2
v3
Schema: employees (alias: emp)(type, amount, salary, code) shipments(type, date, status, name) Task: Find salary from employees where salary exceeds the average salary from shipments for the same code. SQL:
SELECT salary FROM employees AS emp WHERE salary > ( SELECT COUNT(salary) FROM shipments AS shp WHERE shp.code = emp.code );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_01287
train
T1
v2
Schema: items (alias: lne)(level, salary, name, type) shipments(date, salary, code, type) Task: Retrieve amount from items that have at least one corresponding entry in shipments sharing the same type. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = lne.type );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "amount", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_01288
train
T2
v2
Schema: staff (alias: empl)(date, amount, id, level) regions(value, date, name, id) Task: Retrieve code from staff that have at least one corresponding entry in regions sharing the same type. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = empl.type );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "code", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_01289
train
T2
v1
Schema: staff (alias: empl)(id, salary, date, value) managers(value, amount, level, status) Task: Select amount from staff where code exists in managers for the same level. SQL:
SELECT amount FROM staff AS empl WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.level = empl.level );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_01290
train
T2
v1
Schema: shipments (alias: shp)(name, date, salary, value) warehouses(id, amount, salary, date) Task: Select salary from shipments where level exists in warehouses for the same code. SQL:
SELECT salary FROM shipments AS shp WHERE level IN ( SELECT level FROM warehouses AS whs WHERE whs.code = shp.code );
{ "outer_table": "shipments", "inner_table": "warehouses", "outer_alias": "shp", "inner_alias": "whs", "proj_col": "salary", "filter_col": "level", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_01291
train
T2
v1
Schema: items (alias: lne)(level, name, code, date) managers(status, date, amount, level) Task: Retrieve id from items whose type is found in managers rows where status matches the outer record. SQL:
SELECT id FROM items AS lne WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.status = lne.status );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "id", "filter_col": "type", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_01292
train
T2
v3
Schema: schedules (alias: schd)(amount, salary, date, code) sales(salary, type, code, name) Task: Find salary from schedules where value exceeds the average value from sales for the same status. SQL:
SELECT salary FROM schedules AS schd WHERE value > ( SELECT MAX(value) FROM sales AS sale WHERE sale.status = schd.status );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_01293
train
T2
v1
Schema: sales (alias: sale)(type, level, name, amount) budgets(level, value, type, id) Task: Retrieve id from sales whose level is found in budgets rows where code matches the outer record. SQL:
SELECT id FROM sales AS sale WHERE level IN ( SELECT level FROM budgets AS budg WHERE budg.code = sale.code );
{ "outer_table": "sales", "inner_table": "budgets", "outer_alias": "sale", "inner_alias": "budg", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_01294
train
T1
v2
Schema: products (alias: prod)(date, code, status, type) warehouses(type, amount, name, status) Task: Find code from products where a matching record exists in warehouses with 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_01295
train
T1
v2
Schema: services (alias: srvc)(salary, id, date, name) warehouses(date, type, level, value) Task: Retrieve amount from services that have at least one corresponding entry in warehouses sharing the same type. SQL:
SELECT amount FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.type = srvc.type );
{ "outer_table": "services", "inner_table": "warehouses", "outer_alias": "srvc", "inner_alias": "whs", "proj_col": "amount", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_01296
train
T2
v3
Schema: managers (alias: mgr)(name, type, salary, level) shipments(date, id, salary, name) Task: Retrieve value from managers with amount above the COUNT(salary) of shipments rows sharing the same code. SQL:
SELECT value FROM managers AS mgr WHERE amount > ( SELECT COUNT(salary) FROM shipments AS shp WHERE shp.code = mgr.code );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_01297
train
T1
v2
Schema: managers (alias: mgr)(date, code, type, id) warehouses(type, name, status, amount) Task: Retrieve id from managers that have at least one corresponding entry in warehouses sharing the same type. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.type = mgr.type );
{ "outer_table": "managers", "inner_table": "warehouses", "outer_alias": "mgr", "inner_alias": "whs", "proj_col": "id", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_01298
train
T1
v2
Schema: products (alias: prod)(code, name, level, value) invoices(value, date, level, amount) Task: Retrieve value from products that have at least one corresponding entry in invoices sharing the same status. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = prod.status );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "value", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_01299
train
T1