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
v3
Schema: invoices (alias: inv)(level, type, status, value) transactions(name, date, salary, amount) Task: Find salary from invoices where salary exceeds the average value from transactions for the same status. SQL:
SELECT salary FROM invoices AS inv WHERE salary > ( SELECT AVG(value) FROM transactions AS txn WHERE txn.status = inv.status );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15700
train
v2
Schema: sales (alias: sale)(id, value, type, name) tasks(type, code, name, value) Task: Retrieve value from sales that have at least one corresponding entry in tasks sharing the same status. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = sale.status );
{ "outer_table": "sales", "inner_table": "tasks", "outer_alias": "sale", "inner_alias": "tsk", "proj_col": "value", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15701
train
v3
Schema: tasks (alias: tsk)(type, date, id, amount) schedules(code, value, id, type) Task: Find amount from tasks where value exceeds the maximum amount from schedules for the same level. SQL:
SELECT amount FROM tasks AS tsk WHERE value > ( SELECT MAX(amount) FROM schedules AS schd WHERE schd.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "schedules", "outer_alias": "tsk", "inner_alias": "schd", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15702
train
v3
Schema: managers (alias: mgr)(code, level, amount, date) tasks(date, name, id, amount) Task: Find id from managers where value exceeds the count of salary from tasks for the same id. SQL:
SELECT id FROM managers AS mgr WHERE value > ( SELECT COUNT(salary) FROM tasks AS tsk WHERE tsk.id = mgr.id );
{ "outer_table": "managers", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "tsk", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15703
train
v2
Schema: tasks (alias: tsk)(level, value, status, name) employees(salary, status, value, level) Task: Find amount from tasks where a matching record exists in employees with the same id. SQL:
SELECT amount FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "employees", "outer_alias": "tsk", "inner_alias": "emp", "proj_col": "amount", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15704
train
v1
Schema: shipments (alias: shp)(salary, type, amount, date) products(id, name, level, date) Task: Retrieve value from shipments whose id is found in products rows where status matches the outer record. SQL:
SELECT value FROM shipments AS shp WHERE id IN ( SELECT id FROM products AS prod WHERE prod.status = shp.status );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15705
train
v3
Schema: staff (alias: empl)(id, name, code, status) requests(code, date, name, id) Task: Retrieve name from staff with salary above the COUNT(value) of requests rows sharing the same id. SQL:
SELECT name FROM staff AS empl WHERE salary > ( SELECT COUNT(value) FROM requests AS ordr WHERE ordr.id = empl.id );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_15706
train
v2
Schema: products (alias: prod)(name, id, amount, code) items(status, value, code, type) Task: Retrieve amount from products that have at least one corresponding entry in items sharing the same type. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = prod.type );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "amount", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15707
train
v1
Schema: tasks (alias: tsk)(type, amount, name, value) branches(value, code, status, salary) Task: Retrieve name from tasks whose status is found in branches rows where status matches the outer record. SQL:
SELECT name FROM tasks AS tsk WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "branches", "outer_alias": "tsk", "inner_alias": "brc", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15708
train
v1
Schema: managers (alias: mgr)(level, salary, date, code) departments(status, type, code, amount) Task: Find amount from managers where level appears in departments entries with matching code. SQL:
SELECT amount FROM managers AS mgr WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.code = mgr.code );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15709
train
v2
Schema: employees (alias: emp)(date, amount, name, code) managers(value, salary, level, status) Task: Retrieve amount from employees that have at least one corresponding entry in managers sharing the same code. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = emp.code );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "amount", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15710
train
v3
Schema: sales (alias: sale)(level, code, value, type) invoices(code, name, date, id) Task: Find id from sales where amount exceeds the average salary from invoices for the same level. SQL:
SELECT id FROM sales AS sale WHERE amount > ( SELECT AVG(salary) FROM invoices AS inv WHERE inv.level = sale.level );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15711
train
v1
Schema: items (alias: lne)(name, value, status, date) branches(level, value, id, status) Task: Select name from items where code exists in branches for the same type. SQL:
SELECT name FROM items AS lne WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.type = lne.type );
{ "outer_table": "items", "inner_table": "branches", "outer_alias": "lne", "inner_alias": "brc", "proj_col": "name", "filter_col": "code", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15712
train
v2
Schema: projects (alias: prj)(code, type, amount, name) items(amount, id, date, type) Task: Find value from projects where a matching record exists in items with the same code. SQL:
SELECT value FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = prj.code );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "lne", "proj_col": "value", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_15713
train
v3
Schema: customers (alias: cust)(id, salary, amount, code) staff(id, amount, status, type) Task: Find amount from customers where amount exceeds the maximum amount from staff for the same type. SQL:
SELECT amount FROM customers AS cust WHERE amount > ( SELECT MAX(amount) FROM staff AS empl WHERE empl.type = cust.type );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15714
train
v3
Schema: sales (alias: sale)(name, value, level, code) projects(value, id, code, date) Task: Retrieve amount from sales with value above the MIN(value) of projects rows sharing the same type. SQL:
SELECT amount FROM sales AS sale WHERE value > ( SELECT MIN(value) FROM projects AS prj WHERE prj.type = sale.type );
{ "outer_table": "sales", "inner_table": "projects", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15715
train
v2
Schema: requests (alias: ordr)(date, name, status, level) employees(amount, date, id, level) Task: Find value from requests where a matching record exists in employees with the same level. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = ordr.level );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "value", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_15716
train
v3
Schema: branches (alias: brc)(value, amount, level, name) categories(id, code, status, amount) Task: Find id from branches where salary exceeds the count of salary from categories for the same type. SQL:
SELECT id FROM branches AS brc WHERE salary > ( SELECT COUNT(salary) FROM categories AS catg WHERE catg.type = brc.type );
{ "outer_table": "branches", "inner_table": "categories", "outer_alias": "brc", "inner_alias": "catg", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_15717
train
v1
Schema: requests (alias: ordr)(status, id, amount, code) shipments(status, id, amount, type) Task: Retrieve id from requests whose code is found in shipments rows where level matches the outer record. SQL:
SELECT id FROM requests AS ordr WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.level = ordr.level );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "id", "filter_col": "code", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_15718
train
v1
Schema: employees (alias: emp)(date, status, level, amount) regions(name, level, salary, type) Task: Find code from employees where id appears in regions entries with matching level. SQL:
SELECT code FROM employees AS emp WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.level = emp.level );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "code", "filter_col": "id", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15719
train
v2
Schema: regions (alias: rgn)(status, salary, name, code) schedules(code, salary, id, name) Task: Find amount from regions where a matching record exists in schedules with the same id. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = rgn.id );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "amount", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_15720
train
v1
Schema: managers (alias: mgr)(id, level, salary, name) schedules(level, name, type, salary) Task: Select code from managers where status exists in schedules for the same code. SQL:
SELECT code FROM managers AS mgr WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.code = mgr.code );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "code", "filter_col": "status", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15721
train
v1
Schema: transactions (alias: txn)(amount, code, name, status) invoices(id, name, code, value) Task: Select amount from transactions where id exists in invoices for the same type. SQL:
SELECT amount FROM transactions AS txn WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.type = txn.type );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15722
train
v1
Schema: products (alias: prod)(name, salary, date, amount) tasks(salary, name, value, code) Task: Select code from products where status exists in tasks for the same level. SQL:
SELECT code FROM products AS prod WHERE status IN ( SELECT status FROM tasks AS tsk WHERE tsk.level = prod.level );
{ "outer_table": "products", "inner_table": "tasks", "outer_alias": "prod", "inner_alias": "tsk", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15723
train
v3
Schema: branches (alias: brc)(type, amount, value, salary) sales(date, level, amount, value) Task: Retrieve name from branches with value above the MAX(value) of sales rows sharing the same status. SQL:
SELECT name FROM branches AS brc WHERE value > ( SELECT MAX(value) 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": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_15724
train
v2
Schema: regions (alias: rgn)(level, status, code, date) managers(status, type, date, id) Task: Retrieve amount from regions that have at least one corresponding entry in managers sharing the same status. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = rgn.status );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "amount", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_15725
train
v1
Schema: products (alias: prod)(type, amount, id, date) branches(date, amount, type, value) Task: Retrieve amount from products whose code is found in branches rows where id matches the outer record. SQL:
SELECT amount FROM products AS prod WHERE code IN ( SELECT code 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": "code", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15726
train
v2
Schema: customers (alias: cust)(date, level, salary, value) transactions(code, level, name, amount) Task: Retrieve id from customers that have at least one corresponding entry in transactions sharing the same code. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = cust.code );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "id", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15727
train
v3
Schema: transactions (alias: txn)(id, salary, type, value) staff(code, date, name, type) Task: Retrieve value from transactions with salary above the MAX(value) of staff rows sharing the same type. SQL:
SELECT value FROM transactions AS txn WHERE salary > ( SELECT MAX(value) FROM staff AS empl WHERE empl.type = txn.type );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15728
train
v3
Schema: items (alias: lne)(salary, date, id, amount) orders(level, amount, name, type) Task: Find amount from items where value exceeds the minimum amount from orders for the same code. SQL:
SELECT amount FROM items AS lne WHERE value > ( SELECT MIN(amount) FROM orders AS ord WHERE ord.code = lne.code );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15729
train
v1
Schema: tasks (alias: tsk)(type, level, id, name) schedules(value, level, name, amount) Task: Find id from tasks where type appears in schedules entries with matching level. SQL:
SELECT id FROM tasks AS tsk WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "schedules", "outer_alias": "tsk", "inner_alias": "schd", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15730
train
v2
Schema: branches (alias: brc)(status, salary, code, amount) categories(name, amount, date, type) Task: Retrieve name from branches that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT name FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = brc.code );
{ "outer_table": "branches", "inner_table": "categories", "outer_alias": "brc", "inner_alias": "catg", "proj_col": "name", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_15731
train
v3
Schema: managers (alias: mgr)(value, id, code, status) accounts(code, type, salary, level) Task: Retrieve code from managers with amount above the MAX(value) of accounts rows sharing the same id. SQL:
SELECT code FROM managers AS mgr WHERE amount > ( SELECT MAX(value) FROM accounts AS acct WHERE acct.id = mgr.id );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15732
train
v1
Schema: customers (alias: cust)(level, code, id, status) branches(level, amount, date, code) Task: Select name from customers where type exists in branches for the same code. SQL:
SELECT name FROM customers AS cust WHERE type IN ( SELECT type FROM branches AS brc WHERE brc.code = cust.code );
{ "outer_table": "customers", "inner_table": "branches", "outer_alias": "cust", "inner_alias": "brc", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15733
train
v2
Schema: items (alias: lne)(date, id, code, type) tasks(value, type, amount, id) Task: Retrieve salary from items that have at least one corresponding entry in tasks sharing the same status. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = lne.status );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "salary", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15734
train
v2
Schema: tasks (alias: tsk)(date, status, value, level) departments(date, code, name, salary) Task: Find salary from tasks where a matching record exists in departments with the same id. SQL:
SELECT salary FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "departments", "outer_alias": "tsk", "inner_alias": "dept", "proj_col": "salary", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15735
train
v3
Schema: schedules (alias: schd)(code, date, name, id) regions(name, id, date, status) Task: Retrieve name from schedules with value above the AVG(amount) of regions rows sharing the same code. SQL:
SELECT name FROM schedules AS schd WHERE value > ( SELECT AVG(amount) FROM regions AS rgn WHERE rgn.code = schd.code );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15736
train
v1
Schema: staff (alias: empl)(code, salary, date, value) products(amount, salary, value, status) Task: Retrieve code from staff whose type is found in products rows where status matches the outer record. SQL:
SELECT code FROM staff AS empl WHERE type IN ( SELECT type FROM products AS prod WHERE prod.status = empl.status );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_15737
train
v3
Schema: branches (alias: brc)(code, level, value, type) managers(code, value, date, level) Task: Find code from branches where salary exceeds the minimum salary from managers for the same level. SQL:
SELECT code FROM branches AS brc WHERE salary > ( SELECT MIN(salary) FROM managers AS mgr WHERE mgr.level = brc.level );
{ "outer_table": "branches", "inner_table": "managers", "outer_alias": "brc", "inner_alias": "mgr", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_15738
train
v2
Schema: sales (alias: sale)(value, salary, level, type) accounts(type, salary, value, id) Task: Find name from sales where a matching record exists in accounts with the same status. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = sale.status );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "name", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15739
train
v3
Schema: schedules (alias: schd)(id, name, value, level) products(type, salary, name, level) Task: Retrieve code from schedules with salary above the AVG(salary) of products rows sharing the same code. SQL:
SELECT code FROM schedules AS schd WHERE salary > ( SELECT AVG(salary) FROM products AS prod WHERE prod.code = schd.code );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15740
train
v3
Schema: transactions (alias: txn)(salary, status, code, amount) shipments(level, date, name, code) Task: Retrieve code from transactions with value above the COUNT(value) of shipments rows sharing the same level. SQL:
SELECT code FROM transactions AS txn WHERE value > ( SELECT COUNT(value) FROM shipments AS shp WHERE shp.level = txn.level );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15741
train
v2
Schema: products (alias: prod)(status, type, code, salary) tasks(amount, status, salary, name) Task: Find salary from products where a matching record exists in tasks with the same code. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.code = prod.code );
{ "outer_table": "products", "inner_table": "tasks", "outer_alias": "prod", "inner_alias": "tsk", "proj_col": "salary", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15742
train
v1
Schema: branches (alias: brc)(value, status, salary, level) requests(salary, amount, level, value) Task: Retrieve code from branches whose level is found in requests rows where id matches the outer record. SQL:
SELECT code FROM branches AS brc WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.id = brc.id );
{ "outer_table": "branches", "inner_table": "requests", "outer_alias": "brc", "inner_alias": "ordr", "proj_col": "code", "filter_col": "level", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_15743
train
v1
Schema: accounts (alias: acct)(amount, id, salary, code) managers(status, name, amount, id) Task: Find value from accounts where type appears in managers entries with matching id. SQL:
SELECT value FROM accounts AS acct WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.id = acct.id );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "value", "filter_col": "type", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15744
train
v2
Schema: requests (alias: ordr)(date, level, code, salary) items(code, date, amount, id) Task: Find value from requests where a matching record exists in items with the same status. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = ordr.status );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "value", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_15745
train
v3
Schema: tasks (alias: tsk)(type, amount, salary, status) categories(amount, date, status, id) Task: Retrieve id from tasks with value above the SUM(amount) of categories rows sharing the same id. SQL:
SELECT id FROM tasks AS tsk WHERE value > ( SELECT SUM(amount) FROM categories AS catg WHERE catg.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "categories", "outer_alias": "tsk", "inner_alias": "catg", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15746
train
v2
Schema: items (alias: lne)(amount, status, level, type) transactions(id, salary, code, value) Task: Find code from items where a matching record exists in transactions with the same code. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = lne.code );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "code", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15747
train
v2
Schema: departments (alias: dept)(status, type, value, id) accounts(salary, type, name, value) Task: Retrieve code from departments that have at least one corresponding entry in accounts sharing the same type. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = dept.type );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "code", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15748
train
v1
Schema: categories (alias: catg)(value, id, date, name) employees(date, code, status, id) Task: Select salary from categories where type exists in employees for the same type. SQL:
SELECT salary FROM categories AS catg WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.type = catg.type );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15749
train
v2
Schema: regions (alias: rgn)(date, id, amount, type) departments(level, salary, type, status) Task: Retrieve amount from regions that have at least one corresponding entry in departments sharing the same status. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = rgn.status );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "amount", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_15750
train
v3
Schema: shipments (alias: shp)(level, id, date, value) items(type, level, amount, salary) Task: Find salary from shipments where value exceeds the average salary from items for the same type. SQL:
SELECT salary FROM shipments AS shp WHERE value > ( SELECT AVG(salary) FROM items AS lne WHERE lne.type = shp.type );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15751
train
v1
Schema: transactions (alias: txn)(name, level, status, value) regions(name, code, date, id) Task: Find amount from transactions where id appears in regions entries with matching type. SQL:
SELECT amount FROM transactions AS txn WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.type = txn.type );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15752
train
v2
Schema: products (alias: prod)(code, amount, salary, status) regions(status, amount, name, id) Task: Find id from products where a matching record exists in regions with the same type. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = prod.type );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "id", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15753
train
v1
Schema: products (alias: prod)(level, value, status, salary) tasks(name, id, amount, type) Task: Select name from products where id exists in tasks for the same code. SQL:
SELECT name FROM products AS prod WHERE id IN ( SELECT id FROM tasks AS tsk WHERE tsk.code = prod.code );
{ "outer_table": "products", "inner_table": "tasks", "outer_alias": "prod", "inner_alias": "tsk", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15754
train
v3
Schema: products (alias: prod)(value, salary, id, level) projects(level, type, name, status) Task: Find name from products where value exceeds the count of salary from projects for the same status. SQL:
SELECT name FROM products AS prod WHERE value > ( SELECT COUNT(salary) FROM projects AS prj WHERE prj.status = prod.status );
{ "outer_table": "products", "inner_table": "projects", "outer_alias": "prod", "inner_alias": "prj", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15755
train
v3
Schema: invoices (alias: inv)(salary, level, date, id) departments(status, name, date, amount) Task: Retrieve value from invoices with amount above the SUM(salary) of departments rows sharing the same status. SQL:
SELECT value FROM invoices AS inv WHERE amount > ( SELECT SUM(salary) FROM departments AS dept WHERE dept.status = inv.status );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15756
train
v1
Schema: tasks (alias: tsk)(value, code, id, salary) departments(id, type, value, level) Task: Select id from tasks where status exists in departments for the same code. SQL:
SELECT id FROM tasks AS tsk WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "departments", "outer_alias": "tsk", "inner_alias": "dept", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15757
train
v3
Schema: customers (alias: cust)(level, id, type, date) items(type, code, salary, id) Task: Find id from customers where salary exceeds the count of value from items for the same type. SQL:
SELECT id FROM customers AS cust WHERE salary > ( SELECT COUNT(value) FROM items AS lne WHERE lne.type = cust.type );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15758
train
v1
Schema: branches (alias: brc)(date, code, name, salary) transactions(date, code, status, type) Task: Find amount from branches where id appears in transactions entries with matching id. SQL:
SELECT amount FROM branches AS brc WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.id = brc.id );
{ "outer_table": "branches", "inner_table": "transactions", "outer_alias": "brc", "inner_alias": "txn", "proj_col": "amount", "filter_col": "id", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_15759
train
v1
Schema: requests (alias: ordr)(code, salary, id, value) schedules(name, date, amount, level) Task: Retrieve value from requests whose level is found in schedules rows where code matches the outer record. SQL:
SELECT value FROM requests AS ordr WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.code = ordr.code );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_15760
train
v1
Schema: regions (alias: rgn)(type, level, date, value) accounts(type, amount, salary, code) Task: Select id from regions where status exists in accounts for the same level. SQL:
SELECT id FROM regions AS rgn WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.level = rgn.level );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "rgn", "inner_alias": "acct", "proj_col": "id", "filter_col": "status", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_15761
train
v2
Schema: customers (alias: cust)(date, type, id, amount) schedules(date, type, value, code) Task: Find value from customers where a matching record exists in schedules with the same code. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = cust.code );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "value", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15762
train
v1
Schema: invoices (alias: inv)(id, type, status, date) requests(type, status, date, name) Task: Retrieve name from invoices whose type is found in requests rows where status matches the outer record. SQL:
SELECT name FROM invoices AS inv WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.status = inv.status );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "name", "filter_col": "type", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15763
train
v2
Schema: requests (alias: ordr)(amount, level, value, salary) orders(id, name, salary, level) Task: Find salary from requests where a matching record exists in orders with the same level. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = ordr.level );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "salary", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_15764
train
v1
Schema: customers (alias: cust)(type, salary, name, id) shipments(value, status, name, level) Task: Retrieve amount from customers whose type is found in shipments rows where id matches the outer record. SQL:
SELECT amount FROM customers AS cust WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.id = cust.id );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15765
train
v3
Schema: projects (alias: prj)(name, status, salary, type) regions(date, amount, id, salary) Task: Retrieve amount from projects with value above the MAX(amount) of regions rows sharing the same level. SQL:
SELECT amount FROM projects AS prj WHERE value > ( SELECT MAX(amount) FROM regions AS rgn WHERE rgn.level = prj.level );
{ "outer_table": "projects", "inner_table": "regions", "outer_alias": "prj", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_15766
train
v3
Schema: accounts (alias: acct)(id, date, name, amount) requests(type, status, value, code) Task: Find salary from accounts where amount exceeds the maximum salary from requests for the same id. SQL:
SELECT salary FROM accounts AS acct WHERE amount > ( SELECT MAX(salary) FROM requests AS ordr WHERE ordr.id = acct.id );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15767
train
v3
Schema: requests (alias: ordr)(amount, status, value, id) projects(value, level, name, type) Task: Find amount from requests where value exceeds the maximum amount from projects for the same type. SQL:
SELECT amount FROM requests AS ordr WHERE value > ( SELECT MAX(amount) FROM projects AS prj WHERE prj.type = ordr.type );
{ "outer_table": "requests", "inner_table": "projects", "outer_alias": "ordr", "inner_alias": "prj", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_15768
train
v3
Schema: invoices (alias: inv)(name, code, level, date) tasks(id, type, date, salary) Task: Retrieve name from invoices with amount above the MAX(salary) of tasks rows sharing the same level. SQL:
SELECT name FROM invoices AS inv WHERE amount > ( SELECT MAX(salary) FROM tasks AS tsk WHERE tsk.level = inv.level );
{ "outer_table": "invoices", "inner_table": "tasks", "outer_alias": "inv", "inner_alias": "tsk", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15769
train
v1
Schema: items (alias: lne)(name, id, level, status) schedules(salary, value, amount, date) Task: Retrieve salary from items whose status is found in schedules rows where level matches the outer record. SQL:
SELECT salary FROM items AS lne WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.level = lne.level );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15770
train
v1
Schema: categories (alias: catg)(salary, name, id, code) schedules(code, name, id, type) Task: Select id from categories where id exists in schedules for the same level. SQL:
SELECT id FROM categories AS catg WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.level = catg.level );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15771
train
v2
Schema: staff (alias: empl)(status, date, amount, value) invoices(level, code, amount, value) Task: Retrieve name from staff that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT name FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = empl.type );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "name", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_15772
train
v3
Schema: requests (alias: ordr)(value, status, name, code) categories(id, amount, code, name) Task: Retrieve code from requests with value above the COUNT(amount) of categories rows sharing the same id. SQL:
SELECT code FROM requests AS ordr WHERE value > ( SELECT COUNT(amount) FROM categories AS catg WHERE catg.id = ordr.id );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_15773
train
v1
Schema: tasks (alias: tsk)(code, value, name, level) sales(type, value, status, code) Task: Retrieve value from tasks whose type is found in sales rows where status matches the outer record. SQL:
SELECT value FROM tasks AS tsk WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "sales", "outer_alias": "tsk", "inner_alias": "sale", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15774
train
v3
Schema: schedules (alias: schd)(id, level, value, date) regions(salary, name, date, amount) Task: Retrieve value from schedules with value above the SUM(value) of regions rows sharing the same code. SQL:
SELECT value FROM schedules AS schd WHERE value > ( SELECT SUM(value) FROM regions AS rgn WHERE rgn.code = schd.code );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15775
train
v2
Schema: employees (alias: emp)(code, salary, type, amount) items(level, status, value, amount) Task: Find name from employees where a matching record exists in items with the same type. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = emp.type );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "name", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15776
train
v1
Schema: invoices (alias: inv)(salary, amount, status, value) orders(amount, type, value, name) Task: Find id from invoices where id appears in orders entries with matching status. SQL:
SELECT id FROM invoices AS inv WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.status = inv.status );
{ "outer_table": "invoices", "inner_table": "orders", "outer_alias": "inv", "inner_alias": "ord", "proj_col": "id", "filter_col": "id", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15777
train
v2
Schema: products (alias: prod)(name, id, type, value) departments(value, name, type, amount) Task: Retrieve amount from products that have at least one corresponding entry in departments sharing the same code. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = prod.code );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "amount", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15778
train
v3
Schema: projects (alias: prj)(type, value, salary, level) departments(level, code, salary, date) Task: Find value from projects where amount exceeds the total salary from departments for the same code. SQL:
SELECT value FROM projects AS prj WHERE amount > ( SELECT SUM(salary) FROM departments AS dept WHERE dept.code = prj.code );
{ "outer_table": "projects", "inner_table": "departments", "outer_alias": "prj", "inner_alias": "dept", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_15779
train
v2
Schema: projects (alias: prj)(amount, type, code, value) schedules(name, id, code, date) Task: Find id from projects where a matching record exists in schedules with the same type. SQL:
SELECT id FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = prj.type );
{ "outer_table": "projects", "inner_table": "schedules", "outer_alias": "prj", "inner_alias": "schd", "proj_col": "id", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_15780
train
v3
Schema: items (alias: lne)(status, id, level, salary) schedules(name, amount, salary, date) Task: Find salary from items where value exceeds the minimum amount from schedules for the same level. SQL:
SELECT salary FROM items AS lne WHERE value > ( SELECT MIN(amount) FROM schedules AS schd WHERE schd.level = lne.level );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15781
train
v3
Schema: staff (alias: empl)(date, type, name, status) tasks(amount, value, type, level) Task: Find value from staff where value exceeds the maximum value from tasks for the same type. SQL:
SELECT value FROM staff AS empl WHERE value > ( SELECT MAX(value) FROM tasks AS tsk WHERE tsk.type = empl.type );
{ "outer_table": "staff", "inner_table": "tasks", "outer_alias": "empl", "inner_alias": "tsk", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_15782
train
v1
Schema: managers (alias: mgr)(level, date, value, name) staff(level, amount, name, id) Task: Select amount from managers where id exists in staff for the same level. SQL:
SELECT amount FROM managers AS mgr WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.level = mgr.level );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15783
train
v3
Schema: schedules (alias: schd)(id, name, type, date) invoices(code, id, type, value) Task: Retrieve code from schedules with salary above the MIN(value) of invoices rows sharing the same status. SQL:
SELECT code FROM schedules AS schd WHERE salary > ( SELECT MIN(value) FROM invoices AS inv WHERE inv.status = schd.status );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15784
train
v3
Schema: products (alias: prod)(name, type, status, value) shipments(name, level, amount, id) Task: Find value from products where amount exceeds the minimum amount from shipments for the same id. SQL:
SELECT value FROM products AS prod WHERE amount > ( SELECT MIN(amount) FROM shipments AS shp WHERE shp.id = prod.id );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15785
train
v1
Schema: transactions (alias: txn)(level, name, amount, type) tasks(name, value, type, amount) Task: Retrieve name from transactions whose type is found in tasks rows where status matches the outer record. SQL:
SELECT name FROM transactions AS txn WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.status = txn.status );
{ "outer_table": "transactions", "inner_table": "tasks", "outer_alias": "txn", "inner_alias": "tsk", "proj_col": "name", "filter_col": "type", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15786
train
v3
Schema: items (alias: lne)(date, status, amount, type) employees(status, id, date, level) Task: Find value from items where salary exceeds the maximum salary from employees for the same code. SQL:
SELECT value FROM items AS lne WHERE salary > ( SELECT MAX(salary) FROM employees AS emp WHERE emp.code = lne.code );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15787
train
v2
Schema: managers (alias: mgr)(date, type, level, code) schedules(level, amount, code, value) Task: Find value from managers where a matching record exists in schedules with the same status. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = mgr.status );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "value", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15788
train
v2
Schema: requests (alias: ordr)(type, code, name, amount) tasks(status, id, name, amount) Task: Find id from requests where a matching record exists in tasks with the same type. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.type = ordr.type );
{ "outer_table": "requests", "inner_table": "tasks", "outer_alias": "ordr", "inner_alias": "tsk", "proj_col": "id", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_15789
train
v2
Schema: staff (alias: empl)(level, id, code, value) orders(amount, status, value, date) Task: Find id from staff where a matching record exists in orders with the same code. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = empl.code );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "id", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_15790
train
v2
Schema: products (alias: prod)(salary, code, level, value) projects(date, amount, type, value) Task: Retrieve code from products that have at least one corresponding entry in projects sharing the same type. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = prod.type );
{ "outer_table": "products", "inner_table": "projects", "outer_alias": "prod", "inner_alias": "prj", "proj_col": "code", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15791
train
v1
Schema: employees (alias: emp)(salary, amount, date, code) schedules(status, id, amount, level) Task: Select amount from employees where type exists in schedules for the same type. SQL:
SELECT amount FROM employees AS emp WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.type = emp.type );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15792
train
v1
Schema: accounts (alias: acct)(type, date, code, status) transactions(status, value, date, level) Task: Find id from accounts where code appears in transactions entries with matching id. SQL:
SELECT id FROM accounts AS acct WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.id = acct.id );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "id", "filter_col": "code", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15793
train
v3
Schema: accounts (alias: acct)(level, name, id, type) schedules(name, level, code, status) Task: Find amount from accounts where salary exceeds the maximum amount from schedules for the same type. SQL:
SELECT amount FROM accounts AS acct WHERE salary > ( SELECT MAX(amount) FROM schedules AS schd WHERE schd.type = acct.type );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15794
train
v2
Schema: employees (alias: emp)(status, name, level, type) schedules(salary, amount, date, level) Task: Find code from employees where a matching record exists in schedules with the same id. SQL:
SELECT code 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": "code", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15795
train
v3
Schema: managers (alias: mgr)(status, type, level, value) accounts(name, status, type, date) Task: Retrieve amount from managers with amount above the SUM(amount) of accounts rows sharing the same code. SQL:
SELECT amount FROM managers AS mgr WHERE amount > ( SELECT SUM(amount) FROM accounts AS acct WHERE acct.code = mgr.code );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15796
train
v1
Schema: tasks (alias: tsk)(amount, id, code, level) schedules(level, salary, value, name) Task: Retrieve amount from tasks whose level is found in schedules rows where level matches the outer record. SQL:
SELECT amount FROM tasks AS tsk WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "schedules", "outer_alias": "tsk", "inner_alias": "schd", "proj_col": "amount", "filter_col": "level", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15797
train
v3
Schema: managers (alias: mgr)(status, name, date, code) departments(status, value, code, type) Task: Find salary from managers where amount exceeds the count of value from departments for the same level. SQL:
SELECT salary FROM managers AS mgr WHERE amount > ( SELECT COUNT(value) FROM departments AS dept WHERE dept.level = mgr.level );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15798
train
v3
Schema: employees (alias: emp)(name, status, type, salary) transactions(status, name, id, level) Task: Find value from employees where salary exceeds the minimum salary from transactions for the same level. SQL:
SELECT value FROM employees AS emp WHERE salary > ( SELECT MIN(salary) FROM transactions AS txn WHERE txn.level = emp.level );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15799
train