variant
stringclasses
3 values
prompt
stringlengths
160
237
sql
stringlengths
102
141
metadata
unknown
token_group
stringclasses
2 values
id
stringlengths
24
24
split
stringclasses
1 value
v2
Schema: products (alias: prod)(salary, level, type, status) schedules(name, type, amount, id) Task: Retrieve salary from products that have at least one corresponding entry in schedules sharing the same code. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = prod.code );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "salary", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05500
train
v1
Schema: products (alias: prod)(value, type, salary, name) orders(value, id, amount, date) Task: Select name from products where status exists in orders for the same level. SQL:
SELECT name FROM products AS prod WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.level = prod.level );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05501
train
v1
Schema: orders (alias: ord)(value, date, name, status) staff(level, date, salary, type) Task: Retrieve value from orders whose id is found in staff rows where code matches the outer record. SQL:
SELECT value FROM orders AS ord WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.code = ord.code );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05502
train
v1
Schema: shipments (alias: shp)(value, level, code, amount) schedules(amount, level, value, type) Task: Find amount from shipments where code appears in schedules entries with matching status. SQL:
SELECT amount FROM shipments AS shp WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.status = shp.status );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_05503
train
v2
Schema: projects (alias: prj)(id, code, value, level) branches(id, value, date, type) Task: Find salary from projects where a matching record exists in branches with the same id. SQL:
SELECT salary FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.id = prj.id );
{ "outer_table": "projects", "inner_table": "branches", "outer_alias": "prj", "inner_alias": "brc", "proj_col": "salary", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_05504
train
v3
Schema: products (alias: prod)(date, salary, name, level) transactions(value, amount, name, status) Task: Find value from products where amount exceeds the minimum salary from transactions for the same level. SQL:
SELECT value FROM products AS prod WHERE amount > ( SELECT MIN(salary) FROM transactions AS txn WHERE txn.level = prod.level );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05505
train
v3
Schema: sales (alias: sale)(salary, id, amount, code) branches(date, amount, id, name) Task: Find code from sales where amount exceeds the total amount from branches for the same code. SQL:
SELECT code FROM sales AS sale WHERE amount > ( SELECT SUM(amount) FROM branches AS brc WHERE brc.code = sale.code );
{ "outer_table": "sales", "inner_table": "branches", "outer_alias": "sale", "inner_alias": "brc", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05506
train
v2
Schema: managers (alias: mgr)(value, salary, code, id) accounts(date, level, name, status) Task: Retrieve id from managers that have at least one corresponding entry in accounts sharing the same code. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = mgr.code );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "id", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05507
train
v2
Schema: transactions (alias: txn)(type, salary, date, level) projects(status, level, type, code) Task: Retrieve code from transactions that have at least one corresponding entry in projects sharing the same level. SQL:
SELECT code 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": "code", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05508
train
v3
Schema: regions (alias: rgn)(code, amount, id, status) projects(salary, level, value, status) Task: Find name from regions where salary exceeds the maximum amount from projects for the same level. SQL:
SELECT name FROM regions AS rgn WHERE salary > ( SELECT MAX(amount) FROM projects AS prj WHERE prj.level = rgn.level );
{ "outer_table": "regions", "inner_table": "projects", "outer_alias": "rgn", "inner_alias": "prj", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_05509
train
v1
Schema: branches (alias: brc)(amount, name, code, level) transactions(type, value, amount, date) Task: Select id from branches where status exists in transactions for the same level. SQL:
SELECT id FROM branches AS brc WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.level = brc.level );
{ "outer_table": "branches", "inner_table": "transactions", "outer_alias": "brc", "inner_alias": "txn", "proj_col": "id", "filter_col": "status", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_05510
train
v2
Schema: projects (alias: prj)(salary, type, level, value) schedules(name, salary, level, amount) Task: Retrieve code from projects that have at least one corresponding entry in schedules sharing the same code. SQL:
SELECT code FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = prj.code );
{ "outer_table": "projects", "inner_table": "schedules", "outer_alias": "prj", "inner_alias": "schd", "proj_col": "code", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_05511
train
v1
Schema: projects (alias: prj)(value, type, name, date) schedules(name, level, date, code) Task: Retrieve amount from projects whose status is found in schedules rows where type matches the outer record. SQL:
SELECT amount FROM projects AS prj WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.type = prj.type );
{ "outer_table": "projects", "inner_table": "schedules", "outer_alias": "prj", "inner_alias": "schd", "proj_col": "amount", "filter_col": "status", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_05512
train
v3
Schema: transactions (alias: txn)(amount, date, name, value) managers(value, salary, level, amount) Task: Retrieve value from transactions with amount above the MIN(amount) of managers rows sharing the same code. SQL:
SELECT value FROM transactions AS txn WHERE amount > ( SELECT MIN(amount) FROM managers AS mgr WHERE mgr.code = txn.code );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05513
train
v3
Schema: orders (alias: ord)(value, salary, type, level) items(amount, salary, status, name) Task: Retrieve id from orders with salary above the MAX(amount) of items rows sharing the same level. SQL:
SELECT id FROM orders AS ord WHERE salary > ( SELECT MAX(amount) FROM items AS lne WHERE lne.level = ord.level );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05514
train
v3
Schema: tasks (alias: tsk)(amount, level, value, status) managers(code, type, status, value) Task: Retrieve code from tasks with value above the MIN(value) of managers rows sharing the same id. SQL:
SELECT code FROM tasks AS tsk WHERE value > ( SELECT MIN(value) FROM managers AS mgr WHERE mgr.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "managers", "outer_alias": "tsk", "inner_alias": "mgr", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_05515
train
v1
Schema: managers (alias: mgr)(name, date, value, level) shipments(value, status, type, name) Task: Retrieve code from managers whose status is found in shipments rows where status matches the outer record. SQL:
SELECT code FROM managers AS mgr WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.status = mgr.status );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "code", "filter_col": "status", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05516
train
v2
Schema: shipments (alias: shp)(type, value, level, id) branches(level, type, amount, name) Task: Retrieve code from shipments that have at least one corresponding entry in branches sharing the same type. SQL:
SELECT code FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = shp.type );
{ "outer_table": "shipments", "inner_table": "branches", "outer_alias": "shp", "inner_alias": "brc", "proj_col": "code", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_05517
train
v2
Schema: products (alias: prod)(level, salary, name, id) invoices(amount, salary, name, code) Task: Retrieve salary from products that have at least one corresponding entry in invoices sharing the same status. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = prod.status );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "salary", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05518
train
v2
Schema: invoices (alias: inv)(id, status, type, amount) projects(date, value, id, status) Task: Retrieve name from invoices that have at least one corresponding entry in projects sharing the same code. SQL:
SELECT name FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.code = inv.code );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "inv", "inner_alias": "prj", "proj_col": "name", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05519
train
v2
Schema: employees (alias: emp)(status, salary, date, id) customers(amount, type, level, salary) Task: Find code from employees where a matching record exists in customers with the same level. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = emp.level );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "code", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05520
train
v2
Schema: orders (alias: ord)(id, name, value, salary) accounts(salary, type, code, status) Task: Find salary from orders where a matching record exists in accounts with the same level. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = ord.level );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "salary", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05521
train
v2
Schema: items (alias: lne)(amount, name, code, type) shipments(salary, code, date, type) Task: Find code from items where a matching record exists in shipments with the same level. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = lne.level );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "code", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_05522
train
v3
Schema: regions (alias: rgn)(code, salary, type, level) sales(salary, level, date, code) Task: Retrieve salary from regions with value above the MAX(salary) of sales rows sharing the same code. SQL:
SELECT salary FROM regions AS rgn WHERE value > ( SELECT MAX(salary) FROM sales AS sale WHERE sale.code = rgn.code );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_05523
train
v3
Schema: tasks (alias: tsk)(type, amount, date, code) products(id, level, value, name) Task: Find name from tasks where amount exceeds the minimum value from products for the same status. SQL:
SELECT name FROM tasks AS tsk WHERE amount > ( SELECT MIN(value) FROM products AS prod WHERE prod.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "products", "outer_alias": "tsk", "inner_alias": "prod", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_05524
train
v1
Schema: departments (alias: dept)(amount, salary, name, level) customers(salary, code, name, value) Task: Select amount from departments where level exists in customers for the same status. SQL:
SELECT amount FROM departments AS dept WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.status = dept.status );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05525
train
v3
Schema: departments (alias: dept)(value, amount, level, code) customers(level, amount, id, type) Task: Find name from departments where value exceeds the count of amount from customers for the same type. SQL:
SELECT name FROM departments AS dept WHERE value > ( SELECT COUNT(amount) FROM customers AS cust WHERE cust.type = dept.type );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05526
train
v1
Schema: schedules (alias: schd)(id, status, date, level) staff(code, value, name, level) Task: Find name from schedules where id appears in staff entries with matching id. SQL:
SELECT name FROM schedules AS schd WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.id = schd.id );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "name", "filter_col": "id", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_05527
train
v2
Schema: customers (alias: cust)(salary, amount, level, date) invoices(id, value, name, salary) Task: Find code from customers where a matching record exists in invoices with the same type. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = cust.type );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "code", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05528
train
v2
Schema: staff (alias: empl)(code, amount, id, level) managers(code, type, value, date) Task: Retrieve code from staff that have at least one corresponding entry in managers sharing the same level. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = empl.level );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "code", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_05529
train
v3
Schema: regions (alias: rgn)(date, id, status, code) accounts(salary, type, name, amount) Task: Retrieve id from regions with amount above the MIN(value) of accounts rows sharing the same level. SQL:
SELECT id FROM regions AS rgn WHERE amount > ( SELECT MIN(value) FROM accounts AS acct WHERE acct.level = rgn.level );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "rgn", "inner_alias": "acct", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_05530
train
v2
Schema: transactions (alias: txn)(level, status, type, amount) categories(level, code, value, id) Task: Retrieve name from transactions that have at least one corresponding entry in categories sharing the same level. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = txn.level );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "name", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05531
train
v3
Schema: managers (alias: mgr)(code, name, status, date) items(salary, date, level, type) Task: Retrieve code from managers with value above the COUNT(amount) of items rows sharing the same id. SQL:
SELECT code FROM managers AS mgr WHERE value > ( SELECT COUNT(amount) FROM items AS lne WHERE lne.id = mgr.id );
{ "outer_table": "managers", "inner_table": "items", "outer_alias": "mgr", "inner_alias": "lne", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05532
train
v3
Schema: managers (alias: mgr)(salary, date, code, level) invoices(salary, type, level, value) Task: Retrieve code from managers with amount above the AVG(salary) of invoices rows sharing the same level. SQL:
SELECT code FROM managers AS mgr WHERE amount > ( SELECT AVG(salary) FROM invoices AS inv WHERE inv.level = mgr.level );
{ "outer_table": "managers", "inner_table": "invoices", "outer_alias": "mgr", "inner_alias": "inv", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05533
train
v3
Schema: categories (alias: catg)(amount, code, name, id) departments(amount, type, status, name) Task: Find name from categories where salary exceeds the average value from departments for the same code. SQL:
SELECT name FROM categories AS catg WHERE salary > ( SELECT AVG(value) FROM departments AS dept WHERE dept.code = catg.code );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_05534
train
v3
Schema: products (alias: prod)(id, salary, value, status) invoices(code, amount, salary, id) Task: Find name from products where value exceeds the total salary from invoices for the same level. SQL:
SELECT name FROM products AS prod WHERE value > ( SELECT SUM(salary) FROM invoices AS inv WHERE inv.level = prod.level );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05535
train
v1
Schema: departments (alias: dept)(value, level, amount, id) branches(level, salary, value, date) Task: Retrieve id from departments whose code is found in branches rows where code matches the outer record. SQL:
SELECT id FROM departments AS dept WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.code = dept.code );
{ "outer_table": "departments", "inner_table": "branches", "outer_alias": "dept", "inner_alias": "brc", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05536
train
v3
Schema: staff (alias: empl)(value, salary, type, name) transactions(level, salary, type, id) Task: Retrieve value from staff with value above the SUM(salary) of transactions rows sharing the same code. SQL:
SELECT value FROM staff AS empl WHERE value > ( SELECT SUM(salary) FROM transactions AS txn WHERE txn.code = empl.code );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_05537
train
v1
Schema: products (alias: prod)(level, status, salary, code) invoices(name, level, date, status) Task: Retrieve value from products whose status is found in invoices rows where status matches the outer record. SQL:
SELECT value FROM products AS prod WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.status = prod.status );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05538
train
v2
Schema: products (alias: prod)(code, id, salary, level) shipments(name, date, type, amount) Task: Find salary from products where a matching record exists in shipments with the same id. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = prod.id );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "salary", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05539
train
v1
Schema: regions (alias: rgn)(date, value, status, salary) items(type, id, salary, value) Task: Select value from regions where type exists in items for the same code. SQL:
SELECT value FROM regions AS rgn WHERE type IN ( SELECT type FROM items AS lne WHERE lne.code = rgn.code );
{ "outer_table": "regions", "inner_table": "items", "outer_alias": "rgn", "inner_alias": "lne", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_05540
train
v2
Schema: customers (alias: cust)(salary, date, id, value) employees(value, level, type, name) Task: Retrieve id from customers that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = cust.status );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "id", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05541
train
v1
Schema: employees (alias: emp)(level, amount, status, code) branches(amount, code, level, salary) Task: Retrieve value from employees whose code is found in branches rows where id matches the outer record. SQL:
SELECT value FROM employees AS emp WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.id = emp.id );
{ "outer_table": "employees", "inner_table": "branches", "outer_alias": "emp", "inner_alias": "brc", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05542
train
v2
Schema: transactions (alias: txn)(type, value, date, name) employees(level, salary, name, value) Task: Retrieve salary from transactions that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = txn.status );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "salary", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05543
train
v3
Schema: orders (alias: ord)(name, code, date, id) invoices(code, level, type, id) Task: Retrieve salary from orders with salary above the MAX(value) of invoices rows sharing the same level. SQL:
SELECT salary FROM orders AS ord WHERE salary > ( SELECT MAX(value) FROM invoices AS inv WHERE inv.level = ord.level );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05544
train
v1
Schema: employees (alias: emp)(salary, level, amount, value) categories(name, date, level, value) Task: Select name from employees where status exists in categories for the same type. SQL:
SELECT name FROM employees AS emp WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.type = emp.type );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05545
train
v1
Schema: projects (alias: prj)(code, date, level, type) employees(type, status, code, id) Task: Select name from projects where status exists in employees for the same code. SQL:
SELECT name FROM projects AS prj WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.code = prj.code );
{ "outer_table": "projects", "inner_table": "employees", "outer_alias": "prj", "inner_alias": "emp", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_05546
train
v1
Schema: schedules (alias: schd)(amount, level, code, status) items(salary, code, status, name) Task: Retrieve id from schedules whose id is found in items rows where id matches the outer record. SQL:
SELECT id FROM schedules AS schd WHERE id IN ( SELECT id FROM items AS lne WHERE lne.id = schd.id );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_05547
train
v2
Schema: items (alias: lne)(status, date, id, value) categories(type, id, code, date) Task: Find amount from items where a matching record exists in categories with the same id. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = lne.id );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "amount", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_05548
train
v2
Schema: requests (alias: ordr)(amount, type, name, date) employees(value, amount, id, code) Task: Retrieve code from requests that have at least one corresponding entry in employees sharing the same code. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = ordr.code );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "code", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_05549
train
v3
Schema: shipments (alias: shp)(id, salary, name, date) items(date, id, level, amount) Task: Find value from shipments where value exceeds the count of amount from items for the same level. SQL:
SELECT value FROM shipments AS shp WHERE value > ( SELECT COUNT(amount) FROM items AS lne WHERE lne.level = shp.level );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_05550
train
v1
Schema: schedules (alias: schd)(level, id, amount, date) invoices(code, type, name, amount) Task: Retrieve value from schedules whose code is found in invoices rows where id matches the outer record. SQL:
SELECT value FROM schedules AS schd WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.id = schd.id );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_05551
train
v3
Schema: departments (alias: dept)(level, salary, value, id) projects(value, level, status, amount) Task: Find code from departments where salary exceeds the total salary from projects for the same status. SQL:
SELECT code FROM departments AS dept WHERE salary > ( SELECT SUM(salary) FROM projects AS prj WHERE prj.status = dept.status );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05552
train
v2
Schema: managers (alias: mgr)(status, id, amount, code) sales(amount, date, value, code) Task: Retrieve id from managers that have at least one corresponding entry in sales sharing the same id. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = mgr.id );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "id", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05553
train
v2
Schema: shipments (alias: shp)(value, salary, date, type) sales(level, name, value, code) Task: Retrieve amount from shipments that have at least one corresponding entry in sales sharing the same level. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = shp.level );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "amount", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_05554
train
v1
Schema: shipments (alias: shp)(date, id, level, salary) branches(status, code, type, id) Task: Find name from shipments where id appears in branches entries with matching level. SQL:
SELECT name FROM shipments AS shp WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.level = shp.level );
{ "outer_table": "shipments", "inner_table": "branches", "outer_alias": "shp", "inner_alias": "brc", "proj_col": "name", "filter_col": "id", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_05555
train
v2
Schema: categories (alias: catg)(level, type, status, value) items(name, id, status, date) Task: Find code from categories where a matching record exists in items with the same status. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = catg.status );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "code", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_05556
train
v1
Schema: managers (alias: mgr)(code, amount, date, status) invoices(salary, amount, value, name) Task: Retrieve name from managers whose code is found in invoices rows where code matches the outer record. SQL:
SELECT name FROM managers AS mgr WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.code = mgr.code );
{ "outer_table": "managers", "inner_table": "invoices", "outer_alias": "mgr", "inner_alias": "inv", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05557
train
v2
Schema: managers (alias: mgr)(status, amount, id, level) accounts(date, level, salary, name) Task: Find code from managers where a matching record exists in accounts with the same type. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = mgr.type );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "code", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05558
train
v3
Schema: shipments (alias: shp)(amount, level, salary, id) items(name, date, type, value) Task: Find id from shipments where salary exceeds the minimum salary from items for the same level. SQL:
SELECT id FROM shipments AS shp WHERE salary > ( SELECT MIN(salary) FROM items AS lne WHERE lne.level = shp.level );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_05559
train
v3
Schema: customers (alias: cust)(id, status, level, code) accounts(level, salary, id, type) Task: Retrieve code from customers with value above the SUM(value) of accounts rows sharing the same status. SQL:
SELECT code FROM customers AS cust WHERE value > ( SELECT SUM(value) FROM accounts AS acct WHERE acct.status = cust.status );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05560
train
v1
Schema: managers (alias: mgr)(type, date, value, code) sales(value, name, date, type) Task: Select code from managers where id exists in sales for the same code. SQL:
SELECT code FROM managers AS mgr WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.code = mgr.code );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "code", "filter_col": "id", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05561
train
v1
Schema: orders (alias: ord)(code, name, date, level) customers(date, type, code, amount) Task: Find value from orders where id appears in customers entries with matching id. SQL:
SELECT value FROM orders AS ord WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.id = ord.id );
{ "outer_table": "orders", "inner_table": "customers", "outer_alias": "ord", "inner_alias": "cust", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05562
train
v1
Schema: tasks (alias: tsk)(code, salary, value, name) sales(salary, amount, date, level) Task: Retrieve name from tasks whose level is found in sales rows where type matches the outer record. SQL:
SELECT name FROM tasks AS tsk WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "sales", "outer_alias": "tsk", "inner_alias": "sale", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_05563
train
v1
Schema: requests (alias: ordr)(id, name, level, status) tasks(name, type, value, amount) Task: Find code from requests where type appears in tasks entries with matching code. SQL:
SELECT code FROM requests AS ordr WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.code = ordr.code );
{ "outer_table": "requests", "inner_table": "tasks", "outer_alias": "ordr", "inner_alias": "tsk", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_05564
train
v1
Schema: sales (alias: sale)(salary, amount, name, status) staff(code, amount, name, date) Task: Find amount from sales where id appears in staff entries with matching type. SQL:
SELECT amount FROM sales AS sale WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.type = sale.type );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05565
train
v3
Schema: regions (alias: rgn)(status, date, level, code) branches(id, value, level, date) Task: Retrieve salary from regions with value above the AVG(value) of branches rows sharing the same id. SQL:
SELECT salary FROM regions AS rgn WHERE value > ( SELECT AVG(value) FROM branches AS brc WHERE brc.id = rgn.id );
{ "outer_table": "regions", "inner_table": "branches", "outer_alias": "rgn", "inner_alias": "brc", "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_05566
train
v2
Schema: transactions (alias: txn)(code, id, level, salary) sales(code, level, date, status) Task: Retrieve value from transactions that have at least one corresponding entry in sales sharing the same code. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = txn.code );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "value", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05567
train
v3
Schema: sales (alias: sale)(name, type, amount, value) tasks(level, name, amount, id) Task: Find amount from sales where amount exceeds the count of amount from tasks for the same code. SQL:
SELECT amount FROM sales AS sale WHERE amount > ( SELECT COUNT(amount) FROM tasks AS tsk WHERE tsk.code = sale.code );
{ "outer_table": "sales", "inner_table": "tasks", "outer_alias": "sale", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05568
train
v3
Schema: staff (alias: empl)(amount, level, salary, date) shipments(value, date, code, level) Task: Find value from staff where amount exceeds the maximum amount from shipments for the same type. SQL:
SELECT value FROM staff AS empl WHERE amount > ( SELECT MAX(amount) FROM shipments AS shp WHERE shp.type = empl.type );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_05569
train
v3
Schema: accounts (alias: acct)(value, status, date, amount) customers(type, id, name, amount) Task: Retrieve code from accounts with salary above the AVG(amount) of customers rows sharing the same level. SQL:
SELECT code FROM accounts AS acct WHERE salary > ( SELECT AVG(amount) FROM customers AS cust WHERE cust.level = acct.level );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05570
train
v3
Schema: products (alias: prod)(date, level, salary, code) managers(type, code, level, status) Task: Retrieve name from products with amount above the COUNT(salary) of managers rows sharing the same type. SQL:
SELECT name FROM products AS prod WHERE amount > ( SELECT COUNT(salary) FROM managers AS mgr WHERE mgr.type = prod.type );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05571
train
v1
Schema: schedules (alias: schd)(value, level, salary, date) employees(level, amount, salary, type) Task: Retrieve name from schedules whose code is found in employees rows where type matches the outer record. SQL:
SELECT name FROM schedules AS schd WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.type = schd.type );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "name", "filter_col": "code", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_05572
train
v1
Schema: shipments (alias: shp)(salary, id, value, type) sales(value, amount, id, type) Task: Find name from shipments where type appears in sales entries with matching code. SQL:
SELECT name FROM shipments AS shp WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.code = shp.code );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_05573
train
v1
Schema: transactions (alias: txn)(code, level, date, type) managers(type, value, name, code) Task: Select code from transactions where type exists in managers for the same code. SQL:
SELECT code FROM transactions AS txn WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.code = txn.code );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05574
train
v1
Schema: categories (alias: catg)(value, id, type, salary) schedules(status, amount, type, value) Task: Select value from categories where code exists in schedules for the same id. SQL:
SELECT value FROM categories AS catg WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.id = catg.id );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_05575
train
v2
Schema: items (alias: lne)(level, salary, date, status) categories(value, level, id, status) Task: Find name from items where a matching record exists in categories with the same id. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = lne.id );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "name", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_05576
train
v2
Schema: invoices (alias: inv)(value, type, status, amount) products(type, salary, code, status) Task: Retrieve code from invoices that have at least one corresponding entry in products sharing the same code. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = inv.code );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "code", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05577
train
v1
Schema: employees (alias: emp)(level, salary, id, amount) accounts(level, code, status, amount) Task: Retrieve amount from employees whose code is found in accounts rows where level matches the outer record. SQL:
SELECT amount FROM employees AS emp WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.level = emp.level );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05578
train
v3
Schema: requests (alias: ordr)(salary, id, type, status) categories(name, date, salary, type) Task: Find name from requests where value exceeds the total salary from categories for the same id. SQL:
SELECT name FROM requests AS ordr WHERE value > ( SELECT SUM(salary) FROM categories AS catg WHERE catg.id = ordr.id );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_05579
train
v1
Schema: accounts (alias: acct)(type, id, level, date) customers(level, salary, name, id) Task: Find value from accounts where id appears in customers entries with matching status. SQL:
SELECT value FROM accounts AS acct WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.status = acct.status );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05580
train
v2
Schema: branches (alias: brc)(value, name, date, level) products(date, value, name, level) Task: Find name from branches where a matching record exists in products with the same id. SQL:
SELECT name FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = brc.id );
{ "outer_table": "branches", "inner_table": "products", "outer_alias": "brc", "inner_alias": "prod", "proj_col": "name", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_05581
train
v2
Schema: requests (alias: ordr)(id, name, salary, value) invoices(code, salary, name, status) Task: Find salary from requests where a matching record exists in invoices with the same level. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = ordr.level );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "salary", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_05582
train
v2
Schema: categories (alias: catg)(name, status, amount, value) staff(code, type, status, amount) Task: Retrieve code from categories that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = catg.status );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "code", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_05583
train
v2
Schema: shipments (alias: shp)(status, type, level, salary) invoices(code, name, status, amount) Task: Retrieve salary from shipments that have at least one corresponding entry in invoices sharing the same code. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = shp.code );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "salary", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_05584
train
v3
Schema: managers (alias: mgr)(salary, type, name, value) tasks(name, code, value, date) Task: Retrieve salary from managers with amount above the AVG(value) of tasks rows sharing the same type. SQL:
SELECT salary FROM managers AS mgr WHERE amount > ( SELECT AVG(value) FROM tasks AS tsk WHERE tsk.type = mgr.type );
{ "outer_table": "managers", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05585
train
v3
Schema: projects (alias: prj)(type, amount, level, value) regions(status, level, type, code) Task: Find name from projects where salary exceeds the maximum value from regions for the same status. SQL:
SELECT name FROM projects AS prj WHERE salary > ( SELECT MAX(value) FROM regions AS rgn WHERE rgn.status = prj.status );
{ "outer_table": "projects", "inner_table": "regions", "outer_alias": "prj", "inner_alias": "rgn", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_05586
train
v2
Schema: customers (alias: cust)(level, name, code, type) employees(level, status, type, name) Task: Find salary from customers where a matching record exists in employees with the same level. SQL:
SELECT salary 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": "salary", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05587
train
v1
Schema: transactions (alias: txn)(salary, type, date, status) schedules(name, id, status, level) Task: Retrieve code from transactions whose type is found in schedules rows where code matches the outer record. SQL:
SELECT code FROM transactions AS txn WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.code = txn.code );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05588
train
v3
Schema: staff (alias: empl)(name, date, status, id) orders(value, name, type, amount) Task: Find amount from staff where amount exceeds the count of salary from orders for the same type. SQL:
SELECT amount FROM staff AS empl WHERE amount > ( SELECT COUNT(salary) FROM orders AS ord WHERE ord.type = empl.type );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_05589
train
v2
Schema: categories (alias: catg)(type, value, code, id) shipments(date, code, value, name) Task: Find code from categories where a matching record exists in shipments with the same code. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = catg.code );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "catg", "inner_alias": "shp", "proj_col": "code", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_05590
train
v3
Schema: items (alias: lne)(date, type, amount, status) departments(value, date, salary, type) Task: Retrieve id from items with salary above the AVG(amount) of departments rows sharing the same status. SQL:
SELECT id FROM items AS lne WHERE salary > ( SELECT AVG(amount) FROM departments AS dept WHERE dept.status = lne.status );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_05591
train
v1
Schema: branches (alias: brc)(salary, value, name, id) shipments(amount, status, code, date) Task: Find id from branches where code appears in shipments entries with matching level. SQL:
SELECT id FROM branches AS brc WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.level = brc.level );
{ "outer_table": "branches", "inner_table": "shipments", "outer_alias": "brc", "inner_alias": "shp", "proj_col": "id", "filter_col": "code", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_05592
train
v2
Schema: customers (alias: cust)(salary, id, status, name) categories(type, name, value, code) Task: Retrieve name from customers that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = cust.code );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "name", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05593
train
v3
Schema: tasks (alias: tsk)(amount, name, level, id) schedules(date, value, id, code) Task: Find id from tasks where salary exceeds the count of value from schedules for the same code. SQL:
SELECT id FROM tasks AS tsk WHERE salary > ( SELECT COUNT(value) FROM schedules AS schd WHERE schd.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "schedules", "outer_alias": "tsk", "inner_alias": "schd", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_05594
train
v1
Schema: invoices (alias: inv)(salary, name, amount, id) transactions(type, id, code, value) Task: Select name from invoices where type exists in transactions for the same id. SQL:
SELECT name FROM invoices AS inv WHERE type IN ( SELECT type 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": "type", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05595
train
v2
Schema: employees (alias: emp)(value, amount, level, name) managers(amount, type, date, salary) Task: Retrieve amount from employees that have at least one corresponding entry in managers sharing the same id. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = emp.id );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "amount", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05596
train
v2
Schema: accounts (alias: acct)(value, date, name, amount) projects(value, salary, level, type) Task: Retrieve amount from accounts that have at least one corresponding entry in projects sharing the same code. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.code = acct.code );
{ "outer_table": "accounts", "inner_table": "projects", "outer_alias": "acct", "inner_alias": "prj", "proj_col": "amount", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_05597
train
v2
Schema: items (alias: lne)(date, status, amount, level) tasks(date, status, name, value) Task: Retrieve code from items that have at least one corresponding entry in tasks sharing the same code. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.code = lne.code );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "code", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_05598
train
v2
Schema: categories (alias: catg)(date, type, value, amount) projects(date, salary, value, amount) Task: Retrieve value from categories that have at least one corresponding entry in projects sharing the same level. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.level = catg.level );
{ "outer_table": "categories", "inner_table": "projects", "outer_alias": "catg", "inner_alias": "prj", "proj_col": "value", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_05599
train