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: customers (alias: cust)(salary, value, name, id) shipments(salary, date, type, code) Task: Find name from customers where a matching record exists in shipments with the same status. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = cust.status );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "name", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_03700
train
T1
v1
Schema: invoices (alias: inv)(name, date, type, salary) managers(value, level, amount, salary) Task: Select id from invoices where id exists in managers for the same level. SQL:
SELECT id FROM invoices AS inv WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.level = inv.level );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_03701
train
T1
v2
Schema: sales (alias: sale)(salary, status, level, id) orders(value, id, salary, date) Task: Retrieve name from sales that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = sale.level );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "name", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_03702
train
T1
v3
Schema: customers (alias: cust)(value, id, amount, salary) budgets(code, level, status, amount) Task: Find salary from customers where amount exceeds the average amount from budgets for the same status. SQL:
SELECT salary FROM customers AS cust WHERE amount > ( SELECT MAX(amount) FROM budgets AS budg WHERE budg.status = cust.status );
{ "outer_table": "customers", "inner_table": "budgets", "outer_alias": "cust", "inner_alias": "budg", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_03703
train
T1
v3
Schema: customers (alias: cust)(status, amount, id, level) invoices(code, date, value, amount) Task: Find id from customers where salary exceeds the average salary from invoices for the same level. SQL:
SELECT id FROM customers AS cust WHERE salary > ( SELECT MIN(salary) FROM invoices AS inv WHERE inv.level = cust.level );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_03704
train
T1
v3
Schema: warehouses (alias: whs)(id, name, amount, value) transactions(level, code, salary, name) Task: Find id from warehouses where value exceeds the average value from transactions for the same type. SQL:
SELECT id FROM warehouses AS whs WHERE value > ( SELECT MIN(value) FROM transactions AS txn WHERE txn.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "transactions", "outer_alias": "whs", "inner_alias": "txn", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_03705
train
T2
v3
Schema: customers (alias: cust)(level, status, salary, id) departments(type, date, status, code) Task: Retrieve value from customers with salary above the MIN(amount) of departments rows sharing the same status. SQL:
SELECT value FROM customers AS cust WHERE salary > ( SELECT MIN(amount) FROM departments AS dept WHERE dept.status = cust.status );
{ "outer_table": "customers", "inner_table": "departments", "outer_alias": "cust", "inner_alias": "dept", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_03706
train
T1
v2
Schema: schedules (alias: schd)(date, level, name, value) products(value, amount, salary, status) Task: Find value from schedules where a matching record exists in products with the same type. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = schd.type );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "value", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_03707
train
T2
v1
Schema: managers (alias: mgr)(salary, status, value, level) employees(name, salary, date, value) Task: Retrieve name from managers whose id is found in employees rows where level matches the outer record. SQL:
SELECT name 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": "name", "filter_col": "id", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_03708
train
T1
v3
Schema: products (alias: prod)(salary, amount, date, code) transactions(type, name, code, level) Task: Find salary from products where value exceeds the average value from transactions for the same code. SQL:
SELECT salary FROM products AS prod WHERE value > ( SELECT MAX(value) FROM transactions AS txn WHERE txn.code = prod.code );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_03709
train
T1
v2
Schema: schedules (alias: schd)(type, name, code, level) categories(level, date, type, value) Task: Find value from schedules where a matching record exists in categories with the same code. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = schd.code );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "value", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_03710
train
T2
v1
Schema: requests (alias: ordr)(date, type, salary, amount) staff(type, date, code, status) Task: Retrieve amount from requests whose type is found in staff rows where status matches the outer record. SQL:
SELECT amount FROM requests AS ordr WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.status = ordr.status );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_03711
train
T2
v1
Schema: schedules (alias: schd)(date, id, level, value) warehouses(code, type, salary, level) Task: Select code from schedules where type exists in warehouses for the same type. SQL:
SELECT code FROM schedules AS schd WHERE type IN ( SELECT type FROM warehouses AS whs WHERE whs.type = schd.type );
{ "outer_table": "schedules", "inner_table": "warehouses", "outer_alias": "schd", "inner_alias": "whs", "proj_col": "code", "filter_col": "type", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_03712
train
T2
v2
Schema: services (alias: srvc)(salary, id, name, amount) departments(code, id, name, status) Task: Retrieve amount from services that have at least one corresponding entry in departments sharing the same code. SQL:
SELECT amount FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = srvc.code );
{ "outer_table": "services", "inner_table": "departments", "outer_alias": "srvc", "inner_alias": "dept", "proj_col": "amount", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_03713
train
T2
v3
Schema: regions (alias: rgn)(date, type, amount, status) invoices(salary, status, amount, level) Task: Find id from regions where salary exceeds the average value from invoices for the same code. SQL:
SELECT id FROM regions AS rgn WHERE salary > ( SELECT COUNT(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": "COUNT", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_03714
train
T2
v3
Schema: invoices (alias: inv)(status, name, amount, type) staff(amount, name, code, value) Task: Retrieve id from invoices with amount above the MIN(salary) of staff rows sharing the same status. SQL:
SELECT id FROM invoices AS inv WHERE amount > ( SELECT MIN(salary) FROM staff AS empl WHERE empl.status = inv.status );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_03715
train
T1
v2
Schema: transactions (alias: txn)(value, id, amount, level) regions(amount, date, id, name) Task: Find salary from transactions where a matching record exists in regions with the same code. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = txn.code );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "salary", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_03716
train
T1
v3
Schema: employees (alias: emp)(name, amount, level, date) schedules(salary, amount, date, type) Task: Find id from employees where value exceeds the average amount from schedules for the same type. SQL:
SELECT id FROM employees AS emp WHERE value > ( SELECT SUM(amount) FROM schedules AS schd WHERE schd.type = emp.type );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_03717
train
T1
v2
Schema: managers (alias: mgr)(id, value, salary, code) transactions(amount, value, level, type) Task: Find code from managers where a matching record exists in transactions with the same code. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = mgr.code );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "code", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_03718
train
T1
v2
Schema: regions (alias: rgn)(level, status, id, amount) budgets(type, amount, level, name) Task: Find id from regions where a matching record exists in budgets with the same code. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.code = rgn.code );
{ "outer_table": "regions", "inner_table": "budgets", "outer_alias": "rgn", "inner_alias": "budg", "proj_col": "id", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_03719
train
T2
v3
Schema: departments (alias: dept)(type, amount, name, level) budgets(amount, value, date, salary) Task: Find name from departments where value exceeds the average value from budgets for the same level. SQL:
SELECT name FROM departments AS dept WHERE value > ( SELECT COUNT(value) FROM budgets AS budg WHERE budg.level = dept.level );
{ "outer_table": "departments", "inner_table": "budgets", "outer_alias": "dept", "inner_alias": "budg", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_03720
train
T1
v2
Schema: schedules (alias: schd)(code, status, type, amount) accounts(level, salary, amount, type) Task: Find id from schedules where a matching record exists in accounts with the same level. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = schd.level );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "id", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_03721
train
T2
v1
Schema: departments (alias: dept)(date, level, status, id) regions(id, date, amount, code) Task: Find salary from departments where type appears in regions entries with matching type. SQL:
SELECT salary FROM departments AS dept WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.type = dept.type );
{ "outer_table": "departments", "inner_table": "regions", "outer_alias": "dept", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_03722
train
T1
v3
Schema: managers (alias: mgr)(level, id, value, type) warehouses(amount, status, id, date) Task: Retrieve salary from managers with value above the COUNT(value) of warehouses rows sharing the same status. SQL:
SELECT salary FROM managers AS mgr WHERE value > ( SELECT COUNT(value) FROM warehouses AS whs WHERE whs.status = mgr.status );
{ "outer_table": "managers", "inner_table": "warehouses", "outer_alias": "mgr", "inner_alias": "whs", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_03723
train
T1
v2
Schema: budgets (alias: budg)(date, type, salary, value) orders(salary, value, code, amount) Task: Retrieve name from budgets that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT name FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = budg.code );
{ "outer_table": "budgets", "inner_table": "orders", "outer_alias": "budg", "inner_alias": "ord", "proj_col": "name", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_03724
train
T2
v3
Schema: shipments (alias: shp)(amount, level, name, type) customers(status, level, date, id) Task: Find value from shipments where value exceeds the average value from customers for the same code. SQL:
SELECT value FROM shipments AS shp WHERE value > ( SELECT COUNT(value) FROM customers AS cust WHERE cust.code = shp.code );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_03725
train
T2
v2
Schema: accounts (alias: acct)(name, date, salary, amount) managers(code, type, date, salary) Task: Retrieve id from accounts that have at least one corresponding entry in managers sharing the same status. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = acct.status );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "id", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_03726
train
T1
v1
Schema: schedules (alias: schd)(level, id, name, amount) budgets(id, status, type, code) Task: Retrieve salary from schedules whose status is found in budgets rows where id matches the outer record. SQL:
SELECT salary FROM schedules AS schd WHERE status IN ( SELECT status FROM budgets AS budg WHERE budg.id = schd.id );
{ "outer_table": "schedules", "inner_table": "budgets", "outer_alias": "schd", "inner_alias": "budg", "proj_col": "salary", "filter_col": "status", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_03727
train
T2
v1
Schema: departments (alias: dept)(name, salary, date, id) products(code, amount, level, name) Task: Find amount from departments where code appears in products entries with matching id. SQL:
SELECT amount FROM departments AS dept WHERE code IN ( SELECT code FROM products AS prod WHERE prod.id = dept.id );
{ "outer_table": "departments", "inner_table": "products", "outer_alias": "dept", "inner_alias": "prod", "proj_col": "amount", "filter_col": "code", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_03728
train
T1
v1
Schema: warehouses (alias: whs)(id, date, type, code) services(salary, value, level, id) Task: Select salary from warehouses where status exists in services for the same level. SQL:
SELECT salary FROM warehouses AS whs WHERE status IN ( SELECT status FROM services AS srvc WHERE srvc.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "services", "outer_alias": "whs", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_03729
train
T2
v3
Schema: staff (alias: empl)(amount, date, level, name) departments(value, date, amount, status) Task: Find value from staff where salary exceeds the average value from departments for the same code. SQL:
SELECT value FROM staff AS empl WHERE salary > ( SELECT COUNT(value) FROM departments AS dept WHERE dept.code = empl.code );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_03730
train
T2
v3
Schema: accounts (alias: acct)(type, name, id, level) warehouses(value, status, date, salary) Task: Retrieve id from accounts with value above the AVG(value) of warehouses rows sharing the same type. SQL:
SELECT id FROM accounts AS acct WHERE value > ( SELECT AVG(value) FROM warehouses AS whs WHERE whs.type = acct.type );
{ "outer_table": "accounts", "inner_table": "warehouses", "outer_alias": "acct", "inner_alias": "whs", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_03731
train
T1
v2
Schema: schedules (alias: schd)(name, amount, level, status) budgets(id, amount, salary, value) Task: Find value from schedules where a matching record exists in budgets with the same code. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.code = schd.code );
{ "outer_table": "schedules", "inner_table": "budgets", "outer_alias": "schd", "inner_alias": "budg", "proj_col": "value", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_03732
train
T2
v3
Schema: employees (alias: emp)(code, value, type, date) accounts(salary, level, code, id) Task: Retrieve salary from employees with amount above the AVG(value) of accounts rows sharing the same code. SQL:
SELECT salary FROM employees AS emp WHERE amount > ( SELECT AVG(value) FROM accounts AS acct WHERE acct.code = emp.code );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_03733
train
T1
v1
Schema: transactions (alias: txn)(salary, code, level, status) employees(salary, level, type, code) Task: Select value from transactions where level exists in employees for the same type. SQL:
SELECT value FROM transactions AS txn WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.type = txn.type );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_03734
train
T1
v1
Schema: sales (alias: sale)(value, type, amount, date) customers(salary, name, date, amount) Task: Find id from sales where status appears in customers entries with matching id. SQL:
SELECT id FROM sales AS sale WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.id = sale.id );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_03735
train
T1
v1
Schema: staff (alias: empl)(code, amount, status, value) customers(amount, code, name, date) Task: Find value from staff where status appears in customers entries with matching id. SQL:
SELECT value FROM staff AS empl WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.id = empl.id );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_03736
train
T2
v1
Schema: budgets (alias: budg)(salary, amount, level, code) accounts(salary, date, value, name) Task: Select name from budgets where id exists in accounts for the same id. SQL:
SELECT name FROM budgets AS budg WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.id = budg.id );
{ "outer_table": "budgets", "inner_table": "accounts", "outer_alias": "budg", "inner_alias": "acct", "proj_col": "name", "filter_col": "id", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_03737
train
T2
v2
Schema: accounts (alias: acct)(value, id, code, status) invoices(level, code, date, name) Task: Retrieve code from accounts that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT code 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": "code", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_03738
train
T1
v2
Schema: managers (alias: mgr)(level, type, salary, name) regions(date, amount, type, status) Task: Retrieve salary from managers that have at least one corresponding entry in regions sharing the same status. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = mgr.status );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "salary", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_03739
train
T1
v3
Schema: items (alias: lne)(value, level, amount, name) employees(date, id, value, type) Task: Retrieve id from items with amount above the MIN(value) of employees rows sharing the same type. SQL:
SELECT id FROM items AS lne WHERE amount > ( SELECT MIN(value) FROM employees AS emp WHERE emp.type = lne.type );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_03740
train
T2
v3
Schema: transactions (alias: txn)(date, id, type, value) invoices(salary, code, id, value) Task: Retrieve code from transactions with amount above the SUM(amount) of invoices rows sharing the same code. SQL:
SELECT code FROM transactions AS txn WHERE amount > ( SELECT SUM(amount) FROM invoices AS inv WHERE inv.code = txn.code );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_03741
train
T1
v3
Schema: sales (alias: sale)(salary, amount, date, value) regions(name, date, status, amount) Task: Retrieve value from sales with salary above the MAX(amount) of regions rows sharing the same level. SQL:
SELECT value FROM sales AS sale WHERE salary > ( SELECT MAX(amount) FROM regions AS rgn WHERE rgn.level = sale.level );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_03742
train
T1
v2
Schema: services (alias: srvc)(level, code, amount, type) invoices(type, salary, id, date) Task: Retrieve id from services that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT id FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = srvc.id );
{ "outer_table": "services", "inner_table": "invoices", "outer_alias": "srvc", "inner_alias": "inv", "proj_col": "id", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_03743
train
T2
v1
Schema: regions (alias: rgn)(status, date, amount, value) accounts(value, type, date, status) Task: Select id from regions where level exists in accounts for the same code. SQL:
SELECT id FROM regions AS rgn WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.code = rgn.code );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "rgn", "inner_alias": "acct", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_03744
train
T2
v3
Schema: accounts (alias: acct)(amount, code, level, id) requests(type, level, status, amount) Task: Find code from accounts where amount exceeds the average value from requests for the same status. SQL:
SELECT code FROM accounts AS acct WHERE amount > ( SELECT SUM(value) FROM requests AS ordr WHERE ordr.status = acct.status );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_03745
train
T1
v1
Schema: items (alias: lne)(name, code, date, type) warehouses(level, status, id, salary) Task: Retrieve name from items whose status is found in warehouses rows where level matches the outer record. SQL:
SELECT name FROM items AS lne WHERE status IN ( SELECT status FROM warehouses AS whs WHERE whs.level = lne.level );
{ "outer_table": "items", "inner_table": "warehouses", "outer_alias": "lne", "inner_alias": "whs", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_03746
train
T2
v3
Schema: staff (alias: empl)(status, salary, amount, code) managers(date, name, type, salary) Task: Retrieve id from staff with salary above the SUM(value) of managers rows sharing the same id. SQL:
SELECT id FROM staff AS empl WHERE salary > ( SELECT SUM(value) FROM managers AS mgr WHERE mgr.id = empl.id );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_03747
train
T2
v1
Schema: categories (alias: catg)(salary, status, type, id) shipments(level, salary, id, code) Task: Find value from categories where id appears in shipments entries with matching id. SQL:
SELECT value FROM categories AS catg WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.id = catg.id );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "catg", "inner_alias": "shp", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_03748
train
T2
v2
Schema: accounts (alias: acct)(amount, salary, id, level) items(name, code, date, status) Task: Find value from accounts where a matching record exists in items with the same type. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = acct.type );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "value", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_03749
train
T1
v1
Schema: budgets (alias: budg)(value, name, salary, level) warehouses(value, id, name, salary) Task: Select value from budgets where status exists in warehouses for the same type. SQL:
SELECT value FROM budgets AS budg WHERE status IN ( SELECT status FROM warehouses AS whs WHERE whs.type = budg.type );
{ "outer_table": "budgets", "inner_table": "warehouses", "outer_alias": "budg", "inner_alias": "whs", "proj_col": "value", "filter_col": "status", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_03750
train
T2
v3
Schema: accounts (alias: acct)(salary, date, code, status) requests(value, type, status, name) Task: Retrieve salary from accounts with value above the SUM(amount) of requests rows sharing the same level. SQL:
SELECT salary FROM accounts AS acct WHERE value > ( SELECT SUM(amount) FROM requests AS ordr WHERE ordr.level = acct.level );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_03751
train
T1
v3
Schema: budgets (alias: budg)(salary, name, amount, id) products(level, status, name, salary) Task: Retrieve amount from budgets with salary above the AVG(amount) of products rows sharing the same status. SQL:
SELECT amount FROM budgets AS budg WHERE salary > ( SELECT AVG(amount) FROM products AS prod WHERE prod.status = budg.status );
{ "outer_table": "budgets", "inner_table": "products", "outer_alias": "budg", "inner_alias": "prod", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_03752
train
T2
v3
Schema: requests (alias: ordr)(value, status, amount, salary) sales(status, type, amount, level) Task: Retrieve code from requests with salary above the MIN(amount) of sales rows sharing the same status. SQL:
SELECT code FROM requests AS ordr WHERE salary > ( SELECT MIN(amount) FROM sales AS sale WHERE sale.status = ordr.status );
{ "outer_table": "requests", "inner_table": "sales", "outer_alias": "ordr", "inner_alias": "sale", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_03753
train
T2
v3
Schema: departments (alias: dept)(type, id, salary, level) shipments(status, level, date, name) Task: Retrieve code from departments with salary above the MAX(amount) of shipments rows sharing the same id. SQL:
SELECT code FROM departments AS dept WHERE salary > ( SELECT MAX(amount) FROM shipments AS shp WHERE shp.id = dept.id );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_03754
train
T1
v3
Schema: products (alias: prod)(code, status, type, salary) orders(status, date, level, id) Task: Retrieve id from products with value above the AVG(amount) of orders rows sharing the same level. SQL:
SELECT id FROM products AS prod WHERE value > ( SELECT AVG(amount) FROM orders AS ord WHERE ord.level = prod.level );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_03755
train
T1
v2
Schema: managers (alias: mgr)(salary, date, status, name) orders(date, value, salary, amount) Task: Retrieve amount from managers that have at least one corresponding entry in orders sharing the same type. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = mgr.type );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "amount", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_03756
train
T1
v1
Schema: schedules (alias: schd)(name, status, date, code) orders(name, type, id, level) Task: Retrieve id from schedules whose code is found in orders rows where type matches the outer record. SQL:
SELECT id FROM schedules AS schd WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.type = schd.type );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "id", "filter_col": "code", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_03757
train
T2
v3
Schema: employees (alias: emp)(date, name, level, salary) sales(status, salary, level, type) Task: Find id from employees where value exceeds the average amount from sales for the same id. SQL:
SELECT id FROM employees AS emp WHERE value > ( SELECT COUNT(amount) FROM sales AS sale WHERE sale.id = emp.id );
{ "outer_table": "employees", "inner_table": "sales", "outer_alias": "emp", "inner_alias": "sale", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_03758
train
T1
v3
Schema: orders (alias: ord)(amount, status, salary, code) invoices(salary, code, value, amount) Task: Retrieve code from orders with value above the MAX(value) of invoices rows sharing the same id. SQL:
SELECT code FROM orders AS ord WHERE value > ( SELECT MAX(value) FROM invoices AS inv WHERE inv.id = ord.id );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_03759
train
T1
v2
Schema: services (alias: srvc)(status, type, code, date) products(value, id, salary, type) Task: Find amount from services where a matching record exists in products with the same id. SQL:
SELECT amount FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = srvc.id );
{ "outer_table": "services", "inner_table": "products", "outer_alias": "srvc", "inner_alias": "prod", "proj_col": "amount", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_03760
train
T2
v2
Schema: items (alias: lne)(name, salary, level, value) departments(value, amount, status, name) Task: Find salary from items where a matching record exists in departments with the same status. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = lne.status );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "salary", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_03761
train
T2
v3
Schema: requests (alias: ordr)(id, salary, level, value) schedules(code, salary, level, name) Task: Find salary from requests where value exceeds the average salary from schedules for the same status. SQL:
SELECT salary FROM requests AS ordr WHERE value > ( SELECT MIN(salary) FROM schedules AS schd WHERE schd.status = ordr.status );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_03762
train
T2
v3
Schema: sales (alias: sale)(code, date, amount, value) employees(type, amount, date, value) Task: Find salary from sales where salary exceeds the average value from employees for the same type. SQL:
SELECT salary FROM sales AS sale WHERE salary > ( SELECT MAX(value) FROM employees AS emp WHERE emp.type = sale.type );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_03763
train
T1
v1
Schema: invoices (alias: inv)(type, amount, date, id) products(level, code, amount, value) Task: Select id from invoices where code exists in products for the same code. SQL:
SELECT id FROM invoices AS inv WHERE code IN ( SELECT code FROM products AS prod WHERE prod.code = inv.code );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_03764
train
T1
v3
Schema: invoices (alias: inv)(salary, code, amount, date) regions(name, code, salary, value) Task: Find salary from invoices where salary exceeds the average amount from regions for the same type. SQL:
SELECT salary FROM invoices AS inv WHERE salary > ( SELECT SUM(amount) FROM regions AS rgn WHERE rgn.type = inv.type );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_03765
train
T1
v1
Schema: invoices (alias: inv)(amount, type, salary, level) regions(value, salary, date, name) Task: Retrieve salary from invoices whose status is found in regions rows where type matches the outer record. SQL:
SELECT salary FROM invoices AS inv WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.type = inv.type );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_03766
train
T1
v3
Schema: orders (alias: ord)(level, date, status, name) accounts(amount, id, date, status) Task: Find salary from orders where salary exceeds the average value from accounts for the same code. SQL:
SELECT salary FROM orders AS ord WHERE salary > ( SELECT SUM(value) FROM accounts AS acct WHERE acct.code = ord.code );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_03767
train
T1
v3
Schema: categories (alias: catg)(id, level, salary, code) orders(amount, status, salary, type) Task: Retrieve amount from categories with amount above the SUM(value) of orders rows sharing the same id. SQL:
SELECT amount FROM categories AS catg WHERE amount > ( SELECT SUM(value) FROM orders AS ord WHERE ord.id = catg.id );
{ "outer_table": "categories", "inner_table": "orders", "outer_alias": "catg", "inner_alias": "ord", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_03768
train
T2
v1
Schema: warehouses (alias: whs)(date, level, value, id) staff(code, id, salary, level) Task: Find amount from warehouses where id appears in staff entries with matching status. SQL:
SELECT amount 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": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_03769
train
T2
v1
Schema: employees (alias: emp)(date, level, id, status) warehouses(id, code, type, name) Task: Select value from employees where type exists in warehouses for the same level. SQL:
SELECT value FROM employees AS emp WHERE type IN ( SELECT type FROM warehouses AS whs WHERE whs.level = emp.level );
{ "outer_table": "employees", "inner_table": "warehouses", "outer_alias": "emp", "inner_alias": "whs", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_03770
train
T1
v1
Schema: requests (alias: ordr)(level, date, type, value) transactions(id, date, name, type) Task: Retrieve name from requests whose id is found in transactions rows where code matches the outer record. SQL:
SELECT name FROM requests AS ordr WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.code = ordr.code );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_03771
train
T2
v3
Schema: managers (alias: mgr)(code, date, value, amount) staff(level, status, id, type) Task: Retrieve code from managers with value above the COUNT(value) of staff rows sharing the same level. SQL:
SELECT code FROM managers AS mgr WHERE value > ( SELECT COUNT(value) FROM staff AS empl WHERE empl.level = mgr.level );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_03772
train
T1
v1
Schema: requests (alias: ordr)(value, id, name, status) budgets(value, code, name, id) Task: Find id from requests where type appears in budgets entries with matching type. SQL:
SELECT id FROM requests AS ordr WHERE type IN ( SELECT type FROM budgets AS budg WHERE budg.type = ordr.type );
{ "outer_table": "requests", "inner_table": "budgets", "outer_alias": "ordr", "inner_alias": "budg", "proj_col": "id", "filter_col": "type", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_03773
train
T2
v3
Schema: employees (alias: emp)(level, salary, amount, name) budgets(status, id, value, level) Task: Retrieve name from employees with value above the AVG(salary) of budgets rows sharing the same level. SQL:
SELECT name FROM employees AS emp WHERE value > ( SELECT AVG(salary) FROM budgets AS budg WHERE budg.level = emp.level );
{ "outer_table": "employees", "inner_table": "budgets", "outer_alias": "emp", "inner_alias": "budg", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_03774
train
T1
v2
Schema: employees (alias: emp)(date, code, level, name) orders(salary, id, name, code) Task: Find amount from employees where a matching record exists in orders with the same level. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = emp.level );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "amount", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_03775
train
T1
v3
Schema: categories (alias: catg)(type, code, amount, name) orders(status, code, level, salary) Task: Retrieve id from categories with salary above the MAX(value) of orders rows sharing the same id. SQL:
SELECT id FROM categories AS catg WHERE salary > ( SELECT MAX(value) FROM orders AS ord WHERE ord.id = catg.id );
{ "outer_table": "categories", "inner_table": "orders", "outer_alias": "catg", "inner_alias": "ord", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_03776
train
T2
v2
Schema: categories (alias: catg)(name, value, id, type) items(name, level, type, salary) Task: Find id from categories where a matching record exists in items with the same id. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.id = catg.id );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "id", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_03777
train
T2
v3
Schema: budgets (alias: budg)(code, status, date, name) items(amount, level, id, date) Task: Retrieve amount from budgets with value above the SUM(salary) of items rows sharing the same status. SQL:
SELECT amount FROM budgets AS budg WHERE value > ( SELECT SUM(salary) FROM items AS lne WHERE lne.status = budg.status );
{ "outer_table": "budgets", "inner_table": "items", "outer_alias": "budg", "inner_alias": "lne", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_03778
train
T2
v2
Schema: categories (alias: catg)(amount, salary, type, date) accounts(date, level, id, status) Task: Retrieve code from categories that have at least one corresponding entry in accounts sharing the same code. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = catg.code );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "code", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_03779
train
T2
v2
Schema: departments (alias: dept)(salary, level, status, value) transactions(amount, date, name, code) Task: Find name from departments where a matching record exists in transactions with the same level. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = dept.level );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "name", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_03780
train
T1
v2
Schema: schedules (alias: schd)(type, salary, date, code) managers(salary, code, id, amount) Task: Find amount from schedules where a matching record exists in managers with the same status. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = schd.status );
{ "outer_table": "schedules", "inner_table": "managers", "outer_alias": "schd", "inner_alias": "mgr", "proj_col": "amount", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_03781
train
T2
v2
Schema: categories (alias: catg)(value, id, status, name) departments(amount, id, level, value) Task: Find amount from categories where a matching record exists in departments with the same type. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = catg.type );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "amount", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_03782
train
T2
v1
Schema: items (alias: lne)(code, level, value, id) requests(amount, type, date, status) Task: Find code from items where code appears in requests entries with matching type. SQL:
SELECT code FROM items AS lne WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.type = lne.type );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "code", "filter_col": "code", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_03783
train
T2
v2
Schema: regions (alias: rgn)(level, amount, type, date) budgets(status, type, level, amount) Task: Retrieve value from regions that have at least one corresponding entry in budgets sharing the same id. SQL:
SELECT value FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.id = rgn.id );
{ "outer_table": "regions", "inner_table": "budgets", "outer_alias": "rgn", "inner_alias": "budg", "proj_col": "value", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_03784
train
T2
v1
Schema: schedules (alias: schd)(name, value, level, amount) staff(name, code, date, value) Task: Find value from schedules where type appears in staff entries with matching status. SQL:
SELECT value FROM schedules AS schd WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.status = schd.status );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_03785
train
T2
v1
Schema: warehouses (alias: whs)(amount, code, name, salary) orders(value, salary, amount, code) Task: Find value from warehouses where level appears in orders entries with matching status. SQL:
SELECT value FROM warehouses AS whs WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "orders", "outer_alias": "whs", "inner_alias": "ord", "proj_col": "value", "filter_col": "level", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_03786
train
T2
v2
Schema: requests (alias: ordr)(date, id, level, salary) managers(value, id, salary, level) Task: Find code from requests where a matching record exists in managers with the same type. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = ordr.type );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "code", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_03787
train
T2
v3
Schema: invoices (alias: inv)(id, type, value, amount) items(amount, id, level, value) Task: Retrieve name from invoices with value above the MAX(amount) of items rows sharing the same code. SQL:
SELECT name FROM invoices AS inv WHERE value > ( SELECT MAX(amount) FROM items AS lne WHERE lne.code = inv.code );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_03788
train
T1
v1
Schema: regions (alias: rgn)(id, level, date, code) departments(name, code, level, id) Task: Select id from regions where level exists in departments for the same level. SQL:
SELECT id FROM regions AS rgn WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.level = rgn.level );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_03789
train
T2
v2
Schema: requests (alias: ordr)(salary, type, date, amount) schedules(amount, code, name, level) Task: Retrieve amount from requests that have at least one corresponding entry in schedules sharing the same code. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = ordr.code );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "amount", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_03790
train
T2
v3
Schema: employees (alias: emp)(date, code, type, value) accounts(id, name, level, salary) Task: Find name from employees where salary exceeds the average salary from accounts for the same code. SQL:
SELECT name FROM employees AS emp WHERE salary > ( SELECT SUM(salary) FROM accounts AS acct WHERE acct.code = emp.code );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_03791
train
T1
v2
Schema: employees (alias: emp)(id, code, date, amount) managers(level, value, name, salary) Task: Find name from employees where a matching record exists in managers with the same id. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = emp.id );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "name", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_03792
train
T1
v1
Schema: employees (alias: emp)(amount, name, salary, type) departments(status, name, level, date) Task: Find amount from employees where level appears in departments entries with matching code. SQL:
SELECT amount FROM employees AS emp WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.code = emp.code );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_03793
train
T1
v2
Schema: warehouses (alias: whs)(salary, code, level, id) transactions(code, name, type, status) Task: Retrieve salary from warehouses that have at least one corresponding entry in transactions sharing the same code. SQL:
SELECT salary FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "transactions", "outer_alias": "whs", "inner_alias": "txn", "proj_col": "salary", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_03794
train
T2
v2
Schema: orders (alias: ord)(type, salary, amount, date) customers(name, salary, code, id) Task: Find name from orders where a matching record exists in customers with the same level. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = ord.level );
{ "outer_table": "orders", "inner_table": "customers", "outer_alias": "ord", "inner_alias": "cust", "proj_col": "name", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_03795
train
T1
v1
Schema: invoices (alias: inv)(date, salary, level, type) transactions(level, id, type, amount) Task: Find name from invoices where id appears in transactions entries with matching level. SQL:
SELECT name FROM invoices AS inv WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.level = inv.level );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "name", "filter_col": "id", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_03796
train
T1
v3
Schema: schedules (alias: schd)(amount, code, id, level) staff(id, status, value, name) Task: Retrieve name from schedules with salary above the MIN(salary) of staff rows sharing the same id. SQL:
SELECT name FROM schedules AS schd WHERE salary > ( SELECT MIN(salary) FROM staff AS empl WHERE empl.id = schd.id );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_03797
train
T2
v3
Schema: items (alias: lne)(type, level, amount, salary) customers(type, value, date, amount) Task: Find id from items where amount exceeds the average value from customers for the same level. SQL:
SELECT id FROM items AS lne WHERE amount > ( SELECT COUNT(value) FROM customers AS cust WHERE cust.level = lne.level );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_03798
train
T2
v1
Schema: items (alias: lne)(type, amount, id, level) schedules(level, code, status, name) Task: Retrieve value from items whose id is found in schedules rows where code matches the outer record. SQL:
SELECT value FROM items AS lne WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.code = lne.code );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_03799
train
T2