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
v1
Schema: products (alias: prod)(amount, code, value, date) invoices(code, name, salary, type) Task: Retrieve amount from products whose status is found in invoices rows where type matches the outer record. SQL:
SELECT amount FROM products AS prod WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.type = prod.type );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "amount", "filter_col": "status", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06900
train
v3
Schema: projects (alias: prj)(status, salary, type, amount) sales(level, type, date, amount) Task: Find id from projects where salary exceeds the total amount from sales for the same id. SQL:
SELECT id FROM projects AS prj WHERE salary > ( SELECT SUM(amount) FROM sales AS sale WHERE sale.id = prj.id );
{ "outer_table": "projects", "inner_table": "sales", "outer_alias": "prj", "inner_alias": "sale", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06901
train
v2
Schema: employees (alias: emp)(id, status, amount, code) branches(type, salary, name, id) Task: Find value from employees where a matching record exists in branches with the same status. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.status = emp.status );
{ "outer_table": "employees", "inner_table": "branches", "outer_alias": "emp", "inner_alias": "brc", "proj_col": "value", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06902
train
v2
Schema: shipments (alias: shp)(date, amount, salary, code) staff(type, code, amount, value) Task: Retrieve name from shipments that have at least one corresponding entry in staff sharing the same id. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = shp.id );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "name", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_06903
train
v2
Schema: shipments (alias: shp)(level, value, type, salary) categories(type, amount, id, value) Task: Find name from shipments where a matching record exists in categories with the same level. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = shp.level );
{ "outer_table": "shipments", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "catg", "proj_col": "name", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_06904
train
v1
Schema: transactions (alias: txn)(salary, id, amount, date) accounts(amount, type, code, date) Task: Find value from transactions where id appears in accounts entries with matching id. SQL:
SELECT value FROM transactions AS txn WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.id = txn.id );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06905
train
v3
Schema: schedules (alias: schd)(type, id, value, salary) projects(amount, level, type, status) Task: Retrieve code from schedules with value above the MAX(amount) of projects rows sharing the same status. SQL:
SELECT code FROM schedules AS schd WHERE value > ( SELECT MAX(amount) FROM projects AS prj WHERE prj.status = schd.status );
{ "outer_table": "schedules", "inner_table": "projects", "outer_alias": "schd", "inner_alias": "prj", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06906
train
v2
Schema: managers (alias: mgr)(status, id, salary, name) branches(id, date, name, salary) Task: Retrieve salary from managers that have at least one corresponding entry in branches sharing the same id. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.id = mgr.id );
{ "outer_table": "managers", "inner_table": "branches", "outer_alias": "mgr", "inner_alias": "brc", "proj_col": "salary", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06907
train
v2
Schema: products (alias: prod)(date, salary, code, status) departments(code, status, date, salary) Task: Find id from products where a matching record exists in departments with the same type. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = prod.type );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "id", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06908
train
v1
Schema: managers (alias: mgr)(type, code, name, salary) staff(type, status, code, date) Task: Find name from managers where id appears in staff entries with matching code. SQL:
SELECT name FROM managers AS mgr WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.code = mgr.code );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06909
train
v2
Schema: requests (alias: ordr)(date, value, level, amount) categories(status, name, amount, value) Task: Find amount from requests where a matching record exists in categories with the same status. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = ordr.status );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "amount", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06910
train
v1
Schema: regions (alias: rgn)(code, id, salary, level) employees(salary, status, level, type) Task: Select name from regions where level exists in employees for the same level. SQL:
SELECT name FROM regions AS rgn WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.level = rgn.level );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06911
train
v2
Schema: requests (alias: ordr)(id, status, salary, name) categories(status, code, level, salary) Task: Retrieve salary from requests that have at least one corresponding entry in categories sharing the same id. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = ordr.id );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "salary", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06912
train
v2
Schema: regions (alias: rgn)(salary, value, id, code) staff(code, date, amount, level) Task: Retrieve id from regions that have at least one corresponding entry in staff sharing the same level. SQL:
SELECT id 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": "id", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06913
train
v2
Schema: schedules (alias: schd)(name, level, date, salary) items(status, name, type, value) Task: Find value from schedules where a matching record exists in items with the same level. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.level = schd.level );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "value", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06914
train
v1
Schema: regions (alias: rgn)(status, level, id, amount) tasks(level, status, id, code) Task: Select code from regions where id exists in tasks for the same type. SQL:
SELECT code FROM regions AS rgn WHERE id IN ( SELECT id FROM tasks AS tsk WHERE tsk.type = rgn.type );
{ "outer_table": "regions", "inner_table": "tasks", "outer_alias": "rgn", "inner_alias": "tsk", "proj_col": "code", "filter_col": "id", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06915
train
v3
Schema: projects (alias: prj)(date, code, amount, value) managers(name, code, level, status) Task: Find amount from projects where value exceeds the average salary from managers for the same type. SQL:
SELECT amount FROM projects AS prj WHERE value > ( SELECT AVG(salary) FROM managers AS mgr WHERE mgr.type = prj.type );
{ "outer_table": "projects", "inner_table": "managers", "outer_alias": "prj", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06916
train
v2
Schema: accounts (alias: acct)(level, code, value, date) regions(value, status, amount, type) Task: Retrieve name from accounts that have at least one corresponding entry in regions sharing the same code. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = acct.code );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "name", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06917
train
v3
Schema: transactions (alias: txn)(value, type, date, amount) employees(status, level, name, type) Task: Find amount from transactions where value exceeds the total salary from employees for the same type. SQL:
SELECT amount FROM transactions AS txn WHERE value > ( SELECT SUM(salary) 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": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06918
train
v1
Schema: orders (alias: ord)(code, date, status, level) items(amount, id, date, value) Task: Find code from orders where status appears in items entries with matching status. SQL:
SELECT code FROM orders AS ord WHERE status IN ( SELECT status FROM items AS lne WHERE lne.status = ord.status );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "code", "filter_col": "status", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06919
train
v3
Schema: managers (alias: mgr)(value, salary, id, level) invoices(type, salary, amount, status) Task: Retrieve salary from managers with amount above the MIN(value) of invoices rows sharing the same type. SQL:
SELECT salary FROM managers AS mgr WHERE amount > ( SELECT MIN(value) FROM invoices AS inv WHERE inv.type = mgr.type );
{ "outer_table": "managers", "inner_table": "invoices", "outer_alias": "mgr", "inner_alias": "inv", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06920
train
v3
Schema: products (alias: prod)(date, salary, amount, code) items(code, status, salary, level) Task: Find code from products where value exceeds the count of salary from items for the same level. SQL:
SELECT code FROM products AS prod WHERE value > ( SELECT COUNT(salary) FROM items AS lne WHERE lne.level = prod.level );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06921
train
v3
Schema: customers (alias: cust)(value, id, amount, date) products(amount, type, code, salary) Task: Retrieve amount from customers with value above the SUM(value) of products rows sharing the same status. SQL:
SELECT amount FROM customers AS cust WHERE value > ( SELECT SUM(value) FROM products AS prod WHERE prod.status = cust.status );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06922
train
v2
Schema: employees (alias: emp)(value, date, status, type) schedules(salary, value, code, type) Task: Retrieve id from employees that have at least one corresponding entry in schedules sharing the same id. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = emp.id );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "id", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06923
train
v1
Schema: items (alias: lne)(salary, name, amount, id) sales(level, type, date, salary) Task: Find amount from items where code appears in sales entries with matching type. SQL:
SELECT amount FROM items AS lne WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.type = lne.type );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06924
train
v3
Schema: branches (alias: brc)(salary, value, level, amount) sales(code, value, status, id) Task: Retrieve salary from branches with amount above the COUNT(amount) of sales rows sharing the same code. SQL:
SELECT salary FROM branches AS brc WHERE amount > ( SELECT COUNT(amount) FROM sales AS sale WHERE sale.code = brc.code );
{ "outer_table": "branches", "inner_table": "sales", "outer_alias": "brc", "inner_alias": "sale", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_06925
train
v1
Schema: projects (alias: prj)(amount, salary, name, level) sales(level, date, amount, name) Task: Retrieve name from projects whose status is found in sales rows where level matches the outer record. SQL:
SELECT name FROM projects AS prj WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.level = prj.level );
{ "outer_table": "projects", "inner_table": "sales", "outer_alias": "prj", "inner_alias": "sale", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06926
train
v1
Schema: branches (alias: brc)(name, code, salary, value) regions(type, value, date, id) Task: Find name from branches where id appears in regions entries with matching type. SQL:
SELECT name FROM branches AS brc WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.type = brc.type );
{ "outer_table": "branches", "inner_table": "regions", "outer_alias": "brc", "inner_alias": "rgn", "proj_col": "name", "filter_col": "id", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_06927
train
v1
Schema: regions (alias: rgn)(value, amount, salary, level) categories(status, type, value, salary) Task: Find salary from regions where id appears in categories entries with matching id. SQL:
SELECT salary FROM regions AS rgn WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.id = rgn.id );
{ "outer_table": "regions", "inner_table": "categories", "outer_alias": "rgn", "inner_alias": "catg", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06928
train
v2
Schema: invoices (alias: inv)(value, salary, amount, type) regions(code, value, id, type) Task: Find amount from invoices where a matching record exists in regions with the same type. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = inv.type );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "amount", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06929
train
v2
Schema: managers (alias: mgr)(status, amount, salary, name) employees(amount, id, level, value) Task: Retrieve salary from managers that have at least one corresponding entry in employees sharing the same level. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = mgr.level );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "salary", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06930
train
v3
Schema: invoices (alias: inv)(code, value, salary, amount) items(salary, type, amount, name) Task: Find value from invoices where amount exceeds the count of amount from items for the same id. SQL:
SELECT value FROM invoices AS inv WHERE amount > ( SELECT COUNT(amount) FROM items AS lne WHERE lne.id = inv.id );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06931
train
v3
Schema: sales (alias: sale)(value, type, level, salary) projects(date, value, amount, salary) Task: Find value from sales where amount exceeds the count of salary from projects for the same level. SQL:
SELECT value FROM sales AS sale WHERE amount > ( SELECT COUNT(salary) FROM projects AS prj WHERE prj.level = sale.level );
{ "outer_table": "sales", "inner_table": "projects", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06932
train
v3
Schema: regions (alias: rgn)(amount, name, id, date) transactions(date, value, id, amount) Task: Retrieve code from regions with salary above the COUNT(salary) of transactions rows sharing the same type. SQL:
SELECT code FROM regions AS rgn WHERE salary > ( SELECT COUNT(salary) FROM transactions AS txn WHERE txn.type = rgn.type );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06933
train
v2
Schema: managers (alias: mgr)(name, code, id, date) categories(value, salary, id, level) Task: Find amount from managers where a matching record exists in categories with the same code. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = mgr.code );
{ "outer_table": "managers", "inner_table": "categories", "outer_alias": "mgr", "inner_alias": "catg", "proj_col": "amount", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06934
train
v2
Schema: regions (alias: rgn)(amount, status, date, id) transactions(status, type, code, date) Task: Find salary from regions where a matching record exists in transactions with the same id. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = rgn.id );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "salary", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06935
train
v2
Schema: customers (alias: cust)(amount, type, value, status) schedules(id, salary, type, level) Task: Retrieve name from customers that have at least one corresponding entry in schedules sharing the same level. SQL:
SELECT name 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": "name", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06936
train
v2
Schema: shipments (alias: shp)(value, name, status, date) departments(date, value, status, id) Task: Retrieve name from shipments that have at least one corresponding entry in departments sharing the same level. SQL:
SELECT name 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": "name", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_06937
train
v1
Schema: departments (alias: dept)(id, level, status, code) orders(amount, name, value, type) Task: Find code from departments where type appears in orders entries with matching level. SQL:
SELECT code FROM departments AS dept WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.level = dept.level );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "code", "filter_col": "type", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06938
train
v2
Schema: orders (alias: ord)(level, name, status, salary) schedules(code, id, amount, salary) Task: Retrieve amount from orders that have at least one corresponding entry in schedules sharing the same type. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = ord.type );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "amount", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06939
train
v2
Schema: staff (alias: empl)(code, status, id, date) accounts(type, date, id, amount) Task: Find id from staff where a matching record exists in accounts with the same code. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = empl.code );
{ "outer_table": "staff", "inner_table": "accounts", "outer_alias": "empl", "inner_alias": "acct", "proj_col": "id", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_06940
train
v1
Schema: branches (alias: brc)(code, name, salary, type) orders(amount, status, name, level) Task: Select name from branches where code exists in orders for the same code. SQL:
SELECT name FROM branches AS brc WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.code = brc.code );
{ "outer_table": "branches", "inner_table": "orders", "outer_alias": "brc", "inner_alias": "ord", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_06941
train
v3
Schema: items (alias: lne)(id, code, name, value) orders(date, salary, code, type) Task: Retrieve value from items with salary above the COUNT(value) of orders rows sharing the same code. SQL:
SELECT value FROM items AS lne WHERE salary > ( SELECT COUNT(value) FROM orders AS ord WHERE ord.code = lne.code );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06942
train
v1
Schema: departments (alias: dept)(code, salary, amount, type) projects(date, value, status, type) Task: Find code from departments where type appears in projects entries with matching code. SQL:
SELECT code FROM departments AS dept WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.code = dept.code );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06943
train
v3
Schema: invoices (alias: inv)(id, code, level, salary) accounts(type, salary, value, name) Task: Find amount from invoices where value exceeds the minimum value from accounts for the same type. SQL:
SELECT amount FROM invoices AS inv WHERE value > ( SELECT MIN(value) FROM accounts AS acct WHERE acct.type = inv.type );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06944
train
v1
Schema: customers (alias: cust)(code, amount, type, value) orders(date, amount, code, id) Task: Select code from customers where status exists in orders for the same type. SQL:
SELECT code FROM customers AS cust WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.type = cust.type );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06945
train
v2
Schema: transactions (alias: txn)(status, date, salary, id) categories(date, salary, id, amount) Task: Find name from transactions where a matching record exists in categories with the same type. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = txn.type );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "name", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06946
train
v3
Schema: departments (alias: dept)(salary, amount, name, code) schedules(status, date, code, amount) Task: Retrieve id from departments with salary above the COUNT(amount) of schedules rows sharing the same level. SQL:
SELECT id FROM departments AS dept WHERE salary > ( SELECT COUNT(amount) FROM schedules AS schd WHERE schd.level = dept.level );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06947
train
v3
Schema: orders (alias: ord)(level, code, amount, value) managers(type, date, salary, name) Task: Retrieve code from orders with amount above the SUM(value) of managers rows sharing the same type. SQL:
SELECT code FROM orders AS ord WHERE amount > ( SELECT SUM(value) FROM managers AS mgr WHERE mgr.type = ord.type );
{ "outer_table": "orders", "inner_table": "managers", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06948
train
v1
Schema: transactions (alias: txn)(status, id, type, code) requests(amount, status, date, name) Task: Retrieve code from transactions whose code is found in requests rows where code matches the outer record. SQL:
SELECT code FROM transactions AS txn WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.code = txn.code );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06949
train
v1
Schema: departments (alias: dept)(salary, id, status, value) customers(amount, value, status, date) Task: Retrieve name from departments whose code is found in customers rows where id matches the outer record. SQL:
SELECT name FROM departments AS dept WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.id = dept.id );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06950
train
v3
Schema: accounts (alias: acct)(salary, level, date, code) sales(code, type, status, salary) Task: Retrieve id from accounts with salary above the COUNT(value) of sales rows sharing the same status. SQL:
SELECT id FROM accounts AS acct WHERE salary > ( SELECT COUNT(value) FROM sales AS sale WHERE sale.status = acct.status );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06951
train
v1
Schema: shipments (alias: shp)(status, date, amount, id) projects(code, level, id, status) Task: Find value from shipments where status appears in projects entries with matching level. SQL:
SELECT value FROM shipments AS shp WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.level = shp.level );
{ "outer_table": "shipments", "inner_table": "projects", "outer_alias": "shp", "inner_alias": "prj", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_06952
train
v3
Schema: items (alias: lne)(salary, value, id, status) departments(value, status, id, level) Task: Retrieve code from items with amount above the SUM(value) of departments rows sharing the same status. SQL:
SELECT code FROM items AS lne WHERE amount > ( SELECT SUM(value) FROM departments AS dept WHERE dept.status = lne.status );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06953
train
v2
Schema: shipments (alias: shp)(status, id, level, code) products(status, salary, code, name) Task: Find value from shipments where a matching record exists in products with the same id. SQL:
SELECT value FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = shp.id );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "value", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_06954
train
v2
Schema: managers (alias: mgr)(type, date, amount, level) accounts(level, id, amount, status) Task: Retrieve value from managers that have at least one corresponding entry in accounts sharing the same id. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = mgr.id );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "value", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06955
train
v1
Schema: departments (alias: dept)(id, date, name, value) items(type, date, name, code) Task: Select amount from departments where id exists in items for the same type. SQL:
SELECT amount FROM departments AS dept WHERE id IN ( SELECT id FROM items AS lne WHERE lne.type = dept.type );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06956
train
v2
Schema: managers (alias: mgr)(salary, name, status, amount) branches(level, status, salary, value) Task: Retrieve id from managers that have at least one corresponding entry in branches sharing the same type. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = mgr.type );
{ "outer_table": "managers", "inner_table": "branches", "outer_alias": "mgr", "inner_alias": "brc", "proj_col": "id", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06957
train
v2
Schema: shipments (alias: shp)(amount, date, value, salary) requests(id, name, level, type) Task: Retrieve name from shipments that have at least one corresponding entry in requests sharing the same code. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = shp.code );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "name", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_06958
train
v3
Schema: departments (alias: dept)(status, code, value, id) projects(status, type, value, date) Task: Find code from departments where value exceeds the average salary from projects for the same type. SQL:
SELECT code FROM departments AS dept WHERE value > ( SELECT AVG(salary) FROM projects AS prj WHERE prj.type = dept.type );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06959
train
v3
Schema: items (alias: lne)(level, date, name, code) schedules(type, id, date, amount) Task: Find amount from items where amount exceeds the maximum amount from schedules for the same type. SQL:
SELECT amount FROM items AS lne WHERE amount > ( SELECT MAX(amount) FROM schedules AS schd WHERE schd.type = lne.type );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06960
train
v2
Schema: invoices (alias: inv)(status, id, salary, amount) requests(date, salary, level, id) Task: Find salary from invoices where a matching record exists in requests with the same type. SQL:
SELECT salary FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = inv.type );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "salary", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06961
train
v2
Schema: customers (alias: cust)(name, status, id, value) shipments(salary, code, value, date) Task: Find code from customers where a matching record exists in shipments with the same level. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = cust.level );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "code", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06962
train
v2
Schema: regions (alias: rgn)(salary, date, status, code) tasks(name, amount, value, salary) Task: Find id from regions where a matching record exists in tasks with the same status. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = rgn.status );
{ "outer_table": "regions", "inner_table": "tasks", "outer_alias": "rgn", "inner_alias": "tsk", "proj_col": "id", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06963
train
v1
Schema: employees (alias: emp)(date, amount, value, code) regions(value, amount, level, id) Task: Find code from employees where level appears in regions entries with matching code. SQL:
SELECT code FROM employees AS emp WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.code = emp.code );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06964
train
v2
Schema: schedules (alias: schd)(code, type, date, value) orders(status, id, type, code) Task: Find name from schedules where a matching record exists in orders with the same level. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = schd.level );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "name", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06965
train
v2
Schema: sales (alias: sale)(type, level, date, name) accounts(type, amount, salary, status) Task: Retrieve id from sales that have at least one corresponding entry in accounts sharing the same id. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = sale.id );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "id", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06966
train
v1
Schema: invoices (alias: inv)(status, amount, value, date) employees(date, type, amount, status) Task: Find code from invoices where id appears in employees entries with matching type. SQL:
SELECT code FROM invoices AS inv WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.type = inv.type );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "code", "filter_col": "id", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06967
train
v3
Schema: employees (alias: emp)(code, salary, date, value) schedules(amount, value, status, code) Task: Retrieve name from employees with value above the SUM(salary) of schedules rows sharing the same code. SQL:
SELECT name FROM employees AS emp WHERE value > ( SELECT SUM(salary) FROM schedules AS schd WHERE schd.code = emp.code );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06968
train
v2
Schema: items (alias: lne)(amount, id, date, name) requests(level, code, id, date) Task: Retrieve salary from items that have at least one corresponding entry in requests sharing the same id. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = lne.id );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "salary", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06969
train
v1
Schema: branches (alias: brc)(salary, level, value, date) sales(type, amount, date, name) Task: Select name from branches where type exists in sales for the same status. SQL:
SELECT name FROM branches AS brc WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.status = brc.status );
{ "outer_table": "branches", "inner_table": "sales", "outer_alias": "brc", "inner_alias": "sale", "proj_col": "name", "filter_col": "type", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_06970
train
v2
Schema: categories (alias: catg)(level, name, amount, value) sales(name, salary, type, status) Task: Retrieve code from categories that have at least one corresponding entry in sales sharing the same level. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = catg.level );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "code", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06971
train
v1
Schema: shipments (alias: shp)(amount, code, salary, name) products(amount, value, level, salary) Task: Find code from shipments where level appears in products entries with matching type. SQL:
SELECT code FROM shipments AS shp WHERE level IN ( SELECT level FROM products AS prod WHERE prod.type = shp.type );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_06972
train
v3
Schema: requests (alias: ordr)(code, name, status, type) employees(id, name, status, type) Task: Retrieve salary from requests with value above the AVG(value) of employees rows sharing the same status. SQL:
SELECT salary FROM requests AS ordr WHERE value > ( SELECT AVG(value) FROM employees AS emp WHERE emp.status = ordr.status );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06973
train
v3
Schema: managers (alias: mgr)(date, amount, salary, id) invoices(type, id, status, amount) Task: Find amount from managers where amount exceeds the average value from invoices for the same id. SQL:
SELECT amount FROM managers AS mgr WHERE amount > ( SELECT AVG(value) FROM invoices AS inv WHERE inv.id = mgr.id );
{ "outer_table": "managers", "inner_table": "invoices", "outer_alias": "mgr", "inner_alias": "inv", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06974
train
v2
Schema: schedules (alias: schd)(amount, type, id, salary) accounts(level, date, name, type) Task: Retrieve amount from schedules that have at least one corresponding entry in accounts sharing the same type. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = schd.type );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "amount", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06975
train
v1
Schema: requests (alias: ordr)(salary, amount, date, value) accounts(status, amount, salary, id) Task: Find salary from requests where status appears in accounts entries with matching status. SQL:
SELECT salary FROM requests AS ordr WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.status = ordr.status );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06976
train
v2
Schema: tasks (alias: tsk)(code, amount, status, value) categories(level, code, type, salary) Task: Find name from tasks where a matching record exists in categories with the same id. SQL:
SELECT name FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "categories", "outer_alias": "tsk", "inner_alias": "catg", "proj_col": "name", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_06977
train
v1
Schema: orders (alias: ord)(salary, date, id, status) items(id, status, level, amount) Task: Select salary from orders where status exists in items for the same type. SQL:
SELECT salary FROM orders AS ord WHERE status IN ( SELECT status FROM items AS lne WHERE lne.type = ord.type );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06978
train
v2
Schema: transactions (alias: txn)(salary, name, id, date) regions(id, code, name, value) Task: Retrieve id from transactions that have at least one corresponding entry in regions sharing the same id. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = txn.id );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "id", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06979
train
v3
Schema: products (alias: prod)(level, type, date, salary) branches(type, level, status, code) Task: Find amount from products where salary exceeds the minimum amount from branches for the same id. SQL:
SELECT amount FROM products AS prod WHERE salary > ( SELECT MIN(amount) FROM branches AS brc WHERE brc.id = prod.id );
{ "outer_table": "products", "inner_table": "branches", "outer_alias": "prod", "inner_alias": "brc", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06980
train
v3
Schema: requests (alias: ordr)(id, name, level, status) employees(date, id, code, salary) Task: Retrieve value from requests with value above the AVG(amount) of employees rows sharing the same type. SQL:
SELECT value FROM requests AS ordr WHERE value > ( SELECT AVG(amount) FROM employees AS emp WHERE emp.type = ordr.type );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06981
train
v2
Schema: customers (alias: cust)(type, name, date, value) regions(code, type, date, value) Task: Retrieve id from customers that have at least one corresponding entry in regions sharing the same id. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = cust.id );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "id", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06982
train
v1
Schema: invoices (alias: inv)(salary, value, status, code) employees(status, name, type, amount) Task: Select code from invoices where level exists in employees for the same code. SQL:
SELECT code FROM invoices AS inv WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.code = inv.code );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06983
train
v2
Schema: customers (alias: cust)(date, salary, amount, level) accounts(code, id, amount, value) Task: Find code from customers where a matching record exists in accounts with the same code. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = cust.code );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06984
train
v1
Schema: orders (alias: ord)(code, type, date, amount) employees(salary, value, code, type) Task: Find salary from orders where status appears in employees entries with matching status. SQL:
SELECT salary FROM orders AS ord WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.status = ord.status );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06985
train
v3
Schema: regions (alias: rgn)(date, name, id, code) categories(id, date, value, amount) Task: Find code from regions where salary exceeds the average value from categories for the same level. SQL:
SELECT code FROM regions AS rgn WHERE salary > ( SELECT AVG(value) FROM categories AS catg WHERE catg.level = rgn.level );
{ "outer_table": "regions", "inner_table": "categories", "outer_alias": "rgn", "inner_alias": "catg", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06986
train
v2
Schema: requests (alias: ordr)(type, level, name, salary) orders(id, level, salary, value) Task: Retrieve name from requests that have at least one corresponding entry in orders sharing the same id. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = ordr.id );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "name", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06987
train
v1
Schema: schedules (alias: schd)(name, id, date, status) projects(level, name, date, code) Task: Find code from schedules where id appears in projects entries with matching status. SQL:
SELECT code FROM schedules AS schd WHERE id IN ( SELECT id FROM projects AS prj WHERE prj.status = schd.status );
{ "outer_table": "schedules", "inner_table": "projects", "outer_alias": "schd", "inner_alias": "prj", "proj_col": "code", "filter_col": "id", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06988
train
v2
Schema: tasks (alias: tsk)(type, date, value, name) products(id, type, code, date) Task: Retrieve id from tasks that have at least one corresponding entry in products sharing the same type. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "products", "outer_alias": "tsk", "inner_alias": "prod", "proj_col": "id", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_06989
train
v3
Schema: customers (alias: cust)(type, level, salary, name) projects(date, salary, id, value) Task: Retrieve code from customers with salary above the MIN(salary) of projects rows sharing the same id. SQL:
SELECT code FROM customers AS cust WHERE salary > ( SELECT MIN(salary) FROM projects AS prj WHERE prj.id = cust.id );
{ "outer_table": "customers", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "prj", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06990
train
v1
Schema: shipments (alias: shp)(code, value, type, salary) invoices(type, salary, code, name) Task: Retrieve id from shipments whose status is found in invoices rows where status matches the outer record. SQL:
SELECT id FROM shipments AS shp WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.status = shp.status );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_06991
train
v3
Schema: orders (alias: ord)(value, date, amount, status) schedules(type, code, amount, status) Task: Find amount from orders where salary exceeds the total value from schedules for the same code. SQL:
SELECT amount FROM orders AS ord WHERE salary > ( SELECT SUM(value) FROM schedules AS schd WHERE schd.code = ord.code );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06992
train
v1
Schema: employees (alias: emp)(id, salary, value, level) categories(level, amount, type, name) Task: Retrieve name from employees whose type is found in categories rows where type matches the outer record. SQL:
SELECT name FROM employees AS emp WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.type = emp.type );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "name", "filter_col": "type", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06993
train
v2
Schema: employees (alias: emp)(name, code, status, level) orders(level, date, id, status) Task: Retrieve code from employees that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = emp.level );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "code", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06994
train
v2
Schema: requests (alias: ordr)(id, value, name, date) regions(amount, type, level, status) Task: Retrieve code from requests that have at least one corresponding entry in regions sharing the same type. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = ordr.type );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "code", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06995
train
v3
Schema: employees (alias: emp)(type, id, name, code) orders(value, salary, amount, date) Task: Retrieve salary from employees with value above the MAX(amount) of orders rows sharing the same type. SQL:
SELECT salary FROM employees AS emp WHERE value > ( SELECT MAX(amount) FROM orders AS ord WHERE ord.type = emp.type );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06996
train
v1
Schema: invoices (alias: inv)(salary, date, code, type) customers(value, name, code, date) Task: Retrieve name from invoices whose code is found in customers rows where type matches the outer record. SQL:
SELECT name FROM invoices AS inv WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.type = inv.type );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "name", "filter_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06997
train
v3
Schema: sales (alias: sale)(salary, date, name, value) managers(type, code, id, amount) Task: Find id from sales where amount exceeds the minimum salary from managers for the same status. SQL:
SELECT id FROM sales AS sale WHERE amount > ( SELECT MIN(salary) FROM managers AS mgr WHERE mgr.status = sale.status );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06998
train
v1
Schema: invoices (alias: inv)(value, id, name, level) shipments(level, id, name, amount) Task: Select amount from invoices where id exists in shipments for the same id. SQL:
SELECT amount FROM invoices AS inv WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.id = inv.id );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "amount", "filter_col": "id", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06999
train