variant
stringclasses
3 values
prompt
stringlengths
163
237
sql
stringlengths
103
143
metadata
unknown
id
stringlengths
21
21
split
stringclasses
1 value
token_group
stringclasses
2 values
v2
Schema: departments (alias: dept)(value, id, name, salary) orders(date, id, value, type) Task: Find amount from departments where a matching record exists in orders with the same id. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = dept.id );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "amount", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_05400
train
T1
v3
Schema: employees (alias: emp)(id, amount, level, code) orders(value, id, level, amount) Task: Find amount from employees where value exceeds the average value from orders for the same code. SQL:
SELECT amount FROM employees AS emp WHERE value > ( SELECT MAX(value) FROM orders AS ord WHERE ord.code = emp.code );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_05401
train
T1
v1
Schema: budgets (alias: budg)(date, status, name, code) employees(status, type, code, amount) Task: Retrieve id from budgets whose status is found in employees rows where code matches the outer record. SQL:
SELECT id FROM budgets AS budg WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.code = budg.code );
{ "outer_table": "budgets", "inner_table": "employees", "outer_alias": "budg", "inner_alias": "emp", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_05402
train
T2
v2
Schema: staff (alias: empl)(level, amount, name, salary) orders(type, value, name, level) Task: Find code from staff where a matching record exists in orders with the same status. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = empl.status );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "code", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_05403
train
T2
v2
Schema: sales (alias: sale)(salary, amount, id, code) services(code, status, salary, amount) Task: Retrieve amount from sales that have at least one corresponding entry in services sharing the same id. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = sale.id );
{ "outer_table": "sales", "inner_table": "services", "outer_alias": "sale", "inner_alias": "srvc", "proj_col": "amount", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_05404
train
T1
v1
Schema: staff (alias: empl)(type, id, level, status) transactions(salary, status, date, type) Task: Select name from staff where level exists in transactions for the same type. SQL:
SELECT name FROM staff AS empl WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.type = empl.type );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_05405
train
T2
v3
Schema: invoices (alias: inv)(status, salary, id, type) customers(name, date, value, id) Task: Find code from invoices where salary exceeds the average value from customers for the same type. SQL:
SELECT code FROM invoices AS inv WHERE salary > ( SELECT MAX(value) FROM customers AS cust WHERE cust.type = inv.type );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_05406
train
T1
v1
Schema: sales (alias: sale)(type, status, name, level) customers(id, type, code, date) Task: Retrieve code from sales whose code is found in customers rows where code matches the outer record. SQL:
SELECT code FROM sales AS sale WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.code = sale.code );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_05407
train
T1
v3
Schema: invoices (alias: inv)(level, date, salary, amount) budgets(value, id, salary, name) Task: Retrieve amount from invoices with amount above the MAX(amount) of budgets rows sharing the same code. SQL:
SELECT amount FROM invoices AS inv WHERE amount > ( SELECT MAX(amount) FROM budgets AS budg WHERE budg.code = inv.code );
{ "outer_table": "invoices", "inner_table": "budgets", "outer_alias": "inv", "inner_alias": "budg", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_05408
train
T1
v1
Schema: services (alias: srvc)(id, code, amount, salary) requests(date, status, code, id) Task: Find code from services where type appears in requests entries with matching status. SQL:
SELECT code FROM services AS srvc WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.status = srvc.status );
{ "outer_table": "services", "inner_table": "requests", "outer_alias": "srvc", "inner_alias": "ordr", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_05409
train
T2
v3
Schema: budgets (alias: budg)(id, value, status, date) services(value, name, level, amount) Task: Retrieve code from budgets with salary above the MAX(salary) of services rows sharing the same status. SQL:
SELECT code FROM budgets AS budg WHERE salary > ( SELECT MAX(salary) FROM services AS srvc WHERE srvc.status = budg.status );
{ "outer_table": "budgets", "inner_table": "services", "outer_alias": "budg", "inner_alias": "srvc", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_05410
train
T2
v3
Schema: shipments (alias: shp)(status, code, value, amount) accounts(id, salary, value, level) Task: Retrieve amount from shipments with amount above the MIN(value) of accounts rows sharing the same type. SQL:
SELECT amount FROM shipments AS shp WHERE amount > ( SELECT MIN(value) FROM accounts AS acct WHERE acct.type = shp.type );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_05411
train
T2
v1
Schema: warehouses (alias: whs)(value, salary, amount, level) transactions(salary, id, level, status) Task: Find name from warehouses where id appears in transactions entries with matching type. SQL:
SELECT name FROM warehouses AS whs WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "transactions", "outer_alias": "whs", "inner_alias": "txn", "proj_col": "name", "filter_col": "id", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_05412
train
T2
v2
Schema: departments (alias: dept)(salary, value, type, level) shipments(level, code, amount, id) Task: Find id from departments where a matching record exists in shipments with the same level. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = dept.level );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "id", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_05413
train
T1
v2
Schema: shipments (alias: shp)(level, value, salary, amount) services(value, level, salary, amount) Task: Retrieve salary from shipments that have at least one corresponding entry in services sharing the same type. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.type = shp.type );
{ "outer_table": "shipments", "inner_table": "services", "outer_alias": "shp", "inner_alias": "srvc", "proj_col": "salary", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_05414
train
T2
v3
Schema: invoices (alias: inv)(amount, name, salary, date) items(code, salary, date, value) Task: Find value from invoices where amount exceeds the average amount from items for the same status. SQL:
SELECT value FROM invoices AS inv WHERE amount > ( SELECT MIN(amount) FROM items AS lne WHERE lne.status = inv.status );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_05415
train
T1
v1
Schema: requests (alias: ordr)(salary, date, status, id) regions(name, amount, salary, code) Task: Select name from requests where level exists in regions for the same code. SQL:
SELECT name FROM requests AS ordr WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.code = ordr.code );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_05416
train
T2
v2
Schema: shipments (alias: shp)(name, amount, value, salary) invoices(code, name, type, id) Task: Retrieve value from shipments that have at least one corresponding entry in invoices sharing the same status. SQL:
SELECT value FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = shp.status );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "value", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_05417
train
T2
v1
Schema: budgets (alias: budg)(level, type, salary, status) invoices(status, type, name, value) Task: Find id from budgets where id appears in invoices entries with matching id. SQL:
SELECT id FROM budgets AS budg WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.id = budg.id );
{ "outer_table": "budgets", "inner_table": "invoices", "outer_alias": "budg", "inner_alias": "inv", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_05418
train
T2
v2
Schema: requests (alias: ordr)(name, date, amount, level) transactions(status, amount, salary, type) Task: Find name from requests where a matching record exists in transactions with the same code. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = ordr.code );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "name", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_05419
train
T2
v1
Schema: warehouses (alias: whs)(date, level, amount, salary) staff(type, level, date, id) Task: Find amount from warehouses where code appears in staff entries with matching code. SQL:
SELECT amount FROM warehouses AS whs WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "staff", "outer_alias": "whs", "inner_alias": "empl", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_05420
train
T2
v1
Schema: schedules (alias: schd)(value, salary, amount, id) sales(status, date, value, name) Task: Find name from schedules where type appears in sales entries with matching level. SQL:
SELECT name FROM schedules AS schd WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.level = schd.level );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_05421
train
T2
v2
Schema: items (alias: lne)(amount, id, status, name) accounts(status, amount, salary, type) Task: Retrieve code from items that have at least one corresponding entry in accounts sharing the same id. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = lne.id );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "code", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_05422
train
T2
v1
Schema: orders (alias: ord)(amount, name, value, id) customers(type, date, value, level) Task: Retrieve code from orders whose type is found in customers rows where code matches the outer record. SQL:
SELECT code FROM orders AS ord WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.code = ord.code );
{ "outer_table": "orders", "inner_table": "customers", "outer_alias": "ord", "inner_alias": "cust", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_05423
train
T1
v3
Schema: products (alias: prod)(salary, name, value, amount) invoices(type, value, code, id) Task: Find salary from products where salary exceeds the average value from invoices for the same code. SQL:
SELECT salary FROM products AS prod WHERE salary > ( SELECT AVG(value) FROM invoices AS inv WHERE inv.code = prod.code );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_05424
train
T1
v1
Schema: budgets (alias: budg)(value, salary, code, name) categories(amount, status, level, name) Task: Find amount from budgets where status appears in categories entries with matching level. SQL:
SELECT amount FROM budgets AS budg WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.level = budg.level );
{ "outer_table": "budgets", "inner_table": "categories", "outer_alias": "budg", "inner_alias": "catg", "proj_col": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_05425
train
T2
v3
Schema: services (alias: srvc)(type, date, salary, value) shipments(name, amount, value, status) Task: Retrieve salary from services with amount above the AVG(amount) of shipments rows sharing the same status. SQL:
SELECT salary FROM services AS srvc WHERE amount > ( SELECT AVG(amount) FROM shipments AS shp WHERE shp.status = srvc.status );
{ "outer_table": "services", "inner_table": "shipments", "outer_alias": "srvc", "inner_alias": "shp", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_05426
train
T2
v1
Schema: managers (alias: mgr)(salary, name, value, status) requests(level, type, salary, code) Task: Retrieve amount from managers whose id is found in requests rows where level matches the outer record. SQL:
SELECT amount FROM managers AS mgr WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.level = mgr.level );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_05427
train
T1
v3
Schema: products (alias: prod)(type, salary, level, name) customers(amount, name, id, status) Task: Find amount from products where salary exceeds the average salary from customers for the same code. SQL:
SELECT amount FROM products AS prod WHERE salary > ( SELECT COUNT(salary) FROM customers AS cust WHERE cust.code = prod.code );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_05428
train
T1
v1
Schema: managers (alias: mgr)(salary, value, date, amount) products(amount, date, type, level) Task: Select code from managers where level exists in products for the same type. SQL:
SELECT code FROM managers AS mgr WHERE level IN ( SELECT level FROM products AS prod WHERE prod.type = mgr.type );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_05429
train
T1
v2
Schema: accounts (alias: acct)(date, salary, value, code) shipments(salary, name, id, level) Task: Find id from accounts where a matching record exists in shipments with the same level. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = acct.level );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "id", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_05430
train
T1
v2
Schema: accounts (alias: acct)(level, status, name, type) staff(status, id, salary, value) Task: Find value from accounts where a matching record exists in staff with the same code. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = acct.code );
{ "outer_table": "accounts", "inner_table": "staff", "outer_alias": "acct", "inner_alias": "empl", "proj_col": "value", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_05431
train
T1
v1
Schema: schedules (alias: schd)(salary, status, amount, name) employees(amount, code, type, salary) Task: Retrieve salary from schedules whose type is found in employees rows where level matches the outer record. SQL:
SELECT salary FROM schedules AS schd WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.level = schd.level );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "salary", "filter_col": "type", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_05432
train
T2
v3
Schema: categories (alias: catg)(code, value, amount, level) staff(code, level, date, amount) Task: Find value from categories where salary exceeds the average salary from staff for the same status. SQL:
SELECT value FROM categories AS catg WHERE salary > ( SELECT COUNT(salary) FROM staff AS empl WHERE empl.status = catg.status );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_05433
train
T2
v1
Schema: staff (alias: empl)(level, date, type, amount) categories(amount, level, type, salary) Task: Retrieve name from staff whose status is found in categories rows where level matches the outer record. SQL:
SELECT name 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": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_05434
train
T2
v3
Schema: budgets (alias: budg)(name, date, id, salary) requests(value, level, type, id) Task: Retrieve salary from budgets with value above the SUM(amount) of requests rows sharing the same id. SQL:
SELECT salary FROM budgets AS budg WHERE value > ( SELECT SUM(amount) FROM requests AS ordr WHERE ordr.id = budg.id );
{ "outer_table": "budgets", "inner_table": "requests", "outer_alias": "budg", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_05435
train
T2
v2
Schema: sales (alias: sale)(code, type, name, amount) accounts(id, date, status, amount) Task: Find code from sales where a matching record exists in accounts with the same type. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = sale.type );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "code", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_05436
train
T1
v2
Schema: sales (alias: sale)(date, amount, id, level) transactions(value, date, amount, code) Task: Retrieve amount from sales that have at least one corresponding entry in transactions sharing the same type. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = sale.type );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "amount", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_05437
train
T1
v2
Schema: orders (alias: ord)(level, type, code, status) products(value, status, name, amount) Task: Find amount from orders where a matching record exists in products with the same id. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = ord.id );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "amount", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_05438
train
T1
v1
Schema: transactions (alias: txn)(amount, date, status, type) services(code, date, status, level) Task: Retrieve amount from transactions whose level is found in services rows where id matches the outer record. SQL:
SELECT amount FROM transactions AS txn WHERE level IN ( SELECT level FROM services AS srvc WHERE srvc.id = txn.id );
{ "outer_table": "transactions", "inner_table": "services", "outer_alias": "txn", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_05439
train
T1
v3
Schema: warehouses (alias: whs)(name, type, amount, date) employees(name, amount, level, status) Task: Find salary from warehouses where amount exceeds the average salary from employees for the same code. SQL:
SELECT salary FROM warehouses AS whs WHERE amount > ( SELECT MAX(salary) FROM employees AS emp WHERE emp.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "employees", "outer_alias": "whs", "inner_alias": "emp", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_05440
train
T2
v2
Schema: shipments (alias: shp)(value, name, amount, id) transactions(value, name, status, type) Task: Retrieve name from shipments that have at least one corresponding entry in transactions sharing the same code. SQL:
SELECT name 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": "name", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_05441
train
T2
v2
Schema: staff (alias: empl)(level, id, code, type) invoices(date, status, salary, type) Task: Find salary from staff where a matching record exists in invoices with the same level. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = empl.level );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "salary", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_05442
train
T2
v2
Schema: services (alias: srvc)(date, status, value, amount) employees(level, code, date, value) Task: Retrieve id from services that have at least one corresponding entry in employees sharing the same type. SQL:
SELECT id FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = srvc.type );
{ "outer_table": "services", "inner_table": "employees", "outer_alias": "srvc", "inner_alias": "emp", "proj_col": "id", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_05443
train
T2
v1
Schema: products (alias: prod)(salary, id, value, name) categories(status, date, type, level) Task: Select code from products where code exists in categories for the same id. SQL:
SELECT code FROM products AS prod WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.id = prod.id );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_05444
train
T1
v2
Schema: staff (alias: empl)(salary, id, level, value) invoices(type, date, amount, code) Task: Find salary from staff where a matching record exists in invoices with the same type. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = empl.type );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "salary", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_05445
train
T2
v2
Schema: requests (alias: ordr)(code, type, id, salary) sales(salary, id, level, name) Task: Retrieve amount from requests that have at least one corresponding entry in sales sharing the same code. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = ordr.code );
{ "outer_table": "requests", "inner_table": "sales", "outer_alias": "ordr", "inner_alias": "sale", "proj_col": "amount", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_05446
train
T2
v3
Schema: items (alias: lne)(amount, date, value, status) orders(type, name, salary, id) Task: Retrieve amount from items with amount above the COUNT(salary) of orders rows sharing the same status. SQL:
SELECT amount FROM items AS lne WHERE amount > ( SELECT COUNT(salary) FROM orders AS ord WHERE ord.status = lne.status );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_05447
train
T2
v3
Schema: managers (alias: mgr)(amount, salary, level, value) categories(code, name, type, salary) Task: Retrieve id from managers with value above the COUNT(value) of categories rows sharing the same status. SQL:
SELECT id FROM managers AS mgr WHERE value > ( SELECT COUNT(value) FROM categories AS catg WHERE catg.status = mgr.status );
{ "outer_table": "managers", "inner_table": "categories", "outer_alias": "mgr", "inner_alias": "catg", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_05448
train
T1
v2
Schema: budgets (alias: budg)(code, id, amount, value) transactions(level, date, code, type) Task: Find code from budgets where a matching record exists in transactions with the same level. SQL:
SELECT code FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = budg.level );
{ "outer_table": "budgets", "inner_table": "transactions", "outer_alias": "budg", "inner_alias": "txn", "proj_col": "code", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_05449
train
T2
v3
Schema: budgets (alias: budg)(code, salary, date, id) invoices(id, name, level, salary) Task: Retrieve value from budgets with value above the MAX(salary) of invoices rows sharing the same type. SQL:
SELECT value FROM budgets AS budg WHERE value > ( SELECT MAX(salary) FROM invoices AS inv WHERE inv.type = budg.type );
{ "outer_table": "budgets", "inner_table": "invoices", "outer_alias": "budg", "inner_alias": "inv", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_05450
train
T2
v3
Schema: items (alias: lne)(name, code, date, amount) warehouses(level, id, date, salary) Task: Retrieve name from items with amount above the MAX(salary) of warehouses rows sharing the same status. SQL:
SELECT name FROM items AS lne WHERE amount > ( SELECT MAX(salary) FROM warehouses AS whs WHERE whs.status = lne.status );
{ "outer_table": "items", "inner_table": "warehouses", "outer_alias": "lne", "inner_alias": "whs", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_05451
train
T2
v3
Schema: sales (alias: sale)(name, amount, code, type) items(id, date, salary, level) Task: Retrieve id from sales with amount above the MAX(amount) of items rows sharing the same level. SQL:
SELECT id FROM sales AS sale WHERE amount > ( SELECT MAX(amount) FROM items AS lne WHERE lne.level = sale.level );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_05452
train
T1
v3
Schema: items (alias: lne)(id, name, code, type) transactions(name, date, value, type) Task: Find amount from items where amount exceeds the average value from transactions for the same type. SQL:
SELECT amount FROM items AS lne WHERE amount > ( SELECT COUNT(value) FROM transactions AS txn WHERE txn.type = lne.type );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_05453
train
T2
v3
Schema: orders (alias: ord)(status, type, value, name) managers(value, amount, code, level) Task: Retrieve name from orders with amount above the COUNT(value) of managers rows sharing the same id. SQL:
SELECT name FROM orders AS ord WHERE amount > ( SELECT COUNT(value) FROM managers AS mgr WHERE mgr.id = ord.id );
{ "outer_table": "orders", "inner_table": "managers", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_05454
train
T1
v3
Schema: orders (alias: ord)(value, type, code, salary) items(level, status, amount, type) Task: Find code from orders where amount exceeds the average amount from items for the same status. SQL:
SELECT code FROM orders AS ord WHERE amount > ( SELECT MAX(amount) FROM items AS lne WHERE lne.status = ord.status );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_05455
train
T1
v1
Schema: budgets (alias: budg)(name, status, code, date) managers(salary, date, level, id) Task: Select id from budgets where status exists in managers for the same code. SQL:
SELECT id FROM budgets AS budg WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.code = budg.code );
{ "outer_table": "budgets", "inner_table": "managers", "outer_alias": "budg", "inner_alias": "mgr", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_05456
train
T2
v1
Schema: transactions (alias: txn)(date, value, id, level) departments(type, date, id, code) Task: Find value from transactions where id appears in departments entries with matching status. SQL:
SELECT value FROM transactions AS txn WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.status = txn.status );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_05457
train
T1
v2
Schema: products (alias: prod)(name, level, value, date) budgets(code, salary, value, date) Task: Retrieve name from products that have at least one corresponding entry in budgets sharing the same id. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.id = prod.id );
{ "outer_table": "products", "inner_table": "budgets", "outer_alias": "prod", "inner_alias": "budg", "proj_col": "name", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_05458
train
T1
v3
Schema: categories (alias: catg)(code, date, value, salary) warehouses(code, status, type, id) Task: Retrieve salary from categories with value above the MIN(value) of warehouses rows sharing the same status. SQL:
SELECT salary FROM categories AS catg WHERE value > ( SELECT MIN(value) FROM warehouses AS whs WHERE whs.status = catg.status );
{ "outer_table": "categories", "inner_table": "warehouses", "outer_alias": "catg", "inner_alias": "whs", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_05459
train
T2
v2
Schema: orders (alias: ord)(code, date, id, value) products(level, status, date, amount) Task: Retrieve name from orders that have at least one corresponding entry in products sharing the same type. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = ord.type );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "name", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_05460
train
T1
v2
Schema: warehouses (alias: whs)(type, status, id, amount) regions(type, code, value, status) Task: Retrieve id from warehouses that have at least one corresponding entry in regions sharing the same status. SQL:
SELECT id FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "regions", "outer_alias": "whs", "inner_alias": "rgn", "proj_col": "id", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_05461
train
T2
v2
Schema: categories (alias: catg)(id, value, date, code) products(date, type, code, value) Task: Find id from categories where a matching record exists in products with the same id. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = catg.id );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "id", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_05462
train
T2
v3
Schema: categories (alias: catg)(amount, salary, status, date) employees(id, amount, salary, code) Task: Retrieve value from categories with salary above the COUNT(value) of employees rows sharing the same id. SQL:
SELECT value FROM categories AS catg WHERE salary > ( SELECT COUNT(value) FROM employees AS emp WHERE emp.id = catg.id );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_05463
train
T2
v2
Schema: employees (alias: emp)(name, date, value, amount) invoices(date, amount, name, value) Task: Retrieve code from employees that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = emp.id );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "code", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_05464
train
T1
v1
Schema: employees (alias: emp)(value, code, date, status) requests(name, date, id, amount) Task: Select code from employees where level exists in requests for the same code. SQL:
SELECT code FROM employees AS emp WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.code = emp.code );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_05465
train
T1
v2
Schema: requests (alias: ordr)(salary, type, date, id) managers(value, id, status, name) Task: Find code from requests where a matching record exists in managers with the same code. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = ordr.code );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "code", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_05466
train
T2
v2
Schema: staff (alias: empl)(code, level, name, date) budgets(value, code, name, type) Task: Find id from staff where a matching record exists in budgets with the same code. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.code = empl.code );
{ "outer_table": "staff", "inner_table": "budgets", "outer_alias": "empl", "inner_alias": "budg", "proj_col": "id", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_05467
train
T2
v3
Schema: customers (alias: cust)(name, amount, value, status) schedules(value, date, code, amount) Task: Find amount from customers where value exceeds the average salary from schedules for the same status. SQL:
SELECT amount FROM customers AS cust WHERE value > ( SELECT SUM(salary) FROM schedules AS schd WHERE schd.status = cust.status );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_05468
train
T1
v1
Schema: requests (alias: ordr)(code, level, value, status) invoices(code, salary, type, value) Task: Find code from requests where id appears in invoices entries with matching id. SQL:
SELECT code FROM requests AS ordr WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.id = ordr.id );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "code", "filter_col": "id", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_05469
train
T2
v2
Schema: budgets (alias: budg)(type, amount, value, level) regions(value, salary, level, status) Task: Retrieve code from budgets that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT code FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = budg.level );
{ "outer_table": "budgets", "inner_table": "regions", "outer_alias": "budg", "inner_alias": "rgn", "proj_col": "code", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_05470
train
T2
v2
Schema: regions (alias: rgn)(id, code, amount, status) invoices(date, type, code, id) Task: Find amount from regions where a matching record exists in invoices with the same type. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = rgn.type );
{ "outer_table": "regions", "inner_table": "invoices", "outer_alias": "rgn", "inner_alias": "inv", "proj_col": "amount", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_05471
train
T2
v1
Schema: departments (alias: dept)(value, code, level, type) shipments(status, type, id, salary) Task: Find amount from departments where code appears in shipments entries with matching level. SQL:
SELECT amount FROM departments AS dept WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.level = dept.level );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_05472
train
T1
v1
Schema: schedules (alias: schd)(value, name, salary, id) employees(amount, code, value, type) Task: Select code from schedules where id exists in employees for the same type. SQL:
SELECT code FROM schedules AS schd WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.type = schd.type );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "code", "filter_col": "id", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_05473
train
T2
v2
Schema: customers (alias: cust)(status, code, type, name) regions(salary, value, id, code) Task: Find amount from customers where a matching record exists in regions with the same level. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = cust.level );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "amount", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_05474
train
T1
v2
Schema: services (alias: srvc)(type, salary, status, date) accounts(level, status, date, name) Task: Find id from services where a matching record exists in accounts with the same id. SQL:
SELECT id FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = srvc.id );
{ "outer_table": "services", "inner_table": "accounts", "outer_alias": "srvc", "inner_alias": "acct", "proj_col": "id", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_05475
train
T2
v2
Schema: budgets (alias: budg)(date, level, salary, id) schedules(salary, id, date, code) Task: Find name from budgets where a matching record exists in schedules with the same status. SQL:
SELECT name FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = budg.status );
{ "outer_table": "budgets", "inner_table": "schedules", "outer_alias": "budg", "inner_alias": "schd", "proj_col": "name", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_05476
train
T2
v3
Schema: customers (alias: cust)(salary, status, amount, name) items(name, status, date, code) Task: Find name from customers where value exceeds the average salary from items for the same id. SQL:
SELECT name FROM customers AS cust WHERE value > ( SELECT COUNT(salary) FROM items AS lne WHERE lne.id = cust.id );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_05477
train
T1
v1
Schema: products (alias: prod)(code, name, amount, date) categories(value, amount, type, date) Task: Select salary from products where type exists in categories for the same status. SQL:
SELECT salary FROM products AS prod WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.status = prod.status );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "salary", "filter_col": "type", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_05478
train
T1
v3
Schema: budgets (alias: budg)(date, type, status, level) customers(id, code, date, level) Task: Find value from budgets where salary exceeds the average value from customers for the same level. SQL:
SELECT value FROM budgets AS budg WHERE salary > ( SELECT COUNT(value) FROM customers AS cust WHERE cust.level = budg.level );
{ "outer_table": "budgets", "inner_table": "customers", "outer_alias": "budg", "inner_alias": "cust", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_05479
train
T2
v2
Schema: items (alias: lne)(level, value, code, id) orders(id, status, value, date) Task: Retrieve salary from items that have at least one corresponding entry in orders sharing the same id. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = lne.id );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "salary", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_05480
train
T2
v3
Schema: warehouses (alias: whs)(id, date, name, status) orders(level, type, status, code) Task: Find amount from warehouses where value exceeds the average salary from orders for the same status. SQL:
SELECT amount FROM warehouses AS whs WHERE value > ( SELECT SUM(salary) FROM orders AS ord WHERE ord.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "orders", "outer_alias": "whs", "inner_alias": "ord", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_05481
train
T2
v3
Schema: staff (alias: empl)(name, level, status, value) services(code, level, amount, status) Task: Retrieve code from staff with amount above the AVG(salary) of services rows sharing the same code. SQL:
SELECT code FROM staff AS empl WHERE amount > ( SELECT AVG(salary) FROM services AS srvc WHERE srvc.code = empl.code );
{ "outer_table": "staff", "inner_table": "services", "outer_alias": "empl", "inner_alias": "srvc", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_05482
train
T2
v3
Schema: budgets (alias: budg)(name, salary, code, date) transactions(salary, name, type, date) Task: Find value from budgets where value exceeds the average value from transactions for the same status. SQL:
SELECT value FROM budgets AS budg WHERE value > ( SELECT COUNT(value) FROM transactions AS txn WHERE txn.status = budg.status );
{ "outer_table": "budgets", "inner_table": "transactions", "outer_alias": "budg", "inner_alias": "txn", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_05483
train
T2
v2
Schema: invoices (alias: inv)(name, status, level, date) shipments(name, id, type, salary) Task: Find salary from invoices where a matching record exists in shipments with the same status. SQL:
SELECT salary FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = inv.status );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "salary", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_05484
train
T1
v2
Schema: categories (alias: catg)(value, type, name, date) orders(amount, salary, id, status) Task: Retrieve salary from categories that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = catg.level );
{ "outer_table": "categories", "inner_table": "orders", "outer_alias": "catg", "inner_alias": "ord", "proj_col": "salary", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_05485
train
T2
v1
Schema: sales (alias: sale)(code, amount, type, status) transactions(date, status, salary, name) Task: Find value from sales where status appears in transactions entries with matching type. SQL:
SELECT value FROM sales AS sale WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.type = sale.type );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "value", "filter_col": "status", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_05486
train
T1
v1
Schema: sales (alias: sale)(status, name, code, amount) accounts(name, status, level, salary) Task: Find id from sales where id appears in accounts entries with matching status. SQL:
SELECT id FROM sales AS sale WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.status = sale.status );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "id", "filter_col": "id", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_05487
train
T1
v3
Schema: warehouses (alias: whs)(amount, name, level, type) schedules(level, salary, date, value) Task: Retrieve salary from warehouses with value above the MIN(value) of schedules rows sharing the same status. SQL:
SELECT salary FROM warehouses AS whs WHERE value > ( SELECT MIN(value) FROM schedules AS schd WHERE schd.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "schedules", "outer_alias": "whs", "inner_alias": "schd", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_05488
train
T2
v1
Schema: services (alias: srvc)(type, salary, level, date) requests(salary, status, id, code) Task: Retrieve code from services whose status is found in requests rows where level matches the outer record. SQL:
SELECT code FROM services AS srvc WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.level = srvc.level );
{ "outer_table": "services", "inner_table": "requests", "outer_alias": "srvc", "inner_alias": "ordr", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_05489
train
T2
v2
Schema: sales (alias: sale)(name, type, date, salary) departments(type, salary, date, status) Task: Find salary from sales where a matching record exists in departments with the same code. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = sale.code );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "salary", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_05490
train
T1
v3
Schema: employees (alias: emp)(level, type, value, date) accounts(code, date, status, value) Task: Retrieve code from employees with amount above the SUM(value) of accounts rows sharing the same level. SQL:
SELECT code FROM employees AS emp WHERE amount > ( SELECT SUM(value) FROM accounts AS acct WHERE acct.level = emp.level );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_05491
train
T1
v1
Schema: items (alias: lne)(id, salary, type, amount) categories(amount, status, salary, date) Task: Find amount from items where code appears in categories entries with matching type. SQL:
SELECT amount FROM items AS lne WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.type = lne.type );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_05492
train
T2
v3
Schema: schedules (alias: schd)(level, type, id, status) accounts(level, name, salary, date) Task: Retrieve id from schedules with amount above the COUNT(value) of accounts rows sharing the same status. SQL:
SELECT id FROM schedules AS schd WHERE amount > ( SELECT COUNT(value) FROM accounts AS acct WHERE acct.status = schd.status );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_05493
train
T2
v2
Schema: customers (alias: cust)(code, salary, type, level) regions(salary, type, code, name) Task: Find code from customers where a matching record exists in regions with the same type. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = cust.type );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "code", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_05494
train
T1
v1
Schema: regions (alias: rgn)(date, status, id, type) accounts(id, type, status, date) Task: Select salary from regions where level exists in accounts for the same status. SQL:
SELECT salary FROM regions AS rgn WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.status = rgn.status );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "rgn", "inner_alias": "acct", "proj_col": "salary", "filter_col": "level", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_05495
train
T2
v2
Schema: budgets (alias: budg)(salary, level, id, name) schedules(value, salary, type, date) Task: Find name from budgets where a matching record exists in schedules with the same type. SQL:
SELECT name FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = budg.type );
{ "outer_table": "budgets", "inner_table": "schedules", "outer_alias": "budg", "inner_alias": "schd", "proj_col": "name", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_05496
train
T2
v2
Schema: budgets (alias: budg)(date, level, code, name) orders(salary, amount, code, type) Task: Retrieve id from budgets that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT id FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = budg.code );
{ "outer_table": "budgets", "inner_table": "orders", "outer_alias": "budg", "inner_alias": "ord", "proj_col": "id", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_05497
train
T2
v2
Schema: categories (alias: catg)(id, level, salary, code) orders(type, level, date, status) Task: Find code from categories where a matching record exists in orders with the same code. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = catg.code );
{ "outer_table": "categories", "inner_table": "orders", "outer_alias": "catg", "inner_alias": "ord", "proj_col": "code", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_05498
train
T2
v3
Schema: managers (alias: mgr)(type, status, value, name) regions(type, status, salary, value) Task: Find value from managers where salary exceeds the average amount from regions for the same status. SQL:
SELECT value FROM managers AS mgr WHERE salary > ( SELECT MIN(amount) FROM regions AS rgn WHERE rgn.status = mgr.status );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_05499
train
T1