Dataset Viewer
Auto-converted to Parquet Duplicate
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: customers (alias: cust)(amount, status, name, date) schedules(level, code, name, value) Task: Find id from customers where type appears in schedules entries with matching level. SQL:
SELECT id FROM customers AS cust WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.level = cust.level );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_00000
train
T1
v2
Schema: departments (alias: dept)(status, code, id, level) products(level, amount, date, name) Task: Find salary from departments where a matching record exists in products with the same id. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = dept.id );
{ "outer_table": "departments", "inner_table": "products", "outer_alias": "dept", "inner_alias": "prod", "proj_col": "salary", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_00001
train
T1
v3
Schema: warehouses (alias: whs)(name, amount, status, salary) regions(status, level, amount, name) Task: Find id from warehouses where value exceeds the average salary from regions for the same code. SQL:
SELECT id FROM warehouses AS whs WHERE value > ( SELECT AVG(salary) FROM regions AS rgn WHERE rgn.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "regions", "outer_alias": "whs", "inner_alias": "rgn", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_00002
train
T2
v2
Schema: employees (alias: emp)(name, date, level, status) orders(salary, type, value, status) Task: Find id from employees where a matching record exists in orders with the same status. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = emp.status );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "id", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_00003
train
T1
v1
Schema: departments (alias: dept)(code, type, level, id) requests(date, value, type, code) Task: Retrieve name from departments whose id is found in requests rows where code matches the outer record. SQL:
SELECT name FROM departments AS dept WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.code = dept.code );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_00004
train
T1
v3
Schema: warehouses (alias: whs)(name, date, type, level) regions(date, value, name, level) Task: Retrieve code from warehouses with value above the AVG(value) of regions rows sharing the same type. SQL:
SELECT code FROM warehouses AS whs WHERE value > ( SELECT AVG(value) FROM regions AS rgn WHERE rgn.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "regions", "outer_alias": "whs", "inner_alias": "rgn", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_00005
train
T2
v1
Schema: regions (alias: rgn)(value, id, amount, level) staff(date, amount, level, salary) Task: Find salary from regions where type appears in staff entries with matching code. SQL:
SELECT salary FROM regions AS rgn WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.code = rgn.code );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "salary", "filter_col": "type", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_00006
train
T2
v2
Schema: sales (alias: sale)(salary, name, status, date) warehouses(salary, id, type, level) Task: Retrieve name from sales that have at least one corresponding entry in warehouses sharing the same code. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.code = sale.code );
{ "outer_table": "sales", "inner_table": "warehouses", "outer_alias": "sale", "inner_alias": "whs", "proj_col": "name", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_00007
train
T1
v3
Schema: items (alias: lne)(type, status, code, date) products(value, level, amount, status) Task: Find salary from items where salary exceeds the average value from products for the same type. SQL:
SELECT salary FROM items AS lne WHERE salary > ( SELECT COUNT(value) FROM products AS prod WHERE prod.type = lne.type );
{ "outer_table": "items", "inner_table": "products", "outer_alias": "lne", "inner_alias": "prod", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_00008
train
T2
v1
Schema: managers (alias: mgr)(amount, name, type, code) warehouses(amount, code, status, date) Task: Find value from managers where type appears in warehouses entries with matching type. SQL:
SELECT value FROM managers AS mgr WHERE type IN ( SELECT type FROM warehouses AS whs WHERE whs.type = mgr.type );
{ "outer_table": "managers", "inner_table": "warehouses", "outer_alias": "mgr", "inner_alias": "whs", "proj_col": "value", "filter_col": "type", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_00009
train
T1
v1
Schema: transactions (alias: txn)(id, code, type, date) employees(name, status, code, id) Task: Retrieve amount from transactions whose type is found in employees rows where level matches the outer record. SQL:
SELECT amount FROM transactions AS txn WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.level = txn.level );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_00010
train
T1
v1
Schema: employees (alias: emp)(amount, type, status, name) orders(id, date, type, salary) Task: Retrieve id from employees whose id is found in orders rows where status matches the outer record. SQL:
SELECT id FROM employees AS emp WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.status = emp.status );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "id", "filter_col": "id", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_00011
train
T1
v2
Schema: services (alias: srvc)(salary, level, date, code) categories(name, salary, code, level) Task: Find value from services where a matching record exists in categories with the same status. SQL:
SELECT value FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = srvc.status );
{ "outer_table": "services", "inner_table": "categories", "outer_alias": "srvc", "inner_alias": "catg", "proj_col": "value", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_00012
train
T2
v2
Schema: schedules (alias: schd)(salary, code, amount, level) staff(name, code, id, date) Task: Retrieve salary from schedules that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = schd.type );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "salary", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_00013
train
T2
v3
Schema: orders (alias: ord)(date, name, level, value) sales(date, value, type, name) Task: Find id from orders where salary exceeds the average amount from sales for the same id. SQL:
SELECT id FROM orders AS ord WHERE salary > ( SELECT AVG(amount) FROM sales AS sale WHERE sale.id = ord.id );
{ "outer_table": "orders", "inner_table": "sales", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_00014
train
T1
v3
Schema: transactions (alias: txn)(code, status, date, amount) schedules(amount, level, name, code) Task: Retrieve salary from transactions with salary above the AVG(amount) of schedules rows sharing the same code. SQL:
SELECT salary FROM transactions AS txn WHERE salary > ( SELECT AVG(amount) FROM schedules AS schd WHERE schd.code = txn.code );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_00015
train
T1
v1
Schema: sales (alias: sale)(code, value, name, salary) requests(code, id, date, value) Task: Select value from sales where id exists in requests for the same code. SQL:
SELECT value FROM sales AS sale WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.code = sale.code );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_00016
train
T1
v2
Schema: invoices (alias: inv)(level, date, value, id) items(type, id, code, amount) Task: Retrieve salary from invoices that have at least one corresponding entry in items sharing the same status. SQL:
SELECT salary FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = inv.status );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "salary", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_00017
train
T1
v2
Schema: regions (alias: rgn)(value, amount, code, status) services(amount, value, date, status) Task: Find id from regions where a matching record exists in services with the same status. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.status = rgn.status );
{ "outer_table": "regions", "inner_table": "services", "outer_alias": "rgn", "inner_alias": "srvc", "proj_col": "id", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_00018
train
T2
v1
Schema: items (alias: lne)(type, level, value, salary) requests(name, amount, id, level) Task: Retrieve name from items whose status is found in requests rows where level matches the outer record. SQL:
SELECT name FROM items AS lne WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.level = lne.level );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_00019
train
T2
v2
Schema: regions (alias: rgn)(amount, type, status, level) schedules(type, date, salary, level) Task: Retrieve code from regions that have at least one corresponding entry in schedules sharing the same type. SQL:
SELECT code FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = rgn.type );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "code", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_00020
train
T2
v2
Schema: sales (alias: sale)(code, type, amount, status) orders(level, id, type, status) Task: Find code from sales where a matching record exists in orders with the same code. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = sale.code );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "code", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_00021
train
T1
v1
Schema: requests (alias: ordr)(salary, amount, level, date) departments(date, value, status, code) Task: Find salary from requests where code appears in departments entries with matching status. SQL:
SELECT salary FROM requests AS ordr WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.status = ordr.status );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_00022
train
T2
v2
Schema: categories (alias: catg)(value, salary, amount, level) customers(amount, salary, value, level) Task: Retrieve value from categories that have at least one corresponding entry in customers sharing the same level. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = catg.level );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "value", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_00023
train
T2
v3
Schema: items (alias: lne)(amount, type, salary, date) schedules(value, name, type, amount) Task: Find amount from items where amount exceeds the average salary from schedules for the same id. SQL:
SELECT amount FROM items AS lne WHERE amount > ( SELECT COUNT(salary) FROM schedules AS schd WHERE schd.id = lne.id );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_00024
train
T2
v1
Schema: accounts (alias: acct)(date, code, status, amount) categories(status, value, name, amount) Task: Select salary from accounts where status exists in categories for the same level. SQL:
SELECT salary FROM accounts AS acct WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.level = acct.level );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_00025
train
T1
v1
Schema: warehouses (alias: whs)(salary, level, amount, type) sales(amount, type, id, salary) Task: Find amount from warehouses where id appears in sales entries with matching type. SQL:
SELECT amount FROM warehouses AS whs WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "sales", "outer_alias": "whs", "inner_alias": "sale", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_00026
train
T2
v3
Schema: shipments (alias: shp)(date, id, status, level) departments(id, date, status, code) Task: Retrieve code from shipments with salary above the COUNT(salary) of departments rows sharing the same status. SQL:
SELECT code FROM shipments AS shp WHERE salary > ( SELECT COUNT(salary) FROM departments AS dept WHERE dept.status = shp.status );
{ "outer_table": "shipments", "inner_table": "departments", "outer_alias": "shp", "inner_alias": "dept", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_00027
train
T2
v2
Schema: accounts (alias: acct)(id, date, type, value) services(status, value, id, type) Task: Find value from accounts where a matching record exists in services with the same type. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.type = acct.type );
{ "outer_table": "accounts", "inner_table": "services", "outer_alias": "acct", "inner_alias": "srvc", "proj_col": "value", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_00028
train
T1
v1
Schema: budgets (alias: budg)(salary, name, code, type) requests(id, level, date, salary) Task: Retrieve amount from budgets whose type is found in requests rows where type matches the outer record. SQL:
SELECT amount FROM budgets AS budg WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.type = budg.type );
{ "outer_table": "budgets", "inner_table": "requests", "outer_alias": "budg", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_00029
train
T2
v1
Schema: invoices (alias: inv)(status, code, date, type) managers(level, type, code, id) Task: Retrieve name from invoices whose code is found in managers rows where id matches the outer record. SQL:
SELECT name FROM invoices AS inv WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.id = inv.id );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_00030
train
T1
v3
Schema: warehouses (alias: whs)(code, status, value, name) schedules(status, level, name, date) Task: Find salary from warehouses where salary exceeds the average value from schedules for the same code. SQL:
SELECT salary FROM warehouses AS whs WHERE salary > ( SELECT AVG(value) FROM schedules AS schd WHERE schd.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "schedules", "outer_alias": "whs", "inner_alias": "schd", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_00031
train
T2
v3
Schema: departments (alias: dept)(amount, salary, level, status) budgets(salary, status, level, id) Task: Retrieve amount from departments with value above the COUNT(salary) of budgets rows sharing the same level. SQL:
SELECT amount FROM departments AS dept WHERE value > ( SELECT COUNT(salary) FROM budgets AS budg WHERE budg.level = dept.level );
{ "outer_table": "departments", "inner_table": "budgets", "outer_alias": "dept", "inner_alias": "budg", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_00032
train
T1
v1
Schema: departments (alias: dept)(value, status, level, name) employees(value, level, salary, type) Task: Find amount from departments where type appears in employees entries with matching id. SQL:
SELECT amount FROM departments AS dept WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.id = dept.id );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_00033
train
T1
v3
Schema: services (alias: srvc)(type, value, date, code) schedules(salary, id, level, name) Task: Retrieve value from services with amount above the COUNT(salary) of schedules rows sharing the same id. SQL:
SELECT value FROM services AS srvc WHERE amount > ( SELECT COUNT(salary) FROM schedules AS schd WHERE schd.id = srvc.id );
{ "outer_table": "services", "inner_table": "schedules", "outer_alias": "srvc", "inner_alias": "schd", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_00034
train
T2
v3
Schema: services (alias: srvc)(value, code, id, type) budgets(id, name, code, amount) Task: Find value from services where amount exceeds the average value from budgets for the same id. SQL:
SELECT value FROM services AS srvc WHERE amount > ( SELECT MAX(value) FROM budgets AS budg WHERE budg.id = srvc.id );
{ "outer_table": "services", "inner_table": "budgets", "outer_alias": "srvc", "inner_alias": "budg", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_00035
train
T2
v1
Schema: employees (alias: emp)(value, code, date, id) staff(type, id, level, date) Task: Select amount from employees where code exists in staff for the same code. SQL:
SELECT amount FROM employees AS emp WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.code = emp.code );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_00036
train
T1
v3
Schema: products (alias: prod)(name, date, status, code) accounts(status, date, code, value) Task: Find salary from products where amount exceeds the average amount from accounts for the same level. SQL:
SELECT salary FROM products AS prod WHERE amount > ( SELECT MIN(amount) FROM accounts AS acct WHERE acct.level = prod.level );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_00037
train
T1
v3
Schema: services (alias: srvc)(status, value, id, code) staff(type, salary, amount, value) Task: Find amount from services where value exceeds the average salary from staff for the same code. SQL:
SELECT amount FROM services AS srvc WHERE value > ( SELECT COUNT(salary) FROM staff AS empl WHERE empl.code = srvc.code );
{ "outer_table": "services", "inner_table": "staff", "outer_alias": "srvc", "inner_alias": "empl", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_00038
train
T2
v1
Schema: budgets (alias: budg)(level, id, date, type) regions(level, amount, date, status) Task: Find code from budgets where type appears in regions entries with matching status. SQL:
SELECT code FROM budgets AS budg WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.status = budg.status );
{ "outer_table": "budgets", "inner_table": "regions", "outer_alias": "budg", "inner_alias": "rgn", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_00039
train
T2
v2
Schema: budgets (alias: budg)(type, salary, date, name) accounts(value, amount, code, status) Task: Retrieve id from budgets that have at least one corresponding entry in accounts sharing the same code. SQL:
SELECT id FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = budg.code );
{ "outer_table": "budgets", "inner_table": "accounts", "outer_alias": "budg", "inner_alias": "acct", "proj_col": "id", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_00040
train
T2
v2
Schema: managers (alias: mgr)(value, salary, status, amount) products(name, amount, value, id) Task: Find id from managers where a matching record exists in products with the same status. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = mgr.status );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "id", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_00041
train
T1
v2
Schema: managers (alias: mgr)(salary, level, date, id) customers(type, salary, name, code) Task: Find salary from managers where a matching record exists in customers with the same id. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = mgr.id );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "salary", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_00042
train
T1
v2
Schema: regions (alias: rgn)(value, salary, status, name) staff(status, salary, code, amount) Task: Find salary from regions where a matching record exists in staff with the same level. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = rgn.level );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "salary", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_00043
train
T2
v3
Schema: items (alias: lne)(value, name, type, id) accounts(value, code, type, id) Task: Find salary from items where value exceeds the average amount from accounts for the same level. SQL:
SELECT salary FROM items AS lne WHERE value > ( SELECT AVG(amount) FROM accounts AS acct WHERE acct.level = lne.level );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_00044
train
T2
v1
Schema: sales (alias: sale)(type, date, id, code) regions(date, name, level, value) Task: Retrieve id from sales whose status is found in regions rows where id matches the outer record. SQL:
SELECT id FROM sales AS sale WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.id = sale.id );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_00045
train
T1
v2
Schema: items (alias: lne)(value, amount, id, status) shipments(level, code, amount, name) Task: Find name from items where a matching record exists in shipments with the same status. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = lne.status );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "name", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_00046
train
T2
v2
Schema: employees (alias: emp)(status, value, code, type) invoices(status, amount, name, date) Task: Retrieve id from employees that have at least one corresponding entry in invoices sharing the same code. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = emp.code );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "id", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_00047
train
T1
v2
Schema: staff (alias: empl)(id, salary, status, date) managers(type, salary, status, value) Task: Find value from staff where a matching record exists in managers with the same status. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = empl.status );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "value", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_00048
train
T2
v1
Schema: invoices (alias: inv)(level, name, salary, status) schedules(salary, status, level, date) Task: Retrieve amount from invoices whose level is found in schedules rows where level matches the outer record. SQL:
SELECT amount FROM invoices AS inv WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.level = inv.level );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "amount", "filter_col": "level", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_00049
train
T1
v1
Schema: schedules (alias: schd)(date, salary, status, id) shipments(status, level, amount, id) Task: Find name from schedules where level appears in shipments entries with matching status. SQL:
SELECT name FROM schedules AS schd WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.status = schd.status );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_00050
train
T2
v1
Schema: accounts (alias: acct)(amount, level, status, code) categories(id, value, code, status) Task: Find amount from accounts where code appears in categories entries with matching status. SQL:
SELECT amount FROM accounts AS acct WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.status = acct.status );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_00051
train
T1
v1
Schema: services (alias: srvc)(value, amount, id, salary) employees(date, code, level, salary) Task: Find amount from services where type appears in employees entries with matching type. SQL:
SELECT amount FROM services AS srvc WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.type = srvc.type );
{ "outer_table": "services", "inner_table": "employees", "outer_alias": "srvc", "inner_alias": "emp", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_00052
train
T2
v1
Schema: products (alias: prod)(status, amount, level, salary) invoices(level, id, salary, status) Task: Find id from products where code appears in invoices entries with matching id. SQL:
SELECT id FROM products AS prod WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.id = prod.id );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "id", "filter_col": "code", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_00053
train
T1
v2
Schema: requests (alias: ordr)(value, salary, code, id) services(salary, date, value, code) Task: Find name from requests where a matching record exists in services with the same code. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.code = ordr.code );
{ "outer_table": "requests", "inner_table": "services", "outer_alias": "ordr", "inner_alias": "srvc", "proj_col": "name", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_00054
train
T2
v1
Schema: invoices (alias: inv)(salary, code, status, name) employees(status, salary, name, code) Task: Select value from invoices where status exists in employees for the same id. SQL:
SELECT value FROM invoices AS inv WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.id = inv.id );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_00055
train
T1
v2
Schema: categories (alias: catg)(level, id, code, value) staff(code, name, status, type) Task: Find id from categories where a matching record exists in staff with the same id. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = catg.id );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "id", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_00056
train
T2
v3
Schema: employees (alias: emp)(date, type, amount, status) services(date, amount, status, type) Task: Find value from employees where salary exceeds the average salary from services for the same type. SQL:
SELECT value FROM employees AS emp WHERE salary > ( SELECT SUM(salary) FROM services AS srvc WHERE srvc.type = emp.type );
{ "outer_table": "employees", "inner_table": "services", "outer_alias": "emp", "inner_alias": "srvc", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_00057
train
T1
v3
Schema: staff (alias: empl)(date, status, name, level) accounts(amount, level, value, date) Task: Retrieve salary from staff with value above the MAX(value) of accounts rows sharing the same type. SQL:
SELECT salary FROM staff AS empl WHERE value > ( SELECT MAX(value) FROM accounts AS acct WHERE acct.type = empl.type );
{ "outer_table": "staff", "inner_table": "accounts", "outer_alias": "empl", "inner_alias": "acct", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_00058
train
T2
v2
Schema: services (alias: srvc)(id, type, salary, value) items(id, status, salary, type) Task: Retrieve amount from services that have at least one corresponding entry in items sharing the same type. SQL:
SELECT amount FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = srvc.type );
{ "outer_table": "services", "inner_table": "items", "outer_alias": "srvc", "inner_alias": "lne", "proj_col": "amount", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_00059
train
T2
v2
Schema: requests (alias: ordr)(name, salary, code, date) employees(salary, name, level, value) Task: Find salary from requests where a matching record exists in employees with the same status. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = ordr.status );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "salary", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_00060
train
T2
v1
Schema: products (alias: prod)(amount, value, code, salary) orders(salary, code, value, status) Task: Select value from products where level exists in orders for the same type. SQL:
SELECT value FROM products AS prod WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.type = prod.type );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_00061
train
T1
v2
Schema: requests (alias: ordr)(salary, value, type, date) transactions(date, code, level, id) Task: Find id from requests where a matching record exists in transactions with the same level. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = ordr.level );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "id", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_00062
train
T2
v1
Schema: customers (alias: cust)(status, id, name, salary) accounts(date, amount, type, name) Task: Select amount from customers where level exists in accounts for the same code. SQL:
SELECT amount FROM customers AS cust WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.code = cust.code );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_00063
train
T1
v2
Schema: warehouses (alias: whs)(value, amount, id, date) customers(name, code, date, level) Task: Find id from warehouses where a matching record exists in customers with the same code. SQL:
SELECT id FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "customers", "outer_alias": "whs", "inner_alias": "cust", "proj_col": "id", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_00064
train
T2
v3
Schema: budgets (alias: budg)(type, value, salary, date) schedules(status, level, code, value) Task: Find amount from budgets where amount exceeds the average salary from schedules for the same level. SQL:
SELECT amount FROM budgets AS budg WHERE amount > ( SELECT AVG(salary) FROM schedules AS schd WHERE schd.level = budg.level );
{ "outer_table": "budgets", "inner_table": "schedules", "outer_alias": "budg", "inner_alias": "schd", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_00065
train
T2
v2
Schema: staff (alias: empl)(level, date, code, status) products(status, salary, name, value) Task: Retrieve value from staff that have at least one corresponding entry in products sharing the same level. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = empl.level );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "value", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_00066
train
T2
v1
Schema: staff (alias: empl)(value, name, status, salary) sales(value, type, name, code) Task: Find code from staff where id appears in sales entries with matching code. SQL:
SELECT code FROM staff AS empl WHERE id IN ( SELECT id 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": "id", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_00067
train
T2
v3
Schema: warehouses (alias: whs)(amount, value, name, salary) customers(value, level, name, code) Task: Find name from warehouses where salary exceeds the average salary from customers for the same code. SQL:
SELECT name FROM warehouses AS whs WHERE salary > ( SELECT MAX(salary) FROM customers AS cust WHERE cust.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "customers", "outer_alias": "whs", "inner_alias": "cust", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_00068
train
T2
v3
Schema: shipments (alias: shp)(level, name, status, id) schedules(salary, value, amount, status) Task: Find value from shipments where amount exceeds the average salary from schedules for the same type. SQL:
SELECT value FROM shipments AS shp WHERE amount > ( SELECT AVG(salary) FROM schedules AS schd WHERE schd.type = shp.type );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_00069
train
T2
v3
Schema: managers (alias: mgr)(salary, code, id, status) transactions(type, date, salary, amount) Task: Retrieve code from managers with value above the MAX(amount) of transactions rows sharing the same level. SQL:
SELECT code FROM managers AS mgr WHERE value > ( SELECT MAX(amount) FROM transactions AS txn WHERE txn.level = mgr.level );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_00070
train
T1
v2
Schema: shipments (alias: shp)(status, id, level, value) departments(status, name, date, amount) Task: Find id from shipments where a matching record exists in departments with the same level. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = shp.level );
{ "outer_table": "shipments", "inner_table": "departments", "outer_alias": "shp", "inner_alias": "dept", "proj_col": "id", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_00071
train
T2
v2
Schema: staff (alias: empl)(level, id, value, type) customers(status, amount, id, value) Task: Find salary from staff where a matching record exists in customers with the same id. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = empl.id );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "salary", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_00072
train
T2
v2
Schema: requests (alias: ordr)(type, amount, level, code) regions(salary, status, value, amount) Task: Find code from requests where a matching record exists in regions with the same id. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = ordr.id );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "code", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_00073
train
T2
v1
Schema: budgets (alias: budg)(name, type, date, level) employees(code, id, amount, date) Task: Retrieve value from budgets whose id is found in employees rows where status matches the outer record. SQL:
SELECT value FROM budgets AS budg WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.status = budg.status );
{ "outer_table": "budgets", "inner_table": "employees", "outer_alias": "budg", "inner_alias": "emp", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_00074
train
T2
v3
Schema: managers (alias: mgr)(level, type, value, name) orders(code, type, status, date) Task: Find amount from managers where salary exceeds the average amount from orders for the same status. SQL:
SELECT amount FROM managers AS mgr WHERE salary > ( SELECT MIN(amount) FROM orders AS ord WHERE ord.status = mgr.status );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_00075
train
T1
v1
Schema: accounts (alias: acct)(value, status, name, amount) departments(type, date, name, id) Task: Select salary from accounts where status exists in departments for the same id. SQL:
SELECT salary FROM accounts AS acct WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.id = acct.id );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "salary", "filter_col": "status", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_00076
train
T1
v1
Schema: services (alias: srvc)(value, level, salary, code) invoices(type, id, name, amount) Task: Find id from services where id appears in invoices entries with matching type. SQL:
SELECT id FROM services AS srvc WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.type = srvc.type );
{ "outer_table": "services", "inner_table": "invoices", "outer_alias": "srvc", "inner_alias": "inv", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_00077
train
T2
v3
Schema: shipments (alias: shp)(salary, value, amount, id) requests(name, id, date, amount) Task: Find amount from shipments where value exceeds the average salary from requests for the same type. SQL:
SELECT amount FROM shipments AS shp WHERE value > ( SELECT MIN(salary) FROM requests AS ordr WHERE ordr.type = shp.type );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_00078
train
T2
v3
Schema: departments (alias: dept)(date, status, code, level) accounts(id, code, value, status) Task: Retrieve value from departments with salary above the SUM(salary) of accounts rows sharing the same id. SQL:
SELECT value FROM departments AS dept WHERE salary > ( SELECT SUM(salary) FROM accounts AS acct WHERE acct.id = dept.id );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_00079
train
T1
v2
Schema: sales (alias: sale)(type, value, name, code) budgets(value, code, salary, id) Task: Find amount from sales where a matching record exists in budgets with the same code. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.code = sale.code );
{ "outer_table": "sales", "inner_table": "budgets", "outer_alias": "sale", "inner_alias": "budg", "proj_col": "amount", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_00080
train
T1
v2
Schema: invoices (alias: inv)(type, level, amount, value) requests(date, level, id, name) Task: Retrieve amount from invoices that have at least one corresponding entry in requests sharing the same status. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = inv.status );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "amount", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_00081
train
T1
v2
Schema: orders (alias: ord)(value, type, name, date) employees(date, name, id, type) Task: Find id from orders where a matching record exists in employees with the same code. SQL:
SELECT id FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = ord.code );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "id", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_00082
train
T1
v3
Schema: requests (alias: ordr)(id, name, salary, type) customers(value, name, type, amount) Task: Retrieve id from requests with amount above the SUM(amount) of customers rows sharing the same id. SQL:
SELECT id FROM requests AS ordr WHERE amount > ( SELECT SUM(amount) FROM customers AS cust WHERE cust.id = ordr.id );
{ "outer_table": "requests", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_00083
train
T2
v1
Schema: accounts (alias: acct)(value, type, name, code) sales(salary, code, date, amount) Task: Select id from accounts where type exists in sales for the same id. SQL:
SELECT id FROM accounts AS acct WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.id = acct.id );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_00084
train
T1
v1
Schema: managers (alias: mgr)(value, status, id, date) regions(type, salary, name, value) Task: Select id from managers where type exists in regions for the same id. SQL:
SELECT id FROM managers AS mgr WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.id = mgr.id );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_00085
train
T1
v3
Schema: services (alias: srvc)(date, amount, value, name) accounts(type, salary, amount, value) Task: Find salary from services where amount exceeds the average salary from accounts for the same type. SQL:
SELECT salary FROM services AS srvc WHERE amount > ( SELECT MAX(salary) FROM accounts AS acct WHERE acct.type = srvc.type );
{ "outer_table": "services", "inner_table": "accounts", "outer_alias": "srvc", "inner_alias": "acct", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_00086
train
T2
v1
Schema: employees (alias: emp)(value, date, name, status) customers(salary, name, type, code) Task: Select id from employees where id exists in customers for the same status. SQL:
SELECT id FROM employees AS emp WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.status = emp.status );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "id", "filter_col": "id", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_00087
train
T1
v3
Schema: items (alias: lne)(code, type, amount, date) requests(status, level, value, amount) Task: Retrieve code from items with salary above the SUM(amount) of requests rows sharing the same id. SQL:
SELECT code FROM items AS lne WHERE salary > ( SELECT SUM(amount) FROM requests AS ordr WHERE ordr.id = lne.id );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_00088
train
T2
v2
Schema: categories (alias: catg)(salary, value, code, status) transactions(salary, code, date, id) Task: Find id from categories where a matching record exists in transactions with the same level. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = catg.level );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "id", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_00089
train
T2
v3
Schema: sales (alias: sale)(value, name, status, id) shipments(status, date, salary, id) Task: Find salary from sales where value exceeds the average salary from shipments for the same id. SQL:
SELECT salary FROM sales AS sale WHERE value > ( SELECT AVG(salary) FROM shipments AS shp WHERE shp.id = sale.id );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_00090
train
T1
v2
Schema: budgets (alias: budg)(name, date, code, amount) shipments(date, name, status, level) Task: Retrieve name from budgets that have at least one corresponding entry in shipments sharing the same type. SQL:
SELECT name FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = budg.type );
{ "outer_table": "budgets", "inner_table": "shipments", "outer_alias": "budg", "inner_alias": "shp", "proj_col": "name", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_00091
train
T2
v1
Schema: orders (alias: ord)(value, id, date, code) sales(code, name, id, amount) Task: Retrieve value from orders whose id is found in sales rows where id matches the outer record. SQL:
SELECT value FROM orders AS ord WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.id = ord.id );
{ "outer_table": "orders", "inner_table": "sales", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_00092
train
T1
v3
Schema: departments (alias: dept)(type, date, id, code) services(name, type, status, code) Task: Retrieve amount from departments with value above the AVG(amount) of services rows sharing the same level. SQL:
SELECT amount FROM departments AS dept WHERE value > ( SELECT AVG(amount) FROM services AS srvc WHERE srvc.level = dept.level );
{ "outer_table": "departments", "inner_table": "services", "outer_alias": "dept", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_00093
train
T1
v2
Schema: products (alias: prod)(level, type, code, salary) categories(date, amount, level, type) Task: Find salary from products where a matching record exists in categories with the same code. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = prod.code );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "salary", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_00094
train
T1
v3
Schema: invoices (alias: inv)(level, salary, value, id) staff(level, date, id, amount) Task: Find salary from invoices where salary exceeds the average salary from staff for the same level. SQL:
SELECT salary FROM invoices AS inv WHERE salary > ( SELECT MAX(salary) FROM staff AS empl WHERE empl.level = inv.level );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_00095
train
T1
v2
Schema: employees (alias: emp)(name, type, id, code) shipments(code, salary, type, level) Task: Retrieve amount from employees that have at least one corresponding entry in shipments sharing the same code. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = emp.code );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "amount", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_00096
train
T1
v3
Schema: shipments (alias: shp)(name, salary, value, level) departments(level, id, amount, name) Task: Retrieve amount from shipments with value above the SUM(value) of departments rows sharing the same status. SQL:
SELECT amount FROM shipments AS shp WHERE value > ( SELECT SUM(value) FROM departments AS dept WHERE dept.status = shp.status );
{ "outer_table": "shipments", "inner_table": "departments", "outer_alias": "shp", "inner_alias": "dept", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_00097
train
T2
v1
Schema: managers (alias: mgr)(date, name, value, level) sales(level, id, type, date) Task: Find id from managers where level appears in sales entries with matching status. SQL:
SELECT id FROM managers AS mgr WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.status = mgr.status );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_00098
train
T1
v2
Schema: departments (alias: dept)(id, name, code, value) budgets(status, salary, id, value) Task: Find code from departments where a matching record exists in budgets with the same id. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.id = dept.id );
{ "outer_table": "departments", "inner_table": "budgets", "outer_alias": "dept", "inner_alias": "budg", "proj_col": "code", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_00099
train
T1
End of preview. Expand in Data Studio

cs8-fixed

CS8 fixed dataset — deterministic inner alias assignment, used for circuit analysis and SAE training

Structure

  • train.jsonl — 12,000 training examples (20 aliases × 600)
  • val.jsonl — 12,000 validation examples (20 aliases × 600)
  • alias_vocab.json — 20 aliases with T1/T2 tokenization group labels

Alias Groups

  • T1 (single-token): emp, inv, txn, mgr, ord, prod, cust, dept, acct, sale
  • T2 (two-token, generic first subtoken): shp, whs, rgn, lne, empl, ordr, catg, budg, schd, srvc

Citation

Inside-Out: A Circuit-Level Analysis of Table-Alias Scoping in Nested SQL Generation

Downloads last month
34