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: services (alias: srvc)(value, amount, code, name) shipments(salary, status, name, code) Task: Retrieve value from services with amount above the MIN(value) of shipments rows sharing the same id. SQL:
SELECT value FROM services AS srvc WHERE amount > ( SELECT MIN(value) FROM shipments AS shp WHERE shp.id = srvc.id );
{ "outer_table": "services", "inner_table": "shipments", "outer_alias": "srvc", "inner_alias": "shp", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_02300
train
T2
v3
Schema: staff (alias: empl)(date, level, value, amount) services(code, salary, value, name) Task: Find amount from staff where amount exceeds the average salary from services for the same type. SQL:
SELECT amount FROM staff AS empl WHERE amount > ( SELECT MAX(salary) FROM services AS srvc WHERE srvc.type = empl.type );
{ "outer_table": "staff", "inner_table": "services", "outer_alias": "empl", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_02301
train
T2
v2
Schema: departments (alias: dept)(date, amount, type, code) requests(name, value, level, id) Task: Retrieve value from departments that have at least one corresponding entry in requests sharing the same id. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = dept.id );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "value", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_02302
train
T1
v3
Schema: budgets (alias: budg)(name, code, value, type) regions(salary, status, code, amount) Task: Find amount from budgets where amount exceeds the average salary from regions for the same level. SQL:
SELECT amount FROM budgets AS budg WHERE amount > ( SELECT MIN(salary) FROM regions AS rgn WHERE rgn.level = budg.level );
{ "outer_table": "budgets", "inner_table": "regions", "outer_alias": "budg", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_02303
train
T2
v1
Schema: orders (alias: ord)(name, status, salary, amount) categories(value, date, salary, name) Task: Find value from orders where id appears in categories entries with matching code. SQL:
SELECT value FROM orders AS ord WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.code = ord.code );
{ "outer_table": "orders", "inner_table": "categories", "outer_alias": "ord", "inner_alias": "catg", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_02304
train
T1
v3
Schema: products (alias: prod)(level, name, status, code) budgets(name, salary, amount, type) Task: Retrieve salary from products with salary above the SUM(salary) of budgets rows sharing the same code. SQL:
SELECT salary FROM products AS prod WHERE salary > ( SELECT SUM(salary) FROM budgets AS budg WHERE budg.code = prod.code );
{ "outer_table": "products", "inner_table": "budgets", "outer_alias": "prod", "inner_alias": "budg", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_02305
train
T1
v3
Schema: services (alias: srvc)(level, value, type, code) transactions(name, id, code, type) Task: Retrieve value from services with salary above the MAX(amount) of transactions rows sharing the same level. SQL:
SELECT value FROM services AS srvc WHERE salary > ( SELECT MAX(amount) FROM transactions AS txn WHERE txn.level = srvc.level );
{ "outer_table": "services", "inner_table": "transactions", "outer_alias": "srvc", "inner_alias": "txn", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_02306
train
T2
v3
Schema: services (alias: srvc)(type, status, value, date) requests(id, type, salary, name) Task: Find id from services where amount exceeds the average salary from requests for the same id. SQL:
SELECT id FROM services AS srvc WHERE amount > ( SELECT AVG(salary) FROM requests AS ordr WHERE ordr.id = srvc.id );
{ "outer_table": "services", "inner_table": "requests", "outer_alias": "srvc", "inner_alias": "ordr", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_02307
train
T2
v3
Schema: items (alias: lne)(name, level, amount, date) regions(value, code, name, status) Task: Find value from items where value exceeds the average amount from regions for the same level. SQL:
SELECT value FROM items AS lne WHERE value > ( SELECT SUM(amount) FROM regions AS rgn WHERE rgn.level = lne.level );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_02308
train
T2
v3
Schema: shipments (alias: shp)(value, code, level, amount) invoices(level, amount, id, date) Task: Retrieve name from shipments with value above the SUM(salary) of invoices rows sharing the same level. SQL:
SELECT name FROM shipments AS shp WHERE value > ( SELECT SUM(salary) FROM invoices AS inv WHERE inv.level = shp.level );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_02309
train
T2
v2
Schema: budgets (alias: budg)(code, name, level, date) transactions(value, code, name, salary) Task: Retrieve value from budgets that have at least one corresponding entry in transactions sharing the same type. SQL:
SELECT value FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = budg.type );
{ "outer_table": "budgets", "inner_table": "transactions", "outer_alias": "budg", "inner_alias": "txn", "proj_col": "value", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_02310
train
T2
v3
Schema: regions (alias: rgn)(code, date, value, id) customers(salary, status, level, value) Task: Find code from regions where amount exceeds the average salary from customers for the same type. SQL:
SELECT code FROM regions AS rgn WHERE amount > ( SELECT MIN(salary) FROM customers AS cust WHERE cust.type = rgn.type );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_02311
train
T2
v2
Schema: orders (alias: ord)(date, code, value, status) managers(type, date, level, status) Task: Find code from orders where a matching record exists in managers with the same id. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = ord.id );
{ "outer_table": "orders", "inner_table": "managers", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "code", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_02312
train
T1
v1
Schema: invoices (alias: inv)(date, status, id, code) warehouses(value, id, code, level) Task: Select id from invoices where type exists in warehouses for the same code. SQL:
SELECT id FROM invoices AS inv WHERE type IN ( SELECT type FROM warehouses AS whs WHERE whs.code = inv.code );
{ "outer_table": "invoices", "inner_table": "warehouses", "outer_alias": "inv", "inner_alias": "whs", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_02313
train
T1
v2
Schema: schedules (alias: schd)(level, status, amount, value) departments(name, amount, type, level) Task: Find name from schedules where a matching record exists in departments with the same id. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = schd.id );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "name", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_02314
train
T2
v2
Schema: departments (alias: dept)(level, name, id, status) regions(value, date, amount, name) Task: Find id from departments where a matching record exists in regions with the same code. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = dept.code );
{ "outer_table": "departments", "inner_table": "regions", "outer_alias": "dept", "inner_alias": "rgn", "proj_col": "id", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_02315
train
T1
v2
Schema: products (alias: prod)(amount, level, status, salary) schedules(salary, amount, level, code) Task: Find name from products where a matching record exists in schedules with the same type. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = prod.type );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "name", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_02316
train
T1
v3
Schema: warehouses (alias: whs)(id, code, value, salary) schedules(id, level, salary, code) Task: Find salary from warehouses where value exceeds the average amount from schedules for the same type. SQL:
SELECT salary FROM warehouses AS whs WHERE value > ( SELECT SUM(amount) FROM schedules AS schd WHERE schd.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "schedules", "outer_alias": "whs", "inner_alias": "schd", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_02317
train
T2
v3
Schema: products (alias: prod)(status, name, amount, salary) warehouses(id, name, level, code) Task: Find salary from products where value exceeds the average value from warehouses for the same type. SQL:
SELECT salary FROM products AS prod WHERE value > ( SELECT COUNT(value) FROM warehouses AS whs WHERE whs.type = prod.type );
{ "outer_table": "products", "inner_table": "warehouses", "outer_alias": "prod", "inner_alias": "whs", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_02318
train
T1
v2
Schema: staff (alias: empl)(level, value, amount, salary) accounts(date, code, type, name) Task: Find id from staff where a matching record exists in accounts with the same code. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = empl.code );
{ "outer_table": "staff", "inner_table": "accounts", "outer_alias": "empl", "inner_alias": "acct", "proj_col": "id", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_02319
train
T2
v3
Schema: staff (alias: empl)(id, type, date, code) managers(date, code, type, id) Task: Retrieve salary from staff with amount above the AVG(amount) of managers rows sharing the same type. SQL:
SELECT salary FROM staff AS empl WHERE amount > ( SELECT AVG(amount) FROM managers AS mgr WHERE mgr.type = empl.type );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_02320
train
T2
v3
Schema: regions (alias: rgn)(type, name, amount, status) shipments(value, level, amount, status) Task: Retrieve value from regions with value above the AVG(amount) of shipments rows sharing the same status. SQL:
SELECT value FROM regions AS rgn WHERE value > ( SELECT AVG(amount) FROM shipments AS shp WHERE shp.status = rgn.status );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_02321
train
T2
v2
Schema: departments (alias: dept)(value, type, amount, name) transactions(code, amount, status, level) Task: Retrieve amount from departments that have at least one corresponding entry in transactions sharing the same id. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = dept.id );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "amount", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_02322
train
T1
v1
Schema: orders (alias: ord)(name, code, status, level) items(value, name, level, date) Task: Select amount from orders where type exists in items for the same level. SQL:
SELECT amount FROM orders AS ord WHERE type IN ( SELECT type FROM items AS lne WHERE lne.level = ord.level );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_02323
train
T1
v3
Schema: accounts (alias: acct)(name, type, amount, level) services(salary, name, id, level) Task: Retrieve name from accounts with value above the COUNT(amount) of services rows sharing the same type. SQL:
SELECT name FROM accounts AS acct WHERE value > ( SELECT COUNT(amount) FROM services AS srvc WHERE srvc.type = acct.type );
{ "outer_table": "accounts", "inner_table": "services", "outer_alias": "acct", "inner_alias": "srvc", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_02324
train
T1
v1
Schema: products (alias: prod)(amount, value, id, salary) budgets(level, id, name, type) Task: Select name from products where status exists in budgets for the same status. SQL:
SELECT name FROM products AS prod WHERE status IN ( SELECT status FROM budgets AS budg WHERE budg.status = prod.status );
{ "outer_table": "products", "inner_table": "budgets", "outer_alias": "prod", "inner_alias": "budg", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_02325
train
T1
v3
Schema: customers (alias: cust)(id, status, salary, level) regions(date, name, type, salary) Task: Retrieve amount from customers with salary above the MIN(amount) of regions rows sharing the same status. SQL:
SELECT amount FROM customers AS cust WHERE salary > ( SELECT MIN(amount) FROM regions AS rgn WHERE rgn.status = cust.status );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_02326
train
T1
v2
Schema: schedules (alias: schd)(level, date, status, id) requests(name, date, status, type) Task: Retrieve name from schedules that have at least one corresponding entry in requests sharing the same level. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = schd.level );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "name", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_02327
train
T2
v1
Schema: transactions (alias: txn)(name, amount, salary, type) sales(value, name, level, status) Task: Select amount from transactions where status exists in sales for the same status. SQL:
SELECT amount FROM transactions AS txn WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.status = txn.status );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_02328
train
T1
v3
Schema: staff (alias: empl)(id, date, name, status) schedules(salary, status, amount, type) Task: Retrieve code from staff with amount above the AVG(amount) of schedules rows sharing the same id. SQL:
SELECT code FROM staff AS empl WHERE amount > ( SELECT AVG(amount) FROM schedules AS schd WHERE schd.id = empl.id );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_02329
train
T2
v1
Schema: invoices (alias: inv)(date, level, code, value) items(status, id, type, amount) Task: Select id from invoices where code exists in items for the same id. SQL:
SELECT id FROM invoices AS inv WHERE code IN ( SELECT code FROM items AS lne WHERE lne.id = inv.id );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "id", "filter_col": "code", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_02330
train
T1
v3
Schema: customers (alias: cust)(value, id, level, type) sales(code, salary, id, date) Task: Retrieve code from customers with value above the SUM(amount) of sales rows sharing the same type. SQL:
SELECT code FROM customers AS cust WHERE value > ( SELECT SUM(amount) FROM sales AS sale WHERE sale.type = cust.type );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_02331
train
T1
v1
Schema: budgets (alias: budg)(level, name, value, status) shipments(level, amount, id, name) Task: Find value from budgets where code appears in shipments entries with matching code. SQL:
SELECT value FROM budgets AS budg WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.code = budg.code );
{ "outer_table": "budgets", "inner_table": "shipments", "outer_alias": "budg", "inner_alias": "shp", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_02332
train
T2
v2
Schema: items (alias: lne)(date, id, code, type) employees(code, type, name, status) Task: Find amount from items where a matching record exists in employees with the same type. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = lne.type );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "amount", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_02333
train
T2
v3
Schema: requests (alias: ordr)(type, level, value, status) managers(name, status, amount, date) Task: Retrieve amount from requests with amount above the SUM(value) of managers rows sharing the same status. SQL:
SELECT amount FROM requests AS ordr WHERE amount > ( SELECT SUM(value) FROM managers AS mgr WHERE mgr.status = ordr.status );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_02334
train
T2
v3
Schema: staff (alias: empl)(id, name, status, value) budgets(salary, name, date, id) Task: Retrieve code from staff with value above the MIN(amount) of budgets rows sharing the same id. SQL:
SELECT code FROM staff AS empl WHERE value > ( SELECT MIN(amount) FROM budgets AS budg WHERE budg.id = empl.id );
{ "outer_table": "staff", "inner_table": "budgets", "outer_alias": "empl", "inner_alias": "budg", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_02335
train
T2
v1
Schema: warehouses (alias: whs)(value, type, id, name) departments(value, level, status, type) Task: Retrieve amount from warehouses whose id is found in departments rows where id matches the outer record. SQL:
SELECT amount FROM warehouses AS whs WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "departments", "outer_alias": "whs", "inner_alias": "dept", "proj_col": "amount", "filter_col": "id", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_02336
train
T2
v3
Schema: transactions (alias: txn)(amount, level, type, value) customers(status, name, salary, date) Task: Find amount from transactions where amount exceeds the average salary from customers for the same code. SQL:
SELECT amount FROM transactions AS txn WHERE amount > ( SELECT AVG(salary) 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": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_02337
train
T1
v1
Schema: shipments (alias: shp)(code, date, amount, id) warehouses(status, amount, level, salary) Task: Retrieve id from shipments whose code is found in warehouses rows where code matches the outer record. SQL:
SELECT id FROM shipments AS shp WHERE code IN ( SELECT code FROM warehouses AS whs WHERE whs.code = shp.code );
{ "outer_table": "shipments", "inner_table": "warehouses", "outer_alias": "shp", "inner_alias": "whs", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_02338
train
T2
v3
Schema: warehouses (alias: whs)(value, salary, type, id) invoices(amount, value, type, salary) Task: Find value from warehouses where value exceeds the average value from invoices for the same level. SQL:
SELECT value FROM warehouses AS whs WHERE value > ( SELECT COUNT(value) FROM invoices AS inv WHERE inv.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "invoices", "outer_alias": "whs", "inner_alias": "inv", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_02339
train
T2
v3
Schema: schedules (alias: schd)(status, level, value, date) employees(value, status, date, code) Task: Retrieve salary from schedules with amount above the MIN(salary) of employees rows sharing the same code. SQL:
SELECT salary FROM schedules AS schd WHERE amount > ( SELECT MIN(salary) FROM employees AS emp WHERE emp.code = schd.code );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_02340
train
T2
v2
Schema: staff (alias: empl)(status, amount, level, date) items(status, date, salary, amount) Task: Find amount from staff where a matching record exists in items with the same level. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.level = empl.level );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "amount", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_02341
train
T2
v1
Schema: transactions (alias: txn)(id, name, status, type) items(date, level, id, type) Task: Find id from transactions where code appears in items entries with matching status. SQL:
SELECT id FROM transactions AS txn WHERE code IN ( SELECT code FROM items AS lne WHERE lne.status = txn.status );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_02342
train
T1
v3
Schema: items (alias: lne)(status, name, type, date) products(amount, date, code, level) Task: Retrieve value from items with salary above the MAX(value) of products rows sharing the same type. SQL:
SELECT value FROM items AS lne WHERE salary > ( SELECT MAX(value) FROM products AS prod WHERE prod.type = lne.type );
{ "outer_table": "items", "inner_table": "products", "outer_alias": "lne", "inner_alias": "prod", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_02343
train
T2
v1
Schema: managers (alias: mgr)(salary, code, amount, date) categories(level, status, name, type) Task: Find value from managers where status appears in categories entries with matching level. SQL:
SELECT value FROM managers AS mgr WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.level = mgr.level );
{ "outer_table": "managers", "inner_table": "categories", "outer_alias": "mgr", "inner_alias": "catg", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_02344
train
T1
v3
Schema: customers (alias: cust)(value, name, salary, code) services(type, salary, code, level) Task: Retrieve name from customers with salary above the MIN(amount) of services rows sharing the same status. SQL:
SELECT name FROM customers AS cust WHERE salary > ( SELECT MIN(amount) FROM services AS srvc WHERE srvc.status = cust.status );
{ "outer_table": "customers", "inner_table": "services", "outer_alias": "cust", "inner_alias": "srvc", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_02345
train
T1
v1
Schema: customers (alias: cust)(amount, code, salary, value) employees(status, id, value, level) Task: Select id from customers where code exists in employees for the same status. SQL:
SELECT id FROM customers AS cust WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.status = cust.status );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_02346
train
T1
v3
Schema: products (alias: prod)(name, date, amount, code) customers(code, amount, id, level) Task: Retrieve salary from products with value above the SUM(amount) of customers rows sharing the same id. SQL:
SELECT salary FROM products AS prod WHERE value > ( SELECT SUM(amount) FROM customers AS cust WHERE cust.id = prod.id );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_02347
train
T1
v3
Schema: categories (alias: catg)(date, amount, code, id) warehouses(name, value, date, amount) Task: Retrieve value from categories with amount above the AVG(salary) of warehouses rows sharing the same type. SQL:
SELECT value FROM categories AS catg WHERE amount > ( SELECT AVG(salary) FROM warehouses AS whs WHERE whs.type = catg.type );
{ "outer_table": "categories", "inner_table": "warehouses", "outer_alias": "catg", "inner_alias": "whs", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_02348
train
T2
v3
Schema: employees (alias: emp)(amount, type, salary, value) invoices(salary, level, name, date) Task: Find value from employees where value exceeds the average salary from invoices for the same id. SQL:
SELECT value FROM employees AS emp WHERE value > ( SELECT SUM(salary) FROM invoices AS inv WHERE inv.id = emp.id );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_02349
train
T1
v2
Schema: products (alias: prod)(date, code, status, type) shipments(id, date, name, amount) Task: Find id from products where a matching record exists in shipments with the same type. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = prod.type );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "id", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_02350
train
T1
v2
Schema: sales (alias: sale)(level, status, id, type) transactions(name, salary, value, date) Task: Retrieve name from sales that have at least one corresponding entry in transactions sharing the same code. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = sale.code );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "name", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_02351
train
T1
v3
Schema: accounts (alias: acct)(name, date, value, status) sales(type, level, salary, id) Task: Retrieve code from accounts with amount above the MAX(amount) of sales rows sharing the same type. SQL:
SELECT code FROM accounts AS acct WHERE amount > ( SELECT MAX(amount) FROM sales AS sale WHERE sale.type = acct.type );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_02352
train
T1
v1
Schema: managers (alias: mgr)(value, amount, level, code) accounts(id, type, salary, amount) Task: Find amount from managers where code appears in accounts entries with matching level. SQL:
SELECT amount FROM managers AS mgr WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.level = mgr.level );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_02353
train
T1
v1
Schema: budgets (alias: budg)(status, type, code, id) sales(status, code, level, type) Task: Find code from budgets where id appears in sales entries with matching level. SQL:
SELECT code FROM budgets AS budg WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.level = budg.level );
{ "outer_table": "budgets", "inner_table": "sales", "outer_alias": "budg", "inner_alias": "sale", "proj_col": "code", "filter_col": "id", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_02354
train
T2
v2
Schema: schedules (alias: schd)(type, status, salary, value) staff(date, level, value, code) Task: Find salary from schedules where a matching record exists in staff with the same status. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = schd.status );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "salary", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_02355
train
T2
v1
Schema: accounts (alias: acct)(date, status, id, salary) invoices(value, salary, level, type) Task: Find code from accounts where type appears in invoices entries with matching status. SQL:
SELECT code FROM accounts AS acct WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.status = acct.status );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_02356
train
T1
v2
Schema: orders (alias: ord)(date, name, amount, status) accounts(code, status, name, salary) Task: Retrieve value from orders that have at least one corresponding entry in accounts sharing the same level. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = ord.level );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "value", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_02357
train
T1
v3
Schema: transactions (alias: txn)(code, name, date, id) products(id, name, value, code) Task: Retrieve amount from transactions with value above the AVG(value) of products rows sharing the same id. SQL:
SELECT amount FROM transactions AS txn WHERE value > ( SELECT AVG(value) FROM products AS prod WHERE prod.id = txn.id );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_02358
train
T1
v1
Schema: warehouses (alias: whs)(date, value, id, type) shipments(amount, name, status, value) Task: Find id from warehouses where status appears in shipments entries with matching code. SQL:
SELECT id FROM warehouses AS whs WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "shipments", "outer_alias": "whs", "inner_alias": "shp", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_02359
train
T2
v2
Schema: employees (alias: emp)(name, type, amount, level) services(value, salary, status, code) Task: Find amount from employees where a matching record exists in services with the same status. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.status = emp.status );
{ "outer_table": "employees", "inner_table": "services", "outer_alias": "emp", "inner_alias": "srvc", "proj_col": "amount", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_02360
train
T1
v3
Schema: products (alias: prod)(status, salary, date, level) items(name, code, salary, id) Task: Find salary from products where value exceeds the average value from items for the same type. SQL:
SELECT salary FROM products AS prod WHERE value > ( SELECT AVG(value) FROM items AS lne WHERE lne.type = prod.type );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_02361
train
T1
v1
Schema: regions (alias: rgn)(salary, code, amount, level) customers(amount, salary, date, status) Task: Find name from regions where level appears in customers entries with matching level. SQL:
SELECT name FROM regions AS rgn WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.level = rgn.level );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_02362
train
T2
v3
Schema: employees (alias: emp)(date, code, status, salary) products(date, type, name, status) Task: Find value from employees where value exceeds the average amount from products for the same code. SQL:
SELECT value FROM employees AS emp WHERE value > ( SELECT SUM(amount) FROM products AS prod WHERE prod.code = emp.code );
{ "outer_table": "employees", "inner_table": "products", "outer_alias": "emp", "inner_alias": "prod", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_02363
train
T1
v1
Schema: employees (alias: emp)(type, level, name, salary) schedules(code, value, date, type) Task: Find id from employees where level appears in schedules entries with matching type. SQL:
SELECT id FROM employees AS emp WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.type = emp.type );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_02364
train
T1
v2
Schema: budgets (alias: budg)(name, status, amount, salary) employees(value, amount, code, id) Task: Retrieve code from budgets that have at least one corresponding entry in employees sharing the same type. SQL:
SELECT code FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = budg.type );
{ "outer_table": "budgets", "inner_table": "employees", "outer_alias": "budg", "inner_alias": "emp", "proj_col": "code", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_02365
train
T2
v2
Schema: requests (alias: ordr)(value, level, status, id) products(name, date, type, status) Task: Retrieve name from requests that have at least one corresponding entry in products sharing the same status. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = ordr.status );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "name", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_02366
train
T2
v2
Schema: shipments (alias: shp)(salary, amount, value, level) services(salary, status, level, value) Task: Find code from shipments where a matching record exists in services with the same id. SQL:
SELECT code FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = shp.id );
{ "outer_table": "shipments", "inner_table": "services", "outer_alias": "shp", "inner_alias": "srvc", "proj_col": "code", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_02367
train
T2
v1
Schema: customers (alias: cust)(status, id, salary, value) transactions(status, value, amount, date) Task: Select code from customers where code exists in transactions for the same code. SQL:
SELECT code FROM customers AS cust WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.code = cust.code );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_02368
train
T1
v1
Schema: transactions (alias: txn)(type, code, salary, status) budgets(amount, name, type, id) Task: Retrieve id from transactions whose level is found in budgets rows where level matches the outer record. SQL:
SELECT id FROM transactions AS txn WHERE level IN ( SELECT level FROM budgets AS budg WHERE budg.level = txn.level );
{ "outer_table": "transactions", "inner_table": "budgets", "outer_alias": "txn", "inner_alias": "budg", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_02369
train
T1
v3
Schema: products (alias: prod)(level, code, type, status) managers(date, amount, name, id) Task: Retrieve name from products with salary above the COUNT(salary) of managers rows sharing the same id. SQL:
SELECT name FROM products AS prod WHERE salary > ( SELECT COUNT(salary) FROM managers AS mgr WHERE mgr.id = prod.id );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_02370
train
T1
v1
Schema: staff (alias: empl)(id, code, type, value) categories(amount, code, id, level) Task: Retrieve value from staff whose status is found in categories rows where level matches the outer record. SQL:
SELECT value FROM staff AS empl WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.level = empl.level );
{ "outer_table": "staff", "inner_table": "categories", "outer_alias": "empl", "inner_alias": "catg", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_02371
train
T2
v3
Schema: employees (alias: emp)(name, type, id, salary) customers(value, amount, salary, code) Task: Find code from employees where salary exceeds the average amount from customers for the same type. SQL:
SELECT code FROM employees AS emp WHERE salary > ( SELECT AVG(amount) FROM customers AS cust WHERE cust.type = emp.type );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_02372
train
T1
v3
Schema: employees (alias: emp)(salary, type, name, amount) budgets(type, status, name, amount) Task: Find value from employees where salary exceeds the average value from budgets for the same status. SQL:
SELECT value FROM employees AS emp WHERE salary > ( SELECT MIN(value) FROM budgets AS budg WHERE budg.status = emp.status );
{ "outer_table": "employees", "inner_table": "budgets", "outer_alias": "emp", "inner_alias": "budg", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_02373
train
T1
v2
Schema: accounts (alias: acct)(date, salary, amount, level) schedules(salary, type, id, value) Task: Retrieve id from accounts that have at least one corresponding entry in schedules sharing the same status. SQL:
SELECT id 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": "id", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_02374
train
T1
v2
Schema: shipments (alias: shp)(code, level, value, type) transactions(status, amount, date, value) Task: Find value from shipments where a matching record exists in transactions with the same code. SQL:
SELECT value FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = shp.code );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "value", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_02375
train
T2
v1
Schema: requests (alias: ordr)(id, name, value, type) employees(type, level, value, id) Task: Select id from requests where type exists in employees for the same code. SQL:
SELECT id FROM requests AS ordr WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.code = ordr.code );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_02376
train
T2
v1
Schema: regions (alias: rgn)(code, value, date, salary) sales(amount, type, name, code) Task: Find value from regions where type appears in sales entries with matching type. SQL:
SELECT value FROM regions AS rgn WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.type = rgn.type );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "value", "filter_col": "type", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_02377
train
T2
v2
Schema: shipments (alias: shp)(level, type, status, amount) warehouses(amount, value, salary, code) Task: Retrieve value from shipments that have at least one corresponding entry in warehouses sharing the same level. SQL:
SELECT value FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.level = shp.level );
{ "outer_table": "shipments", "inner_table": "warehouses", "outer_alias": "shp", "inner_alias": "whs", "proj_col": "value", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_02378
train
T2
v3
Schema: products (alias: prod)(amount, value, id, salary) services(status, type, date, value) Task: Retrieve code from products with amount above the MAX(value) of services rows sharing the same code. SQL:
SELECT code FROM products AS prod WHERE amount > ( SELECT MAX(value) FROM services AS srvc WHERE srvc.code = prod.code );
{ "outer_table": "products", "inner_table": "services", "outer_alias": "prod", "inner_alias": "srvc", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_02379
train
T1
v2
Schema: transactions (alias: txn)(id, name, status, value) regions(name, code, date, id) Task: Find amount from transactions where a matching record exists in regions with the same id. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = txn.id );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "amount", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_02380
train
T1
v3
Schema: employees (alias: emp)(amount, type, salary, level) services(level, value, type, id) Task: Retrieve id from employees with amount above the SUM(value) of services rows sharing the same type. SQL:
SELECT id FROM employees AS emp WHERE amount > ( SELECT SUM(value) FROM services AS srvc WHERE srvc.type = emp.type );
{ "outer_table": "employees", "inner_table": "services", "outer_alias": "emp", "inner_alias": "srvc", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_02381
train
T1
v3
Schema: categories (alias: catg)(type, amount, status, salary) services(status, type, value, level) Task: Retrieve name from categories with salary above the COUNT(amount) of services rows sharing the same status. SQL:
SELECT name FROM categories AS catg WHERE salary > ( SELECT COUNT(amount) FROM services AS srvc WHERE srvc.status = catg.status );
{ "outer_table": "categories", "inner_table": "services", "outer_alias": "catg", "inner_alias": "srvc", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_02382
train
T2
v1
Schema: staff (alias: empl)(type, level, status, date) employees(status, salary, name, type) Task: Select id from staff where code exists in employees for the same code. SQL:
SELECT id FROM staff AS empl WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.code = empl.code );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_02383
train
T2
v3
Schema: schedules (alias: schd)(name, level, date, status) requests(level, code, type, salary) Task: Retrieve value from schedules with salary above the MAX(salary) of requests rows sharing the same id. SQL:
SELECT value FROM schedules AS schd WHERE salary > ( SELECT MAX(salary) FROM requests AS ordr WHERE ordr.id = schd.id );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_02384
train
T2
v2
Schema: regions (alias: rgn)(salary, id, date, code) sales(amount, level, status, date) Task: Retrieve salary from regions that have at least one corresponding entry in sales sharing the same id. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = rgn.id );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "salary", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_02385
train
T2
v3
Schema: managers (alias: mgr)(date, name, salary, value) services(amount, status, date, salary) Task: Find name from managers where salary exceeds the average value from services for the same type. SQL:
SELECT name FROM managers AS mgr WHERE salary > ( SELECT SUM(value) FROM services AS srvc WHERE srvc.type = mgr.type );
{ "outer_table": "managers", "inner_table": "services", "outer_alias": "mgr", "inner_alias": "srvc", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_02386
train
T1
v2
Schema: sales (alias: sale)(date, status, salary, value) accounts(level, id, amount, value) Task: Retrieve value from sales that have at least one corresponding entry in accounts sharing the same status. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = sale.status );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "value", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_02387
train
T1
v3
Schema: employees (alias: emp)(code, date, amount, name) shipments(date, status, level, salary) Task: Find value from employees where salary exceeds the average value from shipments for the same code. SQL:
SELECT value FROM employees AS emp WHERE salary > ( SELECT AVG(value) FROM shipments AS shp WHERE shp.code = emp.code );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_02388
train
T1
v1
Schema: customers (alias: cust)(status, name, type, id) schedules(value, code, name, date) Task: Retrieve salary from customers whose status is found in schedules rows where id matches the outer record. SQL:
SELECT salary FROM customers AS cust WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.id = cust.id );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "salary", "filter_col": "status", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_02389
train
T1
v1
Schema: requests (alias: ordr)(salary, status, level, name) accounts(name, type, salary, amount) Task: Select value from requests where status exists in accounts for the same id. SQL:
SELECT value FROM requests AS ordr WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.id = ordr.id );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_02390
train
T2
v3
Schema: employees (alias: emp)(value, name, code, level) schedules(name, value, status, date) Task: Retrieve id from employees with amount above the SUM(amount) of schedules rows sharing the same level. SQL:
SELECT id FROM employees AS emp WHERE amount > ( SELECT SUM(amount) 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": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_02391
train
T1
v3
Schema: sales (alias: sale)(name, id, level, status) customers(type, code, amount, date) Task: Retrieve value from sales with salary above the SUM(amount) of customers rows sharing the same status. SQL:
SELECT value FROM sales AS sale WHERE salary > ( SELECT SUM(amount) FROM customers AS cust WHERE cust.status = sale.status );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_02392
train
T1
v3
Schema: orders (alias: ord)(salary, code, value, id) employees(value, amount, type, salary) Task: Retrieve value from orders with value above the MIN(salary) of employees rows sharing the same status. SQL:
SELECT value FROM orders AS ord WHERE value > ( SELECT MIN(salary) FROM employees AS emp WHERE emp.status = ord.status );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_02393
train
T1
v2
Schema: items (alias: lne)(status, date, id, value) budgets(type, id, code, date) Task: Find amount from items where a matching record exists in budgets with the same id. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.id = lne.id );
{ "outer_table": "items", "inner_table": "budgets", "outer_alias": "lne", "inner_alias": "budg", "proj_col": "amount", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_02394
train
T2
v1
Schema: staff (alias: empl)(code, status, type, salary) categories(type, amount, salary, name) Task: Select name from staff where status exists in categories for the same code. SQL:
SELECT name FROM staff AS empl WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.code = empl.code );
{ "outer_table": "staff", "inner_table": "categories", "outer_alias": "empl", "inner_alias": "catg", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_02395
train
T2
v2
Schema: orders (alias: ord)(status, type, date, level) accounts(amount, status, name, value) Task: Retrieve name from orders that have at least one corresponding entry in accounts sharing the same id. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = ord.id );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "name", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_02396
train
T1
v3
Schema: items (alias: lne)(code, amount, salary, name) shipments(amount, name, type, value) Task: Find name from items where amount exceeds the average salary from shipments for the same code. SQL:
SELECT name FROM items AS lne WHERE amount > ( SELECT AVG(salary) FROM shipments AS shp WHERE shp.code = lne.code );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_02397
train
T2
v2
Schema: departments (alias: dept)(level, name, code, type) items(id, level, amount, date) Task: Retrieve salary from departments that have at least one corresponding entry in items sharing the same status. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = dept.status );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "salary", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_02398
train
T1
v3
Schema: customers (alias: cust)(code, type, amount, date) accounts(level, date, amount, type) Task: Find code from customers where amount exceeds the average salary from accounts for the same id. SQL:
SELECT code FROM customers AS cust WHERE amount > ( SELECT COUNT(salary) FROM accounts AS acct WHERE acct.id = cust.id );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_02399
train
T1