variant
stringclasses
3 values
prompt
stringlengths
163
237
sql
stringlengths
103
143
metadata
unknown
id
stringlengths
21
21
split
stringclasses
1 value
token_group
stringclasses
2 values
v2
Schema: managers (alias: mgr)(id, status, name, type) invoices(name, type, status, amount) Task: Retrieve name from managers that have at least one corresponding entry in invoices sharing the same level. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = mgr.level );
{ "outer_table": "managers", "inner_table": "invoices", "outer_alias": "mgr", "inner_alias": "inv", "proj_col": "name", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_10500
train
T1
v1
Schema: sales (alias: sale)(level, value, code, amount) orders(id, date, type, salary) Task: Retrieve code from sales whose level is found in orders rows where level matches the outer record. SQL:
SELECT code FROM sales AS sale WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.level = sale.level );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "code", "filter_col": "level", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_10501
train
T1
v2
Schema: requests (alias: ordr)(date, name, code, type) transactions(level, salary, type, date) Task: Find salary from requests where a matching record exists in transactions with the same type. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = ordr.type );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "salary", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_10502
train
T2
v2
Schema: requests (alias: ordr)(date, amount, type, code) schedules(salary, code, amount, type) Task: Find value from requests where a matching record exists in schedules with the same level. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = ordr.level );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "value", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_10503
train
T2
v1
Schema: categories (alias: catg)(id, salary, code, name) transactions(amount, date, salary, name) Task: Select name from categories where id exists in transactions for the same code. SQL:
SELECT name FROM categories AS catg WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.code = catg.code );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_10504
train
T2
v2
Schema: invoices (alias: inv)(value, level, id, code) schedules(value, date, type, id) Task: Retrieve id from invoices that have at least one corresponding entry in schedules sharing the same code. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = inv.code );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "id", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_10505
train
T1
v1
Schema: requests (alias: ordr)(value, amount, salary, code) accounts(name, value, level, salary) Task: Select id from requests where level exists in accounts for the same status. SQL:
SELECT id FROM requests AS ordr WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.status = ordr.status );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_10506
train
T2
v2
Schema: managers (alias: mgr)(value, code, level, status) customers(id, salary, code, type) Task: Retrieve code from managers that have at least one corresponding entry in customers sharing the same type. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = mgr.type );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "code", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_10507
train
T1
v1
Schema: shipments (alias: shp)(id, status, salary, level) warehouses(type, code, status, date) Task: Find name from shipments where level appears in warehouses entries with matching code. SQL:
SELECT name FROM shipments AS shp WHERE level IN ( SELECT level FROM warehouses AS whs WHERE whs.code = shp.code );
{ "outer_table": "shipments", "inner_table": "warehouses", "outer_alias": "shp", "inner_alias": "whs", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_10508
train
T2
v2
Schema: transactions (alias: txn)(level, status, name, value) requests(code, id, level, salary) Task: Find name from transactions where a matching record exists in requests with the same code. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = txn.code );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "name", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_10509
train
T1
v3
Schema: warehouses (alias: whs)(code, status, name, date) orders(salary, status, type, level) Task: Find value from warehouses where amount exceeds the average value from orders for the same id. SQL:
SELECT value FROM warehouses AS whs WHERE amount > ( SELECT MIN(value) FROM orders AS ord WHERE ord.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "orders", "outer_alias": "whs", "inner_alias": "ord", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_10510
train
T2
v1
Schema: schedules (alias: schd)(name, date, level, type) items(amount, date, status, level) Task: Retrieve code from schedules whose level is found in items rows where type matches the outer record. SQL:
SELECT code FROM schedules AS schd WHERE level IN ( SELECT level FROM items AS lne WHERE lne.type = schd.type );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_10511
train
T2
v1
Schema: transactions (alias: txn)(type, code, amount, value) sales(salary, amount, status, level) Task: Select code from transactions where code exists in sales for the same id. SQL:
SELECT code FROM transactions AS txn WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.id = txn.id );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_10512
train
T1
v1
Schema: schedules (alias: schd)(id, date, type, amount) managers(amount, name, salary, value) Task: Retrieve salary from schedules whose status is found in managers rows where code matches the outer record. SQL:
SELECT salary FROM schedules AS schd WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.code = schd.code );
{ "outer_table": "schedules", "inner_table": "managers", "outer_alias": "schd", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_10513
train
T2
v3
Schema: invoices (alias: inv)(date, code, name, value) regions(level, amount, code, salary) Task: Find amount from invoices where salary exceeds the average value from regions for the same code. SQL:
SELECT amount FROM invoices AS inv WHERE salary > ( SELECT COUNT(value) FROM regions AS rgn WHERE rgn.code = inv.code );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_10514
train
T1
v3
Schema: regions (alias: rgn)(id, code, name, date) budgets(id, code, value, amount) Task: Retrieve id from regions with salary above the SUM(value) of budgets rows sharing the same code. SQL:
SELECT id FROM regions AS rgn WHERE salary > ( SELECT SUM(value) FROM budgets AS budg WHERE budg.code = rgn.code );
{ "outer_table": "regions", "inner_table": "budgets", "outer_alias": "rgn", "inner_alias": "budg", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_10515
train
T2
v1
Schema: orders (alias: ord)(amount, id, value, status) services(name, id, level, value) Task: Retrieve amount from orders whose status is found in services rows where type matches the outer record. SQL:
SELECT amount FROM orders AS ord WHERE status IN ( SELECT status FROM services AS srvc WHERE srvc.type = ord.type );
{ "outer_table": "orders", "inner_table": "services", "outer_alias": "ord", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "status", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_10516
train
T1
v1
Schema: shipments (alias: shp)(salary, code, type, amount) customers(date, code, name, status) Task: Find id from shipments where status appears in customers entries with matching status. SQL:
SELECT id FROM shipments AS shp WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.status = shp.status );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_10517
train
T2
v3
Schema: customers (alias: cust)(id, code, name, level) budgets(type, level, salary, name) Task: Find amount from customers where value exceeds the average value from budgets for the same level. SQL:
SELECT amount FROM customers AS cust WHERE value > ( SELECT COUNT(value) FROM budgets AS budg WHERE budg.level = cust.level );
{ "outer_table": "customers", "inner_table": "budgets", "outer_alias": "cust", "inner_alias": "budg", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_10518
train
T1
v2
Schema: budgets (alias: budg)(amount, level, status, code) products(code, salary, value, name) Task: Find value from budgets where a matching record exists in products with the same code. SQL:
SELECT value FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = budg.code );
{ "outer_table": "budgets", "inner_table": "products", "outer_alias": "budg", "inner_alias": "prod", "proj_col": "value", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_10519
train
T2
v2
Schema: warehouses (alias: whs)(amount, level, name, type) staff(type, value, level, id) Task: Retrieve salary from warehouses that have at least one corresponding entry in staff sharing the same id. SQL:
SELECT salary FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "staff", "outer_alias": "whs", "inner_alias": "empl", "proj_col": "salary", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_10520
train
T2
v2
Schema: accounts (alias: acct)(status, code, id, amount) sales(value, status, id, type) Task: Retrieve code from accounts that have at least one corresponding entry in sales sharing the same code. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = acct.code );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "code", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_10521
train
T1
v2
Schema: transactions (alias: txn)(value, code, salary, amount) shipments(date, type, salary, level) Task: Find amount from transactions where a matching record exists in shipments with the same status. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = txn.status );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "amount", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_10522
train
T1
v2
Schema: warehouses (alias: whs)(id, name, status, code) employees(value, status, type, id) Task: Find value from warehouses where a matching record exists in employees with the same code. SQL:
SELECT value FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "employees", "outer_alias": "whs", "inner_alias": "emp", "proj_col": "value", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_10523
train
T2
v3
Schema: shipments (alias: shp)(code, amount, salary, level) warehouses(amount, name, salary, code) Task: Find amount from shipments where value exceeds the average value from warehouses for the same level. SQL:
SELECT amount FROM shipments AS shp WHERE value > ( SELECT MIN(value) FROM warehouses AS whs WHERE whs.level = shp.level );
{ "outer_table": "shipments", "inner_table": "warehouses", "outer_alias": "shp", "inner_alias": "whs", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_10524
train
T2
v2
Schema: regions (alias: rgn)(date, value, type, level) departments(code, date, value, amount) Task: Retrieve amount from regions that have at least one corresponding entry in departments sharing the same code. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = rgn.code );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "amount", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_10525
train
T2
v1
Schema: sales (alias: sale)(amount, type, id, status) departments(value, level, name, date) Task: Select salary from sales where level exists in departments for the same type. SQL:
SELECT salary FROM sales AS sale WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.type = sale.type );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "salary", "filter_col": "level", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_10526
train
T1
v1
Schema: warehouses (alias: whs)(status, value, name, level) departments(date, name, value, salary) Task: Find name from warehouses where type appears in departments entries with matching type. SQL:
SELECT name FROM warehouses AS whs WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "departments", "outer_alias": "whs", "inner_alias": "dept", "proj_col": "name", "filter_col": "type", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_10527
train
T2
v1
Schema: customers (alias: cust)(amount, value, id, level) orders(status, type, code, date) Task: Find id from customers where type appears in orders entries with matching type. SQL:
SELECT id FROM customers AS cust WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.type = cust.type );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "id", "filter_col": "type", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_10528
train
T1
v1
Schema: regions (alias: rgn)(amount, value, code, status) services(name, id, date, type) Task: Retrieve name from regions whose status is found in services rows where level matches the outer record. SQL:
SELECT name FROM regions AS rgn WHERE status IN ( SELECT status FROM services AS srvc WHERE srvc.level = rgn.level );
{ "outer_table": "regions", "inner_table": "services", "outer_alias": "rgn", "inner_alias": "srvc", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_10529
train
T2
v3
Schema: warehouses (alias: whs)(value, id, level, code) budgets(code, id, type, salary) Task: Retrieve salary from warehouses with salary above the COUNT(salary) of budgets rows sharing the same status. SQL:
SELECT salary FROM warehouses AS whs WHERE salary > ( SELECT COUNT(salary) FROM budgets AS budg WHERE budg.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "budgets", "outer_alias": "whs", "inner_alias": "budg", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_10530
train
T2
v3
Schema: products (alias: prod)(name, level, id, date) shipments(name, status, date, type) Task: Find name from products where value exceeds the average value from shipments for the same type. SQL:
SELECT name FROM products AS prod WHERE value > ( SELECT MAX(value) FROM shipments AS shp WHERE shp.type = prod.type );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_10531
train
T1
v1
Schema: requests (alias: ordr)(amount, value, date, status) products(date, salary, value, name) Task: Select id from requests where level exists in products for the same code. SQL:
SELECT id FROM requests AS ordr WHERE level IN ( SELECT level FROM products AS prod WHERE prod.code = ordr.code );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_10532
train
T2
v3
Schema: schedules (alias: schd)(type, id, value, status) items(status, amount, id, code) Task: Find id from schedules where value exceeds the average amount from items for the same level. SQL:
SELECT id FROM schedules AS schd WHERE value > ( SELECT COUNT(amount) FROM items AS lne WHERE lne.level = schd.level );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_10533
train
T2
v3
Schema: transactions (alias: txn)(amount, code, name, salary) sales(salary, type, id, amount) Task: Find name from transactions where value exceeds the average amount from sales for the same level. SQL:
SELECT name FROM transactions AS txn WHERE value > ( SELECT MIN(amount) FROM sales AS sale WHERE sale.level = txn.level );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_10534
train
T1
v3
Schema: warehouses (alias: whs)(id, level, type, name) customers(status, code, level, name) Task: Retrieve amount from warehouses with amount above the MIN(salary) of customers rows sharing the same status. SQL:
SELECT amount FROM warehouses AS whs WHERE amount > ( SELECT MIN(salary) FROM customers AS cust WHERE cust.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "customers", "outer_alias": "whs", "inner_alias": "cust", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_10535
train
T2
v2
Schema: categories (alias: catg)(code, id, name, date) departments(code, amount, status, salary) Task: Find code from categories where a matching record exists in departments with the same status. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = catg.status );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "code", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_10536
train
T2
v3
Schema: items (alias: lne)(value, salary, type, date) categories(date, salary, level, code) Task: Retrieve id from items with salary above the COUNT(salary) of categories rows sharing the same code. SQL:
SELECT id FROM items AS lne WHERE salary > ( SELECT COUNT(salary) FROM categories AS catg WHERE catg.code = lne.code );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_10537
train
T2
v3
Schema: services (alias: srvc)(name, salary, amount, value) regions(date, code, name, amount) Task: Find name from services where value exceeds the average salary from regions for the same code. SQL:
SELECT name FROM services AS srvc WHERE value > ( SELECT MIN(salary) FROM regions AS rgn WHERE rgn.code = srvc.code );
{ "outer_table": "services", "inner_table": "regions", "outer_alias": "srvc", "inner_alias": "rgn", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_10538
train
T2
v1
Schema: accounts (alias: acct)(date, type, amount, level) managers(salary, date, id, status) Task: Retrieve id from accounts whose level is found in managers rows where status matches the outer record. SQL:
SELECT id FROM accounts AS acct WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.status = acct.status );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_10539
train
T1
v2
Schema: staff (alias: empl)(id, value, status, date) budgets(name, date, level, type) Task: Find salary from staff where a matching record exists in budgets with the same status. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.status = empl.status );
{ "outer_table": "staff", "inner_table": "budgets", "outer_alias": "empl", "inner_alias": "budg", "proj_col": "salary", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_10540
train
T2
v1
Schema: categories (alias: catg)(type, status, date, value) shipments(status, level, code, date) Task: Select name from categories where level exists in shipments for the same code. SQL:
SELECT name FROM categories AS catg WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.code = catg.code );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "catg", "inner_alias": "shp", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_10541
train
T2
v2
Schema: shipments (alias: shp)(id, date, amount, salary) transactions(name, date, type, amount) Task: Find id from shipments where a matching record exists in transactions with the same level. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = shp.level );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "id", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_10542
train
T2
v3
Schema: accounts (alias: acct)(status, id, amount, value) departments(type, level, name, status) Task: Find code from accounts where value exceeds the average amount from departments for the same level. SQL:
SELECT code FROM accounts AS acct WHERE value > ( SELECT AVG(amount) FROM departments AS dept WHERE dept.level = acct.level );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_10543
train
T1
v3
Schema: staff (alias: empl)(level, value, type, code) sales(level, date, type, status) Task: Retrieve salary from staff with amount above the MIN(value) of sales rows sharing the same status. SQL:
SELECT salary FROM staff AS empl WHERE amount > ( SELECT MIN(value) FROM sales AS sale WHERE sale.status = empl.status );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_10544
train
T2
v1
Schema: schedules (alias: schd)(name, salary, code, status) shipments(amount, value, date, level) Task: Select code from schedules where id exists in shipments for the same status. SQL:
SELECT code FROM schedules AS schd WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.status = schd.status );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "code", "filter_col": "id", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_10545
train
T2
v1
Schema: budgets (alias: budg)(name, level, status, value) services(type, name, date, salary) Task: Find name from budgets where level appears in services entries with matching status. SQL:
SELECT name FROM budgets AS budg WHERE level IN ( SELECT level FROM services AS srvc WHERE srvc.status = budg.status );
{ "outer_table": "budgets", "inner_table": "services", "outer_alias": "budg", "inner_alias": "srvc", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_10546
train
T2
v1
Schema: budgets (alias: budg)(amount, code, salary, id) invoices(value, name, level, date) Task: Find code from budgets where id appears in invoices entries with matching status. SQL:
SELECT code FROM budgets AS budg WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.status = budg.status );
{ "outer_table": "budgets", "inner_table": "invoices", "outer_alias": "budg", "inner_alias": "inv", "proj_col": "code", "filter_col": "id", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_10547
train
T2
v2
Schema: departments (alias: dept)(id, name, code, type) transactions(amount, value, salary, level) Task: Find amount from departments where a matching record exists in transactions with the same type. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = dept.type );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "amount", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_10548
train
T1
v2
Schema: managers (alias: mgr)(salary, type, level, status) invoices(status, value, level, salary) Task: Find name from managers where a matching record exists in invoices with the same type. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = mgr.type );
{ "outer_table": "managers", "inner_table": "invoices", "outer_alias": "mgr", "inner_alias": "inv", "proj_col": "name", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_10549
train
T1
v3
Schema: invoices (alias: inv)(level, code, date, id) schedules(salary, status, id, type) Task: Find value from invoices where amount exceeds the average value from schedules for the same type. SQL:
SELECT value FROM invoices AS inv WHERE amount > ( SELECT MAX(value) FROM schedules AS schd WHERE schd.type = inv.type );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_10550
train
T1
v1
Schema: orders (alias: ord)(amount, value, code, type) accounts(amount, date, salary, id) Task: Retrieve value from orders whose status is found in accounts rows where level matches the outer record. SQL:
SELECT value FROM orders AS ord WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.level = ord.level );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_10551
train
T1
v2
Schema: categories (alias: catg)(type, name, status, date) orders(value, type, amount, name) Task: Retrieve code from categories that have at least one corresponding entry in orders sharing 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_10552
train
T2
v3
Schema: accounts (alias: acct)(code, id, value, date) budgets(level, value, name, status) Task: Find id from accounts where value exceeds the average amount from budgets for the same type. SQL:
SELECT id FROM accounts AS acct WHERE value > ( SELECT AVG(amount) FROM budgets AS budg WHERE budg.type = acct.type );
{ "outer_table": "accounts", "inner_table": "budgets", "outer_alias": "acct", "inner_alias": "budg", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_10553
train
T1
v1
Schema: transactions (alias: txn)(value, amount, name, status) accounts(code, status, level, type) Task: Retrieve amount from transactions whose id is found in accounts rows where type matches the outer record. SQL:
SELECT amount FROM transactions AS txn WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.type = txn.type );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_10554
train
T1
v1
Schema: transactions (alias: txn)(status, date, salary, code) items(type, value, salary, id) Task: Find id from transactions where type appears in items entries with matching type. SQL:
SELECT id FROM transactions AS txn WHERE type IN ( SELECT type FROM items AS lne WHERE lne.type = txn.type );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "id", "filter_col": "type", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_10555
train
T1
v1
Schema: regions (alias: rgn)(name, code, level, salary) services(amount, date, name, salary) Task: Retrieve code from regions whose code is found in services rows where level matches the outer record. SQL:
SELECT code FROM regions AS rgn WHERE code IN ( SELECT code FROM services AS srvc WHERE srvc.level = rgn.level );
{ "outer_table": "regions", "inner_table": "services", "outer_alias": "rgn", "inner_alias": "srvc", "proj_col": "code", "filter_col": "code", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_10556
train
T2
v2
Schema: items (alias: lne)(date, amount, status, value) orders(code, salary, status, value) Task: Retrieve value from items that have at least one corresponding entry in orders sharing the same id. SQL:
SELECT value 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": "value", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_10557
train
T2
v3
Schema: transactions (alias: txn)(date, value, name, status) employees(date, salary, name, type) Task: Find salary from transactions where salary exceeds the average salary from employees for the same type. SQL:
SELECT salary FROM transactions AS txn WHERE salary > ( SELECT MAX(salary) FROM employees AS emp WHERE emp.type = txn.type );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_10558
train
T1
v2
Schema: warehouses (alias: whs)(level, date, id, value) employees(name, status, date, salary) Task: Retrieve salary from warehouses that have at least one corresponding entry in employees sharing the same type. SQL:
SELECT salary FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "employees", "outer_alias": "whs", "inner_alias": "emp", "proj_col": "salary", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_10559
train
T2
v3
Schema: shipments (alias: shp)(type, value, status, amount) categories(type, status, level, date) Task: Find code from shipments where value exceeds the average value from categories for the same level. SQL:
SELECT code FROM shipments AS shp WHERE value > ( SELECT MIN(value) FROM categories AS catg WHERE catg.level = shp.level );
{ "outer_table": "shipments", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "catg", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_10560
train
T2
v1
Schema: items (alias: lne)(value, date, amount, status) budgets(date, salary, value, level) Task: Select name from items where status exists in budgets for the same code. SQL:
SELECT name FROM items AS lne WHERE status IN ( SELECT status FROM budgets AS budg WHERE budg.code = lne.code );
{ "outer_table": "items", "inner_table": "budgets", "outer_alias": "lne", "inner_alias": "budg", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_10561
train
T2
v2
Schema: invoices (alias: inv)(date, status, name, id) customers(status, value, date, id) Task: Retrieve code from invoices that have at least one corresponding entry in customers sharing the same status. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = inv.status );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "code", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_10562
train
T1
v3
Schema: employees (alias: emp)(level, value, name, type) budgets(status, name, level, date) Task: Retrieve name from employees with salary above the MAX(amount) of budgets rows sharing the same status. SQL:
SELECT name FROM employees AS emp WHERE salary > ( SELECT MAX(amount) FROM budgets AS budg WHERE budg.status = emp.status );
{ "outer_table": "employees", "inner_table": "budgets", "outer_alias": "emp", "inner_alias": "budg", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_10563
train
T1
v2
Schema: budgets (alias: budg)(salary, type, value, name) items(status, level, type, id) Task: Retrieve name from budgets that have at least one corresponding entry in items sharing the same type. SQL:
SELECT name FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = budg.type );
{ "outer_table": "budgets", "inner_table": "items", "outer_alias": "budg", "inner_alias": "lne", "proj_col": "name", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_10564
train
T2
v2
Schema: regions (alias: rgn)(value, amount, name, date) sales(salary, amount, code, level) Task: Retrieve id from regions that have at least one corresponding entry in sales sharing the same status. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = rgn.status );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "id", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_10565
train
T2
v3
Schema: schedules (alias: schd)(type, amount, salary, date) invoices(name, code, date, id) Task: Find amount from schedules where amount exceeds the average salary from invoices for the same level. SQL:
SELECT amount FROM schedules AS schd WHERE amount > ( SELECT SUM(salary) FROM invoices AS inv WHERE inv.level = schd.level );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_10566
train
T2
v1
Schema: staff (alias: empl)(name, value, status, salary) shipments(type, id, value, status) Task: Select name from staff where code exists in shipments for the same level. SQL:
SELECT name FROM staff AS empl WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.level = empl.level );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_10567
train
T2
v1
Schema: invoices (alias: inv)(amount, value, type, status) products(value, status, code, name) Task: Select amount from invoices where type exists in products for the same type. SQL:
SELECT amount FROM invoices AS inv WHERE type IN ( SELECT type FROM products AS prod WHERE prod.type = inv.type );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_10568
train
T1
v3
Schema: categories (alias: catg)(value, id, code, type) items(date, amount, type, id) Task: Retrieve amount from categories with amount above the COUNT(amount) of items rows sharing the same status. SQL:
SELECT amount FROM categories AS catg WHERE amount > ( SELECT COUNT(amount) FROM items AS lne WHERE lne.status = catg.status );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_10569
train
T2
v1
Schema: customers (alias: cust)(status, amount, salary, code) warehouses(status, salary, date, name) Task: Select value from customers where level exists in warehouses for the same code. SQL:
SELECT value FROM customers AS cust WHERE level IN ( SELECT level FROM warehouses AS whs WHERE whs.code = cust.code );
{ "outer_table": "customers", "inner_table": "warehouses", "outer_alias": "cust", "inner_alias": "whs", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_10570
train
T1
v3
Schema: items (alias: lne)(status, level, type, value) transactions(name, value, status, level) Task: Retrieve value from items with salary above the COUNT(salary) of transactions rows sharing the same status. SQL:
SELECT value FROM items AS lne WHERE salary > ( SELECT COUNT(salary) FROM transactions AS txn WHERE txn.status = lne.status );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_10571
train
T2
v2
Schema: regions (alias: rgn)(name, amount, code, level) customers(code, status, name, date) Task: Find id from regions where a matching record exists in customers with the same status. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = rgn.status );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "id", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_10572
train
T2
v3
Schema: transactions (alias: txn)(type, level, date, code) warehouses(status, type, salary, code) Task: Find salary from transactions where value exceeds the average amount from warehouses for the same code. SQL:
SELECT salary FROM transactions AS txn WHERE value > ( SELECT COUNT(amount) FROM warehouses AS whs WHERE whs.code = txn.code );
{ "outer_table": "transactions", "inner_table": "warehouses", "outer_alias": "txn", "inner_alias": "whs", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_10573
train
T1
v1
Schema: categories (alias: catg)(type, id, salary, status) transactions(status, salary, level, value) Task: Retrieve name from categories whose code is found in transactions rows where status matches the outer record. SQL:
SELECT name FROM categories AS catg WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.status = catg.status );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_10574
train
T2
v1
Schema: staff (alias: empl)(status, level, name, code) transactions(date, code, amount, salary) Task: Find id from staff where level appears in transactions entries with matching type. SQL:
SELECT id 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": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_10575
train
T2
v3
Schema: sales (alias: sale)(amount, type, code, salary) transactions(level, date, value, name) Task: Retrieve amount from sales with value above the MAX(value) of transactions rows sharing the same status. SQL:
SELECT amount FROM sales AS sale WHERE value > ( SELECT MAX(value) FROM transactions AS txn WHERE txn.status = sale.status );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_10576
train
T1
v1
Schema: regions (alias: rgn)(status, code, type, salary) customers(status, name, code, type) Task: Retrieve name from regions whose id is found in customers rows where status matches the outer record. SQL:
SELECT name FROM regions AS rgn WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.status = rgn.status );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "name", "filter_col": "id", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_10577
train
T2
v1
Schema: items (alias: lne)(name, id, code, amount) schedules(level, date, id, code) Task: Retrieve salary from items whose id is found in schedules rows where type matches the outer record. SQL:
SELECT salary FROM items AS lne WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.type = lne.type );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "salary", "filter_col": "id", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_10578
train
T2
v3
Schema: invoices (alias: inv)(level, id, type, date) categories(value, name, code, id) Task: Retrieve name from invoices with salary above the SUM(value) of categories rows sharing the same level. SQL:
SELECT name FROM invoices AS inv WHERE salary > ( SELECT SUM(value) FROM categories AS catg WHERE catg.level = inv.level );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_10579
train
T1
v1
Schema: managers (alias: mgr)(value, name, type, level) employees(level, date, id, amount) Task: Retrieve salary from managers whose id is found in employees rows where level matches the outer record. SQL:
SELECT salary FROM managers AS mgr WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.level = mgr.level );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "salary", "filter_col": "id", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_10580
train
T1
v2
Schema: staff (alias: empl)(amount, type, value, id) employees(id, amount, code, level) Task: Retrieve value from staff that have at least one corresponding entry in employees sharing the same code. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = empl.code );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "value", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_10581
train
T2
v2
Schema: warehouses (alias: whs)(amount, code, date, level) employees(type, id, value, name) Task: Find salary from warehouses where a matching record exists in employees with the same status. SQL:
SELECT salary FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "employees", "outer_alias": "whs", "inner_alias": "emp", "proj_col": "salary", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_10582
train
T2
v2
Schema: managers (alias: mgr)(date, id, type, amount) staff(date, salary, code, level) Task: Retrieve name from managers that have at least one corresponding entry in staff sharing the same code. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = mgr.code );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "name", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_10583
train
T1
v2
Schema: invoices (alias: inv)(type, amount, level, value) customers(value, salary, level, date) Task: Retrieve amount from invoices that have at least one corresponding entry in customers sharing the same type. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = inv.type );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "amount", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_10584
train
T1
v1
Schema: departments (alias: dept)(type, amount, level, salary) orders(id, level, amount, type) Task: Select name from departments where level exists in orders for the same status. SQL:
SELECT name FROM departments AS dept WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.status = dept.status );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_10585
train
T1
v3
Schema: orders (alias: ord)(value, amount, status, name) accounts(code, type, value, name) Task: Retrieve amount from orders with amount above the MAX(salary) of accounts rows sharing the same code. SQL:
SELECT amount FROM orders AS ord WHERE amount > ( SELECT MAX(salary) FROM accounts AS acct WHERE acct.code = ord.code );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_10586
train
T1
v2
Schema: employees (alias: emp)(id, amount, date, salary) services(code, status, date, value) Task: Find code from employees where a matching record exists in services with the same id. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = emp.id );
{ "outer_table": "employees", "inner_table": "services", "outer_alias": "emp", "inner_alias": "srvc", "proj_col": "code", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_10587
train
T1
v3
Schema: accounts (alias: acct)(date, salary, value, type) invoices(date, code, status, level) Task: Find name from accounts where salary exceeds the average value from invoices for the same type. SQL:
SELECT name FROM accounts AS acct WHERE salary > ( SELECT COUNT(value) FROM invoices AS inv WHERE inv.type = acct.type );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_10588
train
T1
v1
Schema: categories (alias: catg)(value, level, salary, type) warehouses(date, status, salary, id) Task: Find name from categories where code appears in warehouses entries with matching code. SQL:
SELECT name FROM categories AS catg WHERE code IN ( SELECT code FROM warehouses AS whs WHERE whs.code = catg.code );
{ "outer_table": "categories", "inner_table": "warehouses", "outer_alias": "catg", "inner_alias": "whs", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_10589
train
T2
v2
Schema: customers (alias: cust)(level, amount, date, value) staff(amount, name, value, status) Task: Find amount from customers where a matching record exists in staff with the same level. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = cust.level );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "amount", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_10590
train
T1
v3
Schema: sales (alias: sale)(name, type, amount, id) transactions(type, level, id, date) Task: Find code from sales where salary exceeds the average salary from transactions for the same type. SQL:
SELECT code FROM sales AS sale WHERE salary > ( SELECT AVG(salary) FROM transactions AS txn WHERE txn.type = sale.type );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_10591
train
T1
v2
Schema: employees (alias: emp)(amount, value, name, salary) departments(status, value, code, date) Task: Find value from employees where a matching record exists in departments with the same type. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = emp.type );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "value", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_10592
train
T1
v2
Schema: managers (alias: mgr)(salary, date, status, code) customers(type, value, amount, id) Task: Retrieve value from managers that have at least one corresponding entry in customers sharing the same id. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = mgr.id );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "value", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_10593
train
T1
v3
Schema: employees (alias: emp)(value, amount, name, code) regions(type, id, code, amount) Task: Find salary from employees where value exceeds the average salary from regions for the same status. SQL:
SELECT salary FROM employees AS emp WHERE value > ( SELECT MIN(salary) FROM regions AS rgn WHERE rgn.status = emp.status );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_10594
train
T1
v1
Schema: managers (alias: mgr)(amount, id, date, level) regions(code, value, id, type) Task: Retrieve name from managers whose type is found in regions rows where status matches the outer record. SQL:
SELECT name FROM managers AS mgr WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.status = mgr.status );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "name", "filter_col": "type", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_10595
train
T1
v3
Schema: orders (alias: ord)(level, name, code, salary) warehouses(type, name, level, id) Task: Find name from orders where value exceeds the average value from warehouses for the same id. SQL:
SELECT name FROM orders AS ord WHERE value > ( SELECT MAX(value) FROM warehouses AS whs WHERE whs.id = ord.id );
{ "outer_table": "orders", "inner_table": "warehouses", "outer_alias": "ord", "inner_alias": "whs", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_10596
train
T1
v3
Schema: budgets (alias: budg)(value, name, date, id) managers(id, name, value, date) Task: Find name from budgets where value exceeds the average value from managers for the same level. SQL:
SELECT name FROM budgets AS budg WHERE value > ( SELECT COUNT(value) FROM managers AS mgr WHERE mgr.level = budg.level );
{ "outer_table": "budgets", "inner_table": "managers", "outer_alias": "budg", "inner_alias": "mgr", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_10597
train
T2
v1
Schema: services (alias: srvc)(amount, date, value, type) accounts(type, value, salary, date) Task: Find salary from services where status appears in accounts entries with matching code. SQL:
SELECT salary FROM services AS srvc WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.code = srvc.code );
{ "outer_table": "services", "inner_table": "accounts", "outer_alias": "srvc", "inner_alias": "acct", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_10598
train
T2
v2
Schema: managers (alias: mgr)(id, value, type, amount) services(status, code, level, name) Task: Find salary from managers where a matching record exists in services with the same code. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.code = mgr.code );
{ "outer_table": "managers", "inner_table": "services", "outer_alias": "mgr", "inner_alias": "srvc", "proj_col": "salary", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_10599
train
T1