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: departments (alias: dept)(date, amount, id, value) orders(type, salary, id, level) Task: Retrieve name from departments that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = dept.code );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "name", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10500
train
v2
Schema: categories (alias: catg)(value, status, amount, code) schedules(type, value, level, code) Task: Retrieve salary from categories that have at least one corresponding entry in schedules sharing the same type. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = catg.type );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "salary", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10501
train
v1
Schema: staff (alias: empl)(amount, type, name, status) orders(value, name, code, level) Task: Retrieve id from staff whose code is found in orders rows where id matches the outer record. SQL:
SELECT id FROM staff AS empl WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.id = empl.id );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "id", "filter_col": "code", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_10502
train
v1
Schema: requests (alias: ordr)(code, type, value, level) projects(value, amount, salary, id) Task: Find amount from requests where code appears in projects entries with matching type. SQL:
SELECT amount FROM requests AS ordr WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.type = ordr.type );
{ "outer_table": "requests", "inner_table": "projects", "outer_alias": "ordr", "inner_alias": "prj", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_10503
train
v1
Schema: categories (alias: catg)(value, status, code, amount) managers(status, type, amount, code) Task: Select salary from categories where id exists in managers for the same level. SQL:
SELECT salary FROM categories AS catg WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.level = catg.level );
{ "outer_table": "categories", "inner_table": "managers", "outer_alias": "catg", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "id", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10504
train
v3
Schema: staff (alias: empl)(status, value, code, date) employees(name, type, code, date) Task: Find amount from staff where salary exceeds the average value from employees for the same id. SQL:
SELECT amount FROM staff AS empl WHERE salary > ( SELECT AVG(value) FROM employees AS emp WHERE emp.id = empl.id );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_10505
train
v2
Schema: schedules (alias: schd)(value, status, date, name) transactions(level, type, status, id) Task: Retrieve salary from schedules that have at least one corresponding entry in transactions sharing the same status. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = schd.status );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "salary", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10506
train
v2
Schema: employees (alias: emp)(status, amount, code, type) staff(amount, date, id, salary) Task: Find id from employees where a matching record exists in staff with the same code. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = emp.code );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "id", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10507
train
v3
Schema: departments (alias: dept)(value, type, status, salary) items(type, name, date, code) Task: Find name from departments where salary exceeds the total salary from items for the same code. SQL:
SELECT name FROM departments AS dept WHERE salary > ( SELECT SUM(salary) FROM items AS lne WHERE lne.code = dept.code );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10508
train
v2
Schema: categories (alias: catg)(date, id, value, code) sales(name, id, value, amount) Task: Retrieve code from categories that have at least one corresponding entry in sales sharing the same id. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = catg.id );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "code", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10509
train
v2
Schema: projects (alias: prj)(code, level, amount, status) items(level, value, type, amount) Task: Find id from projects where a matching record exists in items with the same status. SQL:
SELECT id FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = prj.status );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "lne", "proj_col": "id", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_10510
train
v2
Schema: products (alias: prod)(amount, salary, type, level) tasks(code, salary, value, status) Task: Retrieve code from products that have at least one corresponding entry in tasks sharing the same id. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.id = prod.id );
{ "outer_table": "products", "inner_table": "tasks", "outer_alias": "prod", "inner_alias": "tsk", "proj_col": "code", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10511
train
v3
Schema: departments (alias: dept)(type, value, id, amount) projects(level, name, amount, salary) Task: Find name from departments where value exceeds the minimum value from projects for the same level. SQL:
SELECT name FROM departments AS dept WHERE value > ( SELECT MIN(value) FROM projects AS prj WHERE prj.level = dept.level );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10512
train
v2
Schema: customers (alias: cust)(type, salary, code, date) projects(status, name, date, salary) Task: Retrieve code from customers that have at least one corresponding entry in projects sharing the same level. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.level = cust.level );
{ "outer_table": "customers", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "prj", "proj_col": "code", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10513
train
v3
Schema: categories (alias: catg)(date, name, id, level) requests(value, status, code, amount) Task: Find amount from categories where salary exceeds the average salary from requests for the same id. SQL:
SELECT amount FROM categories AS catg WHERE salary > ( SELECT AVG(salary) FROM requests AS ordr WHERE ordr.id = catg.id );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10514
train
v2
Schema: departments (alias: dept)(value, level, amount, status) shipments(status, code, date, name) Task: Retrieve code from departments that have at least one corresponding entry in shipments sharing the same code. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = dept.code );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "code", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10515
train
v3
Schema: schedules (alias: schd)(salary, name, date, amount) products(status, name, salary, type) Task: Retrieve code from schedules with salary above the COUNT(value) of products rows sharing the same type. SQL:
SELECT code FROM schedules AS schd WHERE salary > ( SELECT COUNT(value) FROM products AS prod WHERE prod.type = schd.type );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10516
train
v1
Schema: employees (alias: emp)(status, level, salary, amount) customers(date, code, name, value) Task: Select id from employees where level exists in customers for the same id. SQL:
SELECT id FROM employees AS emp WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.id = emp.id );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10517
train
v2
Schema: schedules (alias: schd)(amount, value, name, status) transactions(salary, amount, date, status) Task: Retrieve salary from schedules that have at least one corresponding entry in transactions sharing the same status. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = schd.status );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "salary", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10518
train
v3
Schema: regions (alias: rgn)(status, name, level, id) staff(type, code, value, salary) Task: Retrieve code from regions with value above the AVG(salary) of staff rows sharing the same status. SQL:
SELECT code FROM regions AS rgn WHERE value > ( SELECT AVG(salary) FROM staff AS empl WHERE empl.status = rgn.status );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_10519
train
v3
Schema: projects (alias: prj)(name, date, salary, value) tasks(level, code, salary, status) Task: Find code from projects where salary exceeds the count of salary from tasks for the same level. SQL:
SELECT code FROM projects AS prj WHERE salary > ( SELECT COUNT(salary) FROM tasks AS tsk WHERE tsk.level = prj.level );
{ "outer_table": "projects", "inner_table": "tasks", "outer_alias": "prj", "inner_alias": "tsk", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_10520
train
v3
Schema: projects (alias: prj)(level, code, value, status) schedules(value, amount, type, name) Task: Retrieve value from projects with salary above the MAX(value) of schedules rows sharing the same id. SQL:
SELECT value FROM projects AS prj WHERE salary > ( SELECT MAX(value) FROM schedules AS schd WHERE schd.id = prj.id );
{ "outer_table": "projects", "inner_table": "schedules", "outer_alias": "prj", "inner_alias": "schd", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_10521
train
v2
Schema: orders (alias: ord)(name, type, level, amount) transactions(date, salary, code, amount) Task: Retrieve value from orders that have at least one corresponding entry in transactions sharing the same level. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = ord.level );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "value", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10522
train
v1
Schema: shipments (alias: shp)(name, id, level, status) transactions(salary, status, name, type) Task: Select name from shipments where status exists in transactions for the same code. SQL:
SELECT name FROM shipments AS shp WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.code = shp.code );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_10523
train
v2
Schema: accounts (alias: acct)(value, name, id, level) categories(salary, id, level, name) Task: Find salary from accounts where a matching record exists in categories with the same level. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = acct.level );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "salary", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10524
train
v2
Schema: accounts (alias: acct)(date, code, salary, type) managers(salary, code, value, amount) Task: Retrieve salary from accounts that have at least one corresponding entry in managers sharing the same code. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = acct.code );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "salary", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10525
train
v3
Schema: projects (alias: prj)(type, name, id, value) departments(type, value, code, salary) Task: Retrieve salary from projects with amount above the AVG(value) of departments rows sharing the same status. SQL:
SELECT salary FROM projects AS prj WHERE amount > ( SELECT AVG(value) FROM departments AS dept WHERE dept.status = prj.status );
{ "outer_table": "projects", "inner_table": "departments", "outer_alias": "prj", "inner_alias": "dept", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_10526
train
v3
Schema: regions (alias: rgn)(date, amount, level, id) orders(level, value, name, date) Task: Find id from regions where value exceeds the total amount from orders for the same level. SQL:
SELECT id FROM regions AS rgn WHERE value > ( SELECT SUM(amount) FROM orders AS ord WHERE ord.level = rgn.level );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_10527
train
v3
Schema: requests (alias: ordr)(status, date, amount, name) employees(name, value, status, level) Task: Retrieve amount from requests with amount above the AVG(amount) of employees rows sharing the same id. SQL:
SELECT amount FROM requests AS ordr WHERE amount > ( SELECT AVG(amount) FROM employees AS emp WHERE emp.id = ordr.id );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_10528
train
v2
Schema: requests (alias: ordr)(amount, name, level, code) tasks(date, code, id, name) Task: Find code from requests where a matching record exists in tasks with the same id. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.id = ordr.id );
{ "outer_table": "requests", "inner_table": "tasks", "outer_alias": "ordr", "inner_alias": "tsk", "proj_col": "code", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_10529
train
v1
Schema: regions (alias: rgn)(name, status, date, type) customers(date, amount, code, name) Task: Find code from regions where level appears in customers entries with matching status. SQL:
SELECT code FROM regions AS rgn WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.status = rgn.status );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_10530
train
v2
Schema: shipments (alias: shp)(value, salary, status, name) schedules(code, value, name, level) Task: Find name from shipments where a matching record exists in schedules with the same status. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = shp.status );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "name", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_10531
train
v2
Schema: invoices (alias: inv)(amount, salary, status, value) transactions(status, level, code, value) Task: Retrieve salary from invoices that have at least one corresponding entry in transactions sharing the same type. SQL:
SELECT salary FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = inv.type );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "salary", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10532
train
v3
Schema: shipments (alias: shp)(name, type, salary, amount) orders(name, salary, code, id) Task: Retrieve value from shipments with value above the MAX(amount) of orders rows sharing the same code. SQL:
SELECT value FROM shipments AS shp WHERE value > ( SELECT MAX(amount) FROM orders AS ord WHERE ord.code = shp.code );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_10533
train
v3
Schema: categories (alias: catg)(code, status, id, amount) employees(level, name, status, code) Task: Retrieve salary from categories with amount above the AVG(value) of employees rows sharing the same status. SQL:
SELECT salary FROM categories AS catg WHERE amount > ( SELECT AVG(value) FROM employees AS emp WHERE emp.status = catg.status );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10534
train
v1
Schema: categories (alias: catg)(level, value, name, code) tasks(level, name, value, id) Task: Select salary from categories where status exists in tasks for the same status. SQL:
SELECT salary FROM categories AS catg WHERE status IN ( SELECT status FROM tasks AS tsk WHERE tsk.status = catg.status );
{ "outer_table": "categories", "inner_table": "tasks", "outer_alias": "catg", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10535
train
v3
Schema: staff (alias: empl)(amount, value, id, code) transactions(id, type, code, salary) Task: Find name from staff where salary exceeds the total salary from transactions for the same code. SQL:
SELECT name FROM staff AS empl WHERE salary > ( 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": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_10536
train
v2
Schema: products (alias: prod)(code, amount, type, level) items(type, value, id, level) Task: Find amount from products where a matching record exists in items with the same status. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = prod.status );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "amount", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10537
train
v1
Schema: regions (alias: rgn)(id, salary, level, name) sales(salary, amount, type, date) Task: Select amount from regions where type exists in sales for the same id. SQL:
SELECT amount FROM regions AS rgn WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.id = rgn.id );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_10538
train
v1
Schema: categories (alias: catg)(status, type, name, salary) projects(code, id, date, level) Task: Find salary from categories where code appears in projects entries with matching id. SQL:
SELECT salary FROM categories AS catg WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.id = catg.id );
{ "outer_table": "categories", "inner_table": "projects", "outer_alias": "catg", "inner_alias": "prj", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10539
train
v1
Schema: managers (alias: mgr)(code, level, id, value) products(amount, code, level, status) Task: Retrieve name from managers whose level is found in products rows where level matches the outer record. SQL:
SELECT name FROM managers AS mgr WHERE level IN ( SELECT level FROM products AS prod WHERE prod.level = mgr.level );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10540
train
v2
Schema: employees (alias: emp)(date, value, type, name) orders(code, status, name, salary) Task: Retrieve amount from employees that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = emp.code );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "amount", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10541
train
v1
Schema: regions (alias: rgn)(value, name, date, status) requests(status, date, salary, amount) Task: Select id from regions where status exists in requests for the same level. SQL:
SELECT id FROM regions AS rgn WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.level = rgn.level );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "id", "filter_col": "status", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_10542
train
v3
Schema: projects (alias: prj)(salary, level, value, amount) branches(status, name, value, amount) Task: Find name from projects where salary exceeds the maximum salary from branches for the same id. SQL:
SELECT name FROM projects AS prj WHERE salary > ( SELECT MAX(salary) FROM branches AS brc WHERE brc.id = prj.id );
{ "outer_table": "projects", "inner_table": "branches", "outer_alias": "prj", "inner_alias": "brc", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_10543
train
v3
Schema: employees (alias: emp)(type, status, amount, code) regions(level, date, code, name) Task: Find value from employees where value exceeds the average amount from regions for the same type. SQL:
SELECT value FROM employees AS emp WHERE value > ( SELECT AVG(amount) FROM regions AS rgn WHERE rgn.type = emp.type );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10544
train
v2
Schema: shipments (alias: shp)(status, salary, type, level) employees(value, type, status, amount) Task: Retrieve value from shipments that have at least one corresponding entry in employees sharing the same type. SQL:
SELECT value FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = shp.type );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "value", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_10545
train
v3
Schema: schedules (alias: schd)(name, value, type, salary) projects(level, id, name, salary) Task: Retrieve name from schedules with amount above the COUNT(amount) of projects rows sharing the same level. SQL:
SELECT name FROM schedules AS schd WHERE amount > ( SELECT COUNT(amount) FROM projects AS prj WHERE prj.level = schd.level );
{ "outer_table": "schedules", "inner_table": "projects", "outer_alias": "schd", "inner_alias": "prj", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10546
train
v2
Schema: staff (alias: empl)(type, name, level, status) items(amount, name, salary, date) Task: Find salary from staff where a matching record exists in items with the same level. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.level = empl.level );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "salary", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_10547
train
v2
Schema: categories (alias: catg)(amount, salary, status, date) staff(level, name, id, amount) Task: Find name from categories where a matching record exists in staff with the same status. SQL:
SELECT name 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": "name", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10548
train
v3
Schema: managers (alias: mgr)(salary, amount, level, status) orders(level, value, id, name) Task: Retrieve value from managers with value above the AVG(value) of orders rows sharing the same level. SQL:
SELECT value FROM managers AS mgr WHERE value > ( SELECT AVG(value) FROM orders AS ord WHERE ord.level = mgr.level );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10549
train
v3
Schema: shipments (alias: shp)(salary, id, type, date) customers(status, amount, id, code) Task: Retrieve name from shipments with salary above the AVG(value) of customers rows sharing the same status. SQL:
SELECT name FROM shipments AS shp WHERE salary > ( SELECT AVG(value) FROM customers AS cust WHERE cust.status = shp.status );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_10550
train
v2
Schema: accounts (alias: acct)(status, date, name, amount) projects(code, salary, level, date) Task: Find id from accounts where a matching record exists in projects with the same code. SQL:
SELECT id 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": "id", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10551
train
v2
Schema: items (alias: lne)(type, id, salary, code) accounts(id, level, code, value) Task: Find name from items where a matching record exists in accounts with the same id. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = lne.id );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "name", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_10552
train
v2
Schema: items (alias: lne)(type, value, level, salary) managers(id, salary, level, amount) Task: Find value from items where a matching record exists in managers with the same status. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = lne.status );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "value", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_10553
train
v3
Schema: categories (alias: catg)(salary, level, type, name) regions(amount, salary, date, id) Task: Retrieve salary from categories with salary above the MAX(salary) of regions rows sharing the same type. SQL:
SELECT salary FROM categories AS catg WHERE salary > ( SELECT MAX(salary) FROM regions AS rgn WHERE rgn.type = catg.type );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10554
train
v2
Schema: projects (alias: prj)(date, id, code, name) categories(salary, amount, date, code) Task: Retrieve salary from projects that have at least one corresponding entry in categories sharing the same status. SQL:
SELECT salary FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = prj.status );
{ "outer_table": "projects", "inner_table": "categories", "outer_alias": "prj", "inner_alias": "catg", "proj_col": "salary", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_10555
train
v2
Schema: transactions (alias: txn)(status, amount, id, value) invoices(amount, id, name, code) Task: Retrieve salary from transactions that have at least one corresponding entry in invoices sharing the same code. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = txn.code );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "salary", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10556
train
v3
Schema: orders (alias: ord)(amount, type, salary, name) sales(amount, level, type, status) Task: Find value from orders where amount exceeds the total salary from sales for the same id. SQL:
SELECT value FROM orders AS ord WHERE amount > ( SELECT SUM(salary) FROM sales AS sale WHERE sale.id = ord.id );
{ "outer_table": "orders", "inner_table": "sales", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10557
train
v3
Schema: accounts (alias: acct)(code, id, value, status) requests(amount, salary, name, type) Task: Find id from accounts where amount exceeds the maximum amount from requests for the same type. SQL:
SELECT id FROM accounts AS acct WHERE amount > ( SELECT MAX(amount) FROM requests AS ordr WHERE ordr.type = acct.type );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10558
train
v1
Schema: accounts (alias: acct)(amount, type, salary, level) managers(value, date, name, code) Task: Select name from accounts where id exists in managers for the same id. SQL:
SELECT name FROM accounts AS acct WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.id = acct.id );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "name", "filter_col": "id", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10559
train
v3
Schema: projects (alias: prj)(code, level, value, status) tasks(name, status, amount, salary) Task: Retrieve id from projects with salary above the MAX(salary) of tasks rows sharing the same status. SQL:
SELECT id FROM projects AS prj WHERE salary > ( SELECT MAX(salary) FROM tasks AS tsk WHERE tsk.status = prj.status );
{ "outer_table": "projects", "inner_table": "tasks", "outer_alias": "prj", "inner_alias": "tsk", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_10560
train
v2
Schema: branches (alias: brc)(date, name, code, type) projects(type, date, code, status) Task: Find salary from branches where a matching record exists in projects with the same id. SQL:
SELECT salary FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.id = brc.id );
{ "outer_table": "branches", "inner_table": "projects", "outer_alias": "brc", "inner_alias": "prj", "proj_col": "salary", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_10561
train
v1
Schema: accounts (alias: acct)(salary, code, status, level) transactions(level, type, id, salary) Task: Retrieve value from accounts whose level is found in transactions rows where type matches the outer record. SQL:
SELECT value FROM accounts AS acct WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.type = acct.type );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10562
train
v1
Schema: customers (alias: cust)(date, id, amount, salary) transactions(level, code, name, date) Task: Select id from customers where type exists in transactions for the same id. SQL:
SELECT id FROM customers AS cust WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.id = cust.id );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10563
train
v2
Schema: staff (alias: empl)(name, salary, id, level) tasks(status, date, value, amount) Task: Retrieve salary from staff that have at least one corresponding entry in tasks sharing the same status. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = empl.status );
{ "outer_table": "staff", "inner_table": "tasks", "outer_alias": "empl", "inner_alias": "tsk", "proj_col": "salary", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_10564
train
v3
Schema: tasks (alias: tsk)(date, id, value, salary) shipments(name, level, value, date) Task: Find name from tasks where salary exceeds the average salary from shipments for the same type. SQL:
SELECT name FROM tasks AS tsk WHERE salary > ( SELECT AVG(salary) FROM shipments AS shp WHERE shp.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "shipments", "outer_alias": "tsk", "inner_alias": "shp", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_10565
train
v2
Schema: orders (alias: ord)(code, salary, name, date) schedules(id, value, salary, level) Task: Retrieve salary from orders that have at least one corresponding entry in schedules sharing the same id. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = ord.id );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "salary", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10566
train
v1
Schema: tasks (alias: tsk)(level, value, date, code) projects(salary, id, value, date) Task: Retrieve salary from tasks whose level is found in projects rows where code matches the outer record. SQL:
SELECT salary FROM tasks AS tsk WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "projects", "outer_alias": "tsk", "inner_alias": "prj", "proj_col": "salary", "filter_col": "level", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_10567
train
v3
Schema: sales (alias: sale)(status, value, level, salary) departments(status, name, salary, level) Task: Retrieve value from sales with amount above the COUNT(salary) of departments rows sharing the same code. SQL:
SELECT value FROM sales AS sale WHERE amount > ( SELECT COUNT(salary) FROM departments AS dept WHERE dept.code = sale.code );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10568
train
v3
Schema: orders (alias: ord)(status, name, value, date) departments(name, salary, date, type) Task: Retrieve salary from orders with value above the SUM(salary) of departments rows sharing the same status. SQL:
SELECT salary FROM orders AS ord WHERE value > ( SELECT SUM(salary) FROM departments AS dept WHERE dept.status = ord.status );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10569
train
v2
Schema: accounts (alias: acct)(status, salary, type, code) regions(id, amount, status, type) Task: Retrieve salary from accounts that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = acct.level );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "salary", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10570
train
v1
Schema: departments (alias: dept)(id, date, amount, level) accounts(date, status, type, id) Task: Select code from departments where type exists in accounts for the same code. SQL:
SELECT code FROM departments AS dept WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.code = dept.code );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10571
train
v3
Schema: managers (alias: mgr)(code, value, status, salary) staff(amount, value, level, date) Task: Retrieve code from managers with salary above the AVG(salary) of staff rows sharing the same id. SQL:
SELECT code FROM managers AS mgr WHERE salary > ( SELECT AVG(salary) FROM staff AS empl WHERE empl.id = mgr.id );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10572
train
v1
Schema: transactions (alias: txn)(level, amount, salary, type) products(type, salary, id, level) Task: Retrieve code from transactions whose status is found in products rows where id matches the outer record. SQL:
SELECT code FROM transactions AS txn WHERE status IN ( SELECT status FROM products AS prod WHERE prod.id = txn.id );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10573
train
v3
Schema: customers (alias: cust)(type, level, salary, status) shipments(salary, status, code, value) Task: Retrieve id from customers with value above the AVG(value) of shipments rows sharing the same id. SQL:
SELECT id FROM customers AS cust WHERE value > ( SELECT AVG(value) FROM shipments AS shp WHERE shp.id = cust.id );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10574
train
v3
Schema: regions (alias: rgn)(id, value, type, name) staff(value, code, status, name) Task: Retrieve salary from regions with salary above the MAX(value) of staff rows sharing the same status. SQL:
SELECT salary FROM regions AS rgn WHERE salary > ( SELECT MAX(value) FROM staff AS empl WHERE empl.status = rgn.status );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_10575
train
v1
Schema: projects (alias: prj)(date, code, salary, name) sales(name, date, status, value) Task: Select id from projects where id exists in sales for the same id. SQL:
SELECT id FROM projects AS prj WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.id = prj.id );
{ "outer_table": "projects", "inner_table": "sales", "outer_alias": "prj", "inner_alias": "sale", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_10576
train
v3
Schema: products (alias: prod)(type, id, amount, name) projects(name, salary, date, status) Task: Find name from products where amount exceeds the count of amount from projects for the same code. SQL:
SELECT name FROM products AS prod WHERE amount > ( SELECT COUNT(amount) FROM projects AS prj WHERE prj.code = prod.code );
{ "outer_table": "products", "inner_table": "projects", "outer_alias": "prod", "inner_alias": "prj", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10577
train
v2
Schema: managers (alias: mgr)(date, status, name, type) departments(date, value, code, name) Task: Retrieve amount from managers that have at least one corresponding entry in departments sharing the same type. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = mgr.type );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "amount", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10578
train
v1
Schema: customers (alias: cust)(date, type, name, code) orders(status, level, code, type) Task: Find id from customers where id appears in orders entries with matching level. SQL:
SELECT id FROM customers AS cust WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.level = cust.level );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10579
train
v1
Schema: invoices (alias: inv)(id, value, amount, name) departments(salary, type, value, date) Task: Select code from invoices where level exists in departments for the same level. SQL:
SELECT code FROM invoices AS inv WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.level = inv.level );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "code", "filter_col": "level", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10580
train
v3
Schema: transactions (alias: txn)(value, name, amount, type) projects(code, id, type, salary) Task: Retrieve name from transactions with salary above the MAX(value) of projects rows sharing the same level. SQL:
SELECT name FROM transactions AS txn WHERE salary > ( SELECT MAX(value) FROM projects AS prj WHERE prj.level = txn.level );
{ "outer_table": "transactions", "inner_table": "projects", "outer_alias": "txn", "inner_alias": "prj", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10581
train
v3
Schema: invoices (alias: inv)(salary, code, type, level) items(type, status, value, salary) Task: Find salary from invoices where salary exceeds the maximum salary from items for the same id. SQL:
SELECT salary FROM invoices AS inv WHERE salary > ( SELECT MAX(salary) FROM items AS lne WHERE lne.id = inv.id );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10582
train
v1
Schema: schedules (alias: schd)(id, name, type, code) staff(amount, level, salary, date) Task: Find salary from schedules where level appears in staff entries with matching status. SQL:
SELECT salary FROM schedules AS schd WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.status = schd.status );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "salary", "filter_col": "level", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10583
train
v3
Schema: shipments (alias: shp)(id, status, date, level) schedules(code, value, salary, status) Task: Retrieve id from shipments with value above the COUNT(value) of schedules rows sharing the same id. SQL:
SELECT id FROM shipments AS shp WHERE value > ( SELECT COUNT(value) FROM schedules AS schd WHERE schd.id = shp.id );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_10584
train
v1
Schema: requests (alias: ordr)(name, id, salary, code) schedules(amount, salary, value, date) Task: Find value from requests where level appears in schedules entries with matching status. SQL:
SELECT value FROM requests AS ordr WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.status = ordr.status );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "value", "filter_col": "level", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_10585
train
v2
Schema: transactions (alias: txn)(code, salary, type, status) regions(salary, name, id, date) Task: Retrieve id from transactions that have at least one corresponding entry in regions sharing the same type. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = txn.type );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "id", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10586
train
v1
Schema: transactions (alias: txn)(level, value, date, name) customers(level, date, name, id) Task: Retrieve amount from transactions whose id is found in customers rows where code matches the outer record. SQL:
SELECT amount FROM transactions AS txn WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.code = txn.code );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10587
train
v2
Schema: invoices (alias: inv)(level, amount, salary, date) requests(value, status, amount, id) Task: Retrieve id from invoices that have at least one corresponding entry in requests sharing the same type. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = inv.type );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "id", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10588
train
v3
Schema: accounts (alias: acct)(id, name, salary, value) projects(date, salary, level, value) Task: Find id from accounts where amount exceeds the total salary from projects for the same status. SQL:
SELECT id FROM accounts AS acct WHERE amount > ( SELECT SUM(salary) FROM projects AS prj WHERE prj.status = acct.status );
{ "outer_table": "accounts", "inner_table": "projects", "outer_alias": "acct", "inner_alias": "prj", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10589
train
v2
Schema: departments (alias: dept)(salary, value, amount, id) shipments(name, id, date, status) Task: Find amount from departments where a matching record exists in shipments with the same type. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = dept.type );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "amount", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10590
train
v3
Schema: customers (alias: cust)(name, salary, date, amount) employees(type, id, salary, code) Task: Find salary from customers where salary exceeds the maximum salary from employees for the same level. SQL:
SELECT salary FROM customers AS cust WHERE salary > ( SELECT MAX(salary) FROM employees AS emp WHERE emp.level = cust.level );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10591
train
v2
Schema: schedules (alias: schd)(status, name, value, amount) regions(type, amount, status, id) Task: Find salary from schedules where a matching record exists in regions with the same code. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = schd.code );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "salary", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10592
train
v1
Schema: staff (alias: empl)(amount, code, date, type) requests(code, name, type, salary) Task: Retrieve amount from staff whose code is found in requests rows where id matches the outer record. SQL:
SELECT amount FROM staff AS empl WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.id = empl.id );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "code", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_10593
train
v1
Schema: staff (alias: empl)(code, salary, status, level) invoices(name, amount, date, id) Task: Select name from staff where type exists in invoices for the same type. SQL:
SELECT name FROM staff AS empl WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.type = empl.type );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "name", "filter_col": "type", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_10594
train
v1
Schema: managers (alias: mgr)(amount, status, level, id) shipments(salary, code, date, amount) Task: Retrieve salary from managers whose level is found in shipments rows where id matches the outer record. SQL:
SELECT salary FROM managers AS mgr WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.id = mgr.id );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "salary", "filter_col": "level", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10595
train
v1
Schema: customers (alias: cust)(id, code, salary, type) employees(level, salary, status, date) Task: Find name from customers where type appears in employees entries with matching id. 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_10596
train
v1
Schema: accounts (alias: acct)(name, code, type, value) sales(code, date, amount, name) Task: Find id from accounts where type appears in sales entries with matching status. SQL:
SELECT id FROM accounts AS acct WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.status = acct.status );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "id", "filter_col": "type", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10597
train
v1
Schema: requests (alias: ordr)(amount, salary, value, level) managers(level, type, date, salary) Task: Select salary from requests where level exists in managers for the same level. SQL:
SELECT salary FROM requests AS ordr WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.level = ordr.level );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "level", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_10598
train
v1
Schema: managers (alias: mgr)(salary, level, id, date) employees(name, id, value, code) Task: Select salary from managers where id exists in employees for the same type. SQL:
SELECT salary FROM managers AS mgr WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.type = mgr.type );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "salary", "filter_col": "id", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10599
train