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: customers (alias: cust)(code, amount, id, name) regions(name, type, status, level) Task: Find name from customers where code appears in regions entries with matching level. SQL:
SELECT name FROM customers AS cust WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.level = cust.level );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03400
train
v1
Schema: categories (alias: catg)(name, code, salary, date) shipments(amount, date, salary, level) Task: Retrieve value from categories whose type is found in shipments rows where level matches the outer record. SQL:
SELECT value FROM categories AS catg WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.level = catg.level );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "catg", "inner_alias": "shp", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03401
train
v1
Schema: orders (alias: ord)(type, date, status, code) accounts(value, amount, name, id) Task: Retrieve id from orders whose id is found in accounts rows where type matches the outer record. SQL:
SELECT id FROM orders AS ord WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.type = ord.type );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03402
train
v3
Schema: tasks (alias: tsk)(status, salary, name, amount) schedules(value, level, date, code) Task: Find value from tasks where value exceeds the maximum value from schedules for the same type. SQL:
SELECT value FROM tasks AS tsk WHERE value > ( SELECT MAX(value) FROM schedules AS schd WHERE schd.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "schedules", "outer_alias": "tsk", "inner_alias": "schd", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03403
train
v2
Schema: transactions (alias: txn)(status, level, type, value) categories(status, id, type, salary) Task: Retrieve amount from transactions that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = txn.code );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "amount", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03404
train
v3
Schema: shipments (alias: shp)(code, status, name, level) employees(status, code, date, salary) Task: Retrieve value from shipments with amount above the MIN(value) of employees rows sharing the same status. SQL:
SELECT value FROM shipments AS shp WHERE amount > ( SELECT MIN(value) FROM employees AS emp WHERE emp.status = shp.status );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_03405
train
v3
Schema: transactions (alias: txn)(salary, date, id, amount) departments(level, id, salary, status) Task: Find code from transactions where value exceeds the total salary from departments for the same code. SQL:
SELECT code FROM transactions AS txn WHERE value > ( SELECT SUM(salary) FROM departments AS dept WHERE dept.code = txn.code );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03406
train
v1
Schema: requests (alias: ordr)(status, type, salary, value) products(date, value, level, salary) Task: Select id from requests where code exists in products for the same id. SQL:
SELECT id FROM requests AS ordr WHERE code IN ( SELECT code FROM products AS prod WHERE prod.id = ordr.id );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "id", "filter_col": "code", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_03407
train
v3
Schema: invoices (alias: inv)(salary, date, name, status) staff(level, amount, code, salary) Task: Find name from invoices where amount exceeds the total salary from staff for the same code. SQL:
SELECT name FROM invoices AS inv WHERE amount > ( SELECT SUM(salary) FROM staff AS empl WHERE empl.code = inv.code );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03408
train
v3
Schema: branches (alias: brc)(status, type, value, code) departments(code, salary, status, level) Task: Find value from branches where salary exceeds the total amount from departments for the same type. SQL:
SELECT value FROM branches AS brc WHERE salary > ( SELECT SUM(amount) FROM departments AS dept WHERE dept.type = brc.type );
{ "outer_table": "branches", "inner_table": "departments", "outer_alias": "brc", "inner_alias": "dept", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_03409
train
v1
Schema: staff (alias: empl)(name, level, amount, salary) departments(value, level, amount, code) Task: Find name from staff where level appears in departments entries with matching status. SQL:
SELECT name FROM staff AS empl WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.status = empl.status );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_03410
train
v3
Schema: items (alias: lne)(status, code, value, level) projects(value, type, name, status) Task: Find value from items where value exceeds the total amount from projects for the same code. SQL:
SELECT value FROM items AS lne WHERE value > ( SELECT SUM(amount) FROM projects AS prj WHERE prj.code = lne.code );
{ "outer_table": "items", "inner_table": "projects", "outer_alias": "lne", "inner_alias": "prj", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03411
train
v1
Schema: products (alias: prod)(code, id, name, status) invoices(value, status, id, name) Task: Select amount from products where type exists in invoices for the same status. SQL:
SELECT amount FROM products AS prod WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.status = prod.status );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03412
train
v1
Schema: employees (alias: emp)(salary, level, id, code) categories(value, id, level, amount) Task: Find amount from employees where status appears in categories entries with matching level. SQL:
SELECT amount FROM employees AS emp WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.level = emp.level );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03413
train
v3
Schema: products (alias: prod)(code, id, amount, type) sales(status, level, type, name) Task: Find salary from products where salary exceeds the count of amount from sales for the same id. SQL:
SELECT salary FROM products AS prod WHERE salary > ( SELECT COUNT(amount) 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": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03414
train
v3
Schema: shipments (alias: shp)(value, salary, amount, name) schedules(amount, name, level, code) Task: Retrieve code from shipments with amount above the MAX(amount) of schedules rows sharing the same id. SQL:
SELECT code FROM shipments AS shp WHERE amount > ( SELECT MAX(amount) FROM schedules AS schd WHERE schd.id = shp.id );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_03415
train
v2
Schema: orders (alias: ord)(name, code, id, amount) shipments(date, level, status, type) Task: Find amount from orders where a matching record exists in shipments with the same type. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = ord.type );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "amount", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03416
train
v1
Schema: branches (alias: brc)(status, type, level, value) invoices(id, status, code, level) Task: Retrieve id from branches whose code is found in invoices rows where status matches the outer record. SQL:
SELECT id FROM branches AS brc WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.status = brc.status );
{ "outer_table": "branches", "inner_table": "invoices", "outer_alias": "brc", "inner_alias": "inv", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_03417
train
v3
Schema: employees (alias: emp)(status, date, code, name) branches(name, id, salary, level) Task: Retrieve amount from employees with amount above the COUNT(value) of branches rows sharing the same level. SQL:
SELECT amount FROM employees AS emp WHERE amount > ( SELECT COUNT(value) FROM branches AS brc WHERE brc.level = emp.level );
{ "outer_table": "employees", "inner_table": "branches", "outer_alias": "emp", "inner_alias": "brc", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03418
train
v1
Schema: customers (alias: cust)(name, value, salary, date) requests(name, salary, id, amount) Task: Find value from customers where code appears in requests entries with matching type. SQL:
SELECT value FROM customers AS cust WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.type = cust.type );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03419
train
v1
Schema: transactions (alias: txn)(amount, id, status, type) departments(value, type, name, code) Task: Retrieve amount from transactions whose id is found in departments rows where type matches the outer record. SQL:
SELECT amount FROM transactions AS txn WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.type = txn.type );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03420
train
v2
Schema: employees (alias: emp)(level, amount, status, code) branches(date, value, id, salary) Task: Find salary from employees where a matching record exists in branches with the same level. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.level = emp.level );
{ "outer_table": "employees", "inner_table": "branches", "outer_alias": "emp", "inner_alias": "brc", "proj_col": "salary", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03421
train
v3
Schema: departments (alias: dept)(name, salary, level, date) transactions(amount, type, level, id) Task: Find salary from departments where salary exceeds the count of salary from transactions for the same id. SQL:
SELECT salary FROM departments AS dept WHERE salary > ( SELECT COUNT(salary) FROM transactions AS txn WHERE txn.id = dept.id );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03422
train
v1
Schema: transactions (alias: txn)(amount, salary, level, date) customers(code, type, name, level) Task: Retrieve name from transactions whose code is found in customers rows where level matches the outer record. SQL:
SELECT name FROM transactions AS txn WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.level = txn.level );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03423
train
v2
Schema: products (alias: prod)(amount, name, id, level) shipments(type, name, level, status) Task: Find code from products where a matching record exists in shipments with the same level. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = prod.level );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "code", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03424
train
v3
Schema: invoices (alias: inv)(amount, name, status, id) orders(name, status, level, date) Task: Retrieve amount from invoices with salary above the MIN(salary) of orders rows sharing the same level. SQL:
SELECT amount FROM invoices AS inv WHERE salary > ( SELECT MIN(salary) FROM orders AS ord WHERE ord.level = inv.level );
{ "outer_table": "invoices", "inner_table": "orders", "outer_alias": "inv", "inner_alias": "ord", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03425
train
v1
Schema: shipments (alias: shp)(date, status, value, code) managers(name, level, code, date) Task: Select name from shipments where code exists in managers for the same code. SQL:
SELECT name FROM shipments AS shp WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.code = shp.code );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_03426
train
v1
Schema: branches (alias: brc)(code, level, date, amount) projects(level, status, name, code) Task: Select code from branches where level exists in projects for the same status. SQL:
SELECT code FROM branches AS brc WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.status = brc.status );
{ "outer_table": "branches", "inner_table": "projects", "outer_alias": "brc", "inner_alias": "prj", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_03427
train
v1
Schema: requests (alias: ordr)(name, level, status, id) products(id, code, date, type) Task: Select value from requests where id exists in products for the same id. SQL:
SELECT value FROM requests AS ordr WHERE id IN ( SELECT id FROM products AS prod WHERE prod.id = ordr.id );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_03428
train
v3
Schema: orders (alias: ord)(code, amount, type, id) transactions(code, value, name, id) Task: Find salary from orders where salary exceeds the average salary from transactions for the same code. SQL:
SELECT salary FROM orders AS ord WHERE salary > ( SELECT AVG(salary) FROM transactions AS txn WHERE txn.code = ord.code );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03429
train
v3
Schema: customers (alias: cust)(salary, value, status, amount) tasks(type, code, value, id) Task: Retrieve value from customers with value above the MIN(value) of tasks rows sharing the same id. SQL:
SELECT value FROM customers AS cust WHERE value > ( SELECT MIN(value) FROM tasks AS tsk WHERE tsk.id = cust.id );
{ "outer_table": "customers", "inner_table": "tasks", "outer_alias": "cust", "inner_alias": "tsk", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03430
train
v2
Schema: branches (alias: brc)(value, salary, status, amount) categories(level, amount, value, date) Task: Retrieve amount from branches that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT amount FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = brc.code );
{ "outer_table": "branches", "inner_table": "categories", "outer_alias": "brc", "inner_alias": "catg", "proj_col": "amount", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_03431
train
v1
Schema: shipments (alias: shp)(salary, type, level, id) departments(name, level, value, salary) Task: Retrieve amount from shipments whose code is found in departments rows where type matches the outer record. SQL:
SELECT amount FROM shipments AS shp WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.type = shp.type );
{ "outer_table": "shipments", "inner_table": "departments", "outer_alias": "shp", "inner_alias": "dept", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_03432
train
v2
Schema: categories (alias: catg)(status, id, salary, date) products(value, type, date, salary) Task: Find salary from categories where a matching record exists in products with the same status. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = catg.status );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "salary", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03433
train
v1
Schema: departments (alias: dept)(amount, type, date, salary) tasks(amount, code, level, value) Task: Find salary from departments where level appears in tasks entries with matching status. SQL:
SELECT salary FROM departments AS dept WHERE level IN ( SELECT level FROM tasks AS tsk WHERE tsk.status = dept.status );
{ "outer_table": "departments", "inner_table": "tasks", "outer_alias": "dept", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "level", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03434
train
v3
Schema: categories (alias: catg)(id, status, type, code) departments(level, type, status, date) Task: Retrieve value from categories with amount above the SUM(value) of departments rows sharing the same code. SQL:
SELECT value FROM categories AS catg WHERE amount > ( SELECT SUM(value) FROM departments AS dept WHERE dept.code = catg.code );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03435
train
v3
Schema: managers (alias: mgr)(level, code, name, type) branches(name, salary, value, id) Task: Retrieve salary from managers with value above the AVG(salary) of branches rows sharing the same status. SQL:
SELECT salary FROM managers AS mgr WHERE value > ( SELECT AVG(salary) FROM branches AS brc WHERE brc.status = mgr.status );
{ "outer_table": "managers", "inner_table": "branches", "outer_alias": "mgr", "inner_alias": "brc", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03436
train
v3
Schema: regions (alias: rgn)(value, status, type, name) items(status, value, code, name) Task: Retrieve salary from regions with salary above the AVG(value) of items rows sharing the same id. SQL:
SELECT salary FROM regions AS rgn WHERE salary > ( SELECT AVG(value) FROM items AS lne WHERE lne.id = rgn.id );
{ "outer_table": "regions", "inner_table": "items", "outer_alias": "rgn", "inner_alias": "lne", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_03437
train
v2
Schema: items (alias: lne)(amount, name, id, value) products(level, amount, id, code) Task: Find name from items where a matching record exists in products with the same level. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = lne.level );
{ "outer_table": "items", "inner_table": "products", "outer_alias": "lne", "inner_alias": "prod", "proj_col": "name", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03438
train
v3
Schema: products (alias: prod)(salary, id, value, amount) employees(name, amount, value, status) Task: Retrieve value from products with salary above the MIN(value) of employees rows sharing the same level. SQL:
SELECT value FROM products AS prod WHERE salary > ( SELECT MIN(value) FROM employees AS emp WHERE emp.level = prod.level );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03439
train
v1
Schema: managers (alias: mgr)(value, type, id, amount) accounts(id, salary, level, type) Task: Select amount from managers where type exists in accounts for the same id. SQL:
SELECT amount FROM managers AS mgr WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.id = mgr.id );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03440
train
v2
Schema: transactions (alias: txn)(id, code, value, status) tasks(value, type, id, amount) Task: Retrieve id from transactions that have at least one corresponding entry in tasks sharing the same code. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.code = txn.code );
{ "outer_table": "transactions", "inner_table": "tasks", "outer_alias": "txn", "inner_alias": "tsk", "proj_col": "id", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03441
train
v1
Schema: orders (alias: ord)(date, id, amount, level) schedules(status, type, code, name) Task: Select value from orders where code exists in schedules for the same level. SQL:
SELECT value FROM orders AS ord WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.level = ord.level );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03442
train
v3
Schema: employees (alias: emp)(type, id, date, status) staff(type, level, code, date) Task: Find id from employees where amount exceeds the count of salary from staff for the same level. SQL:
SELECT id FROM employees AS emp WHERE amount > ( SELECT COUNT(salary) FROM staff AS empl WHERE empl.level = emp.level );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03443
train
v3
Schema: schedules (alias: schd)(status, date, value, type) customers(amount, id, type, salary) Task: Retrieve code from schedules with value above the SUM(amount) of customers rows sharing the same code. SQL:
SELECT code FROM schedules AS schd WHERE value > ( SELECT SUM(amount) FROM customers AS cust WHERE cust.code = schd.code );
{ "outer_table": "schedules", "inner_table": "customers", "outer_alias": "schd", "inner_alias": "cust", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03444
train
v3
Schema: categories (alias: catg)(code, date, value, amount) projects(name, id, code, salary) Task: Find code from categories where amount exceeds the total value from projects for the same code. SQL:
SELECT code FROM categories AS catg WHERE amount > ( SELECT SUM(value) FROM projects AS prj WHERE prj.code = catg.code );
{ "outer_table": "categories", "inner_table": "projects", "outer_alias": "catg", "inner_alias": "prj", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03445
train
v3
Schema: projects (alias: prj)(code, amount, date, level) departments(type, id, salary, code) Task: Find salary from projects where value exceeds the total amount from departments for the same id. SQL:
SELECT salary FROM projects AS prj WHERE value > ( SELECT SUM(amount) FROM departments AS dept WHERE dept.id = prj.id );
{ "outer_table": "projects", "inner_table": "departments", "outer_alias": "prj", "inner_alias": "dept", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_03446
train
v3
Schema: regions (alias: rgn)(level, date, code, status) shipments(name, type, date, id) Task: Retrieve amount from regions with salary above the COUNT(salary) of shipments rows sharing the same id. SQL:
SELECT amount FROM regions AS rgn WHERE salary > ( SELECT COUNT(salary) FROM shipments AS shp WHERE shp.id = rgn.id );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_03447
train
v2
Schema: customers (alias: cust)(amount, type, name, salary) accounts(status, date, name, salary) Task: Retrieve value from customers that have at least one corresponding entry in accounts sharing the same level. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = cust.level );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "value", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03448
train
v2
Schema: regions (alias: rgn)(id, amount, status, type) sales(value, level, id, code) Task: Retrieve salary from regions that have at least one corresponding entry in sales sharing the same code. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = rgn.code );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "salary", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_03449
train
v2
Schema: customers (alias: cust)(type, level, salary, name) invoices(code, name, date, value) Task: Find id from customers where a matching record exists in invoices with the same id. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = cust.id );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "id", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03450
train
v3
Schema: schedules (alias: schd)(type, name, amount, id) sales(value, salary, name, amount) Task: Find code from schedules where amount exceeds the maximum amount from sales for the same status. SQL:
SELECT code FROM schedules AS schd WHERE amount > ( SELECT MAX(amount) FROM sales AS sale WHERE sale.status = schd.status );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03451
train
v3
Schema: tasks (alias: tsk)(value, id, date, name) customers(id, code, amount, date) Task: Find name from tasks where salary exceeds the maximum value from customers for the same status. SQL:
SELECT name FROM tasks AS tsk WHERE salary > ( SELECT MAX(value) FROM customers AS cust WHERE cust.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "customers", "outer_alias": "tsk", "inner_alias": "cust", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03452
train
v2
Schema: tasks (alias: tsk)(type, salary, code, name) employees(status, level, salary, value) Task: Find name from tasks where a matching record exists in employees with the same type. SQL:
SELECT name FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "employees", "outer_alias": "tsk", "inner_alias": "emp", "proj_col": "name", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03453
train
v1
Schema: departments (alias: dept)(code, id, amount, type) accounts(date, code, type, salary) Task: Retrieve id from departments whose type is found in accounts rows where level matches the outer record. SQL:
SELECT id FROM departments AS dept WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.level = dept.level );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03454
train
v1
Schema: categories (alias: catg)(level, date, value, amount) requests(name, amount, id, type) Task: Find value from categories where code appears in requests entries with matching id. SQL:
SELECT value FROM categories AS catg WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.id = catg.id );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03455
train
v1
Schema: customers (alias: cust)(salary, level, name, date) managers(salary, code, level, value) Task: Retrieve amount from customers whose level is found in managers rows where status matches the outer record. SQL:
SELECT amount FROM customers AS cust WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.status = cust.status );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03456
train
v1
Schema: invoices (alias: inv)(status, code, date, type) managers(level, type, code, id) Task: Retrieve name from invoices whose code is found in managers rows where id matches the outer record. SQL:
SELECT name FROM invoices AS inv WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.id = inv.id );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03457
train
v3
Schema: departments (alias: dept)(amount, level, id, value) accounts(level, type, code, value) Task: Retrieve value from departments with salary above the AVG(salary) of accounts rows sharing the same type. SQL:
SELECT value FROM departments AS dept WHERE salary > ( SELECT AVG(salary) FROM accounts AS acct WHERE acct.type = dept.type );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03458
train
v2
Schema: requests (alias: ordr)(id, type, value, salary) projects(status, salary, code, date) Task: Retrieve value from requests that have at least one corresponding entry in projects sharing the same level. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.level = ordr.level );
{ "outer_table": "requests", "inner_table": "projects", "outer_alias": "ordr", "inner_alias": "prj", "proj_col": "value", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_03459
train
v1
Schema: products (alias: prod)(amount, status, level, date) invoices(id, salary, level, code) Task: Select value from products where type exists in invoices for the same type. SQL:
SELECT value FROM products AS prod WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.type = prod.type );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "value", "filter_col": "type", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03460
train
v1
Schema: staff (alias: empl)(date, code, type, status) regions(date, salary, value, name) Task: Find salary from staff where type appears in regions entries with matching status. SQL:
SELECT salary FROM staff AS empl WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.status = empl.status );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "type", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_03461
train
v2
Schema: sales (alias: sale)(name, level, amount, id) orders(level, date, name, code) Task: Find value from sales where a matching record exists in orders with the same type. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = sale.type );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "value", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03462
train
v3
Schema: transactions (alias: txn)(date, value, salary, code) regions(value, salary, date, code) Task: Find code from transactions where amount exceeds the count of salary from regions for the same type. SQL:
SELECT code FROM transactions AS txn WHERE amount > ( SELECT COUNT(salary) FROM regions AS rgn WHERE rgn.type = txn.type );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03463
train
v2
Schema: managers (alias: mgr)(level, amount, id, code) regions(type, value, id, amount) Task: Retrieve value from managers that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = mgr.level );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "value", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03464
train
v3
Schema: tasks (alias: tsk)(salary, status, level, name) orders(amount, type, value, salary) Task: Retrieve salary from tasks with salary above the MAX(value) of orders rows sharing the same code. SQL:
SELECT salary FROM tasks AS tsk WHERE salary > ( SELECT MAX(value) FROM orders AS ord WHERE ord.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "orders", "outer_alias": "tsk", "inner_alias": "ord", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03465
train
v1
Schema: branches (alias: brc)(amount, name, type, level) staff(level, status, value, date) Task: Find name from branches where type appears in staff entries with matching type. SQL:
SELECT name FROM branches AS brc WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.type = brc.type );
{ "outer_table": "branches", "inner_table": "staff", "outer_alias": "brc", "inner_alias": "empl", "proj_col": "name", "filter_col": "type", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_03466
train
v3
Schema: orders (alias: ord)(code, status, name, amount) employees(id, name, amount, level) Task: Find salary from orders where value exceeds the average amount from employees for the same status. SQL:
SELECT salary FROM orders AS ord WHERE value > ( SELECT AVG(amount) FROM employees AS emp WHERE emp.status = ord.status );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03467
train
v1
Schema: customers (alias: cust)(level, code, type, salary) categories(value, id, salary, amount) Task: Select name from customers where level exists in categories for the same type. SQL:
SELECT name FROM customers AS cust WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.type = cust.type );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03468
train
v3
Schema: items (alias: lne)(date, type, amount, status) managers(salary, date, value, type) Task: Find value from items where amount exceeds the maximum salary from managers for the same status. SQL:
SELECT value FROM items AS lne WHERE amount > ( SELECT MAX(salary) FROM managers AS mgr WHERE mgr.status = lne.status );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03469
train
v1
Schema: customers (alias: cust)(amount, salary, code, name) employees(level, status, salary, amount) Task: Retrieve name from customers whose type is found in employees rows where id matches the outer record. SQL:
SELECT name FROM customers AS cust WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.id = cust.id );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "name", "filter_col": "type", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03470
train
v2
Schema: categories (alias: catg)(type, salary, id, value) branches(name, value, date, salary) Task: Find name from categories where a matching record exists in branches with the same status. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.status = catg.status );
{ "outer_table": "categories", "inner_table": "branches", "outer_alias": "catg", "inner_alias": "brc", "proj_col": "name", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03471
train
v2
Schema: items (alias: lne)(status, date, id, type) branches(code, date, type, level) Task: Retrieve value from items that have at least one corresponding entry in branches sharing the same code. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.code = lne.code );
{ "outer_table": "items", "inner_table": "branches", "outer_alias": "lne", "inner_alias": "brc", "proj_col": "value", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03472
train
v3
Schema: sales (alias: sale)(salary, status, level, date) staff(name, code, status, salary) Task: Retrieve amount from sales with value above the COUNT(value) of staff rows sharing the same id. SQL:
SELECT amount FROM sales AS sale WHERE value > ( SELECT COUNT(value) FROM staff AS empl WHERE empl.id = sale.id );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03473
train
v2
Schema: requests (alias: ordr)(value, id, date, salary) items(amount, value, status, code) Task: Retrieve value from requests that have at least one corresponding entry in items sharing the same status. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = ordr.status );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "value", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_03474
train
v3
Schema: products (alias: prod)(id, status, code, type) transactions(value, salary, id, date) Task: Retrieve code from products with amount above the COUNT(amount) of transactions rows sharing the same type. SQL:
SELECT code FROM products AS prod WHERE amount > ( SELECT COUNT(amount) FROM transactions AS txn WHERE txn.type = prod.type );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03475
train
v1
Schema: orders (alias: ord)(amount, date, salary, status) categories(date, salary, id, level) Task: Find salary from orders where type appears in categories entries with matching type. SQL:
SELECT salary FROM orders AS ord WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.type = ord.type );
{ "outer_table": "orders", "inner_table": "categories", "outer_alias": "ord", "inner_alias": "catg", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03476
train
v3
Schema: products (alias: prod)(amount, name, code, status) managers(type, level, amount, salary) Task: Find amount from products where value exceeds the count of value from managers for the same id. SQL:
SELECT amount FROM products AS prod WHERE value > ( SELECT COUNT(value) FROM managers AS mgr WHERE mgr.id = prod.id );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03477
train
v3
Schema: staff (alias: empl)(amount, code, name, id) tasks(name, type, code, value) Task: Find salary from staff where salary exceeds the maximum salary from tasks for the same level. SQL:
SELECT salary FROM staff AS empl WHERE salary > ( SELECT MAX(salary) FROM tasks AS tsk WHERE tsk.level = empl.level );
{ "outer_table": "staff", "inner_table": "tasks", "outer_alias": "empl", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_03478
train
v1
Schema: products (alias: prod)(type, value, amount, salary) schedules(value, salary, type, id) Task: Select code from products where status exists in schedules for the same id. SQL:
SELECT code FROM products AS prod WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.id = prod.id );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03479
train
v1
Schema: transactions (alias: txn)(salary, level, code, status) accounts(value, id, date, status) Task: Find amount from transactions where code appears in accounts entries with matching code. SQL:
SELECT amount FROM transactions AS txn WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.code = txn.code );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03480
train
v2
Schema: accounts (alias: acct)(value, type, id, name) tasks(amount, id, level, name) Task: Find id from accounts where a matching record exists in tasks with the same status. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = acct.status );
{ "outer_table": "accounts", "inner_table": "tasks", "outer_alias": "acct", "inner_alias": "tsk", "proj_col": "id", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03481
train
v3
Schema: accounts (alias: acct)(name, value, id, level) shipments(id, amount, status, salary) Task: Retrieve id from accounts with salary above the MAX(value) of shipments rows sharing the same level. SQL:
SELECT id FROM accounts AS acct WHERE salary > ( SELECT MAX(value) FROM shipments AS shp WHERE shp.level = acct.level );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03482
train
v2
Schema: staff (alias: empl)(value, name, code, status) shipments(level, status, code, type) Task: Find salary from staff where a matching record exists in shipments with the same type. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = empl.type );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "salary", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_03483
train
v2
Schema: categories (alias: catg)(type, value, date, level) invoices(date, salary, name, value) Task: Retrieve id from categories that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = catg.type );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "id", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03484
train
v1
Schema: schedules (alias: schd)(amount, id, type, date) shipments(code, status, amount, id) Task: Retrieve amount from schedules whose level is found in shipments rows where status matches the outer record. SQL:
SELECT amount FROM schedules AS schd WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.status = schd.status );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03485
train
v1
Schema: employees (alias: emp)(id, name, status, value) items(salary, id, amount, name) Task: Select amount from employees where type exists in items for the same level. SQL:
SELECT amount FROM employees AS emp WHERE type IN ( SELECT type FROM items AS lne WHERE lne.level = emp.level );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03486
train
v1
Schema: branches (alias: brc)(type, id, amount, date) projects(status, value, name, level) Task: Retrieve code from branches whose level is found in projects rows where type matches the outer record. SQL:
SELECT code FROM branches AS brc WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.type = brc.type );
{ "outer_table": "branches", "inner_table": "projects", "outer_alias": "brc", "inner_alias": "prj", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_03487
train
v3
Schema: projects (alias: prj)(status, level, type, amount) orders(amount, type, id, value) Task: Find value from projects where salary exceeds the count of value from orders for the same type. SQL:
SELECT value FROM projects AS prj WHERE salary > ( SELECT COUNT(value) FROM orders AS ord WHERE ord.type = prj.type );
{ "outer_table": "projects", "inner_table": "orders", "outer_alias": "prj", "inner_alias": "ord", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_03488
train
v1
Schema: shipments (alias: shp)(name, value, amount, level) tasks(level, value, code, name) Task: Select name from shipments where type exists in tasks for the same type. SQL:
SELECT name FROM shipments AS shp WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.type = shp.type );
{ "outer_table": "shipments", "inner_table": "tasks", "outer_alias": "shp", "inner_alias": "tsk", "proj_col": "name", "filter_col": "type", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_03489
train
v2
Schema: sales (alias: sale)(amount, salary, name, level) shipments(value, type, name, date) Task: Retrieve code from sales that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = sale.status );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "code", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03490
train
v1
Schema: orders (alias: ord)(salary, id, code, type) products(date, amount, status, value) Task: Retrieve name from orders whose level is found in products rows where type matches the outer record. SQL:
SELECT name FROM orders AS ord WHERE level IN ( SELECT level FROM products AS prod WHERE prod.type = ord.type );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03491
train
v2
Schema: items (alias: lne)(id, name, amount, status) categories(code, type, name, value) Task: Find id from items where a matching record exists in categories with the same id. SQL:
SELECT id 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": "id", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03492
train
v3
Schema: branches (alias: brc)(id, name, type, code) schedules(status, type, amount, code) Task: Find salary from branches where amount exceeds the count of amount from schedules for the same status. SQL:
SELECT salary FROM branches AS brc WHERE amount > ( SELECT COUNT(amount) FROM schedules AS schd WHERE schd.status = brc.status );
{ "outer_table": "branches", "inner_table": "schedules", "outer_alias": "brc", "inner_alias": "schd", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_03493
train
v2
Schema: requests (alias: ordr)(amount, code, value, date) regions(id, type, date, status) Task: Find name from requests where a matching record exists in regions with the same code. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = ordr.code );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "name", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_03494
train
v2
Schema: shipments (alias: shp)(status, id, value, salary) orders(level, value, id, salary) Task: Find salary from shipments where a matching record exists in orders with the same level. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = shp.level );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "salary", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_03495
train
v1
Schema: managers (alias: mgr)(code, id, date, value) projects(name, value, status, id) Task: Find code from managers where code appears in projects entries with matching type. SQL:
SELECT code FROM managers AS mgr WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.type = mgr.type );
{ "outer_table": "managers", "inner_table": "projects", "outer_alias": "mgr", "inner_alias": "prj", "proj_col": "code", "filter_col": "code", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03496
train
v2
Schema: products (alias: prod)(type, salary, name, id) employees(code, value, status, id) Task: Find value from products where a matching record exists in employees with the same status. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = prod.status );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "value", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03497
train
v2
Schema: customers (alias: cust)(value, status, code, date) products(status, type, name, amount) Task: Find amount from customers where a matching record exists in products with the same level. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = cust.level );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "amount", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03498
train
v2
Schema: orders (alias: ord)(salary, code, amount, value) invoices(amount, date, status, name) Task: Retrieve amount from orders that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = ord.type );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "amount", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03499
train