variant
stringclasses
3 values
prompt
stringlengths
160
237
sql
stringlengths
102
141
metadata
unknown
token_group
stringclasses
2 values
id
stringlengths
24
24
split
stringclasses
1 value
v2
Schema: staff (alias: empl)(amount, value, salary, id) customers(level, code, salary, value) Task: Retrieve id from staff that have at least one corresponding entry in customers sharing the same code. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = empl.code );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "id", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18900
train
v1
Schema: employees (alias: emp)(salary, code, id, type) branches(type, status, code, value) Task: Retrieve name from employees whose type is found in branches rows where type matches the outer record. SQL:
SELECT name FROM employees AS emp WHERE type IN ( SELECT type FROM branches AS brc WHERE brc.type = emp.type );
{ "outer_table": "employees", "inner_table": "branches", "outer_alias": "emp", "inner_alias": "brc", "proj_col": "name", "filter_col": "type", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18901
train
v2
Schema: transactions (alias: txn)(type, value, status, amount) customers(value, code, id, amount) Task: Retrieve name from transactions that have at least one corresponding entry in customers sharing the same type. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = txn.type );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "name", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18902
train
v3
Schema: tasks (alias: tsk)(value, level, name, code) regions(amount, id, name, code) Task: Find amount from tasks where value exceeds the count of salary from regions for the same type. SQL:
SELECT amount FROM tasks AS tsk WHERE value > ( SELECT COUNT(salary) FROM regions AS rgn WHERE rgn.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "regions", "outer_alias": "tsk", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18903
train
v2
Schema: staff (alias: empl)(type, code, date, value) customers(level, id, value, name) Task: Retrieve name from staff that have at least one corresponding entry in customers sharing the same status. SQL:
SELECT name FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = empl.status );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "name", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18904
train
v1
Schema: tasks (alias: tsk)(salary, id, code, date) branches(name, type, salary, date) Task: Select value from tasks where code exists in branches for the same status. SQL:
SELECT value FROM tasks AS tsk WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "branches", "outer_alias": "tsk", "inner_alias": "brc", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18905
train
v2
Schema: orders (alias: ord)(salary, value, type, name) categories(code, date, level, value) Task: Find salary from orders where a matching record exists in categories with the same level. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = ord.level );
{ "outer_table": "orders", "inner_table": "categories", "outer_alias": "ord", "inner_alias": "catg", "proj_col": "salary", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18906
train
v2
Schema: items (alias: lne)(value, date, id, code) projects(type, code, salary, id) Task: Find amount from items where a matching record exists in projects with the same id. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.id = lne.id );
{ "outer_table": "items", "inner_table": "projects", "outer_alias": "lne", "inner_alias": "prj", "proj_col": "amount", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18907
train
v1
Schema: sales (alias: sale)(type, salary, id, date) employees(date, name, amount, salary) Task: Retrieve value from sales whose status is found in employees rows where type matches the outer record. SQL:
SELECT value FROM sales AS sale WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.type = sale.type );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "value", "filter_col": "status", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18908
train
v1
Schema: accounts (alias: acct)(type, name, code, status) tasks(amount, level, type, date) Task: Find name from accounts where status appears in tasks entries with matching status. SQL:
SELECT name FROM accounts AS acct WHERE status IN ( SELECT status FROM tasks AS tsk WHERE tsk.status = acct.status );
{ "outer_table": "accounts", "inner_table": "tasks", "outer_alias": "acct", "inner_alias": "tsk", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18909
train
v3
Schema: tasks (alias: tsk)(id, status, level, date) categories(id, code, date, value) Task: Find id from tasks where amount exceeds the total value from categories for the same code. SQL:
SELECT id FROM tasks AS tsk WHERE amount > ( SELECT SUM(value) FROM categories AS catg WHERE catg.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "categories", "outer_alias": "tsk", "inner_alias": "catg", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18910
train
v3
Schema: customers (alias: cust)(id, name, amount, status) invoices(name, code, salary, amount) Task: Find amount from customers where value exceeds the count of value from invoices for the same id. SQL:
SELECT amount FROM customers AS cust WHERE value > ( SELECT COUNT(value) FROM invoices AS inv WHERE inv.id = cust.id );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18911
train
v3
Schema: accounts (alias: acct)(salary, id, amount, date) orders(name, id, date, type) Task: Find code from accounts where value exceeds the maximum amount from orders for the same code. SQL:
SELECT code FROM accounts AS acct WHERE value > ( SELECT MAX(amount) FROM orders AS ord WHERE ord.code = acct.code );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18912
train
v3
Schema: tasks (alias: tsk)(status, level, name, salary) orders(value, type, status, level) Task: Find salary from tasks where salary exceeds the total salary from orders for the same id. SQL:
SELECT salary FROM tasks AS tsk WHERE salary > ( SELECT SUM(salary) FROM orders AS ord WHERE ord.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "orders", "outer_alias": "tsk", "inner_alias": "ord", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18913
train
v3
Schema: categories (alias: catg)(name, id, date, code) invoices(status, amount, date, code) Task: Find id from categories where salary exceeds the total salary from invoices for the same id. SQL:
SELECT id FROM categories AS catg WHERE salary > ( SELECT SUM(salary) FROM invoices AS inv WHERE inv.id = catg.id );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18914
train
v1
Schema: shipments (alias: shp)(status, value, code, type) categories(name, value, id, status) Task: Find value from shipments where type appears in categories entries with matching status. SQL:
SELECT value FROM shipments AS shp WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.status = shp.status );
{ "outer_table": "shipments", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "catg", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18915
train
v1
Schema: projects (alias: prj)(code, date, status, amount) branches(amount, id, level, value) Task: Find amount from projects where type appears in branches entries with matching code. SQL:
SELECT amount FROM projects AS prj WHERE type IN ( SELECT type FROM branches AS brc WHERE brc.code = prj.code );
{ "outer_table": "projects", "inner_table": "branches", "outer_alias": "prj", "inner_alias": "brc", "proj_col": "amount", "filter_col": "type", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18916
train
v3
Schema: transactions (alias: txn)(date, salary, id, type) projects(name, code, amount, value) Task: Find amount from transactions where amount exceeds the total value from projects for the same id. SQL:
SELECT amount FROM transactions AS txn WHERE amount > ( SELECT SUM(value) FROM projects AS prj WHERE prj.id = txn.id );
{ "outer_table": "transactions", "inner_table": "projects", "outer_alias": "txn", "inner_alias": "prj", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18917
train
v2
Schema: invoices (alias: inv)(salary, status, date, value) schedules(id, type, value, name) Task: Find amount from invoices where a matching record exists in schedules with the same code. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = inv.code );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "amount", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18918
train
v2
Schema: accounts (alias: acct)(salary, level, code, value) tasks(status, level, name, id) Task: Retrieve amount from accounts that have at least one corresponding entry in tasks sharing the same id. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.id = acct.id );
{ "outer_table": "accounts", "inner_table": "tasks", "outer_alias": "acct", "inner_alias": "tsk", "proj_col": "amount", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18919
train
v2
Schema: shipments (alias: shp)(value, code, id, name) customers(id, type, value, level) Task: Retrieve code from shipments that have at least one corresponding entry in customers sharing the same type. SQL:
SELECT code FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = shp.type );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "code", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18920
train
v1
Schema: orders (alias: ord)(amount, name, date, code) projects(value, name, status, type) Task: Find code from orders where level appears in projects entries with matching type. SQL:
SELECT code FROM orders AS ord WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.type = ord.type );
{ "outer_table": "orders", "inner_table": "projects", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18921
train
v3
Schema: items (alias: lne)(code, value, name, status) orders(type, value, salary, date) Task: Retrieve salary from items with amount above the MIN(value) of orders rows sharing the same code. SQL:
SELECT salary FROM items AS lne WHERE amount > ( SELECT MIN(value) FROM orders AS ord WHERE ord.code = lne.code );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18922
train
v1
Schema: accounts (alias: acct)(name, status, date, value) staff(id, type, status, level) Task: Find value from accounts where level appears in staff entries with matching level. SQL:
SELECT value FROM accounts AS acct WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.level = acct.level );
{ "outer_table": "accounts", "inner_table": "staff", "outer_alias": "acct", "inner_alias": "empl", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18923
train
v1
Schema: transactions (alias: txn)(name, value, date, code) items(type, date, name, level) Task: Select code from transactions where level exists in items for the same id. SQL:
SELECT code FROM transactions AS txn WHERE level IN ( SELECT level FROM items AS lne WHERE lne.id = txn.id );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "code", "filter_col": "level", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18924
train
v2
Schema: transactions (alias: txn)(amount, type, code, status) managers(value, date, amount, code) Task: Find id from transactions where a matching record exists in managers with the same type. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = txn.type );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "id", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18925
train
v2
Schema: customers (alias: cust)(level, type, amount, salary) invoices(level, date, status, salary) Task: Retrieve id from customers that have at least one corresponding entry in invoices sharing the same code. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = cust.code );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "id", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18926
train
v3
Schema: transactions (alias: txn)(date, name, status, value) items(date, type, status, amount) Task: Find code from transactions where salary exceeds the minimum value from items for the same id. SQL:
SELECT code FROM transactions AS txn WHERE salary > ( SELECT MIN(value) FROM items AS lne WHERE lne.id = txn.id );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18927
train
v2
Schema: categories (alias: catg)(id, status, name, amount) customers(code, name, status, type) Task: Retrieve code from categories that have at least one corresponding entry in customers sharing the same id. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = catg.id );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "code", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18928
train
v3
Schema: invoices (alias: inv)(value, name, salary, amount) sales(level, type, date, salary) Task: Find name from invoices where salary exceeds the maximum value from sales for the same status. SQL:
SELECT name FROM invoices AS inv WHERE salary > ( SELECT MAX(value) FROM sales AS sale WHERE sale.status = inv.status );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18929
train
v2
Schema: products (alias: prod)(id, date, status, amount) managers(date, level, code, type) Task: Retrieve amount from products that have at least one corresponding entry in managers sharing the same code. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = prod.code );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "amount", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18930
train
v1
Schema: schedules (alias: schd)(level, date, name, code) departments(status, amount, code, level) Task: Retrieve value from schedules whose code is found in departments rows where type matches the outer record. SQL:
SELECT value FROM schedules AS schd WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.type = schd.type );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18931
train
v1
Schema: categories (alias: catg)(salary, value, status, type) invoices(salary, code, type, name) Task: Select amount from categories where code exists in invoices for the same type. SQL:
SELECT amount FROM categories AS catg WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.type = catg.type );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18932
train
v1
Schema: requests (alias: ordr)(amount, type, salary, date) projects(status, value, date, code) Task: Retrieve value from requests whose level is found in projects rows where level matches the outer record. SQL:
SELECT value FROM requests AS ordr WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.level = ordr.level );
{ "outer_table": "requests", "inner_table": "projects", "outer_alias": "ordr", "inner_alias": "prj", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18933
train
v3
Schema: invoices (alias: inv)(level, value, type, date) customers(code, value, id, type) Task: Find value from invoices where salary exceeds the total value from customers for the same code. SQL:
SELECT value FROM invoices AS inv WHERE salary > ( SELECT SUM(value) FROM customers AS cust WHERE cust.code = inv.code );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18934
train
v3
Schema: invoices (alias: inv)(status, code, name, date) customers(name, salary, value, id) Task: Retrieve amount from invoices with salary above the MIN(value) of customers rows sharing the same type. SQL:
SELECT amount FROM invoices AS inv WHERE salary > ( SELECT MIN(value) FROM customers AS cust WHERE cust.type = inv.type );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18935
train
v3
Schema: tasks (alias: tsk)(code, status, id, level) requests(level, value, amount, salary) Task: Find code from tasks where amount exceeds the total amount from requests for the same type. SQL:
SELECT code FROM tasks AS tsk WHERE amount > ( SELECT SUM(amount) FROM requests AS ordr WHERE ordr.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "requests", "outer_alias": "tsk", "inner_alias": "ordr", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18936
train
v1
Schema: transactions (alias: txn)(level, code, amount, status) employees(code, type, amount, id) Task: Find amount from transactions where code appears in employees entries with matching type. SQL:
SELECT amount FROM transactions AS txn WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.type = txn.type );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18937
train
v2
Schema: schedules (alias: schd)(date, status, id, name) sales(amount, name, type, level) Task: Find amount from schedules where a matching record exists in sales with the same level. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = schd.level );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "amount", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18938
train
v3
Schema: invoices (alias: inv)(type, status, level, date) projects(amount, name, status, level) Task: Retrieve name from invoices with amount above the MIN(salary) of projects rows sharing the same status. SQL:
SELECT name FROM invoices AS inv WHERE amount > ( SELECT MIN(salary) FROM projects AS prj WHERE prj.status = inv.status );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "inv", "inner_alias": "prj", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18939
train
v2
Schema: departments (alias: dept)(date, salary, type, status) categories(id, salary, level, date) Task: Retrieve code from departments that have at least one corresponding entry in categories sharing the same status. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = dept.status );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "code", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18940
train
v1
Schema: tasks (alias: tsk)(date, salary, status, amount) invoices(amount, code, status, level) Task: Select id from tasks where level exists in invoices for the same level. SQL:
SELECT id FROM tasks AS tsk WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "invoices", "outer_alias": "tsk", "inner_alias": "inv", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_18941
train
v2
Schema: customers (alias: cust)(code, salary, value, id) invoices(type, status, level, amount) Task: Retrieve code from customers that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = cust.type );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "code", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18942
train
v1
Schema: products (alias: prod)(date, name, value, salary) invoices(amount, type, code, status) Task: Find name from products where id appears in invoices entries with matching level. SQL:
SELECT name FROM products AS prod WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.level = prod.level );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "name", "filter_col": "id", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18943
train
v2
Schema: requests (alias: ordr)(type, code, amount, name) items(status, code, level, salary) Task: Retrieve id from requests that have at least one corresponding entry in items sharing the same code. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = ordr.code );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "id", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18944
train
v3
Schema: schedules (alias: schd)(salary, date, value, code) tasks(level, amount, date, status) Task: Retrieve name from schedules with salary above the MIN(value) of tasks rows sharing the same level. SQL:
SELECT name FROM schedules AS schd WHERE salary > ( SELECT MIN(value) FROM tasks AS tsk WHERE tsk.level = schd.level );
{ "outer_table": "schedules", "inner_table": "tasks", "outer_alias": "schd", "inner_alias": "tsk", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18945
train
v2
Schema: projects (alias: prj)(type, amount, name, value) sales(id, salary, value, amount) Task: Retrieve name from projects that have at least one corresponding entry in sales sharing the same code. SQL:
SELECT name FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = prj.code );
{ "outer_table": "projects", "inner_table": "sales", "outer_alias": "prj", "inner_alias": "sale", "proj_col": "name", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18946
train
v3
Schema: sales (alias: sale)(amount, level, type, id) accounts(id, status, salary, type) Task: Find id from sales where amount exceeds the total salary from accounts for the same type. SQL:
SELECT id FROM sales AS sale WHERE amount > ( SELECT SUM(salary) FROM accounts AS acct WHERE acct.type = sale.type );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18947
train
v2
Schema: staff (alias: empl)(amount, code, salary, name) accounts(id, type, status, level) Task: Find value from staff where a matching record exists in accounts with the same level. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = empl.level );
{ "outer_table": "staff", "inner_table": "accounts", "outer_alias": "empl", "inner_alias": "acct", "proj_col": "value", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18948
train
v1
Schema: sales (alias: sale)(amount, type, id, name) accounts(type, level, salary, status) Task: Select value from sales where status exists in accounts for the same status. SQL:
SELECT value FROM sales AS sale WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.status = sale.status );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18949
train
v1
Schema: items (alias: lne)(status, level, value, code) employees(date, name, code, status) Task: Select salary from items where level exists in employees for the same id. SQL:
SELECT salary FROM items AS lne WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.id = lne.id );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "salary", "filter_col": "level", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18950
train
v1
Schema: employees (alias: emp)(salary, type, code, id) departments(salary, amount, status, value) Task: Find salary from employees where level appears in departments entries with matching type. SQL:
SELECT salary FROM employees AS emp WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.type = emp.type );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "salary", "filter_col": "level", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18951
train
v3
Schema: regions (alias: rgn)(salary, type, status, amount) invoices(status, type, level, code) Task: Find code from regions where value exceeds the minimum salary from invoices for the same status. SQL:
SELECT code FROM regions AS rgn WHERE value > ( SELECT MIN(salary) FROM invoices AS inv WHERE inv.status = rgn.status );
{ "outer_table": "regions", "inner_table": "invoices", "outer_alias": "rgn", "inner_alias": "inv", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_18952
train
v2
Schema: products (alias: prod)(amount, date, name, status) regions(code, value, status, name) Task: Find name from products where a matching record exists in regions with the same code. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = prod.code );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "name", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18953
train
v1
Schema: transactions (alias: txn)(level, date, id, amount) employees(id, status, code, date) Task: Retrieve amount from transactions whose code is found in employees rows where type matches the outer record. SQL:
SELECT amount FROM transactions AS txn WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.type = txn.type );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18954
train
v3
Schema: items (alias: lne)(date, name, code, salary) projects(amount, salary, id, date) Task: Retrieve amount from items with amount above the AVG(salary) of projects rows sharing the same level. SQL:
SELECT amount FROM items AS lne WHERE amount > ( SELECT AVG(salary) FROM projects AS prj WHERE prj.level = lne.level );
{ "outer_table": "items", "inner_table": "projects", "outer_alias": "lne", "inner_alias": "prj", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18955
train
v1
Schema: departments (alias: dept)(amount, id, name, code) regions(amount, id, type, salary) Task: Find salary from departments where status appears in regions entries with matching code. SQL:
SELECT salary FROM departments AS dept WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.code = dept.code );
{ "outer_table": "departments", "inner_table": "regions", "outer_alias": "dept", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18956
train
v2
Schema: requests (alias: ordr)(status, name, level, id) transactions(id, value, level, code) Task: Find id from requests where a matching record exists in transactions with the same status. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = ordr.status );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "id", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18957
train
v2
Schema: requests (alias: ordr)(name, level, code, salary) projects(type, amount, value, level) Task: Find value from requests where a matching record exists in projects with the same id. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.id = ordr.id );
{ "outer_table": "requests", "inner_table": "projects", "outer_alias": "ordr", "inner_alias": "prj", "proj_col": "value", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18958
train
v3
Schema: items (alias: lne)(code, level, status, id) transactions(name, date, code, level) Task: Retrieve code from items with value above the MIN(value) of transactions rows sharing the same code. SQL:
SELECT code FROM items AS lne WHERE value > ( SELECT MIN(value) FROM transactions AS txn WHERE txn.code = lne.code );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18959
train
v3
Schema: products (alias: prod)(code, status, name, id) schedules(id, status, code, level) Task: Retrieve id from products with amount above the AVG(value) of schedules rows sharing the same id. SQL:
SELECT id FROM products AS prod WHERE amount > ( SELECT AVG(value) FROM schedules AS schd WHERE schd.id = prod.id );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18960
train
v1
Schema: accounts (alias: acct)(salary, date, value, amount) regions(amount, type, name, value) Task: Find salary from accounts where id appears in regions entries with matching type. SQL:
SELECT salary FROM accounts AS acct WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.type = acct.type );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "id", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18961
train
v1
Schema: managers (alias: mgr)(date, id, type, status) accounts(amount, code, level, type) Task: Find id from managers where id appears in accounts entries with matching id. SQL:
SELECT id FROM managers AS mgr WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.id = mgr.id );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18962
train
v2
Schema: employees (alias: emp)(salary, name, amount, level) customers(amount, id, name, level) Task: Retrieve amount from employees that have at least one corresponding entry in customers sharing the same level. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = emp.level );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "amount", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18963
train
v2
Schema: schedules (alias: schd)(name, level, salary, type) employees(code, status, type, amount) Task: Retrieve name from schedules that have at least one corresponding entry in employees sharing the same id. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = schd.id );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "name", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18964
train
v3
Schema: invoices (alias: inv)(type, salary, level, amount) departments(salary, code, amount, id) Task: Retrieve amount from invoices with salary above the MAX(amount) of departments rows sharing the same type. SQL:
SELECT amount FROM invoices AS inv WHERE salary > ( SELECT MAX(amount) FROM departments AS dept WHERE dept.type = inv.type );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18965
train
v2
Schema: managers (alias: mgr)(type, salary, value, status) requests(code, date, name, value) Task: Find salary from managers where a matching record exists in requests with the same type. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = mgr.type );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "salary", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18966
train
v3
Schema: schedules (alias: schd)(salary, type, name, value) items(date, name, value, type) Task: Retrieve salary from schedules with value above the SUM(value) of items rows sharing the same id. SQL:
SELECT salary FROM schedules AS schd WHERE value > ( SELECT SUM(value) FROM items AS lne WHERE lne.id = schd.id );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18967
train
v1
Schema: staff (alias: empl)(type, salary, amount, date) sales(status, code, name, type) Task: Retrieve value from staff whose type is found in sales rows where code matches the outer record. SQL:
SELECT value FROM staff AS empl WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.code = empl.code );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18968
train
v2
Schema: transactions (alias: txn)(type, code, date, level) shipments(type, code, value, amount) Task: Retrieve value from transactions that have at least one corresponding entry in shipments sharing the same type. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = txn.type );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "value", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18969
train
v2
Schema: accounts (alias: acct)(amount, value, name, id) schedules(code, salary, name, status) Task: Retrieve salary from accounts that have at least one corresponding entry in schedules sharing the same code. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = acct.code );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "salary", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18970
train
v3
Schema: staff (alias: empl)(amount, date, name, status) items(value, id, amount, level) Task: Retrieve amount from staff with salary above the AVG(value) of items rows sharing the same level. SQL:
SELECT amount FROM staff AS empl WHERE salary > ( SELECT AVG(value) FROM items AS lne WHERE lne.level = empl.level );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18971
train
v2
Schema: sales (alias: sale)(level, salary, id, value) managers(salary, code, status, name) Task: Find amount from sales where a matching record exists in managers with the same status. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = sale.status );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "amount", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18972
train
v1
Schema: customers (alias: cust)(type, value, name, code) accounts(salary, amount, status, code) Task: Retrieve name from customers whose code is found in accounts rows where status matches the outer record. SQL:
SELECT name FROM customers AS cust WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.status = cust.status );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18973
train
v2
Schema: projects (alias: prj)(value, level, date, salary) products(name, code, salary, status) Task: Retrieve value from projects that have at least one corresponding entry in products sharing the same level. SQL:
SELECT value FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = prj.level );
{ "outer_table": "projects", "inner_table": "products", "outer_alias": "prj", "inner_alias": "prod", "proj_col": "value", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18974
train
v3
Schema: orders (alias: ord)(name, status, level, salary) accounts(type, amount, name, salary) Task: Retrieve amount from orders with salary above the MIN(salary) of accounts rows sharing the same code. SQL:
SELECT amount FROM orders AS ord WHERE salary > ( SELECT MIN(salary) FROM accounts AS acct WHERE acct.code = ord.code );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18975
train
v1
Schema: staff (alias: empl)(type, level, name, amount) categories(date, amount, id, status) Task: Select value from staff where level exists in categories for the same type. SQL:
SELECT value FROM staff AS empl WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.type = empl.type );
{ "outer_table": "staff", "inner_table": "categories", "outer_alias": "empl", "inner_alias": "catg", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18976
train
v1
Schema: schedules (alias: schd)(id, name, value, amount) categories(status, id, type, level) Task: Select value from schedules where level exists in categories for the same status. SQL:
SELECT value FROM schedules AS schd WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.status = schd.status );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "value", "filter_col": "level", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_18977
train
v2
Schema: customers (alias: cust)(code, id, name, level) branches(salary, level, status, id) Task: Find salary from customers where a matching record exists in branches with the same level. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.level = cust.level );
{ "outer_table": "customers", "inner_table": "branches", "outer_alias": "cust", "inner_alias": "brc", "proj_col": "salary", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18978
train
v2
Schema: customers (alias: cust)(name, level, id, salary) categories(type, name, salary, code) Task: Retrieve salary from customers that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = cust.code );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "salary", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18979
train
v2
Schema: accounts (alias: acct)(type, salary, date, level) shipments(amount, code, value, level) Task: Retrieve value from accounts that have at least one corresponding entry in shipments sharing the same level. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = acct.level );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "value", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18980
train
v3
Schema: managers (alias: mgr)(status, code, level, date) products(amount, name, value, status) Task: Retrieve amount from managers with value above the SUM(salary) of products rows sharing the same code. SQL:
SELECT amount FROM managers AS mgr WHERE value > ( SELECT SUM(salary) FROM products AS prod WHERE prod.code = mgr.code );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18981
train
v2
Schema: branches (alias: brc)(type, level, value, status) projects(salary, type, status, value) Task: Retrieve id from branches that have at least one corresponding entry in projects sharing the same level. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.level = brc.level );
{ "outer_table": "branches", "inner_table": "projects", "outer_alias": "brc", "inner_alias": "prj", "proj_col": "id", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_18982
train
v3
Schema: items (alias: lne)(status, amount, value, type) invoices(type, amount, status, level) Task: Retrieve salary from items with salary above the SUM(amount) of invoices rows sharing the same level. SQL:
SELECT salary FROM items AS lne WHERE salary > ( SELECT SUM(amount) FROM invoices AS inv WHERE inv.level = lne.level );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18983
train
v1
Schema: transactions (alias: txn)(amount, salary, code, status) regions(code, value, level, amount) Task: Retrieve value from transactions whose type is found in regions rows where status matches the outer record. SQL:
SELECT value FROM transactions AS txn WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.status = txn.status );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18984
train
v2
Schema: managers (alias: mgr)(id, code, date, level) shipments(name, level, amount, date) Task: Find amount from managers where a matching record exists in shipments with the same type. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = mgr.type );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "amount", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18985
train
v3
Schema: invoices (alias: inv)(type, status, level, name) regions(code, date, level, type) Task: Find name from invoices where salary exceeds the maximum amount from regions for the same status. SQL:
SELECT name FROM invoices AS inv WHERE salary > ( SELECT MAX(amount) FROM regions AS rgn WHERE rgn.status = inv.status );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18986
train
v3
Schema: staff (alias: empl)(type, code, date, amount) regions(date, code, name, amount) Task: Retrieve code from staff with value above the AVG(value) of regions rows sharing the same status. SQL:
SELECT code FROM staff AS empl WHERE value > ( SELECT AVG(value) FROM regions AS rgn WHERE rgn.status = empl.status );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_18987
train
v1
Schema: projects (alias: prj)(level, id, salary, value) invoices(level, date, status, code) Task: Retrieve salary from projects whose id is found in invoices rows where status matches the outer record. SQL:
SELECT salary FROM projects AS prj WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.status = prj.status );
{ "outer_table": "projects", "inner_table": "invoices", "outer_alias": "prj", "inner_alias": "inv", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18988
train
v2
Schema: projects (alias: prj)(salary, amount, type, level) products(code, name, status, level) Task: Retrieve code from projects that have at least one corresponding entry in products sharing the same status. SQL:
SELECT code FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = prj.status );
{ "outer_table": "projects", "inner_table": "products", "outer_alias": "prj", "inner_alias": "prod", "proj_col": "code", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18989
train
v1
Schema: regions (alias: rgn)(salary, name, amount, date) tasks(type, code, amount, name) Task: Find value from regions where type appears in tasks entries with matching id. SQL:
SELECT value FROM regions AS rgn WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.id = rgn.id );
{ "outer_table": "regions", "inner_table": "tasks", "outer_alias": "rgn", "inner_alias": "tsk", "proj_col": "value", "filter_col": "type", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_18990
train
v3
Schema: projects (alias: prj)(status, value, level, name) items(value, name, salary, amount) Task: Find value from projects where amount exceeds the count of amount from items for the same level. SQL:
SELECT value FROM projects AS prj WHERE amount > ( SELECT COUNT(amount) FROM items AS lne WHERE lne.level = prj.level );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "lne", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_18991
train
v1
Schema: managers (alias: mgr)(name, date, code, amount) sales(date, code, status, name) Task: Find amount from managers where code appears in sales entries with matching code. SQL:
SELECT amount FROM managers AS mgr WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.code = mgr.code );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18992
train
v1
Schema: managers (alias: mgr)(status, code, date, salary) projects(value, id, salary, level) Task: Retrieve name from managers whose id is found in projects rows where code matches the outer record. SQL:
SELECT name FROM managers AS mgr WHERE id IN ( SELECT id FROM projects AS prj WHERE prj.code = mgr.code );
{ "outer_table": "managers", "inner_table": "projects", "outer_alias": "mgr", "inner_alias": "prj", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18993
train
v2
Schema: customers (alias: cust)(salary, type, status, amount) schedules(level, type, id, code) Task: Retrieve id from customers that have at least one corresponding entry in schedules sharing the same level. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = cust.level );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "id", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18994
train
v3
Schema: items (alias: lne)(salary, value, type, date) projects(name, amount, type, code) Task: Retrieve code from items with salary above the MIN(salary) of projects rows sharing the same code. SQL:
SELECT code FROM items AS lne WHERE salary > ( SELECT MIN(salary) FROM projects AS prj WHERE prj.code = lne.code );
{ "outer_table": "items", "inner_table": "projects", "outer_alias": "lne", "inner_alias": "prj", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_18995
train
v1
Schema: requests (alias: ordr)(code, date, type, level) items(type, date, salary, level) Task: Select code from requests where level exists in items for the same code. SQL:
SELECT code FROM requests AS ordr WHERE level IN ( SELECT level FROM items AS lne WHERE lne.code = ordr.code );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18996
train
v1
Schema: accounts (alias: acct)(level, date, name, salary) transactions(amount, name, type, code) Task: Retrieve salary from accounts whose code is found in transactions rows where code matches the outer record. SQL:
SELECT salary FROM accounts AS acct WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.code = acct.code );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_18997
train
v1
Schema: requests (alias: ordr)(date, type, level, value) categories(value, status, date, salary) Task: Retrieve amount from requests whose status is found in categories rows where level matches the outer record. SQL:
SELECT amount FROM requests AS ordr WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.level = ordr.level );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_18998
train
v3
Schema: shipments (alias: shp)(code, name, date, id) sales(level, type, salary, id) Task: Find code from shipments where salary exceeds the total value from sales for the same type. SQL:
SELECT code FROM shipments AS shp WHERE salary > ( SELECT SUM(value) FROM sales AS sale WHERE sale.type = shp.type );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_18999
train