variant
stringclasses
3 values
prompt
stringlengths
160
237
sql
stringlengths
102
141
metadata
unknown
token_group
stringclasses
2 values
id
stringlengths
24
24
split
stringclasses
1 value
v3
Schema: requests (alias: ordr)(amount, date, salary, type) departments(value, status, type, amount) Task: Retrieve amount from requests with amount above the SUM(amount) of departments rows sharing the same type. SQL:
SELECT amount FROM requests AS ordr WHERE amount > ( SELECT SUM(amount) FROM departments AS dept WHERE dept.type = ordr.type );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_03600
train
v2
Schema: accounts (alias: acct)(salary, status, code, date) shipments(type, level, name, status) Task: Retrieve id from accounts that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = acct.id );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "id", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03601
train
v2
Schema: projects (alias: prj)(id, code, name, salary) regions(value, type, level, code) Task: Retrieve value from projects that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT value FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = prj.level );
{ "outer_table": "projects", "inner_table": "regions", "outer_alias": "prj", "inner_alias": "rgn", "proj_col": "value", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_03602
train
v1
Schema: regions (alias: rgn)(name, date, code, amount) staff(value, amount, salary, date) Task: Find salary from regions where id appears in staff entries with matching code. SQL:
SELECT salary FROM regions AS rgn WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.code = rgn.code );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_03603
train
v1
Schema: departments (alias: dept)(amount, level, code, type) projects(id, type, value, amount) Task: Select code from departments where status exists in projects for the same id. SQL:
SELECT code FROM departments AS dept WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.id = dept.id );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03604
train
v1
Schema: branches (alias: brc)(amount, salary, value, type) schedules(date, salary, value, name) Task: Find amount from branches where type appears in schedules entries with matching id. SQL:
SELECT amount FROM branches AS brc WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.id = brc.id );
{ "outer_table": "branches", "inner_table": "schedules", "outer_alias": "brc", "inner_alias": "schd", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_03605
train
v3
Schema: invoices (alias: inv)(level, name, value, code) sales(id, status, value, name) Task: Find value from invoices where value exceeds the minimum salary from sales for the same type. SQL:
SELECT value FROM invoices AS inv WHERE value > ( SELECT MIN(salary) FROM sales AS sale WHERE sale.type = inv.type );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03606
train
v1
Schema: staff (alias: empl)(level, date, id, code) customers(level, status, salary, code) Task: Select name from staff where code exists in customers for the same status. SQL:
SELECT name FROM staff AS empl WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.status = empl.status );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_03607
train
v3
Schema: accounts (alias: acct)(status, date, value, level) products(date, id, status, value) Task: Find code from accounts where amount exceeds the total value from products for the same status. SQL:
SELECT code FROM accounts AS acct WHERE amount > ( SELECT SUM(value) FROM products AS prod WHERE prod.status = acct.status );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03608
train
v3
Schema: invoices (alias: inv)(salary, name, id, value) categories(level, code, amount, salary) Task: Find name from invoices where value exceeds the total value from categories for the same status. SQL:
SELECT name FROM invoices AS inv WHERE value > ( SELECT SUM(value) FROM categories AS catg WHERE catg.status = inv.status );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03609
train
v1
Schema: sales (alias: sale)(date, status, value, amount) employees(name, level, id, salary) Task: Retrieve amount from sales whose type is found in employees rows where level matches the outer record. SQL:
SELECT amount FROM sales AS sale WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.level = sale.level );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03610
train
v1
Schema: invoices (alias: inv)(amount, salary, type, id) sales(code, value, status, date) Task: Retrieve id from invoices whose id is found in sales rows where code matches the outer record. SQL:
SELECT id FROM invoices AS inv WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.code = inv.code );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "id", "filter_col": "id", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03611
train
v2
Schema: invoices (alias: inv)(status, id, value, name) departments(level, type, status, amount) Task: Retrieve value from invoices that have at least one corresponding entry in departments sharing the same id. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = inv.id );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "value", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03612
train
v1
Schema: tasks (alias: tsk)(amount, name, value, date) staff(value, code, salary, date) Task: Retrieve salary from tasks whose level is found in staff rows where code matches the outer record. SQL:
SELECT salary FROM tasks AS tsk WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "staff", "outer_alias": "tsk", "inner_alias": "empl", "proj_col": "salary", "filter_col": "level", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03613
train
v1
Schema: managers (alias: mgr)(value, code, level, id) products(value, level, id, name) Task: Select name from managers where type exists in products for the same status. SQL:
SELECT name FROM managers AS mgr WHERE type IN ( SELECT type FROM products AS prod WHERE prod.status = mgr.status );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "name", "filter_col": "type", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03614
train
v3
Schema: managers (alias: mgr)(id, name, amount, date) items(id, date, type, level) Task: Retrieve value from managers with amount above the MIN(value) of items rows sharing the same status. SQL:
SELECT value FROM managers AS mgr WHERE amount > ( SELECT MIN(value) FROM items AS lne WHERE lne.status = mgr.status );
{ "outer_table": "managers", "inner_table": "items", "outer_alias": "mgr", "inner_alias": "lne", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03615
train
v2
Schema: customers (alias: cust)(date, code, name, level) orders(status, id, date, salary) Task: Retrieve id from customers that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = cust.code );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "id", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03616
train
v3
Schema: accounts (alias: acct)(code, salary, level, status) customers(value, date, code, status) Task: Retrieve value from accounts with value above the MIN(value) of customers rows sharing the same status. SQL:
SELECT value FROM accounts AS acct WHERE value > ( SELECT MIN(value) FROM customers AS cust WHERE cust.status = acct.status );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03617
train
v3
Schema: schedules (alias: schd)(salary, level, type, code) regions(type, level, date, code) Task: Retrieve id from schedules with value above the SUM(amount) of regions rows sharing the same status. SQL:
SELECT id FROM schedules AS schd WHERE value > ( SELECT SUM(amount) FROM regions AS rgn WHERE rgn.status = schd.status );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03618
train
v2
Schema: tasks (alias: tsk)(code, status, amount, value) staff(type, amount, salary, status) Task: Retrieve name from tasks that have at least one corresponding entry in staff sharing the same level. SQL:
SELECT name FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "staff", "outer_alias": "tsk", "inner_alias": "empl", "proj_col": "name", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03619
train
v2
Schema: requests (alias: ordr)(value, code, level, type) branches(amount, name, code, status) Task: Retrieve amount from requests that have at least one corresponding entry in branches sharing the same status. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.status = ordr.status );
{ "outer_table": "requests", "inner_table": "branches", "outer_alias": "ordr", "inner_alias": "brc", "proj_col": "amount", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_03620
train
v2
Schema: tasks (alias: tsk)(type, name, level, date) projects(code, level, type, date) Task: Find code from tasks where a matching record exists in projects with the same id. SQL:
SELECT code FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "projects", "outer_alias": "tsk", "inner_alias": "prj", "proj_col": "code", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03621
train
v3
Schema: items (alias: lne)(amount, code, level, name) invoices(level, date, amount, type) Task: Retrieve name from items with value above the SUM(value) of invoices rows sharing the same level. SQL:
SELECT name FROM items AS lne WHERE value > ( SELECT SUM(value) FROM invoices AS inv WHERE inv.level = lne.level );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03622
train
v1
Schema: items (alias: lne)(type, level, value, salary) staff(name, amount, id, level) Task: Retrieve name from items whose status is found in staff rows where level matches the outer record. SQL:
SELECT name FROM items AS lne WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.level = lne.level );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03623
train
v1
Schema: tasks (alias: tsk)(level, status, value, name) schedules(amount, id, type, code) Task: Find code from tasks where type appears in schedules entries with matching type. SQL:
SELECT code FROM tasks AS tsk WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "schedules", "outer_alias": "tsk", "inner_alias": "schd", "proj_col": "code", "filter_col": "type", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03624
train
v1
Schema: tasks (alias: tsk)(id, code, name, date) regions(amount, value, code, type) Task: Select code from tasks where code exists in regions for the same status. SQL:
SELECT code FROM tasks AS tsk WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "regions", "outer_alias": "tsk", "inner_alias": "rgn", "proj_col": "code", "filter_col": "code", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03625
train
v2
Schema: shipments (alias: shp)(amount, id, type, level) customers(type, status, value, code) Task: Find salary from shipments where a matching record exists in customers with the same level. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = shp.level );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "salary", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_03626
train
v3
Schema: tasks (alias: tsk)(id, salary, date, value) employees(amount, type, id, date) Task: Retrieve code from tasks with salary above the MAX(value) of employees rows sharing the same level. SQL:
SELECT code FROM tasks AS tsk WHERE salary > ( SELECT MAX(value) FROM employees AS emp WHERE emp.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "employees", "outer_alias": "tsk", "inner_alias": "emp", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03627
train
v2
Schema: products (alias: prod)(salary, amount, code, type) orders(level, date, code, amount) Task: Retrieve code from products that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = prod.code );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "code", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03628
train
v1
Schema: schedules (alias: schd)(level, id, salary, status) projects(name, type, level, amount) Task: Select id from schedules where type exists in projects for the same type. SQL:
SELECT id FROM schedules AS schd WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.type = schd.type );
{ "outer_table": "schedules", "inner_table": "projects", "outer_alias": "schd", "inner_alias": "prj", "proj_col": "id", "filter_col": "type", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03629
train
v2
Schema: employees (alias: emp)(date, type, value, level) orders(type, level, name, status) Task: Find value from employees where a matching record exists in orders with the same type. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = emp.type );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "value", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03630
train
v2
Schema: categories (alias: catg)(type, date, amount, salary) invoices(status, type, level, date) Task: Retrieve name from categories that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT name 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": "name", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03631
train
v2
Schema: staff (alias: empl)(id, status, code, type) branches(status, code, name, value) Task: Find value from staff where a matching record exists in branches with the same code. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.code = empl.code );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "value", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_03632
train
v2
Schema: projects (alias: prj)(date, salary, id, level) departments(name, code, date, status) Task: Find id from projects where a matching record exists in departments with the same type. SQL:
SELECT id FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = prj.type );
{ "outer_table": "projects", "inner_table": "departments", "outer_alias": "prj", "inner_alias": "dept", "proj_col": "id", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_03633
train
v3
Schema: shipments (alias: shp)(status, salary, amount, name) tasks(code, status, amount, date) Task: Retrieve value from shipments with value above the MAX(salary) of tasks rows sharing the same id. SQL:
SELECT value FROM shipments AS shp WHERE value > ( SELECT MAX(salary) FROM tasks AS tsk WHERE tsk.id = shp.id );
{ "outer_table": "shipments", "inner_table": "tasks", "outer_alias": "shp", "inner_alias": "tsk", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_03634
train
v2
Schema: requests (alias: ordr)(value, id, level, salary) branches(type, amount, salary, name) Task: Retrieve amount from requests that have at least one corresponding entry in branches sharing the same code. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.code = ordr.code );
{ "outer_table": "requests", "inner_table": "branches", "outer_alias": "ordr", "inner_alias": "brc", "proj_col": "amount", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_03635
train
v2
Schema: shipments (alias: shp)(level, salary, value, status) requests(level, id, salary, date) Task: Retrieve salary from shipments that have at least one corresponding entry in requests sharing the same level. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = shp.level );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "salary", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_03636
train
v1
Schema: customers (alias: cust)(amount, id, type, name) employees(level, type, code, date) Task: Find salary from customers where id appears in employees entries with matching code. SQL:
SELECT salary FROM customers AS cust WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.code = cust.code );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03637
train
v3
Schema: requests (alias: ordr)(value, type, name, id) branches(type, level, name, value) Task: Retrieve value from requests with value above the MAX(value) of branches rows sharing the same status. SQL:
SELECT value FROM requests AS ordr WHERE value > ( SELECT MAX(value) FROM branches AS brc WHERE brc.status = ordr.status );
{ "outer_table": "requests", "inner_table": "branches", "outer_alias": "ordr", "inner_alias": "brc", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_03638
train
v3
Schema: staff (alias: empl)(type, amount, date, value) shipments(code, value, level, date) Task: Find salary from staff where salary exceeds the count of salary from shipments for the same level. SQL:
SELECT salary FROM staff AS empl WHERE salary > ( SELECT COUNT(salary) FROM shipments AS shp WHERE shp.level = empl.level );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_03639
train
v1
Schema: departments (alias: dept)(level, amount, date, code) products(value, date, status, type) Task: Find id from departments where level appears in products entries with matching code. SQL:
SELECT id FROM departments AS dept WHERE level IN ( SELECT level FROM products AS prod WHERE prod.code = dept.code );
{ "outer_table": "departments", "inner_table": "products", "outer_alias": "dept", "inner_alias": "prod", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03640
train
v2
Schema: managers (alias: mgr)(amount, salary, level, id) regions(id, code, level, amount) Task: Find amount from managers where a matching record exists in regions with the same type. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = mgr.type );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "amount", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03641
train
v2
Schema: accounts (alias: acct)(id, amount, status, value) orders(status, value, id, amount) Task: Find name from accounts where a matching record exists in orders with the same code. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = acct.code );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "name", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03642
train
v2
Schema: branches (alias: brc)(value, date, amount, status) transactions(code, salary, date, status) Task: Find code from branches where a matching record exists in transactions with the same status. SQL:
SELECT code FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = brc.status );
{ "outer_table": "branches", "inner_table": "transactions", "outer_alias": "brc", "inner_alias": "txn", "proj_col": "code", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_03643
train
v3
Schema: projects (alias: prj)(name, id, level, date) accounts(name, code, date, type) Task: Retrieve amount from projects with amount above the MIN(value) of accounts rows sharing the same level. SQL:
SELECT amount FROM projects AS prj WHERE amount > ( SELECT MIN(value) FROM accounts AS acct WHERE acct.level = prj.level );
{ "outer_table": "projects", "inner_table": "accounts", "outer_alias": "prj", "inner_alias": "acct", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_03644
train
v3
Schema: items (alias: lne)(amount, date, level, type) sales(salary, type, id, amount) Task: Find name from items where salary exceeds the count of value from sales for the same level. SQL:
SELECT name FROM items AS lne WHERE salary > ( SELECT COUNT(value) FROM sales AS sale WHERE sale.level = lne.level );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03645
train
v2
Schema: employees (alias: emp)(type, name, level, salary) shipments(id, type, level, amount) Task: Find code from employees where a matching record exists in shipments with the same type. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = emp.type );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "code", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03646
train
v2
Schema: employees (alias: emp)(name, type, level, value) projects(value, code, salary, date) Task: Retrieve value from employees that have at least one corresponding entry in projects sharing the same type. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = emp.type );
{ "outer_table": "employees", "inner_table": "projects", "outer_alias": "emp", "inner_alias": "prj", "proj_col": "value", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03647
train
v2
Schema: accounts (alias: acct)(status, date, type, id) transactions(value, amount, type, id) Task: Retrieve name from accounts that have at least one corresponding entry in transactions sharing the same status. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = acct.status );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "name", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03648
train
v3
Schema: invoices (alias: inv)(date, value, name, status) tasks(level, name, type, value) Task: Find name from invoices where amount exceeds the maximum amount from tasks for the same id. SQL:
SELECT name FROM invoices AS inv WHERE amount > ( SELECT MAX(amount) FROM tasks AS tsk WHERE tsk.id = inv.id );
{ "outer_table": "invoices", "inner_table": "tasks", "outer_alias": "inv", "inner_alias": "tsk", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03649
train
v3
Schema: invoices (alias: inv)(code, type, id, amount) branches(name, type, value, amount) Task: Find salary from invoices where amount exceeds the maximum salary from branches for the same status. SQL:
SELECT salary FROM invoices AS inv WHERE amount > ( SELECT MAX(salary) FROM branches AS brc WHERE brc.status = inv.status );
{ "outer_table": "invoices", "inner_table": "branches", "outer_alias": "inv", "inner_alias": "brc", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03650
train
v3
Schema: accounts (alias: acct)(id, status, date, name) tasks(amount, date, value, name) Task: Find amount from accounts where value exceeds the minimum salary from tasks for the same id. SQL:
SELECT amount FROM accounts AS acct WHERE value > ( SELECT MIN(salary) FROM tasks AS tsk WHERE tsk.id = acct.id );
{ "outer_table": "accounts", "inner_table": "tasks", "outer_alias": "acct", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03651
train
v1
Schema: tasks (alias: tsk)(id, amount, level, type) products(level, value, date, status) Task: Retrieve value from tasks whose status is found in products rows where id matches the outer record. SQL:
SELECT value FROM tasks AS tsk WHERE status IN ( SELECT status FROM products AS prod WHERE prod.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "products", "outer_alias": "tsk", "inner_alias": "prod", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03652
train
v2
Schema: tasks (alias: tsk)(amount, level, date, name) projects(level, salary, status, value) Task: Find name from tasks where a matching record exists in projects with the same type. SQL:
SELECT name FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "projects", "outer_alias": "tsk", "inner_alias": "prj", "proj_col": "name", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03653
train
v2
Schema: projects (alias: prj)(name, amount, code, level) staff(salary, status, code, amount) Task: Find salary from projects where a matching record exists in staff with the same id. SQL:
SELECT salary FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = prj.id );
{ "outer_table": "projects", "inner_table": "staff", "outer_alias": "prj", "inner_alias": "empl", "proj_col": "salary", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_03654
train
v3
Schema: products (alias: prod)(amount, date, name, level) customers(type, value, status, amount) Task: Retrieve id from products with value above the SUM(amount) of customers rows sharing the same id. SQL:
SELECT id FROM products AS prod WHERE value > ( SELECT SUM(amount) FROM customers AS cust WHERE cust.id = prod.id );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03655
train
v1
Schema: items (alias: lne)(status, date, salary, level) orders(status, level, id, salary) Task: Select id from items where type exists in orders for the same code. SQL:
SELECT id FROM items AS lne WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.code = lne.code );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03656
train
v3
Schema: orders (alias: ord)(value, name, type, id) schedules(name, status, id, level) Task: Find name from orders where salary exceeds the maximum amount from schedules for the same type. SQL:
SELECT name FROM orders AS ord WHERE salary > ( SELECT MAX(amount) FROM schedules AS schd WHERE schd.type = ord.type );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03657
train
v3
Schema: projects (alias: prj)(id, code, salary, amount) categories(code, amount, type, name) Task: Find amount from projects where amount exceeds the average salary from categories for the same level. SQL:
SELECT amount FROM projects AS prj WHERE amount > ( SELECT AVG(salary) FROM categories AS catg WHERE catg.level = prj.level );
{ "outer_table": "projects", "inner_table": "categories", "outer_alias": "prj", "inner_alias": "catg", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_03658
train
v1
Schema: managers (alias: mgr)(value, salary, status, code) customers(salary, date, value, amount) Task: Find value from managers where status appears in customers entries with matching status. SQL:
SELECT value FROM managers AS mgr WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.status = mgr.status );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03659
train
v3
Schema: sales (alias: sale)(code, status, name, value) tasks(id, value, type, amount) Task: Retrieve value from sales with salary above the SUM(amount) of tasks rows sharing the same id. SQL:
SELECT value FROM sales AS sale WHERE salary > ( SELECT SUM(amount) FROM tasks AS tsk WHERE tsk.id = sale.id );
{ "outer_table": "sales", "inner_table": "tasks", "outer_alias": "sale", "inner_alias": "tsk", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03660
train
v2
Schema: managers (alias: mgr)(id, date, level, amount) staff(level, value, type, salary) Task: Find amount from managers where a matching record exists in staff with the same id. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = mgr.id );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "amount", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03661
train
v3
Schema: tasks (alias: tsk)(salary, type, level, status) employees(name, salary, date, status) Task: Retrieve code from tasks with salary above the SUM(amount) of employees rows sharing the same id. SQL:
SELECT code FROM tasks AS tsk WHERE salary > ( SELECT SUM(amount) FROM employees AS emp WHERE emp.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "employees", "outer_alias": "tsk", "inner_alias": "emp", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03662
train
v2
Schema: managers (alias: mgr)(status, value, code, level) schedules(date, value, name, amount) Task: Retrieve name from managers that have at least one corresponding entry in schedules sharing the same level. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = mgr.level );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "name", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03663
train
v1
Schema: tasks (alias: tsk)(id, type, code, value) schedules(level, status, date, value) Task: Select salary from tasks where status exists in schedules for the same id. SQL:
SELECT salary FROM tasks AS tsk WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "schedules", "outer_alias": "tsk", "inner_alias": "schd", "proj_col": "salary", "filter_col": "status", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03664
train
v1
Schema: employees (alias: emp)(code, id, value, salary) categories(code, level, name, salary) Task: Select value from employees where id exists in categories for the same id. SQL:
SELECT value FROM employees AS emp WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.id = emp.id );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03665
train
v3
Schema: shipments (alias: shp)(code, amount, status, id) projects(name, salary, level, date) Task: Find salary from shipments where value exceeds the total amount from projects for the same level. SQL:
SELECT salary FROM shipments AS shp WHERE value > ( SELECT SUM(amount) FROM projects AS prj WHERE prj.level = shp.level );
{ "outer_table": "shipments", "inner_table": "projects", "outer_alias": "shp", "inner_alias": "prj", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_03666
train
v1
Schema: requests (alias: ordr)(id, amount, code, status) staff(name, date, amount, id) Task: Retrieve name from requests whose status is found in staff rows where code matches the outer record. SQL:
SELECT name FROM requests AS ordr WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.code = ordr.code );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_03667
train
v1
Schema: transactions (alias: txn)(type, code, salary, status) categories(amount, name, type, id) Task: Retrieve id from transactions whose level is found in categories rows where level matches the outer record. SQL:
SELECT id FROM transactions AS txn WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.level = txn.level );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03668
train
v2
Schema: items (alias: lne)(status, level, name, amount) orders(date, id, salary, status) Task: Retrieve name from items that have at least one corresponding entry in orders sharing the same type. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = lne.type );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "name", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03669
train
v1
Schema: employees (alias: emp)(amount, value, date, code) requests(name, level, type, amount) Task: Retrieve value from employees whose status is found in requests rows where type matches the outer record. SQL:
SELECT value FROM employees AS emp WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.type = emp.type );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "value", "filter_col": "status", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03670
train
v2
Schema: departments (alias: dept)(code, status, level, amount) transactions(status, name, code, id) Task: Retrieve salary from departments that have at least one corresponding entry in transactions sharing the same id. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = dept.id );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "salary", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03671
train
v2
Schema: tasks (alias: tsk)(salary, level, amount, code) items(type, id, value, code) Task: Find code from tasks where a matching record exists in items with the same level. SQL:
SELECT code FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "items", "outer_alias": "tsk", "inner_alias": "lne", "proj_col": "code", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03672
train
v2
Schema: branches (alias: brc)(value, level, salary, amount) requests(code, level, value, amount) Task: Find value from branches where a matching record exists in requests with the same id. SQL:
SELECT value FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = brc.id );
{ "outer_table": "branches", "inner_table": "requests", "outer_alias": "brc", "inner_alias": "ordr", "proj_col": "value", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_03673
train
v3
Schema: requests (alias: ordr)(amount, type, salary, code) regions(amount, id, code, type) Task: Find id from requests where salary exceeds the maximum value from regions for the same type. SQL:
SELECT id FROM requests AS ordr WHERE salary > ( SELECT MAX(value) FROM regions AS rgn WHERE rgn.type = ordr.type );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_03674
train
v1
Schema: categories (alias: catg)(value, level, code, status) customers(level, id, date, amount) Task: Find amount from categories where id appears in customers entries with matching level. SQL:
SELECT amount FROM categories AS catg WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.level = catg.level );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03675
train
v2
Schema: products (alias: prod)(status, salary, name, date) categories(status, type, code, date) Task: Retrieve code from products that have at least one corresponding entry in categories sharing the same id. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = prod.id );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "code", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03676
train
v2
Schema: regions (alias: rgn)(amount, type, status, date) staff(amount, value, code, level) Task: Find id from regions where a matching record exists in staff with the same level. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = rgn.level );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "id", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_03677
train
v3
Schema: accounts (alias: acct)(value, type, amount, status) tasks(name, level, status, type) Task: Retrieve salary from accounts with salary above the MAX(amount) of tasks rows sharing the same status. SQL:
SELECT salary FROM accounts AS acct WHERE salary > ( SELECT MAX(amount) FROM tasks AS tsk WHERE tsk.status = acct.status );
{ "outer_table": "accounts", "inner_table": "tasks", "outer_alias": "acct", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03678
train
v2
Schema: orders (alias: ord)(salary, date, value, name) tasks(name, level, amount, salary) Task: Find id from orders where a matching record exists in tasks with the same status. SQL:
SELECT id FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = ord.status );
{ "outer_table": "orders", "inner_table": "tasks", "outer_alias": "ord", "inner_alias": "tsk", "proj_col": "id", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03679
train
v3
Schema: managers (alias: mgr)(amount, date, status, name) transactions(status, date, code, amount) Task: Find id from managers where salary exceeds the maximum salary from transactions for the same type. SQL:
SELECT id FROM managers AS mgr WHERE salary > ( SELECT MAX(salary) FROM transactions AS txn WHERE txn.type = mgr.type );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03680
train
v1
Schema: customers (alias: cust)(level, name, code, date) projects(name, level, amount, salary) Task: Select amount from customers where id exists in projects for the same level. SQL:
SELECT amount FROM customers AS cust WHERE id IN ( SELECT id FROM projects AS prj WHERE prj.level = cust.level );
{ "outer_table": "customers", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "prj", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03681
train
v3
Schema: sales (alias: sale)(salary, type, amount, level) accounts(type, salary, amount, level) Task: Retrieve name from sales with salary above the COUNT(amount) of accounts rows sharing the same id. SQL:
SELECT name FROM sales AS sale WHERE salary > ( SELECT COUNT(amount) FROM accounts AS acct WHERE acct.id = sale.id );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03682
train
v2
Schema: managers (alias: mgr)(amount, name, date, id) transactions(name, status, id, type) Task: Find name from managers where a matching record exists in transactions with the same type. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = mgr.type );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "name", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03683
train
v1
Schema: employees (alias: emp)(code, level, value, amount) customers(date, code, type, amount) Task: Select name from employees where code exists in customers for the same status. SQL:
SELECT name FROM employees AS emp WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.status = emp.status );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03684
train
v1
Schema: items (alias: lne)(code, name, id, status) managers(name, amount, date, value) Task: Select id from items where level exists in managers for the same code. SQL:
SELECT id FROM items AS lne WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.code = lne.code );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03685
train
v2
Schema: tasks (alias: tsk)(name, status, code, type) transactions(code, salary, value, name) Task: Find id from tasks where a matching record exists in transactions with the same level. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "transactions", "outer_alias": "tsk", "inner_alias": "txn", "proj_col": "id", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03686
train
v2
Schema: products (alias: prod)(date, amount, name, level) shipments(date, status, value, amount) Task: Find name from products where a matching record exists in shipments with the same id. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = prod.id );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "name", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03687
train
v1
Schema: sales (alias: sale)(amount, status, date, value) orders(salary, name, status, amount) Task: Find name from sales where level appears in orders entries with matching code. SQL:
SELECT name FROM sales AS sale WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.code = sale.code );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03688
train
v3
Schema: categories (alias: catg)(type, name, salary, status) projects(name, status, code, salary) Task: Retrieve code from categories with amount above the MAX(value) of projects rows sharing the same type. SQL:
SELECT code FROM categories AS catg WHERE amount > ( SELECT MAX(value) FROM projects AS prj WHERE prj.type = catg.type );
{ "outer_table": "categories", "inner_table": "projects", "outer_alias": "catg", "inner_alias": "prj", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03689
train
v1
Schema: sales (alias: sale)(id, date, value, type) requests(name, level, id, date) Task: Retrieve amount from sales whose level is found in requests rows where level matches the outer record. SQL:
SELECT amount FROM sales AS sale WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.level = sale.level );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "level", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03690
train
v1
Schema: schedules (alias: schd)(level, date, amount, name) branches(code, id, date, level) Task: Select salary from schedules where status exists in branches for the same level. SQL:
SELECT salary FROM schedules AS schd WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.level = schd.level );
{ "outer_table": "schedules", "inner_table": "branches", "outer_alias": "schd", "inner_alias": "brc", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03691
train
v2
Schema: products (alias: prod)(code, salary, id, status) tasks(code, id, value, date) Task: Find salary from products where a matching record exists in tasks with the same id. SQL:
SELECT salary 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": "salary", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03692
train
v2
Schema: accounts (alias: acct)(type, level, status, salary) customers(name, salary, type, id) Task: Retrieve id from accounts that have at least one corresponding entry in customers sharing the same level. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = acct.level );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "id", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03693
train
v1
Schema: schedules (alias: schd)(value, type, name, id) requests(salary, type, id, status) Task: Retrieve amount from schedules whose level is found in requests rows where code matches the outer record. SQL:
SELECT amount FROM schedules AS schd WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.code = schd.code );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03694
train
v1
Schema: employees (alias: emp)(date, code, amount, salary) categories(code, type, name, salary) Task: Retrieve value from employees whose type is found in categories rows where code matches the outer record. SQL:
SELECT value FROM employees AS emp WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.code = emp.code );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03695
train
v1
Schema: tasks (alias: tsk)(id, code, level, status) sales(status, type, value, amount) Task: Retrieve amount from tasks whose status is found in sales rows where id matches the outer record. SQL:
SELECT amount FROM tasks AS tsk WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "sales", "outer_alias": "tsk", "inner_alias": "sale", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03696
train
v2
Schema: orders (alias: ord)(status, date, code, name) items(type, id, value, date) Task: Retrieve value from orders that have at least one corresponding entry in items sharing the same type. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = ord.type );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "value", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03697
train
v3
Schema: invoices (alias: inv)(name, type, level, date) tasks(type, salary, name, value) Task: Find value from invoices where salary exceeds the total amount from tasks for the same id. SQL:
SELECT value FROM invoices AS inv WHERE salary > ( SELECT SUM(amount) FROM tasks AS tsk WHERE tsk.id = inv.id );
{ "outer_table": "invoices", "inner_table": "tasks", "outer_alias": "inv", "inner_alias": "tsk", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03698
train
v2
Schema: products (alias: prod)(level, salary, type, status) regions(code, level, salary, amount) Task: Retrieve amount from products that have at least one corresponding entry in regions sharing the same type. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = prod.type );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "amount", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03699
train