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: items (alias: lne)(amount, salary, type, id) regions(level, id, salary, type) Task: Find name from items where amount exceeds the minimum value from regions for the same level. SQL:
SELECT name FROM items AS lne WHERE amount > ( SELECT MIN(value) FROM regions AS rgn WHERE rgn.level = lne.level );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_07500
train
v1
Schema: categories (alias: catg)(status, type, date, level) staff(code, name, id, type) Task: Retrieve amount from categories whose id is found in staff rows where code matches the outer record. SQL:
SELECT amount FROM categories AS catg WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.code = catg.code );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_07501
train
v3
Schema: schedules (alias: schd)(type, code, id, name) orders(level, date, id, salary) Task: Find code from schedules where salary exceeds the minimum amount from orders for the same status. SQL:
SELECT code FROM schedules AS schd WHERE salary > ( SELECT MIN(amount) FROM orders AS ord WHERE ord.status = schd.status );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_07502
train
v3
Schema: items (alias: lne)(type, salary, level, name) staff(date, name, status, value) Task: Retrieve amount from items with salary above the COUNT(amount) of staff rows sharing the same id. SQL:
SELECT amount FROM items AS lne WHERE salary > ( SELECT COUNT(amount) FROM staff AS empl WHERE empl.id = lne.id );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_07503
train
v2
Schema: orders (alias: ord)(id, value, status, code) customers(salary, amount, code, type) Task: Find code from orders where a matching record exists in customers with the same level. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = ord.level );
{ "outer_table": "orders", "inner_table": "customers", "outer_alias": "ord", "inner_alias": "cust", "proj_col": "code", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07504
train
v1
Schema: products (alias: prod)(level, id, type, salary) transactions(name, level, amount, id) Task: Retrieve name from products whose code is found in transactions rows where id matches the outer record. SQL:
SELECT name FROM products AS prod WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.id = prod.id );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07505
train
v2
Schema: customers (alias: cust)(level, value, name, amount) invoices(level, code, salary, value) Task: Find name from customers where a matching record exists in invoices with the same type. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = cust.type );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "name", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07506
train
v3
Schema: sales (alias: sale)(date, id, amount, salary) managers(id, salary, level, date) Task: Find value from sales where value exceeds the average value from managers for the same code. SQL:
SELECT value FROM sales AS sale WHERE value > ( SELECT AVG(value) FROM managers AS mgr WHERE mgr.code = sale.code );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07507
train
v3
Schema: projects (alias: prj)(level, value, salary, status) staff(name, salary, status, id) Task: Find salary from projects where value exceeds the minimum amount from staff for the same level. SQL:
SELECT salary FROM projects AS prj WHERE value > ( SELECT MIN(amount) FROM staff AS empl WHERE empl.level = prj.level );
{ "outer_table": "projects", "inner_table": "staff", "outer_alias": "prj", "inner_alias": "empl", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_07508
train
v2
Schema: branches (alias: brc)(value, code, amount, salary) staff(code, value, level, salary) Task: Find amount from branches where a matching record exists in staff with the same type. SQL:
SELECT amount FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = brc.type );
{ "outer_table": "branches", "inner_table": "staff", "outer_alias": "brc", "inner_alias": "empl", "proj_col": "amount", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_07509
train
v1
Schema: accounts (alias: acct)(code, status, level, amount) products(salary, level, code, value) Task: Select code from accounts where id exists in products for the same id. SQL:
SELECT code FROM accounts AS acct WHERE id IN ( SELECT id FROM products AS prod WHERE prod.id = acct.id );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "code", "filter_col": "id", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07510
train
v3
Schema: schedules (alias: schd)(amount, code, value, salary) projects(code, level, amount, name) Task: Find salary from schedules where value exceeds the maximum value from projects for the same code. SQL:
SELECT salary FROM schedules AS schd WHERE value > ( SELECT MAX(value) FROM projects AS prj WHERE prj.code = schd.code );
{ "outer_table": "schedules", "inner_table": "projects", "outer_alias": "schd", "inner_alias": "prj", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_07511
train
v2
Schema: items (alias: lne)(id, status, type, amount) regions(status, amount, salary, type) Task: Find value from items where a matching record exists in regions with the same code. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = lne.code );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "value", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_07512
train
v1
Schema: invoices (alias: inv)(code, level, name, status) categories(type, amount, date, value) Task: Select salary from invoices where id exists in categories for the same code. SQL:
SELECT salary FROM invoices AS inv WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.code = inv.code );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07513
train
v2
Schema: accounts (alias: acct)(name, date, salary, value) transactions(date, value, level, status) Task: Retrieve name from accounts that have at least one corresponding entry in transactions sharing the same level. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = acct.level );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "name", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07514
train
v2
Schema: customers (alias: cust)(value, name, status, salary) staff(type, salary, amount, level) Task: Retrieve amount from customers that have at least one corresponding entry in staff sharing the same id. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = cust.id );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "amount", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07515
train
v1
Schema: projects (alias: prj)(id, name, salary, amount) shipments(level, status, code, date) Task: Select salary from projects where type exists in shipments for the same status. SQL:
SELECT salary FROM projects AS prj WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.status = prj.status );
{ "outer_table": "projects", "inner_table": "shipments", "outer_alias": "prj", "inner_alias": "shp", "proj_col": "salary", "filter_col": "type", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_07516
train
v3
Schema: products (alias: prod)(level, type, amount, status) transactions(code, status, name, value) Task: Retrieve id from products with value above the MIN(salary) of transactions rows sharing the same type. SQL:
SELECT id FROM products AS prod WHERE value > ( SELECT MIN(salary) FROM transactions AS txn WHERE txn.type = prod.type );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07517
train
v3
Schema: departments (alias: dept)(value, id, salary, date) shipments(date, level, id, value) Task: Find name from departments where salary exceeds the minimum value from shipments for the same id. SQL:
SELECT name FROM departments AS dept WHERE salary > ( SELECT MIN(value) FROM shipments AS shp WHERE shp.id = dept.id );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07518
train
v1
Schema: requests (alias: ordr)(level, name, id, status) products(code, id, amount, value) Task: Find value from requests where status appears in products entries with matching id. SQL:
SELECT value FROM requests AS ordr WHERE status IN ( SELECT status FROM products AS prod WHERE prod.id = ordr.id );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_07519
train
v3
Schema: employees (alias: emp)(name, date, status, salary) categories(amount, date, salary, level) Task: Retrieve id from employees with salary above the SUM(amount) of categories rows sharing the same level. SQL:
SELECT id FROM employees AS emp WHERE salary > ( SELECT SUM(amount) FROM categories AS catg WHERE catg.level = emp.level );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07520
train
v3
Schema: tasks (alias: tsk)(salary, value, date, type) projects(code, level, id, salary) Task: Retrieve value from tasks with salary above the AVG(value) of projects rows sharing the same id. SQL:
SELECT value FROM tasks AS tsk WHERE salary > ( SELECT AVG(value) FROM projects AS prj WHERE prj.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "projects", "outer_alias": "tsk", "inner_alias": "prj", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_07521
train
v2
Schema: transactions (alias: txn)(type, level, salary, value) requests(status, date, amount, level) Task: Find salary from transactions where a matching record exists in requests with the same code. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = txn.code );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "salary", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07522
train
v2
Schema: shipments (alias: shp)(name, status, date, code) employees(name, date, value, level) Task: Retrieve amount from shipments that have at least one corresponding entry in employees sharing the same id. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = shp.id );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "amount", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_07523
train
v1
Schema: branches (alias: brc)(id, type, date, status) sales(status, level, name, date) Task: Retrieve name from branches whose code is found in sales rows where level matches the outer record. SQL:
SELECT name FROM branches AS brc WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.level = brc.level );
{ "outer_table": "branches", "inner_table": "sales", "outer_alias": "brc", "inner_alias": "sale", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_07524
train
v1
Schema: orders (alias: ord)(value, amount, date, name) staff(code, level, name, value) Task: Find id from orders where status appears in staff entries with matching type. SQL:
SELECT id FROM orders AS ord WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.type = ord.type );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07525
train
v1
Schema: transactions (alias: txn)(name, type, date, amount) products(id, level, code, value) Task: Select name from transactions where level exists in products for the same status. SQL:
SELECT name FROM transactions AS txn WHERE level IN ( SELECT level FROM products AS prod WHERE prod.status = txn.status );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07526
train
v2
Schema: accounts (alias: acct)(name, salary, amount, value) employees(level, date, value, status) Task: Retrieve value from accounts that have at least one corresponding entry in employees sharing the same code. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = acct.code );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "value", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07527
train
v1
Schema: accounts (alias: acct)(type, level, value, date) schedules(value, code, amount, status) Task: Retrieve value from accounts whose id is found in schedules rows where status matches the outer record. SQL:
SELECT value FROM accounts AS acct WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.status = acct.status );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07528
train
v3
Schema: employees (alias: emp)(name, level, type, date) departments(status, type, code, id) Task: Retrieve name from employees with salary above the SUM(value) of departments rows sharing the same type. SQL:
SELECT name FROM employees AS emp WHERE salary > ( SELECT SUM(value) FROM departments AS dept WHERE dept.type = emp.type );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07529
train
v1
Schema: branches (alias: brc)(salary, value, code, amount) transactions(type, name, status, level) Task: Select value from branches where level exists in transactions for the same status. SQL:
SELECT value FROM branches AS brc WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.status = brc.status );
{ "outer_table": "branches", "inner_table": "transactions", "outer_alias": "brc", "inner_alias": "txn", "proj_col": "value", "filter_col": "level", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_07530
train
v3
Schema: departments (alias: dept)(level, salary, name, value) branches(date, status, type, amount) Task: Find value from departments where value exceeds the count of salary from branches for the same type. SQL:
SELECT value FROM departments AS dept WHERE value > ( SELECT COUNT(salary) FROM branches AS brc WHERE brc.type = dept.type );
{ "outer_table": "departments", "inner_table": "branches", "outer_alias": "dept", "inner_alias": "brc", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07531
train
v2
Schema: transactions (alias: txn)(amount, code, date, salary) projects(id, salary, status, value) Task: Find id from transactions where a matching record exists in projects with the same level. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.level = txn.level );
{ "outer_table": "transactions", "inner_table": "projects", "outer_alias": "txn", "inner_alias": "prj", "proj_col": "id", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07532
train
v3
Schema: tasks (alias: tsk)(status, id, type, name) requests(code, type, id, amount) Task: Find id from tasks where value exceeds the average amount from requests for the same type. SQL:
SELECT id FROM tasks AS tsk WHERE value > ( SELECT AVG(amount) FROM requests AS ordr WHERE ordr.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "requests", "outer_alias": "tsk", "inner_alias": "ordr", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_07533
train
v3
Schema: shipments (alias: shp)(code, type, level, salary) schedules(salary, name, level, date) Task: Find code from shipments where amount exceeds the maximum amount from schedules for the same status. SQL:
SELECT code FROM shipments AS shp WHERE amount > ( SELECT MAX(amount) FROM schedules AS schd WHERE schd.status = shp.status );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_07534
train
v3
Schema: invoices (alias: inv)(status, value, name, id) accounts(type, id, name, date) Task: Retrieve code from invoices with amount above the MIN(salary) of accounts rows sharing the same code. SQL:
SELECT code FROM invoices AS inv WHERE amount > ( SELECT MIN(salary) FROM accounts AS acct WHERE acct.code = inv.code );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07535
train
v2
Schema: items (alias: lne)(status, salary, type, id) managers(date, status, salary, name) Task: Retrieve code from items that have at least one corresponding entry in managers sharing the same status. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = lne.status );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "code", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_07536
train
v1
Schema: tasks (alias: tsk)(level, id, salary, date) categories(level, amount, type, salary) Task: Find value from tasks where type appears in categories entries with matching level. SQL:
SELECT value FROM tasks AS tsk WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "categories", "outer_alias": "tsk", "inner_alias": "catg", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_07537
train
v3
Schema: accounts (alias: acct)(type, level, amount, salary) products(date, type, status, salary) Task: Retrieve code from accounts with value above the MIN(amount) of products rows sharing the same type. SQL:
SELECT code FROM accounts AS acct WHERE value > ( SELECT MIN(amount) FROM products AS prod WHERE prod.type = acct.type );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07538
train
v3
Schema: regions (alias: rgn)(id, date, name, code) accounts(date, id, salary, status) Task: Retrieve salary from regions with value above the AVG(value) of accounts rows sharing the same id. SQL:
SELECT salary FROM regions AS rgn WHERE value > ( SELECT AVG(value) FROM accounts AS acct WHERE acct.id = rgn.id );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "rgn", "inner_alias": "acct", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_07539
train
v3
Schema: staff (alias: empl)(status, code, value, salary) branches(level, date, type, name) Task: Find name from staff where value exceeds the maximum value from branches for the same id. SQL:
SELECT name FROM staff AS empl WHERE value > ( SELECT MAX(value) FROM branches AS brc WHERE brc.id = empl.id );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_07540
train
v1
Schema: items (alias: lne)(name, id, code, amount) schedules(level, date, id, code) Task: Retrieve salary from items whose id is found in schedules rows where type matches the outer record. SQL:
SELECT salary FROM items AS lne WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.type = lne.type );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "salary", "filter_col": "id", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_07541
train
v2
Schema: schedules (alias: schd)(id, type, value, code) accounts(status, type, date, salary) Task: Retrieve name from schedules that have at least one corresponding entry in accounts sharing the same type. SQL:
SELECT name 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": "name", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_07542
train
v3
Schema: projects (alias: prj)(id, value, status, date) invoices(type, name, code, value) Task: Find id from projects where amount exceeds the minimum salary from invoices for the same type. SQL:
SELECT id FROM projects AS prj WHERE amount > ( SELECT MIN(salary) FROM invoices AS inv WHERE inv.type = prj.type );
{ "outer_table": "projects", "inner_table": "invoices", "outer_alias": "prj", "inner_alias": "inv", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_07543
train
v2
Schema: departments (alias: dept)(value, type, amount, status) accounts(id, value, amount, salary) Task: Find value from departments where a matching record exists in accounts with the same id. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = dept.id );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "value", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07544
train
v3
Schema: transactions (alias: txn)(id, status, level, code) invoices(name, date, code, status) Task: Retrieve salary from transactions with amount above the MAX(value) of invoices rows sharing the same type. SQL:
SELECT salary FROM transactions AS txn WHERE amount > ( SELECT MAX(value) FROM invoices AS inv WHERE inv.type = txn.type );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07545
train
v3
Schema: categories (alias: catg)(amount, status, salary, value) employees(value, date, code, amount) Task: Find id from categories where salary exceeds the minimum value from employees for the same id. SQL:
SELECT id FROM categories AS catg WHERE salary > ( SELECT MIN(value) FROM employees AS emp WHERE emp.id = catg.id );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_07546
train
v1
Schema: items (alias: lne)(level, status, name, id) employees(level, type, amount, name) Task: Find code from items where status appears in employees entries with matching type. SQL:
SELECT code FROM items AS lne WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.type = lne.type );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_07547
train
v1
Schema: customers (alias: cust)(salary, code, type, id) orders(type, code, status, level) Task: Select id from customers where id exists in orders for the same status. SQL:
SELECT id FROM customers AS cust WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.status = cust.status );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "id", "filter_col": "id", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07548
train
v2
Schema: sales (alias: sale)(value, salary, level, date) orders(value, status, code, amount) Task: Retrieve code from sales that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = sale.level );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "code", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07549
train
v2
Schema: transactions (alias: txn)(value, date, id, code) customers(code, name, level, amount) Task: Retrieve amount from transactions that have at least one corresponding entry in customers sharing the same status. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = txn.status );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "amount", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07550
train
v2
Schema: accounts (alias: acct)(id, value, salary, status) managers(type, value, code, date) Task: Find name from accounts where a matching record exists in managers with the same code. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = acct.code );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "name", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07551
train
v3
Schema: tasks (alias: tsk)(salary, type, level, name) staff(amount, type, id, status) Task: Find salary from tasks where value exceeds the minimum salary from staff for the same level. SQL:
SELECT salary FROM tasks AS tsk WHERE value > ( SELECT MIN(salary) FROM staff AS empl WHERE empl.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "staff", "outer_alias": "tsk", "inner_alias": "empl", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_07552
train
v1
Schema: accounts (alias: acct)(value, id, date, name) departments(date, salary, value, code) Task: Find code from accounts where status appears in departments entries with matching status. SQL:
SELECT code FROM accounts AS acct WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.status = acct.status );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "code", "filter_col": "status", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07553
train
v1
Schema: shipments (alias: shp)(status, value, date, amount) transactions(amount, status, code, type) Task: Find id from shipments where id appears in transactions entries with matching type. SQL:
SELECT id FROM shipments AS shp WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.type = shp.type );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_07554
train
v2
Schema: employees (alias: emp)(amount, id, value, date) transactions(status, value, amount, id) Task: Retrieve value from employees that have at least one corresponding entry in transactions sharing the same type. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = emp.type );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "value", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07555
train
v2
Schema: products (alias: prod)(salary, value, name, amount) invoices(value, level, amount, id) Task: Retrieve value from products that have at least one corresponding entry in invoices sharing the same code. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = prod.code );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "value", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07556
train
v2
Schema: managers (alias: mgr)(id, date, type, amount) departments(name, type, value, date) Task: Retrieve id from managers that have at least one corresponding entry in departments sharing the same code. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = mgr.code );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "id", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07557
train
v2
Schema: shipments (alias: shp)(type, status, id, date) employees(type, status, amount, level) Task: Retrieve id from shipments that have at least one corresponding entry in employees sharing the same level. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = shp.level );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "id", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_07558
train
v3
Schema: categories (alias: catg)(name, type, date, amount) staff(type, status, code, salary) Task: Retrieve amount from categories with value above the SUM(value) of staff rows sharing the same id. SQL:
SELECT amount FROM categories AS catg WHERE value > ( SELECT SUM(value) FROM staff AS empl WHERE empl.id = catg.id );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_07559
train
v1
Schema: branches (alias: brc)(name, code, id, amount) shipments(value, code, name, salary) Task: Select id from branches where code exists in shipments for the same type. SQL:
SELECT id FROM branches AS brc WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.type = brc.type );
{ "outer_table": "branches", "inner_table": "shipments", "outer_alias": "brc", "inner_alias": "shp", "proj_col": "id", "filter_col": "code", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_07560
train
v2
Schema: managers (alias: mgr)(status, date, salary, amount) staff(date, name, level, type) Task: Find amount from managers where a matching record exists in staff with the same type. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = mgr.type );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "amount", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07561
train
v3
Schema: accounts (alias: acct)(status, salary, id, value) managers(level, type, code, amount) Task: Find amount from accounts where amount exceeds the count of salary from managers for the same level. SQL:
SELECT amount FROM accounts AS acct WHERE amount > ( SELECT COUNT(salary) FROM managers AS mgr WHERE mgr.level = acct.level );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07562
train
v1
Schema: categories (alias: catg)(salary, type, status, amount) requests(status, id, code, date) Task: Find name from categories where code appears in requests entries with matching code. SQL:
SELECT name FROM categories AS catg WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.code = catg.code );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_07563
train
v1
Schema: tasks (alias: tsk)(type, amount, id, code) categories(date, level, type, code) Task: Select name from tasks where level exists in categories for the same status. SQL:
SELECT name FROM tasks AS tsk WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "categories", "outer_alias": "tsk", "inner_alias": "catg", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_07564
train
v2
Schema: products (alias: prod)(code, status, value, id) invoices(code, amount, status, salary) Task: Retrieve value from products that have at least one corresponding entry in invoices sharing the same code. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = prod.code );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "value", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07565
train
v3
Schema: products (alias: prod)(level, value, salary, date) shipments(id, code, level, amount) Task: Retrieve value from products with amount above the COUNT(salary) of shipments rows sharing the same level. SQL:
SELECT value FROM products AS prod WHERE amount > ( SELECT COUNT(salary) FROM shipments AS shp WHERE shp.level = prod.level );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07566
train
v2
Schema: transactions (alias: txn)(code, status, amount, salary) customers(id, status, type, level) Task: Retrieve value from transactions that have at least one corresponding entry in customers sharing the same level. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = txn.level );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "value", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07567
train
v2
Schema: projects (alias: prj)(code, id, date, status) customers(level, name, code, amount) Task: Find id from projects where a matching record exists in customers with the same type. SQL:
SELECT id FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = prj.type );
{ "outer_table": "projects", "inner_table": "customers", "outer_alias": "prj", "inner_alias": "cust", "proj_col": "id", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_07568
train
v2
Schema: managers (alias: mgr)(name, amount, salary, date) tasks(level, date, value, name) Task: Find id from managers where a matching record exists in tasks with the same status. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = mgr.status );
{ "outer_table": "managers", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "tsk", "proj_col": "id", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07569
train
v1
Schema: projects (alias: prj)(type, status, amount, value) sales(type, date, id, code) Task: Find amount from projects where id appears in sales entries with matching status. SQL:
SELECT amount FROM projects AS prj WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.status = prj.status );
{ "outer_table": "projects", "inner_table": "sales", "outer_alias": "prj", "inner_alias": "sale", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_07570
train
v2
Schema: tasks (alias: tsk)(salary, amount, level, name) employees(code, value, salary, type) Task: Retrieve code from tasks that have at least one corresponding entry in employees sharing the same id. SQL:
SELECT code 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": "code", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_07571
train
v2
Schema: departments (alias: dept)(salary, amount, name, level) items(id, amount, level, value) Task: Retrieve code from departments that have at least one corresponding entry in items sharing the same code. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = dept.code );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "code", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07572
train
v3
Schema: categories (alias: catg)(amount, level, type, code) managers(level, code, type, salary) Task: Find salary from categories where salary exceeds the count of salary from managers for the same level. SQL:
SELECT salary FROM categories AS catg WHERE salary > ( SELECT COUNT(salary) FROM managers AS mgr WHERE mgr.level = catg.level );
{ "outer_table": "categories", "inner_table": "managers", "outer_alias": "catg", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_07573
train
v2
Schema: staff (alias: empl)(type, name, amount, date) employees(date, name, salary, status) Task: Find name from staff where a matching record exists in employees with the same type. SQL:
SELECT name FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = empl.type );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "name", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_07574
train
v2
Schema: regions (alias: rgn)(amount, salary, value, id) shipments(salary, name, value, amount) Task: Find salary from regions where a matching record exists in shipments with the same status. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = rgn.status );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "salary", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_07575
train
v3
Schema: projects (alias: prj)(amount, level, value, date) orders(level, value, status, id) Task: Find value from projects where amount exceeds the total value from orders for the same type. SQL:
SELECT value FROM projects AS prj WHERE amount > ( SELECT SUM(value) FROM orders AS ord WHERE ord.type = prj.type );
{ "outer_table": "projects", "inner_table": "orders", "outer_alias": "prj", "inner_alias": "ord", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_07576
train
v1
Schema: requests (alias: ordr)(id, name, code, level) categories(status, level, salary, id) Task: Retrieve id from requests whose type is found in categories rows where code matches the outer record. SQL:
SELECT id FROM requests AS ordr WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.code = ordr.code );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_07577
train
v1
Schema: invoices (alias: inv)(status, salary, id, amount) transactions(amount, type, code, value) Task: Select name from invoices where code exists in transactions for the same id. SQL:
SELECT name FROM invoices AS inv WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.id = inv.id );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07578
train
v2
Schema: tasks (alias: tsk)(code, type, date, name) accounts(name, code, salary, level) Task: Retrieve salary from tasks that have at least one corresponding entry in accounts sharing the same type. SQL:
SELECT salary FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "accounts", "outer_alias": "tsk", "inner_alias": "acct", "proj_col": "salary", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_07579
train
v2
Schema: branches (alias: brc)(id, amount, level, name) schedules(salary, status, type, code) Task: Find id from branches where a matching record exists in schedules with the same status. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = brc.status );
{ "outer_table": "branches", "inner_table": "schedules", "outer_alias": "brc", "inner_alias": "schd", "proj_col": "id", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_07580
train
v2
Schema: categories (alias: catg)(date, salary, code, value) departments(value, type, date, id) Task: Find amount from categories where a matching record exists in departments with the same id. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = catg.id );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "amount", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_07581
train
v3
Schema: tasks (alias: tsk)(id, status, amount, salary) managers(id, amount, status, name) Task: Retrieve name from tasks with amount above the AVG(amount) of managers rows sharing the same type. SQL:
SELECT name FROM tasks AS tsk WHERE amount > ( SELECT AVG(amount) FROM managers AS mgr WHERE mgr.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "managers", "outer_alias": "tsk", "inner_alias": "mgr", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_07582
train
v1
Schema: branches (alias: brc)(status, type, salary, value) products(amount, name, date, level) Task: Select amount from branches where status exists in products for the same code. SQL:
SELECT amount FROM branches AS brc WHERE status IN ( SELECT status FROM products AS prod WHERE prod.code = brc.code );
{ "outer_table": "branches", "inner_table": "products", "outer_alias": "brc", "inner_alias": "prod", "proj_col": "amount", "filter_col": "status", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_07583
train
v1
Schema: invoices (alias: inv)(value, amount, level, name) tasks(value, amount, code, status) Task: Retrieve amount from invoices whose level is found in tasks rows where status matches the outer record. SQL:
SELECT amount FROM invoices AS inv WHERE level IN ( SELECT level FROM tasks AS tsk WHERE tsk.status = inv.status );
{ "outer_table": "invoices", "inner_table": "tasks", "outer_alias": "inv", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07584
train
v3
Schema: projects (alias: prj)(type, amount, name, id) accounts(level, date, code, amount) Task: Retrieve amount from projects with amount above the MIN(amount) of accounts rows sharing the same level. SQL:
SELECT amount FROM projects AS prj WHERE amount > ( SELECT MIN(amount) FROM accounts AS acct WHERE acct.level = prj.level );
{ "outer_table": "projects", "inner_table": "accounts", "outer_alias": "prj", "inner_alias": "acct", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_07585
train
v1
Schema: invoices (alias: inv)(type, id, date, value) schedules(level, name, date, code) Task: Select code from invoices where code exists in schedules for the same type. SQL:
SELECT code FROM invoices AS inv WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.type = inv.type );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "code", "filter_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07586
train
v2
Schema: products (alias: prod)(id, date, code, status) tasks(value, salary, code, status) Task: Find code from products where a matching record exists in tasks with the same type. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.type = prod.type );
{ "outer_table": "products", "inner_table": "tasks", "outer_alias": "prod", "inner_alias": "tsk", "proj_col": "code", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07587
train
v2
Schema: regions (alias: rgn)(id, code, status, type) tasks(code, salary, amount, name) Task: Retrieve id from regions that have at least one corresponding entry in tasks sharing the same id. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.id = rgn.id );
{ "outer_table": "regions", "inner_table": "tasks", "outer_alias": "rgn", "inner_alias": "tsk", "proj_col": "id", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_07588
train
v3
Schema: staff (alias: empl)(amount, status, date, id) customers(value, date, type, id) Task: Find value from staff where amount exceeds the total salary from customers for the same id. SQL:
SELECT value FROM staff AS empl WHERE amount > ( SELECT SUM(salary) FROM customers AS cust WHERE cust.id = empl.id );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_07589
train
v1
Schema: departments (alias: dept)(id, status, code, salary) sales(name, amount, code, value) Task: Retrieve salary from departments whose status is found in sales rows where level matches the outer record. SQL:
SELECT salary FROM departments AS dept WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.level = dept.level );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07590
train
v2
Schema: shipments (alias: shp)(value, name, type, amount) staff(id, value, level, date) Task: Find id from shipments where a matching record exists in staff with the same status. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = shp.status );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "id", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_07591
train
v3
Schema: categories (alias: catg)(date, salary, amount, id) schedules(date, status, amount, value) Task: Retrieve name from categories with salary above the MAX(value) of schedules rows sharing the same type. SQL:
SELECT name FROM categories AS catg WHERE salary > ( SELECT MAX(value) FROM schedules AS schd WHERE schd.type = catg.type );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_07592
train
v3
Schema: categories (alias: catg)(status, type, code, value) sales(name, salary, date, code) Task: Retrieve value from categories with salary above the COUNT(amount) of sales rows sharing the same level. SQL:
SELECT value FROM categories AS catg WHERE salary > ( SELECT COUNT(amount) FROM sales AS sale WHERE sale.level = catg.level );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_07593
train
v1
Schema: orders (alias: ord)(amount, type, date, code) branches(date, status, id, type) Task: Find salary from orders where level appears in branches entries with matching code. SQL:
SELECT salary FROM orders AS ord WHERE level IN ( SELECT level FROM branches AS brc WHERE brc.code = ord.code );
{ "outer_table": "orders", "inner_table": "branches", "outer_alias": "ord", "inner_alias": "brc", "proj_col": "salary", "filter_col": "level", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07594
train
v1
Schema: customers (alias: cust)(name, level, salary, value) transactions(type, status, id, value) Task: Retrieve salary from customers whose status is found in transactions rows where code matches the outer record. SQL:
SELECT salary FROM customers AS cust WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.code = cust.code );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07595
train
v3
Schema: products (alias: prod)(id, salary, code, type) projects(salary, date, code, name) Task: Find salary from products where value exceeds the maximum amount from projects for the same id. SQL:
SELECT salary FROM products AS prod WHERE value > ( SELECT MAX(amount) FROM projects AS prj WHERE prj.id = prod.id );
{ "outer_table": "products", "inner_table": "projects", "outer_alias": "prod", "inner_alias": "prj", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07596
train
v2
Schema: branches (alias: brc)(value, level, type, id) schedules(id, name, value, status) Task: Find amount from branches where a matching record exists in schedules with the same type. SQL:
SELECT amount FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = brc.type );
{ "outer_table": "branches", "inner_table": "schedules", "outer_alias": "brc", "inner_alias": "schd", "proj_col": "amount", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_07597
train
v3
Schema: customers (alias: cust)(name, level, id, salary) accounts(date, type, name, amount) Task: Retrieve amount from customers with value above the MIN(amount) of accounts rows sharing the same level. SQL:
SELECT amount FROM customers AS cust WHERE value > ( SELECT MIN(amount) FROM accounts AS acct WHERE acct.level = cust.level );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_07598
train
v1
Schema: items (alias: lne)(status, type, id, level) managers(code, value, date, salary) Task: Find value from items where code appears in managers entries with matching status. SQL:
SELECT value FROM items AS lne WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.status = lne.status );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_07599
train