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
v1
Schema: accounts (alias: acct)(type, code, amount, salary) products(type, amount, value, name) Task: Find value from accounts where id appears in products entries with matching code. SQL:
SELECT value FROM accounts AS acct WHERE id IN ( SELECT id FROM products AS prod WHERE prod.code = acct.code );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_08500
train
T1
v2
Schema: invoices (alias: inv)(status, value, name, date) categories(amount, name, salary, level) Task: Retrieve value from invoices that have at least one corresponding entry in categories sharing the same type. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = inv.type );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "value", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_08501
train
T1
v1
Schema: staff (alias: empl)(name, date, amount, id) transactions(code, id, name, level) Task: Retrieve amount from staff whose code is found in transactions rows where type matches the outer record. SQL:
SELECT amount FROM staff AS empl WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.type = empl.type );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_08502
train
T2
v3
Schema: shipments (alias: shp)(id, name, level, date) budgets(type, salary, status, value) Task: Retrieve id from shipments with salary above the COUNT(amount) of budgets rows sharing the same level. SQL:
SELECT id FROM shipments AS shp WHERE salary > ( SELECT COUNT(amount) FROM budgets AS budg WHERE budg.level = shp.level );
{ "outer_table": "shipments", "inner_table": "budgets", "outer_alias": "shp", "inner_alias": "budg", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_08503
train
T2
v3
Schema: sales (alias: sale)(type, date, status, id) staff(status, amount, name, type) Task: Retrieve code from sales with value above the COUNT(value) of staff rows sharing the same type. SQL:
SELECT code FROM sales AS sale WHERE value > ( SELECT COUNT(value) FROM staff AS empl WHERE empl.type = sale.type );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_08504
train
T1
v1
Schema: services (alias: srvc)(status, code, salary, value) products(salary, status, id, value) Task: Select id from services where status exists in products for the same code. SQL:
SELECT id FROM services AS srvc WHERE status IN ( SELECT status FROM products AS prod WHERE prod.code = srvc.code );
{ "outer_table": "services", "inner_table": "products", "outer_alias": "srvc", "inner_alias": "prod", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_08505
train
T2
v2
Schema: staff (alias: empl)(date, code, salary, status) services(code, date, id, name) Task: Retrieve name from staff that have at least one corresponding entry in services sharing the same code. SQL:
SELECT name FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.code = empl.code );
{ "outer_table": "staff", "inner_table": "services", "outer_alias": "empl", "inner_alias": "srvc", "proj_col": "name", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_08506
train
T2
v2
Schema: budgets (alias: budg)(date, value, type, name) invoices(type, id, code, value) Task: Retrieve value from budgets that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT value FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = budg.type );
{ "outer_table": "budgets", "inner_table": "invoices", "outer_alias": "budg", "inner_alias": "inv", "proj_col": "value", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_08507
train
T2
v3
Schema: accounts (alias: acct)(value, code, type, date) budgets(amount, code, id, name) Task: Retrieve code from accounts with salary above the AVG(salary) of budgets rows sharing the same id. SQL:
SELECT code FROM accounts AS acct WHERE salary > ( SELECT AVG(salary) FROM budgets AS budg WHERE budg.id = acct.id );
{ "outer_table": "accounts", "inner_table": "budgets", "outer_alias": "acct", "inner_alias": "budg", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_08508
train
T1
v2
Schema: budgets (alias: budg)(salary, date, code, name) managers(salary, value, code, date) Task: Retrieve amount from budgets that have at least one corresponding entry in managers sharing the same type. SQL:
SELECT amount FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = budg.type );
{ "outer_table": "budgets", "inner_table": "managers", "outer_alias": "budg", "inner_alias": "mgr", "proj_col": "amount", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_08509
train
T2
v1
Schema: invoices (alias: inv)(amount, code, type, value) services(value, amount, code, type) Task: Select salary from invoices where type exists in services for the same code. SQL:
SELECT salary FROM invoices AS inv WHERE type IN ( SELECT type FROM services AS srvc WHERE srvc.code = inv.code );
{ "outer_table": "invoices", "inner_table": "services", "outer_alias": "inv", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "type", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_08510
train
T1
v1
Schema: accounts (alias: acct)(name, salary, status, id) shipments(salary, name, level, status) Task: Retrieve id from accounts whose status is found in shipments rows where id matches the outer record. SQL:
SELECT id FROM accounts AS acct WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.id = acct.id );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_08511
train
T1
v1
Schema: orders (alias: ord)(code, value, status, name) shipments(status, type, salary, level) Task: Retrieve name from orders whose status is found in shipments rows where level matches the outer record. SQL:
SELECT name FROM orders AS ord WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.level = ord.level );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_08512
train
T1
v2
Schema: transactions (alias: txn)(status, amount, name, date) categories(salary, status, code, id) Task: Retrieve name from transactions that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = txn.code );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "name", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_08513
train
T1
v2
Schema: services (alias: srvc)(level, name, code, value) invoices(amount, type, code, level) Task: Find salary from services where a matching record exists in invoices with the same code. SQL:
SELECT salary FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = srvc.code );
{ "outer_table": "services", "inner_table": "invoices", "outer_alias": "srvc", "inner_alias": "inv", "proj_col": "salary", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_08514
train
T2
v1
Schema: departments (alias: dept)(code, date, type, value) schedules(code, name, salary, type) Task: Find code from departments where status appears in schedules entries with matching code. SQL:
SELECT code FROM departments AS dept WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.code = dept.code );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "code", "filter_col": "status", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_08515
train
T1
v2
Schema: regions (alias: rgn)(salary, date, status, code) shipments(name, amount, value, salary) Task: Find id from regions where a matching record exists in shipments with the same status. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = rgn.status );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "id", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_08516
train
T2
v2
Schema: accounts (alias: acct)(value, type, date, status) managers(id, status, code, value) Task: Find amount from accounts where a matching record exists in managers with the same type. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = acct.type );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "amount", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_08517
train
T1
v1
Schema: budgets (alias: budg)(amount, value, level, name) items(type, amount, value, date) Task: Retrieve name from budgets whose code is found in items rows where status matches the outer record. SQL:
SELECT name FROM budgets AS budg WHERE code IN ( SELECT code FROM items AS lne WHERE lne.status = budg.status );
{ "outer_table": "budgets", "inner_table": "items", "outer_alias": "budg", "inner_alias": "lne", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_08518
train
T2
v3
Schema: products (alias: prod)(level, salary, code, status) sales(value, id, status, salary) Task: Retrieve id from products with amount above the SUM(value) of sales rows sharing the same status. SQL:
SELECT id FROM products AS prod WHERE amount > ( SELECT SUM(value) FROM sales AS sale WHERE sale.status = prod.status );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_08519
train
T1
v3
Schema: sales (alias: sale)(name, status, date, salary) employees(status, level, type, value) Task: Retrieve code from sales with amount above the COUNT(amount) of employees rows sharing the same status. SQL:
SELECT code FROM sales AS sale WHERE amount > ( SELECT COUNT(amount) FROM employees AS emp WHERE emp.status = sale.status );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_08520
train
T1
v1
Schema: managers (alias: mgr)(salary, code, name, status) items(id, date, code, level) Task: Find value from managers where level appears in items entries with matching code. SQL:
SELECT value FROM managers AS mgr WHERE level IN ( SELECT level FROM items AS lne WHERE lne.code = mgr.code );
{ "outer_table": "managers", "inner_table": "items", "outer_alias": "mgr", "inner_alias": "lne", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_08521
train
T1
v1
Schema: warehouses (alias: whs)(code, name, salary, type) orders(amount, status, name, level) Task: Select name from warehouses where code exists in orders for the same code. SQL:
SELECT name FROM warehouses AS whs WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "orders", "outer_alias": "whs", "inner_alias": "ord", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_08522
train
T2
v2
Schema: accounts (alias: acct)(status, type, code, name) invoices(type, date, value, salary) Task: Find salary from accounts where a matching record exists in invoices with the same type. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = acct.type );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "salary", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_08523
train
T1
v2
Schema: requests (alias: ordr)(name, date, salary, value) warehouses(salary, name, type, code) Task: Find value from requests where a matching record exists in warehouses with the same level. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.level = ordr.level );
{ "outer_table": "requests", "inner_table": "warehouses", "outer_alias": "ordr", "inner_alias": "whs", "proj_col": "value", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_08524
train
T2
v3
Schema: staff (alias: empl)(amount, code, date, name) invoices(date, amount, level, status) Task: Find amount from staff where value exceeds the average value from invoices for the same level. SQL:
SELECT amount FROM staff AS empl WHERE value > ( SELECT MAX(value) FROM invoices AS inv WHERE inv.level = empl.level );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_08525
train
T2
v2
Schema: orders (alias: ord)(type, level, date, status) departments(level, code, name, salary) Task: Find amount from orders where a matching record exists in departments with the same status. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = ord.status );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "amount", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_08526
train
T1
v3
Schema: transactions (alias: txn)(code, value, type, id) managers(amount, type, date, code) Task: Retrieve salary from transactions with value above the MIN(amount) of managers rows sharing the same id. SQL:
SELECT salary FROM transactions AS txn WHERE value > ( SELECT MIN(amount) FROM managers AS mgr WHERE mgr.id = txn.id );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_08527
train
T1
v1
Schema: services (alias: srvc)(code, salary, id, level) products(amount, value, salary, date) Task: Retrieve amount from services whose level is found in products rows where id matches the outer record. SQL:
SELECT amount FROM services AS srvc WHERE level IN ( SELECT level FROM products AS prod WHERE prod.id = srvc.id );
{ "outer_table": "services", "inner_table": "products", "outer_alias": "srvc", "inner_alias": "prod", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_08528
train
T2
v3
Schema: transactions (alias: txn)(type, amount, status, name) staff(type, name, status, level) Task: Find name from transactions where amount exceeds the average amount from staff for the same code. SQL:
SELECT name FROM transactions AS txn WHERE amount > ( SELECT MAX(amount) FROM staff AS empl WHERE empl.code = txn.code );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_08529
train
T1
v1
Schema: requests (alias: ordr)(code, salary, status, level) invoices(name, amount, date, id) Task: Select name from requests where type exists in invoices for the same type. SQL:
SELECT name FROM requests AS ordr WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.type = ordr.type );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "name", "filter_col": "type", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_08530
train
T2
v2
Schema: products (alias: prod)(status, value, type, salary) regions(status, value, level, code) Task: Find amount from products where a matching record exists in regions with the same status. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = prod.status );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "amount", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_08531
train
T1
v1
Schema: transactions (alias: txn)(code, id, date, name) departments(amount, status, name, salary) Task: Select id from transactions where code exists in departments for the same id. SQL:
SELECT id FROM transactions AS txn WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.id = txn.id );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "id", "filter_col": "code", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_08532
train
T1
v2
Schema: customers (alias: cust)(amount, date, code, name) invoices(type, code, level, name) Task: Retrieve amount from customers that have at least one corresponding entry in invoices sharing the same code. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = cust.code );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "amount", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_08533
train
T1
v2
Schema: departments (alias: dept)(status, code, type, value) sales(date, salary, code, status) Task: Retrieve id from departments that have at least one corresponding entry in sales sharing the same code. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = dept.code );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "id", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_08534
train
T1
v2
Schema: regions (alias: rgn)(amount, status, level, date) orders(date, id, code, name) Task: Retrieve code from regions that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT code FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = rgn.code );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "code", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_08535
train
T2
v3
Schema: accounts (alias: acct)(amount, id, value, code) requests(date, level, name, id) Task: Retrieve amount from accounts with value above the MIN(salary) of requests rows sharing the same id. SQL:
SELECT amount FROM accounts AS acct WHERE value > ( SELECT MIN(salary) FROM requests AS ordr WHERE ordr.id = acct.id );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_08536
train
T1
v3
Schema: accounts (alias: acct)(level, salary, amount, status) departments(value, date, type, amount) Task: Retrieve id from accounts with salary above the MIN(amount) of departments rows sharing the same level. SQL:
SELECT id FROM accounts AS acct WHERE salary > ( SELECT MIN(amount) FROM departments AS dept WHERE dept.level = acct.level );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_08537
train
T1
v1
Schema: categories (alias: catg)(date, value, name, salary) regions(name, salary, level, type) Task: Retrieve code from categories whose code is found in regions rows where level matches the outer record. SQL:
SELECT code FROM categories AS catg WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.level = catg.level );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "code", "filter_col": "code", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_08538
train
T2
v2
Schema: accounts (alias: acct)(salary, status, value, type) schedules(level, status, amount, code) Task: Retrieve amount from accounts that have at least one corresponding entry in schedules sharing the same type. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = acct.type );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "amount", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_08539
train
T1
v1
Schema: departments (alias: dept)(name, salary, type, id) employees(name, id, amount, type) Task: Retrieve id from departments whose level is found in employees rows where type matches the outer record. SQL:
SELECT id FROM departments AS dept WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.type = dept.type );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_08540
train
T1
v3
Schema: departments (alias: dept)(type, salary, amount, date) staff(status, level, code, id) Task: Find amount from departments where amount exceeds the average amount from staff for the same code. SQL:
SELECT amount FROM departments AS dept WHERE amount > ( SELECT SUM(amount) FROM staff AS empl WHERE empl.code = dept.code );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_08541
train
T1
v2
Schema: customers (alias: cust)(type, code, salary, name) items(salary, type, id, amount) Task: Retrieve amount from customers that have at least one corresponding entry in items sharing the same status. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = cust.status );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "amount", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_08542
train
T1
v2
Schema: managers (alias: mgr)(amount, type, value, code) employees(salary, value, level, status) Task: Retrieve name from managers that have at least one corresponding entry in employees sharing the same id. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = mgr.id );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "name", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_08543
train
T1
v3
Schema: categories (alias: catg)(level, value, salary, name) departments(value, status, id, type) Task: Retrieve id from categories with amount above the SUM(salary) of departments rows sharing the same type. SQL:
SELECT id FROM categories AS catg WHERE amount > ( SELECT SUM(salary) FROM departments AS dept WHERE dept.type = catg.type );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_08544
train
T2
v1
Schema: categories (alias: catg)(code, date, value, type) employees(status, amount, name, code) Task: Retrieve salary from categories whose level is found in employees rows where code matches the outer record. SQL:
SELECT salary FROM categories AS catg WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.code = catg.code );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "salary", "filter_col": "level", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_08545
train
T2
v1
Schema: transactions (alias: txn)(level, salary, id, status) orders(status, level, type, date) Task: Retrieve code from transactions whose status is found in orders rows where type matches the outer record. SQL:
SELECT code FROM transactions AS txn WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.type = txn.type );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_08546
train
T1
v3
Schema: shipments (alias: shp)(level, name, type, date) employees(type, salary, name, id) Task: Find id from shipments where value exceeds the average amount from employees for the same status. SQL:
SELECT id FROM shipments AS shp WHERE value > ( SELECT MIN(amount) FROM employees AS emp WHERE emp.status = shp.status );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_08547
train
T2
v2
Schema: managers (alias: mgr)(id, date, code, type) warehouses(status, code, id, name) Task: Find salary from managers where a matching record exists in warehouses with the same id. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.id = mgr.id );
{ "outer_table": "managers", "inner_table": "warehouses", "outer_alias": "mgr", "inner_alias": "whs", "proj_col": "salary", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_08548
train
T1
v1
Schema: services (alias: srvc)(status, name, type, amount) regions(type, value, code, salary) Task: Retrieve amount from services whose status is found in regions rows where type matches the outer record. SQL:
SELECT amount FROM services AS srvc WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.type = srvc.type );
{ "outer_table": "services", "inner_table": "regions", "outer_alias": "srvc", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "status", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_08549
train
T2
v2
Schema: transactions (alias: txn)(value, code, type, amount) managers(salary, amount, level, name) Task: Find name from transactions where a matching record exists in managers with the same status. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = txn.status );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "name", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_08550
train
T1
v2
Schema: budgets (alias: budg)(code, name, type, id) departments(code, amount, id, name) Task: Retrieve id from budgets that have at least one corresponding entry in departments sharing the same status. SQL:
SELECT id FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = budg.status );
{ "outer_table": "budgets", "inner_table": "departments", "outer_alias": "budg", "inner_alias": "dept", "proj_col": "id", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_08551
train
T2
v3
Schema: staff (alias: empl)(id, value, date, status) employees(amount, id, salary, status) Task: Retrieve amount from staff with amount above the AVG(salary) of employees rows sharing the same type. SQL:
SELECT amount FROM staff AS empl WHERE amount > ( SELECT AVG(salary) FROM employees AS emp WHERE emp.type = empl.type );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_08552
train
T2
v1
Schema: shipments (alias: shp)(amount, salary, date, type) categories(salary, date, name, status) Task: Find value from shipments where type appears in categories entries with matching status. SQL:
SELECT value FROM shipments AS shp WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.status = shp.status );
{ "outer_table": "shipments", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "catg", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_08553
train
T2
v1
Schema: warehouses (alias: whs)(date, id, status, amount) schedules(level, code, value, status) Task: Find id from warehouses where id appears in schedules entries with matching code. SQL:
SELECT id FROM warehouses AS whs WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "schedules", "outer_alias": "whs", "inner_alias": "schd", "proj_col": "id", "filter_col": "id", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_08554
train
T2
v1
Schema: staff (alias: empl)(date, level, id, salary) categories(salary, value, date, level) Task: Retrieve value from staff whose status is found in categories rows where type matches the outer record. SQL:
SELECT value FROM staff AS empl WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.type = empl.type );
{ "outer_table": "staff", "inner_table": "categories", "outer_alias": "empl", "inner_alias": "catg", "proj_col": "value", "filter_col": "status", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_08555
train
T2
v2
Schema: schedules (alias: schd)(code, value, name, level) budgets(status, code, name, salary) Task: Retrieve amount from schedules that have at least one corresponding entry in budgets sharing the same id. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.id = schd.id );
{ "outer_table": "schedules", "inner_table": "budgets", "outer_alias": "schd", "inner_alias": "budg", "proj_col": "amount", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_08556
train
T2
v1
Schema: invoices (alias: inv)(level, code, amount, status) budgets(name, level, value, type) Task: Select salary from invoices where level exists in budgets for the same level. SQL:
SELECT salary FROM invoices AS inv WHERE level IN ( SELECT level FROM budgets AS budg WHERE budg.level = inv.level );
{ "outer_table": "invoices", "inner_table": "budgets", "outer_alias": "inv", "inner_alias": "budg", "proj_col": "salary", "filter_col": "level", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_08557
train
T1
v1
Schema: requests (alias: ordr)(status, type, id, code) customers(name, level, code, id) Task: Select value from requests where type exists in customers for the same type. SQL:
SELECT value FROM requests AS ordr WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.type = ordr.type );
{ "outer_table": "requests", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "value", "filter_col": "type", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_08558
train
T2
v2
Schema: departments (alias: dept)(id, code, salary, amount) orders(value, id, amount, name) Task: Retrieve value from departments that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = dept.level );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "value", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_08559
train
T1
v3
Schema: managers (alias: mgr)(type, status, level, value) items(type, code, date, level) Task: Retrieve name from managers with amount above the COUNT(amount) of items rows sharing the same level. SQL:
SELECT name FROM managers AS mgr WHERE amount > ( SELECT COUNT(amount) FROM items AS lne WHERE lne.level = mgr.level );
{ "outer_table": "managers", "inner_table": "items", "outer_alias": "mgr", "inner_alias": "lne", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_08560
train
T1
v2
Schema: categories (alias: catg)(value, date, code, type) requests(name, level, date, status) Task: Retrieve amount from categories that have at least one corresponding entry in requests sharing the same id. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = catg.id );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "amount", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_08561
train
T2
v2
Schema: items (alias: lne)(code, type, amount, status) services(type, amount, status, date) Task: Retrieve id from items that have at least one corresponding entry in services sharing the same id. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = lne.id );
{ "outer_table": "items", "inner_table": "services", "outer_alias": "lne", "inner_alias": "srvc", "proj_col": "id", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_08562
train
T2
v1
Schema: schedules (alias: schd)(id, amount, date, level) orders(type, id, amount, name) Task: Retrieve value from schedules whose level is found in orders rows where level matches the outer record. SQL:
SELECT value FROM schedules AS schd WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.level = schd.level );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_08563
train
T2
v2
Schema: customers (alias: cust)(name, level, type, date) budgets(date, type, amount, status) Task: Find value from customers where a matching record exists in budgets with the same level. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.level = cust.level );
{ "outer_table": "customers", "inner_table": "budgets", "outer_alias": "cust", "inner_alias": "budg", "proj_col": "value", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_08564
train
T1
v2
Schema: products (alias: prod)(code, name, date, amount) orders(date, code, type, salary) Task: Retrieve amount from products that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = prod.code );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "amount", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_08565
train
T1
v3
Schema: transactions (alias: txn)(value, salary, type, code) orders(level, amount, type, salary) Task: Find name from transactions where value exceeds the average amount from orders for the same level. SQL:
SELECT name FROM transactions AS txn WHERE value > ( SELECT SUM(amount) FROM orders AS ord WHERE ord.level = txn.level );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_08566
train
T1
v3
Schema: services (alias: srvc)(name, amount, value, code) departments(amount, type, salary, id) Task: Find amount from services where value exceeds the average salary from departments for the same level. SQL:
SELECT amount FROM services AS srvc WHERE value > ( SELECT SUM(salary) FROM departments AS dept WHERE dept.level = srvc.level );
{ "outer_table": "services", "inner_table": "departments", "outer_alias": "srvc", "inner_alias": "dept", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_08567
train
T2
v1
Schema: shipments (alias: shp)(id, amount, level, code) products(amount, status, type, level) Task: Find code from shipments where status appears in products entries with matching id. SQL:
SELECT code FROM shipments AS shp WHERE status IN ( SELECT status FROM products AS prod WHERE prod.id = shp.id );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_08568
train
T2
v1
Schema: employees (alias: emp)(salary, type, date, id) requests(id, name, status, salary) Task: Find amount from employees where status appears in requests entries with matching status. SQL:
SELECT amount FROM employees AS emp WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.status = emp.status );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_08569
train
T1
v2
Schema: staff (alias: empl)(status, type, date, level) requests(type, value, status, name) Task: Retrieve salary from staff that have at least one corresponding entry in requests sharing the same type. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = empl.type );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "salary", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_08570
train
T2
v3
Schema: staff (alias: empl)(type, id, level, amount) requests(id, status, name, salary) Task: Find name from staff where value exceeds the average value from requests for the same type. SQL:
SELECT name FROM staff AS empl WHERE value > ( SELECT MAX(value) FROM requests AS ordr WHERE ordr.type = empl.type );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_08571
train
T2
v2
Schema: sales (alias: sale)(name, salary, level, type) budgets(amount, code, value, type) Task: Find amount from sales where a matching record exists in budgets with the same id. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.id = sale.id );
{ "outer_table": "sales", "inner_table": "budgets", "outer_alias": "sale", "inner_alias": "budg", "proj_col": "amount", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_08572
train
T1
v3
Schema: budgets (alias: budg)(code, id, status, date) employees(level, type, code, date) Task: Find amount from budgets where amount exceeds the average value from employees for the same type. SQL:
SELECT amount FROM budgets AS budg WHERE amount > ( SELECT COUNT(value) FROM employees AS emp WHERE emp.type = budg.type );
{ "outer_table": "budgets", "inner_table": "employees", "outer_alias": "budg", "inner_alias": "emp", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_08573
train
T2
v2
Schema: employees (alias: emp)(level, name, value, type) invoices(date, name, id, amount) Task: Retrieve amount from employees that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT amount 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": "amount", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_08574
train
T1
v1
Schema: warehouses (alias: whs)(salary, code, value, level) staff(amount, code, date, value) Task: Select salary from warehouses where id exists in staff for the same status. SQL:
SELECT salary FROM warehouses AS whs WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "staff", "outer_alias": "whs", "inner_alias": "empl", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_08575
train
T2
v2
Schema: budgets (alias: budg)(name, salary, amount, type) sales(name, salary, type, level) Task: Retrieve salary from budgets that have at least one corresponding entry in sales sharing the same level. SQL:
SELECT salary FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = budg.level );
{ "outer_table": "budgets", "inner_table": "sales", "outer_alias": "budg", "inner_alias": "sale", "proj_col": "salary", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_08576
train
T2
v1
Schema: orders (alias: ord)(value, type, code, status) items(status, code, salary, value) Task: Find name from orders where code appears in items entries with matching status. SQL:
SELECT name FROM orders AS ord WHERE code IN ( SELECT code FROM items AS lne WHERE lne.status = ord.status );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_08577
train
T1
v3
Schema: customers (alias: cust)(value, level, date, salary) regions(salary, status, type, code) Task: Find code from customers where value exceeds the average salary from regions for the same level. SQL:
SELECT code FROM customers AS cust WHERE value > ( SELECT COUNT(salary) FROM regions AS rgn WHERE rgn.level = cust.level );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_08578
train
T1
v2
Schema: products (alias: prod)(code, name, value, status) categories(name, id, salary, status) Task: Retrieve salary from products that have at least one corresponding entry in categories sharing the same type. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = prod.type );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "salary", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_08579
train
T1
v2
Schema: items (alias: lne)(name, type, id, code) categories(id, code, name, value) Task: Retrieve value from items that have at least one corresponding entry in categories sharing the same status. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = lne.status );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "value", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_08580
train
T2
v1
Schema: shipments (alias: shp)(date, id, status, salary) regions(salary, name, status, level) Task: Select salary from shipments where code exists in regions for the same code. SQL:
SELECT salary FROM shipments AS shp WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.code = shp.code );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_08581
train
T2
v3
Schema: regions (alias: rgn)(name, amount, code, salary) departments(salary, code, date, amount) Task: Find code from regions where value exceeds the average amount from departments for the same status. SQL:
SELECT code FROM regions AS rgn WHERE value > ( SELECT AVG(amount) FROM departments AS dept WHERE dept.status = rgn.status );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_08582
train
T2
v2
Schema: requests (alias: ordr)(status, name, code, salary) shipments(date, name, value, level) Task: Find id from requests where a matching record exists in shipments with the same id. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = ordr.id );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "id", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_08583
train
T2
v1
Schema: accounts (alias: acct)(amount, status, type, name) services(level, amount, salary, type) Task: Retrieve name from accounts whose type is found in services rows where code matches the outer record. SQL:
SELECT name FROM accounts AS acct WHERE type IN ( SELECT type FROM services AS srvc WHERE srvc.code = acct.code );
{ "outer_table": "accounts", "inner_table": "services", "outer_alias": "acct", "inner_alias": "srvc", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_08584
train
T1
v3
Schema: departments (alias: dept)(amount, status, name, type) categories(name, level, value, code) Task: Find salary from departments where amount exceeds the average amount from categories for the same level. SQL:
SELECT salary FROM departments AS dept WHERE amount > ( SELECT MAX(amount) FROM categories AS catg WHERE catg.level = dept.level );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_08585
train
T1
v2
Schema: products (alias: prod)(value, salary, name, id) managers(type, name, status, amount) Task: Retrieve value from products that have at least one corresponding entry in managers sharing the same id. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = prod.id );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "value", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_08586
train
T1
v2
Schema: categories (alias: catg)(amount, status, salary, date) invoices(date, name, level, salary) Task: Find salary from categories where a matching record exists in invoices with the same type. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = catg.type );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "salary", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_08587
train
T2
v1
Schema: employees (alias: emp)(level, amount, salary, date) transactions(id, date, level, amount) Task: Find name from employees where level appears in transactions entries with matching type. SQL:
SELECT name FROM employees AS emp WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.type = emp.type );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_08588
train
T1
v1
Schema: schedules (alias: schd)(date, name, type, value) products(salary, value, amount, type) Task: Select salary from schedules where type exists in products for the same type. SQL:
SELECT salary FROM schedules AS schd WHERE type IN ( SELECT type FROM products AS prod WHERE prod.type = schd.type );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_08589
train
T2
v2
Schema: transactions (alias: txn)(salary, code, date, amount) items(code, level, value, id) Task: Find name from transactions where a matching record exists in items with the same level. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.level = txn.level );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "name", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_08590
train
T1
v3
Schema: staff (alias: empl)(code, amount, id, salary) shipments(salary, type, id, code) Task: Find id from staff where amount exceeds the average salary from shipments for the same id. SQL:
SELECT id FROM staff AS empl WHERE amount > ( SELECT MAX(salary) FROM shipments AS shp WHERE shp.id = empl.id );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_08591
train
T2
v2
Schema: accounts (alias: acct)(code, value, salary, status) managers(id, type, code, status) Task: Retrieve code from accounts that have at least one corresponding entry in managers sharing the same code. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = acct.code );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "code", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_08592
train
T1
v3
Schema: departments (alias: dept)(status, code, amount, id) transactions(salary, date, amount, id) Task: Find name from departments where amount exceeds the average amount from transactions for the same code. SQL:
SELECT name FROM departments AS dept WHERE amount > ( SELECT SUM(amount) FROM transactions AS txn WHERE txn.code = dept.code );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_08593
train
T1
v3
Schema: regions (alias: rgn)(name, salary, level, id) invoices(type, salary, value, date) Task: Retrieve id from regions with salary above the MIN(value) of invoices rows sharing the same code. SQL:
SELECT id FROM regions AS rgn WHERE salary > ( SELECT MIN(value) FROM invoices AS inv WHERE inv.code = rgn.code );
{ "outer_table": "regions", "inner_table": "invoices", "outer_alias": "rgn", "inner_alias": "inv", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_08594
train
T2
v3
Schema: schedules (alias: schd)(value, name, type, amount) transactions(value, level, salary, type) Task: Retrieve name from schedules with salary above the MIN(salary) of transactions rows sharing the same level. SQL:
SELECT name FROM schedules AS schd WHERE salary > ( SELECT MIN(salary) FROM transactions AS txn WHERE txn.level = schd.level );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_08595
train
T2
v3
Schema: shipments (alias: shp)(salary, amount, date, type) sales(level, amount, date, name) Task: Retrieve id from shipments with value above the SUM(amount) of sales rows sharing the same id. SQL:
SELECT id FROM shipments AS shp WHERE value > ( SELECT SUM(amount) FROM sales AS sale WHERE sale.id = shp.id );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_08596
train
T2
v3
Schema: requests (alias: ordr)(name, id, date, status) orders(date, value, amount, type) Task: Find value from requests where amount exceeds the average value from orders for the same code. SQL:
SELECT value FROM requests AS ordr WHERE amount > ( SELECT COUNT(value) FROM orders AS ord WHERE ord.code = ordr.code );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_08597
train
T2
v1
Schema: staff (alias: empl)(code, level, id, type) sales(date, code, type, status) Task: Select code from staff where code exists in sales for the same code. SQL:
SELECT code FROM staff AS empl WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.code = empl.code );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_08598
train
T2
v1
Schema: customers (alias: cust)(salary, code, amount, value) items(id, name, code, date) Task: Find id from customers where type appears in items entries with matching level. SQL:
SELECT id FROM customers AS cust WHERE type IN ( SELECT type FROM items AS lne WHERE lne.level = cust.level );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_08599
train
T1