variant
stringclasses
3 values
prompt
stringlengths
160
237
sql
stringlengths
102
141
metadata
unknown
token_group
stringclasses
2 values
id
stringlengths
24
24
split
stringclasses
1 value
v1
Schema: staff (alias: empl)(date, amount, value, status) employees(code, salary, status, amount) Task: Find name from staff where id appears in employees entries with matching code. SQL:
SELECT name FROM staff AS empl WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.code = empl.code );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_15500
train
v3
Schema: sales (alias: sale)(date, id, level, code) employees(status, salary, id, value) Task: Retrieve value from sales with value above the SUM(salary) of employees rows sharing the same code. SQL:
SELECT value FROM sales AS sale WHERE value > ( SELECT SUM(salary) FROM employees AS emp WHERE emp.code = sale.code );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15501
train
v1
Schema: accounts (alias: acct)(code, level, type, amount) schedules(status, date, name, code) Task: Select amount from accounts where level exists in schedules for the same code. SQL:
SELECT amount FROM accounts AS acct WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.code = acct.code );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15502
train
v3
Schema: staff (alias: empl)(id, level, type, status) invoices(level, salary, code, date) Task: Retrieve name from staff with amount above the COUNT(value) of invoices rows sharing the same type. SQL:
SELECT name FROM staff AS empl WHERE amount > ( SELECT COUNT(value) FROM invoices AS inv WHERE inv.type = empl.type );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_15503
train
v3
Schema: projects (alias: prj)(amount, code, salary, date) shipments(date, type, level, amount) Task: Find amount from projects where amount exceeds the maximum amount from shipments for the same type. SQL:
SELECT amount FROM projects AS prj WHERE amount > ( SELECT MAX(amount) FROM shipments AS shp WHERE shp.type = prj.type );
{ "outer_table": "projects", "inner_table": "shipments", "outer_alias": "prj", "inner_alias": "shp", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_15504
train
v3
Schema: branches (alias: brc)(date, level, name, amount) orders(code, status, name, amount) Task: Find value from branches where amount exceeds the maximum amount from orders for the same level. SQL:
SELECT value FROM branches AS brc WHERE amount > ( SELECT MAX(amount) FROM orders AS ord WHERE ord.level = brc.level );
{ "outer_table": "branches", "inner_table": "orders", "outer_alias": "brc", "inner_alias": "ord", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_15505
train
v3
Schema: shipments (alias: shp)(amount, value, id, status) transactions(name, salary, value, status) Task: Retrieve amount from shipments with value above the MIN(amount) of transactions rows sharing the same level. SQL:
SELECT amount FROM shipments AS shp WHERE value > ( SELECT MIN(amount) FROM transactions AS txn WHERE txn.level = shp.level );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15506
train
v1
Schema: departments (alias: dept)(date, salary, status, value) tasks(type, status, value, amount) Task: Retrieve name from departments whose type is found in tasks rows where level matches the outer record. SQL:
SELECT name FROM departments AS dept WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.level = dept.level );
{ "outer_table": "departments", "inner_table": "tasks", "outer_alias": "dept", "inner_alias": "tsk", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15507
train
v3
Schema: accounts (alias: acct)(code, status, name, amount) shipments(date, status, id, salary) Task: Find id from accounts where salary exceeds the total value from shipments for the same code. SQL:
SELECT id FROM accounts AS acct WHERE salary > ( SELECT SUM(value) FROM shipments AS shp WHERE shp.code = acct.code );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15508
train
v3
Schema: items (alias: lne)(level, salary, status, type) schedules(level, date, amount, name) Task: Find code from items where value exceeds the maximum amount from schedules for the same level. SQL:
SELECT code FROM items AS lne WHERE value > ( SELECT MAX(amount) FROM schedules AS schd WHERE schd.level = lne.level );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15509
train
v2
Schema: customers (alias: cust)(type, status, level, id) staff(value, date, type, amount) Task: Find amount from customers where a matching record exists in staff with the same level. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = cust.level );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "amount", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15510
train
v2
Schema: projects (alias: prj)(level, type, id, amount) branches(type, value, amount, salary) Task: Find id from projects where a matching record exists in branches with the same status. SQL:
SELECT id FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.status = prj.status );
{ "outer_table": "projects", "inner_table": "branches", "outer_alias": "prj", "inner_alias": "brc", "proj_col": "id", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_15511
train
v2
Schema: requests (alias: ordr)(amount, status, date, level) regions(level, status, name, value) Task: Find salary from requests where a matching record exists in regions with the same status. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = ordr.status );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "salary", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_15512
train
v2
Schema: sales (alias: sale)(id, code, amount, name) products(salary, id, level, date) Task: Retrieve code from sales that have at least one corresponding entry in products sharing the same code. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = sale.code );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "code", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15513
train
v3
Schema: managers (alias: mgr)(date, salary, code, level) schedules(date, amount, level, value) Task: Retrieve salary from managers with salary above the MIN(salary) of schedules rows sharing the same code. SQL:
SELECT salary FROM managers AS mgr WHERE salary > ( SELECT MIN(salary) FROM schedules AS schd WHERE schd.code = mgr.code );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15514
train
v1
Schema: tasks (alias: tsk)(level, type, salary, name) projects(level, id, type, code) Task: Retrieve value from tasks whose code is found in projects rows where status matches the outer record. SQL:
SELECT value FROM tasks AS tsk WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "projects", "outer_alias": "tsk", "inner_alias": "prj", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15515
train
v3
Schema: regions (alias: rgn)(name, type, id, status) invoices(value, date, salary, level) Task: Retrieve salary from regions with salary above the MIN(amount) of invoices rows sharing the same status. SQL:
SELECT salary FROM regions AS rgn WHERE salary > ( SELECT MIN(amount) FROM invoices AS inv WHERE inv.status = rgn.status );
{ "outer_table": "regions", "inner_table": "invoices", "outer_alias": "rgn", "inner_alias": "inv", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_15516
train
v1
Schema: departments (alias: dept)(level, type, name, salary) projects(type, amount, status, code) Task: Retrieve amount from departments whose type is found in projects rows where type matches the outer record. SQL:
SELECT amount FROM departments AS dept WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.type = dept.type );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15517
train
v1
Schema: sales (alias: sale)(value, date, type, level) invoices(name, value, status, type) Task: Find value from sales where code appears in invoices entries with matching type. SQL:
SELECT value FROM sales AS sale WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.type = sale.type );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15518
train
v3
Schema: items (alias: lne)(code, status, amount, level) accounts(amount, type, salary, level) Task: Find name from items where amount exceeds the count of amount from accounts for the same id. SQL:
SELECT name FROM items AS lne WHERE amount > ( SELECT COUNT(amount) FROM accounts AS acct WHERE acct.id = lne.id );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15519
train
v3
Schema: products (alias: prod)(level, name, id, type) regions(name, code, status, type) Task: Retrieve code from products with value above the COUNT(salary) of regions rows sharing the same level. SQL:
SELECT code FROM products AS prod WHERE value > ( SELECT COUNT(salary) FROM regions AS rgn WHERE rgn.level = prod.level );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15520
train
v2
Schema: branches (alias: brc)(amount, level, name, type) projects(type, value, level, id) Task: Retrieve salary from branches that have at least one corresponding entry in projects sharing the same id. SQL:
SELECT salary FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.id = brc.id );
{ "outer_table": "branches", "inner_table": "projects", "outer_alias": "brc", "inner_alias": "prj", "proj_col": "salary", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_15521
train
v2
Schema: invoices (alias: inv)(value, type, salary, level) sales(type, value, salary, date) Task: Retrieve name from invoices that have at least one corresponding entry in sales sharing the same id. SQL:
SELECT name FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = inv.id );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "name", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15522
train
v2
Schema: invoices (alias: inv)(value, name, date, amount) employees(value, id, salary, code) Task: Find name from invoices where a matching record exists in employees with the same level. SQL:
SELECT name FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = inv.level );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "name", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15523
train
v2
Schema: branches (alias: brc)(amount, level, type, status) accounts(code, date, value, id) Task: Retrieve id from branches that have at least one corresponding entry in accounts sharing the same status. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = brc.status );
{ "outer_table": "branches", "inner_table": "accounts", "outer_alias": "brc", "inner_alias": "acct", "proj_col": "id", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_15524
train
v3
Schema: branches (alias: brc)(date, level, type, salary) items(level, date, amount, code) Task: Find value from branches where value exceeds the total amount from items for the same code. SQL:
SELECT value FROM branches AS brc WHERE value > ( SELECT SUM(amount) FROM items AS lne WHERE lne.code = brc.code );
{ "outer_table": "branches", "inner_table": "items", "outer_alias": "brc", "inner_alias": "lne", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_15525
train
v3
Schema: regions (alias: rgn)(status, name, code, date) requests(status, level, code, type) Task: Find salary from regions where amount exceeds the maximum salary from requests for the same level. SQL:
SELECT salary FROM regions AS rgn WHERE amount > ( SELECT MAX(salary) FROM requests AS ordr WHERE ordr.level = rgn.level );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_15526
train
v2
Schema: transactions (alias: txn)(date, salary, amount, level) regions(status, code, date, salary) Task: Find value from transactions where a matching record exists in regions with the same type. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = txn.type );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "value", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15527
train
v1
Schema: invoices (alias: inv)(code, value, id, level) tasks(id, value, code, type) Task: Find value from invoices where status appears in tasks entries with matching id. SQL:
SELECT value FROM invoices AS inv WHERE status IN ( SELECT status FROM tasks AS tsk WHERE tsk.id = inv.id );
{ "outer_table": "invoices", "inner_table": "tasks", "outer_alias": "inv", "inner_alias": "tsk", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15528
train
v2
Schema: sales (alias: sale)(level, code, type, name) products(name, date, type, salary) Task: Find id from sales where a matching record exists in products with the same level. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = sale.level );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "id", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15529
train
v2
Schema: shipments (alias: shp)(id, amount, value, level) regions(name, level, id, amount) Task: Find salary from shipments where a matching record exists in regions with the same type. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = shp.type );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "salary", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15530
train
v1
Schema: projects (alias: prj)(name, code, level, status) items(id, type, amount, name) Task: Select id from projects where code exists in items for the same status. SQL:
SELECT id FROM projects AS prj WHERE code IN ( SELECT code FROM items AS lne WHERE lne.status = prj.status );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "lne", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_15531
train
v3
Schema: managers (alias: mgr)(type, salary, id, value) customers(value, status, name, date) Task: Find code from managers where value exceeds the count of salary from customers for the same id. SQL:
SELECT code FROM managers AS mgr WHERE value > ( SELECT COUNT(salary) FROM customers AS cust WHERE cust.id = mgr.id );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "code", "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_15532
train
v2
Schema: orders (alias: ord)(amount, salary, name, status) schedules(code, level, type, id) Task: Find salary from orders where a matching record exists in schedules with the same id. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = ord.id );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "salary", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15533
train
v3
Schema: departments (alias: dept)(code, id, value, name) transactions(value, date, salary, amount) Task: Retrieve name from departments with amount above the COUNT(amount) of transactions rows sharing the same id. SQL:
SELECT name FROM departments AS dept WHERE amount > ( SELECT COUNT(amount) FROM transactions AS txn WHERE txn.id = dept.id );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15534
train
v2
Schema: departments (alias: dept)(date, level, type, code) invoices(level, salary, value, type) Task: Retrieve value from departments that have at least one corresponding entry in invoices sharing the same code. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = dept.code );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "value", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15535
train
v2
Schema: orders (alias: ord)(id, name, salary, status) schedules(level, amount, id, code) Task: Find salary from orders where a matching record exists in schedules with the same code. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = ord.code );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "salary", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15536
train
v3
Schema: employees (alias: emp)(name, type, salary, value) schedules(code, salary, value, status) Task: Retrieve name from employees with value above the COUNT(amount) of schedules rows sharing the same type. SQL:
SELECT name FROM employees AS emp WHERE value > ( SELECT COUNT(amount) FROM schedules AS schd WHERE schd.type = emp.type );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15537
train
v2
Schema: departments (alias: dept)(level, value, code, status) staff(amount, salary, date, name) Task: Find name from departments where a matching record exists in staff with the same status. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = dept.status );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "name", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15538
train
v3
Schema: shipments (alias: shp)(value, amount, code, status) categories(amount, name, status, value) Task: Find amount from shipments where amount exceeds the maximum salary from categories for the same code. SQL:
SELECT amount FROM shipments AS shp WHERE amount > ( SELECT MAX(salary) FROM categories AS catg WHERE catg.code = shp.code );
{ "outer_table": "shipments", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "catg", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15539
train
v1
Schema: customers (alias: cust)(level, value, status, salary) orders(date, amount, id, value) Task: Find salary from customers where id appears in orders entries with matching type. SQL:
SELECT salary FROM customers AS cust WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.type = cust.type );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "salary", "filter_col": "id", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15540
train
v2
Schema: customers (alias: cust)(value, code, status, id) employees(code, id, level, type) Task: Retrieve id from customers that have at least one corresponding entry in employees sharing the same level. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = cust.level );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "id", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15541
train
v1
Schema: shipments (alias: shp)(type, status, date, id) items(date, amount, id, status) Task: Find salary from shipments where code appears in items entries with matching level. SQL:
SELECT salary FROM shipments AS shp WHERE code IN ( SELECT code FROM items AS lne WHERE lne.level = shp.level );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "salary", "filter_col": "code", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15542
train
v1
Schema: customers (alias: cust)(amount, code, salary, status) products(status, name, code, amount) Task: Select name from customers where code exists in products for the same status. SQL:
SELECT name FROM customers AS cust WHERE code IN ( SELECT code FROM products AS prod WHERE prod.status = cust.status );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15543
train
v3
Schema: categories (alias: catg)(status, date, value, amount) products(id, level, code, type) Task: Retrieve id from categories with salary above the MAX(amount) of products rows sharing the same status. SQL:
SELECT id FROM categories AS catg WHERE salary > ( SELECT MAX(amount) FROM products AS prod WHERE prod.status = catg.status );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15544
train
v2
Schema: customers (alias: cust)(date, status, code, value) categories(amount, date, status, name) Task: Find id from customers where a matching record exists in categories with the same status. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = cust.status );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "id", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15545
train
v1
Schema: sales (alias: sale)(name, type, date, salary) accounts(salary, amount, date, value) Task: Select salary from sales where id exists in accounts for the same status. SQL:
SELECT salary FROM sales AS sale WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.status = sale.status );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15546
train
v3
Schema: tasks (alias: tsk)(id, value, date, level) schedules(type, salary, value, name) Task: Find value from tasks where value exceeds the minimum amount from schedules for the same id. SQL:
SELECT value FROM tasks AS tsk WHERE value > ( SELECT MIN(amount) FROM schedules AS schd WHERE schd.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "schedules", "outer_alias": "tsk", "inner_alias": "schd", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15547
train
v2
Schema: invoices (alias: inv)(salary, value, id, date) staff(salary, date, value, amount) Task: Retrieve amount from invoices that have at least one corresponding entry in staff sharing the same level. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = inv.level );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "amount", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15548
train
v3
Schema: requests (alias: ordr)(type, id, level, code) invoices(id, code, salary, date) Task: Find amount from requests where salary exceeds the count of salary from invoices for the same status. SQL:
SELECT amount FROM requests AS ordr WHERE salary > ( SELECT COUNT(salary) FROM invoices AS inv WHERE inv.status = ordr.status );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_15549
train
v1
Schema: branches (alias: brc)(type, amount, date, value) requests(status, amount, value, salary) Task: Find salary from branches where level appears in requests entries with matching level. SQL:
SELECT salary FROM branches AS brc WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.level = brc.level );
{ "outer_table": "branches", "inner_table": "requests", "outer_alias": "brc", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "level", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_15550
train
v1
Schema: staff (alias: empl)(value, amount, status, name) projects(id, code, status, salary) Task: Find value from staff where status appears in projects entries with matching level. SQL:
SELECT value FROM staff AS empl WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.level = empl.level );
{ "outer_table": "staff", "inner_table": "projects", "outer_alias": "empl", "inner_alias": "prj", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_15551
train
v2
Schema: accounts (alias: acct)(type, id, date, amount) staff(id, name, type, status) Task: Find amount from accounts where a matching record exists in staff with the same type. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = acct.type );
{ "outer_table": "accounts", "inner_table": "staff", "outer_alias": "acct", "inner_alias": "empl", "proj_col": "amount", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15552
train
v1
Schema: accounts (alias: acct)(id, name, status, level) customers(date, name, code, id) Task: Retrieve amount from accounts whose status is found in customers rows where status matches the outer record. SQL:
SELECT amount FROM accounts AS acct WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.status = acct.status );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15553
train
v3
Schema: customers (alias: cust)(value, id, status, date) products(level, type, value, code) Task: Retrieve value from customers with value above the MAX(value) of products rows sharing the same status. SQL:
SELECT value FROM customers AS cust WHERE value > ( SELECT MAX(value) FROM products AS prod WHERE prod.status = cust.status );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15554
train
v2
Schema: items (alias: lne)(type, salary, status, date) orders(code, date, salary, status) Task: Retrieve code from items that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = lne.level );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "code", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15555
train
v1
Schema: schedules (alias: schd)(id, level, amount, name) projects(value, id, code, status) Task: Find amount from schedules where status appears in projects entries with matching id. SQL:
SELECT amount FROM schedules AS schd WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.id = schd.id );
{ "outer_table": "schedules", "inner_table": "projects", "outer_alias": "schd", "inner_alias": "prj", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15556
train
v3
Schema: invoices (alias: inv)(name, date, value, id) regions(salary, name, status, level) Task: Find salary from invoices where amount exceeds the count of salary from regions for the same code. SQL:
SELECT salary FROM invoices AS inv WHERE amount > ( SELECT COUNT(salary) FROM regions AS rgn WHERE rgn.code = inv.code );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15557
train
v3
Schema: shipments (alias: shp)(id, name, amount, date) employees(salary, value, amount, id) Task: Find name from shipments where salary exceeds the total value from employees for the same type. SQL:
SELECT name FROM shipments AS shp WHERE salary > ( SELECT SUM(value) FROM employees AS emp WHERE emp.type = shp.type );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15558
train
v1
Schema: accounts (alias: acct)(type, level, id, name) projects(date, name, type, salary) Task: Select id from accounts where status exists in projects for the same code. SQL:
SELECT id FROM accounts AS acct WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.code = acct.code );
{ "outer_table": "accounts", "inner_table": "projects", "outer_alias": "acct", "inner_alias": "prj", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15559
train
v2
Schema: invoices (alias: inv)(id, code, name, amount) transactions(amount, date, value, salary) Task: Retrieve id from invoices that have at least one corresponding entry in transactions sharing the same level. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = inv.level );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "id", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15560
train
v2
Schema: categories (alias: catg)(id, name, level, code) regions(status, type, value, amount) Task: Retrieve value from categories that have at least one corresponding entry in regions sharing the same id. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = catg.id );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "value", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15561
train
v3
Schema: schedules (alias: schd)(name, amount, level, status) employees(type, code, name, date) Task: Find amount from schedules where salary exceeds the maximum value from employees for the same level. SQL:
SELECT amount FROM schedules AS schd WHERE salary > ( SELECT MAX(value) FROM employees AS emp WHERE emp.level = schd.level );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15562
train
v3
Schema: transactions (alias: txn)(type, code, name, amount) invoices(code, type, level, name) Task: Find id from transactions where amount exceeds the average value from invoices for the same type. SQL:
SELECT id FROM transactions AS txn WHERE amount > ( SELECT AVG(value) FROM invoices AS inv WHERE inv.type = txn.type );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15563
train
v2
Schema: managers (alias: mgr)(type, salary, id, code) orders(value, code, level, date) Task: Find salary from managers where a matching record exists in orders with the same status. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = mgr.status );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "salary", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15564
train
v2
Schema: employees (alias: emp)(status, level, amount, value) shipments(code, id, date, amount) Task: Find name from employees where a matching record exists in shipments with the same status. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = emp.status );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "name", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15565
train
v2
Schema: schedules (alias: schd)(status, id, name, salary) tasks(amount, salary, date, id) Task: Find salary from schedules where a matching record exists in tasks with the same status. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = schd.status );
{ "outer_table": "schedules", "inner_table": "tasks", "outer_alias": "schd", "inner_alias": "tsk", "proj_col": "salary", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15566
train
v2
Schema: managers (alias: mgr)(type, date, status, salary) regions(value, salary, name, amount) Task: Find amount from managers where a matching record exists in regions with the same code. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = mgr.code );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "amount", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15567
train
v1
Schema: accounts (alias: acct)(type, amount, status, value) categories(amount, salary, value, code) Task: Select value from accounts where level exists in categories for the same level. SQL:
SELECT value FROM accounts AS acct WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.level = acct.level );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15568
train
v1
Schema: tasks (alias: tsk)(type, amount, id, name) shipments(date, status, salary, name) Task: Select id from tasks where type exists in shipments for the same id. SQL:
SELECT id FROM tasks AS tsk WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "shipments", "outer_alias": "tsk", "inner_alias": "shp", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15569
train
v3
Schema: schedules (alias: schd)(value, salary, level, date) items(amount, type, value, level) Task: Find name from schedules where salary exceeds the maximum salary from items for the same code. SQL:
SELECT name FROM schedules AS schd WHERE salary > ( SELECT MAX(salary) FROM items AS lne WHERE lne.code = schd.code );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15570
train
v1
Schema: branches (alias: brc)(salary, date, type, name) shipments(status, amount, type, value) Task: Select name from branches where type exists in shipments for the same level. SQL:
SELECT name FROM branches AS brc WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.level = brc.level );
{ "outer_table": "branches", "inner_table": "shipments", "outer_alias": "brc", "inner_alias": "shp", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_15571
train
v1
Schema: projects (alias: prj)(code, id, value, type) schedules(status, type, level, salary) Task: Find id from projects where code appears in schedules entries with matching status. SQL:
SELECT id FROM projects AS prj WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.status = prj.status );
{ "outer_table": "projects", "inner_table": "schedules", "outer_alias": "prj", "inner_alias": "schd", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_15572
train
v2
Schema: requests (alias: ordr)(amount, type, date, name) accounts(value, code, type, date) Task: Retrieve amount from requests that have at least one corresponding entry in accounts sharing the same code. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = ordr.code );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "amount", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_15573
train
v1
Schema: schedules (alias: schd)(date, type, status, value) projects(name, level, salary, date) Task: Select id from schedules where code exists in projects for the same id. SQL:
SELECT id FROM schedules AS schd WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.id = schd.id );
{ "outer_table": "schedules", "inner_table": "projects", "outer_alias": "schd", "inner_alias": "prj", "proj_col": "id", "filter_col": "code", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15574
train
v1
Schema: departments (alias: dept)(value, id, code, type) schedules(name, amount, type, status) Task: Find value from departments where id appears in schedules entries with matching type. SQL:
SELECT value FROM departments AS dept WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.type = dept.type );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15575
train
v1
Schema: employees (alias: emp)(type, amount, value, level) categories(type, level, status, id) Task: Retrieve value from employees whose code is found in categories rows where code matches the outer record. SQL:
SELECT value FROM employees AS emp WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.code = emp.code );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15576
train
v3
Schema: schedules (alias: schd)(date, type, status, salary) regions(status, level, date, name) Task: Retrieve amount from schedules with amount above the COUNT(value) of regions rows sharing the same status. SQL:
SELECT amount FROM schedules AS schd WHERE amount > ( SELECT COUNT(value) FROM regions AS rgn WHERE rgn.status = schd.status );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15577
train
v3
Schema: employees (alias: emp)(salary, level, id, date) staff(salary, type, value, date) Task: Find code from employees where salary exceeds the count of value from staff for the same id. SQL:
SELECT code FROM employees AS emp WHERE salary > ( SELECT COUNT(value) FROM staff AS empl WHERE empl.id = emp.id );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15578
train
v2
Schema: transactions (alias: txn)(id, date, status, salary) schedules(amount, level, name, code) Task: Retrieve salary from transactions that have at least one corresponding entry in schedules sharing the same code. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = txn.code );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "salary", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15579
train
v2
Schema: accounts (alias: acct)(type, status, value, code) orders(status, amount, name, value) Task: Retrieve name from accounts that have at least one corresponding entry in orders sharing the same type. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = acct.type );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "name", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15580
train
v2
Schema: projects (alias: prj)(salary, value, id, date) shipments(amount, value, type, level) Task: Retrieve salary from projects that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT salary FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = prj.id );
{ "outer_table": "projects", "inner_table": "shipments", "outer_alias": "prj", "inner_alias": "shp", "proj_col": "salary", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_15581
train
v2
Schema: sales (alias: sale)(amount, salary, code, date) orders(code, amount, name, salary) Task: Find id from sales where a matching record exists in orders with the same id. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = sale.id );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "id", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15582
train
v3
Schema: sales (alias: sale)(type, code, amount, date) items(salary, type, value, amount) Task: Retrieve name from sales with value above the COUNT(amount) of items rows sharing the same code. SQL:
SELECT name FROM sales AS sale WHERE value > ( SELECT COUNT(amount) FROM items AS lne WHERE lne.code = sale.code );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15583
train
v3
Schema: customers (alias: cust)(id, code, type, level) items(amount, name, date, level) Task: Find code from customers where salary exceeds the count of salary from items for the same level. SQL:
SELECT code FROM customers AS cust WHERE salary > ( SELECT COUNT(salary) FROM items AS lne WHERE lne.level = cust.level );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15584
train
v3
Schema: employees (alias: emp)(amount, id, code, status) categories(amount, id, status, date) Task: Find amount from employees where value exceeds the total amount from categories for the same code. SQL:
SELECT amount FROM employees AS emp WHERE value > ( SELECT SUM(amount) FROM categories AS catg WHERE catg.code = emp.code );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15585
train
v2
Schema: invoices (alias: inv)(level, id, name, code) projects(name, id, level, type) Task: Find salary from invoices where a matching record exists in projects with the same id. SQL:
SELECT salary FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.id = inv.id );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "inv", "inner_alias": "prj", "proj_col": "salary", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15586
train
v1
Schema: orders (alias: ord)(type, status, amount, name) regions(value, type, salary, date) Task: Retrieve name from orders whose status is found in regions rows where level matches the outer record. SQL:
SELECT name FROM orders AS ord WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.level = ord.level );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15587
train
v1
Schema: products (alias: prod)(salary, date, level, name) sales(id, date, status, name) Task: Find salary from products where id appears in sales entries with matching id. SQL:
SELECT salary FROM products AS prod WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.id = prod.id );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15588
train
v1
Schema: shipments (alias: shp)(code, name, value, id) invoices(amount, code, id, level) Task: Retrieve id from shipments whose level is found in invoices rows where id matches the outer record. SQL:
SELECT id FROM shipments AS shp WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.id = shp.id );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15589
train
v3
Schema: categories (alias: catg)(date, value, id, code) regions(level, value, type, code) Task: Find id from categories where value exceeds the count of value from regions for the same status. SQL:
SELECT id FROM categories AS catg WHERE value > ( SELECT COUNT(value) FROM regions AS rgn WHERE rgn.status = catg.status );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15590
train
v2
Schema: orders (alias: ord)(id, amount, status, code) shipments(date, code, amount, type) Task: Find salary from orders where a matching record exists in shipments with the same id. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = ord.id );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "salary", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15591
train
v1
Schema: sales (alias: sale)(date, name, level, salary) accounts(name, status, code, salary) Task: Select id from sales where code exists in accounts for the same type. SQL:
SELECT id FROM sales AS sale WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.type = sale.type );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "id", "filter_col": "code", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15592
train
v2
Schema: schedules (alias: schd)(amount, code, value, level) shipments(amount, salary, value, level) Task: Retrieve code from schedules that have at least one corresponding entry in shipments sharing the same code. SQL:
SELECT code FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = schd.code );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "code", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15593
train
v3
Schema: staff (alias: empl)(value, salary, id, code) invoices(code, amount, status, salary) Task: Find code from staff where amount exceeds the average value from invoices for the same id. SQL:
SELECT code FROM staff AS empl WHERE amount > ( SELECT AVG(value) FROM invoices AS inv WHERE inv.id = empl.id );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_15594
train
v1
Schema: regions (alias: rgn)(salary, date, code, name) sales(status, salary, type, code) Task: Select code from regions where type exists in sales for the same code. SQL:
SELECT code FROM regions AS rgn WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.code = rgn.code );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_15595
train
v2
Schema: sales (alias: sale)(date, status, id, amount) orders(code, type, value, status) Task: Retrieve id from sales that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT id 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": "id", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15596
train
v2
Schema: schedules (alias: schd)(type, value, code, level) branches(salary, name, code, date) Task: Retrieve name from schedules that have at least one corresponding entry in branches sharing the same status. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.status = schd.status );
{ "outer_table": "schedules", "inner_table": "branches", "outer_alias": "schd", "inner_alias": "brc", "proj_col": "name", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15597
train
v3
Schema: customers (alias: cust)(salary, amount, date, code) accounts(date, salary, status, id) Task: Retrieve amount from customers with value above the MAX(amount) of accounts rows sharing the same type. SQL:
SELECT amount FROM customers AS cust WHERE value > ( SELECT MAX(amount) FROM accounts AS acct WHERE acct.type = cust.type );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15598
train
v1
Schema: managers (alias: mgr)(value, amount, status, level) departments(type, amount, salary, id) Task: Retrieve amount from managers whose status is found in departments rows where type matches the outer record. SQL:
SELECT amount FROM managers AS mgr WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.type = mgr.type );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "amount", "filter_col": "status", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15599
train