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: customers (alias: cust)(date, name, level, amount) accounts(code, name, date, status) Task: Find code from customers where a matching record exists in accounts with the same type. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = cust.type );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "code", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11800
train
v1
Schema: regions (alias: rgn)(date, code, value, salary) requests(name, code, salary, amount) Task: Find id from regions where code appears in requests entries with matching id. SQL:
SELECT id FROM regions AS rgn WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.id = rgn.id );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "id", "filter_col": "code", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_11801
train
v2
Schema: products (alias: prod)(level, type, value, code) managers(level, code, id, name) Task: Retrieve id from products that have at least one corresponding entry in managers sharing the same id. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = prod.id );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "id", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11802
train
v1
Schema: items (alias: lne)(level, name, code, date) products(amount, status, id, date) Task: Find id from items where status appears in products entries with matching id. SQL:
SELECT id FROM items AS lne WHERE status IN ( SELECT status FROM products AS prod WHERE prod.id = lne.id );
{ "outer_table": "items", "inner_table": "products", "outer_alias": "lne", "inner_alias": "prod", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_11803
train
v3
Schema: customers (alias: cust)(level, value, salary, id) managers(amount, salary, status, code) Task: Find amount from customers where value exceeds the maximum amount from managers for the same type. SQL:
SELECT amount FROM customers AS cust WHERE value > ( SELECT MAX(amount) FROM managers AS mgr WHERE mgr.type = cust.type );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11804
train
v1
Schema: tasks (alias: tsk)(amount, id, salary, level) items(status, id, code, amount) Task: Find value from tasks where type appears in items entries with matching status. SQL:
SELECT value FROM tasks AS tsk WHERE type IN ( SELECT type FROM items AS lne WHERE lne.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "items", "outer_alias": "tsk", "inner_alias": "lne", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_11805
train
v3
Schema: branches (alias: brc)(name, code, salary, level) items(date, type, status, id) Task: Retrieve amount from branches with amount above the COUNT(amount) of items rows sharing the same code. SQL:
SELECT amount FROM branches AS brc WHERE amount > ( SELECT COUNT(amount) FROM items AS lne WHERE lne.code = brc.code );
{ "outer_table": "branches", "inner_table": "items", "outer_alias": "brc", "inner_alias": "lne", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_11806
train
v2
Schema: departments (alias: dept)(status, code, date, level) shipments(level, date, value, type) Task: Retrieve amount from departments that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = dept.status );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "amount", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11807
train
v1
Schema: orders (alias: ord)(salary, status, name, value) branches(code, date, id, value) Task: Retrieve name from orders whose status is found in branches rows where code matches the outer record. SQL:
SELECT name FROM orders AS ord WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.code = ord.code );
{ "outer_table": "orders", "inner_table": "branches", "outer_alias": "ord", "inner_alias": "brc", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11808
train
v2
Schema: regions (alias: rgn)(status, type, date, amount) orders(amount, name, type, salary) Task: Retrieve salary from regions that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = rgn.level );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "salary", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_11809
train
v3
Schema: orders (alias: ord)(value, id, status, salary) requests(type, salary, id, date) Task: Find value from orders where value exceeds the minimum value from requests for the same id. SQL:
SELECT value FROM orders AS ord WHERE value > ( SELECT MIN(value) FROM requests AS ordr WHERE ordr.id = ord.id );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11810
train
v3
Schema: invoices (alias: inv)(amount, level, id, name) orders(name, date, status, code) Task: Find amount from invoices where amount exceeds the maximum amount from orders for the same code. SQL:
SELECT amount FROM invoices AS inv WHERE amount > ( SELECT MAX(amount) FROM orders AS ord WHERE ord.code = inv.code );
{ "outer_table": "invoices", "inner_table": "orders", "outer_alias": "inv", "inner_alias": "ord", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11811
train
v2
Schema: staff (alias: empl)(value, level, name, id) managers(amount, status, level, date) Task: Retrieve salary from staff that have at least one corresponding entry in managers sharing the same status. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = empl.status );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "salary", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_11812
train
v2
Schema: sales (alias: sale)(value, type, level, name) branches(date, value, type, amount) Task: Retrieve amount from sales that have at least one corresponding entry in branches sharing the same status. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.status = sale.status );
{ "outer_table": "sales", "inner_table": "branches", "outer_alias": "sale", "inner_alias": "brc", "proj_col": "amount", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11813
train
v1
Schema: regions (alias: rgn)(name, level, status, type) accounts(level, value, type, status) Task: Select code from regions where code exists in accounts for the same level. SQL:
SELECT code FROM regions AS rgn WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.level = rgn.level );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "rgn", "inner_alias": "acct", "proj_col": "code", "filter_col": "code", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_11814
train
v2
Schema: shipments (alias: shp)(id, code, value, amount) regions(code, type, date, status) Task: Retrieve value from shipments that have at least one corresponding entry in regions sharing the same code. SQL:
SELECT value FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = shp.code );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "value", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_11815
train
v3
Schema: employees (alias: emp)(id, salary, type, value) invoices(amount, level, value, name) Task: Find salary from employees where amount exceeds the average value from invoices for the same id. SQL:
SELECT salary FROM employees AS emp WHERE amount > ( SELECT AVG(value) FROM invoices AS inv WHERE inv.id = emp.id );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11816
train
v3
Schema: projects (alias: prj)(type, date, id, amount) requests(level, amount, type, status) Task: Retrieve name from projects with value above the AVG(value) of requests rows sharing the same id. SQL:
SELECT name FROM projects AS prj WHERE value > ( SELECT AVG(value) FROM requests AS ordr WHERE ordr.id = prj.id );
{ "outer_table": "projects", "inner_table": "requests", "outer_alias": "prj", "inner_alias": "ordr", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_11817
train
v1
Schema: customers (alias: cust)(date, value, name, level) staff(level, amount, type, code) Task: Select id from customers where level exists in staff for the same code. SQL:
SELECT id FROM customers AS cust WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.code = cust.code );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11818
train
v1
Schema: invoices (alias: inv)(value, salary, date, id) projects(value, type, name, level) Task: Select amount from invoices where id exists in projects for the same status. SQL:
SELECT amount FROM invoices AS inv WHERE id IN ( SELECT id FROM projects AS prj WHERE prj.status = inv.status );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "inv", "inner_alias": "prj", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11819
train
v1
Schema: staff (alias: empl)(date, amount, type, status) requests(id, type, code, date) Task: Retrieve id from staff whose level is found in requests rows where code matches the outer record. SQL:
SELECT id FROM staff AS empl WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.code = empl.code );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_11820
train
v3
Schema: categories (alias: catg)(value, amount, id, level) departments(value, amount, name, id) Task: Retrieve code from categories with value above the COUNT(salary) of departments rows sharing the same level. SQL:
SELECT code FROM categories AS catg WHERE value > ( SELECT COUNT(salary) FROM departments AS dept WHERE dept.level = catg.level );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11821
train
v3
Schema: customers (alias: cust)(id, level, name, value) shipments(code, level, value, salary) Task: Find id from customers where value exceeds the total value from shipments for the same code. SQL:
SELECT id FROM customers AS cust WHERE value > ( SELECT SUM(value) FROM shipments AS shp WHERE shp.code = cust.code );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11822
train
v2
Schema: projects (alias: prj)(salary, status, name, date) accounts(name, amount, id, date) Task: Find amount from projects where a matching record exists in accounts with the same status. SQL:
SELECT amount FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = prj.status );
{ "outer_table": "projects", "inner_table": "accounts", "outer_alias": "prj", "inner_alias": "acct", "proj_col": "amount", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_11823
train
v3
Schema: regions (alias: rgn)(name, type, date, code) orders(type, value, salary, code) Task: Find salary from regions where value exceeds the count of value from orders for the same level. SQL:
SELECT salary FROM regions AS rgn WHERE value > ( SELECT COUNT(value) FROM orders AS ord WHERE ord.level = rgn.level );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_11824
train
v1
Schema: employees (alias: emp)(type, id, level, date) accounts(amount, code, salary, name) Task: Find id from employees where level appears in accounts entries with matching level. SQL:
SELECT id FROM employees AS emp WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.level = emp.level );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11825
train
v3
Schema: sales (alias: sale)(type, status, date, salary) shipments(type, status, code, id) Task: Find amount from sales where value exceeds the minimum amount from shipments for the same level. SQL:
SELECT amount FROM sales AS sale WHERE value > ( SELECT MIN(amount) FROM shipments AS shp WHERE shp.level = sale.level );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11826
train
v3
Schema: staff (alias: empl)(status, level, code, value) transactions(status, amount, level, value) Task: Retrieve id from staff with value above the AVG(salary) of transactions rows sharing the same type. SQL:
SELECT id FROM staff AS empl WHERE value > ( SELECT AVG(salary) FROM transactions AS txn WHERE txn.type = empl.type );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_11827
train
v3
Schema: staff (alias: empl)(level, id, name, code) tasks(date, code, level, id) Task: Retrieve amount from staff with salary above the MAX(amount) of tasks rows sharing the same type. SQL:
SELECT amount FROM staff AS empl WHERE salary > ( SELECT MAX(amount) FROM tasks AS tsk WHERE tsk.type = empl.type );
{ "outer_table": "staff", "inner_table": "tasks", "outer_alias": "empl", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_11828
train
v1
Schema: regions (alias: rgn)(level, type, salary, code) departments(date, value, level, salary) Task: Retrieve code from regions whose id is found in departments rows where level matches the outer record. SQL:
SELECT code FROM regions AS rgn WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.level = rgn.level );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "code", "filter_col": "id", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_11829
train
v2
Schema: departments (alias: dept)(status, id, amount, name) accounts(type, code, value, level) Task: Retrieve id from departments that have at least one corresponding entry in accounts sharing the same type. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = dept.type );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "id", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11830
train
v3
Schema: regions (alias: rgn)(code, id, type, salary) departments(name, amount, type, salary) Task: Find amount from regions where salary exceeds the maximum salary from departments for the same type. SQL:
SELECT amount FROM regions AS rgn WHERE salary > ( SELECT MAX(salary) FROM departments AS dept WHERE dept.type = rgn.type );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_11831
train
v2
Schema: branches (alias: brc)(type, status, id, code) shipments(id, date, value, code) Task: Retrieve value from branches that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT value FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = brc.status );
{ "outer_table": "branches", "inner_table": "shipments", "outer_alias": "brc", "inner_alias": "shp", "proj_col": "value", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_11832
train
v3
Schema: sales (alias: sale)(date, type, status, level) accounts(status, level, id, code) Task: Find amount from sales where amount exceeds the total salary from accounts for the same code. SQL:
SELECT amount FROM sales AS sale WHERE amount > ( SELECT SUM(salary) FROM accounts AS acct WHERE acct.code = sale.code );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11833
train
v3
Schema: categories (alias: catg)(salary, code, date, status) products(name, date, salary, code) Task: Find name from categories where amount exceeds the maximum salary from products for the same type. SQL:
SELECT name FROM categories AS catg WHERE amount > ( SELECT MAX(salary) FROM products AS prod WHERE prod.type = catg.type );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11834
train
v2
Schema: products (alias: prod)(amount, level, status, salary) schedules(salary, amount, level, code) Task: Find name from products where a matching record exists in schedules with the same type. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = prod.type );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "name", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11835
train
v2
Schema: branches (alias: brc)(code, date, type, name) categories(id, name, level, status) Task: Retrieve amount from branches that have at least one corresponding entry in categories sharing the same level. SQL:
SELECT amount FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = brc.level );
{ "outer_table": "branches", "inner_table": "categories", "outer_alias": "brc", "inner_alias": "catg", "proj_col": "amount", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_11836
train
v2
Schema: managers (alias: mgr)(type, name, value, code) transactions(id, amount, status, value) Task: Retrieve value from managers that have at least one corresponding entry in transactions sharing the same level. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = mgr.level );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "value", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11837
train
v2
Schema: managers (alias: mgr)(value, code, type, amount) products(status, value, level, date) Task: Find name from managers where a matching record exists in products with the same type. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = mgr.type );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "name", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11838
train
v2
Schema: departments (alias: dept)(amount, salary, level, name) invoices(amount, status, name, type) Task: Retrieve amount from departments that have at least one corresponding entry in invoices sharing the same level. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = dept.level );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "amount", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11839
train
v3
Schema: sales (alias: sale)(code, date, id, status) shipments(code, value, name, type) Task: Retrieve value from sales with salary above the MIN(value) of shipments rows sharing the same level. SQL:
SELECT value FROM sales AS sale WHERE salary > ( SELECT MIN(value) FROM shipments AS shp WHERE shp.level = sale.level );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11840
train
v2
Schema: tasks (alias: tsk)(status, value, id, name) branches(level, value, code, type) Task: Retrieve value from tasks that have at least one corresponding entry in branches sharing the same level. SQL:
SELECT value FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "branches", "outer_alias": "tsk", "inner_alias": "brc", "proj_col": "value", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_11841
train
v2
Schema: customers (alias: cust)(id, level, date, name) transactions(id, salary, code, type) Task: Retrieve code from customers that have at least one corresponding entry in transactions sharing the same status. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = cust.status );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "code", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11842
train
v3
Schema: orders (alias: ord)(salary, date, id, status) staff(date, salary, value, id) Task: Find id from orders where value exceeds the count of salary from staff for the same level. SQL:
SELECT id FROM orders AS ord WHERE value > ( SELECT COUNT(salary) FROM staff AS empl WHERE empl.level = ord.level );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11843
train
v1
Schema: shipments (alias: shp)(date, name, salary, level) sales(type, value, status, level) Task: Retrieve id from shipments whose id is found in sales rows where id matches the outer record. SQL:
SELECT id FROM shipments AS shp WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.id = shp.id );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_11844
train
v3
Schema: departments (alias: dept)(id, amount, date, name) orders(date, id, amount, name) Task: Retrieve amount from departments with amount above the SUM(salary) of orders rows sharing the same level. SQL:
SELECT amount FROM departments AS dept WHERE amount > ( SELECT SUM(salary) FROM orders AS ord WHERE ord.level = dept.level );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11845
train
v2
Schema: transactions (alias: txn)(status, id, salary, level) customers(status, level, salary, date) Task: Find salary from transactions where a matching record exists in customers with the same level. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = txn.level );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "salary", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11846
train
v3
Schema: shipments (alias: shp)(level, code, amount, name) requests(date, code, level, name) Task: Retrieve name from shipments with value above the SUM(salary) of requests rows sharing the same status. SQL:
SELECT name FROM shipments AS shp WHERE value > ( SELECT SUM(salary) FROM requests AS ordr WHERE ordr.status = shp.status );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_11847
train
v2
Schema: transactions (alias: txn)(value, status, level, id) invoices(level, value, name, status) Task: Retrieve amount from transactions that have at least one corresponding entry in invoices sharing the same status. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = txn.status );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "amount", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11848
train
v2
Schema: items (alias: lne)(level, id, value, type) tasks(code, date, salary, level) Task: Find salary from items where a matching record exists in tasks with the same type. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.type = lne.type );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "salary", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_11849
train
v3
Schema: tasks (alias: tsk)(status, salary, date, id) invoices(level, id, type, name) Task: Retrieve id from tasks with value above the AVG(salary) of invoices rows sharing the same level. SQL:
SELECT id FROM tasks AS tsk WHERE value > ( SELECT AVG(salary) FROM invoices AS inv WHERE inv.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "invoices", "outer_alias": "tsk", "inner_alias": "inv", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_11850
train
v3
Schema: requests (alias: ordr)(level, salary, amount, id) schedules(level, status, name, salary) Task: Retrieve amount from requests with amount above the COUNT(value) of schedules rows sharing the same status. SQL:
SELECT amount FROM requests AS ordr WHERE amount > ( SELECT COUNT(value) FROM schedules AS schd WHERE schd.status = ordr.status );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_11851
train
v2
Schema: projects (alias: prj)(name, amount, salary, type) shipments(type, code, level, amount) Task: Find id from projects where a matching record exists in shipments with the same code. SQL:
SELECT id FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = prj.code );
{ "outer_table": "projects", "inner_table": "shipments", "outer_alias": "prj", "inner_alias": "shp", "proj_col": "id", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_11852
train
v3
Schema: managers (alias: mgr)(level, code, status, type) transactions(type, level, code, amount) Task: Retrieve salary from managers with amount above the MAX(salary) of transactions rows sharing the same code. SQL:
SELECT salary FROM managers AS mgr WHERE amount > ( SELECT MAX(salary) FROM transactions AS txn WHERE txn.code = mgr.code );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11853
train
v2
Schema: projects (alias: prj)(amount, status, type, id) staff(code, level, salary, name) Task: Retrieve code from projects that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT code FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = prj.type );
{ "outer_table": "projects", "inner_table": "staff", "outer_alias": "prj", "inner_alias": "empl", "proj_col": "code", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_11854
train
v1
Schema: invoices (alias: inv)(name, amount, value, type) tasks(type, status, amount, code) Task: Retrieve salary from invoices whose level is found in tasks rows where id matches the outer record. SQL:
SELECT salary FROM invoices AS inv WHERE level IN ( SELECT level FROM tasks AS tsk WHERE tsk.id = inv.id );
{ "outer_table": "invoices", "inner_table": "tasks", "outer_alias": "inv", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "level", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11855
train
v1
Schema: branches (alias: brc)(code, name, status, value) items(salary, value, amount, level) Task: Retrieve value from branches whose level is found in items rows where id matches the outer record. SQL:
SELECT value FROM branches AS brc WHERE level IN ( SELECT level FROM items AS lne WHERE lne.id = brc.id );
{ "outer_table": "branches", "inner_table": "items", "outer_alias": "brc", "inner_alias": "lne", "proj_col": "value", "filter_col": "level", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_11856
train
v1
Schema: branches (alias: brc)(amount, salary, type, value) sales(type, status, level, value) Task: Select salary from branches where type exists in sales for the same code. SQL:
SELECT salary FROM branches AS brc WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.code = brc.code );
{ "outer_table": "branches", "inner_table": "sales", "outer_alias": "brc", "inner_alias": "sale", "proj_col": "salary", "filter_col": "type", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_11857
train
v2
Schema: accounts (alias: acct)(code, type, id, date) branches(level, id, name, status) Task: Find amount from accounts where a matching record exists in branches with the same status. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.status = acct.status );
{ "outer_table": "accounts", "inner_table": "branches", "outer_alias": "acct", "inner_alias": "brc", "proj_col": "amount", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11858
train
v2
Schema: products (alias: prod)(status, type, date, code) tasks(salary, name, value, type) 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_11859
train
v3
Schema: regions (alias: rgn)(code, status, salary, value) products(amount, value, code, name) Task: Retrieve value from regions with amount above the COUNT(value) of products rows sharing the same code. SQL:
SELECT value FROM regions AS rgn WHERE amount > ( SELECT COUNT(value) FROM products AS prod WHERE prod.code = rgn.code );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_11860
train
v1
Schema: tasks (alias: tsk)(name, type, id, value) staff(code, type, amount, status) Task: Select amount from tasks where type exists in staff for the same type. SQL:
SELECT amount FROM tasks AS tsk WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "staff", "outer_alias": "tsk", "inner_alias": "empl", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_11861
train
v2
Schema: regions (alias: rgn)(level, status, amount, salary) projects(date, level, amount, name) Task: Retrieve value from regions that have at least one corresponding entry in projects sharing the same type. SQL:
SELECT value FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = rgn.type );
{ "outer_table": "regions", "inner_table": "projects", "outer_alias": "rgn", "inner_alias": "prj", "proj_col": "value", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_11862
train
v3
Schema: invoices (alias: inv)(status, value, salary, date) regions(date, amount, salary, value) Task: Retrieve amount from invoices with amount above the MAX(amount) of regions rows sharing the same type. SQL:
SELECT amount FROM invoices AS inv WHERE amount > ( SELECT MAX(amount) FROM regions AS rgn WHERE rgn.type = inv.type );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11863
train
v1
Schema: tasks (alias: tsk)(value, id, date, code) sales(value, id, date, type) Task: Select amount from tasks where code exists in sales for the same code. SQL:
SELECT amount FROM tasks AS tsk WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "sales", "outer_alias": "tsk", "inner_alias": "sale", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_11864
train
v1
Schema: schedules (alias: schd)(code, id, name, status) accounts(level, amount, id, date) Task: Find name from schedules where status appears in accounts entries with matching type. SQL:
SELECT name FROM schedules AS schd WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.type = schd.type );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11865
train
v3
Schema: customers (alias: cust)(amount, value, id, status) branches(level, amount, id, status) Task: Find id from customers where value exceeds the maximum amount from branches for the same code. SQL:
SELECT id FROM customers AS cust WHERE value > ( SELECT MAX(amount) FROM branches AS brc WHERE brc.code = cust.code );
{ "outer_table": "customers", "inner_table": "branches", "outer_alias": "cust", "inner_alias": "brc", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11866
train
v1
Schema: products (alias: prod)(date, code, status, id) orders(amount, code, type, status) Task: Retrieve value from products whose code is found in orders rows where status matches the outer record. SQL:
SELECT value FROM products AS prod WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.status = prod.status );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11867
train
v1
Schema: managers (alias: mgr)(value, date, type, id) staff(code, salary, name, status) Task: Select code from managers where type exists in staff for the same level. SQL:
SELECT code FROM managers AS mgr WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.level = mgr.level );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "code", "filter_col": "type", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11868
train
v2
Schema: departments (alias: dept)(date, code, name, salary) invoices(code, amount, level, name) Task: Find name from departments where a matching record exists in invoices with the same type. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = dept.type );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "name", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11869
train
v3
Schema: staff (alias: empl)(type, amount, name, id) regions(date, code, amount, salary) Task: Find id from staff where value exceeds the average amount from regions for the same code. SQL:
SELECT id FROM staff AS empl WHERE value > ( SELECT AVG(amount) FROM regions AS rgn WHERE rgn.code = empl.code );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_11870
train
v3
Schema: projects (alias: prj)(date, status, value, id) invoices(name, type, salary, date) Task: Find code from projects where value exceeds the total value from invoices for the same type. SQL:
SELECT code FROM projects AS prj WHERE value > ( SELECT SUM(value) FROM invoices AS inv WHERE inv.type = prj.type );
{ "outer_table": "projects", "inner_table": "invoices", "outer_alias": "prj", "inner_alias": "inv", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_11871
train
v2
Schema: products (alias: prod)(value, salary, name, date) transactions(name, date, salary, id) Task: Find salary from products where a matching record exists in transactions with the same id. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = prod.id );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "salary", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11872
train
v3
Schema: departments (alias: dept)(type, name, salary, status) projects(value, amount, date, status) Task: Retrieve id from departments with value above the SUM(salary) of projects rows sharing the same level. SQL:
SELECT id FROM departments AS dept WHERE value > ( SELECT SUM(salary) FROM projects AS prj WHERE prj.level = dept.level );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11873
train
v1
Schema: items (alias: lne)(id, date, type, name) accounts(date, id, code, type) Task: Find salary from items where code appears in accounts entries with matching code. SQL:
SELECT salary FROM items AS lne WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.code = lne.code );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_11874
train
v1
Schema: tasks (alias: tsk)(amount, salary, date, type) requests(salary, date, name, status) Task: Find value from tasks where type appears in requests entries with matching status. SQL:
SELECT value FROM tasks AS tsk WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "requests", "outer_alias": "tsk", "inner_alias": "ordr", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_11875
train
v3
Schema: shipments (alias: shp)(name, status, date, value) regions(status, id, date, type) Task: Retrieve id from shipments with amount above the MAX(amount) of regions rows sharing the same type. SQL:
SELECT id FROM shipments AS shp WHERE amount > ( SELECT MAX(amount) FROM regions AS rgn WHERE rgn.type = shp.type );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_11876
train
v1
Schema: requests (alias: ordr)(salary, date, level, id) invoices(type, amount, date, status) Task: Find id from requests where id appears in invoices entries with matching level. SQL:
SELECT id FROM requests AS ordr WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.level = ordr.level );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_11877
train
v3
Schema: categories (alias: catg)(amount, id, level, value) requests(status, salary, level, id) Task: Find amount from categories where amount exceeds the average value from requests for the same id. SQL:
SELECT amount FROM categories AS catg WHERE amount > ( SELECT AVG(value) 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": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11878
train
v1
Schema: staff (alias: empl)(date, level, id, salary) projects(name, level, status, id) Task: Retrieve value from staff whose id is found in projects rows where status matches the outer record. SQL:
SELECT value FROM staff AS empl WHERE id IN ( SELECT id FROM projects AS prj WHERE prj.status = empl.status );
{ "outer_table": "staff", "inner_table": "projects", "outer_alias": "empl", "inner_alias": "prj", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_11879
train
v1
Schema: requests (alias: ordr)(date, name, value, amount) orders(id, status, type, level) Task: Find id from requests where status appears in orders entries with matching code. SQL:
SELECT id FROM requests AS ordr WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.code = ordr.code );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_11880
train
v2
Schema: branches (alias: brc)(level, type, code, value) categories(id, salary, level, type) Task: Retrieve code from branches that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT code FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = brc.code );
{ "outer_table": "branches", "inner_table": "categories", "outer_alias": "brc", "inner_alias": "catg", "proj_col": "code", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_11881
train
v1
Schema: branches (alias: brc)(code, name, amount, value) employees(name, value, id, date) Task: Select id from branches where id exists in employees for the same status. SQL:
SELECT id FROM branches AS brc WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.status = brc.status );
{ "outer_table": "branches", "inner_table": "employees", "outer_alias": "brc", "inner_alias": "emp", "proj_col": "id", "filter_col": "id", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_11882
train
v3
Schema: transactions (alias: txn)(name, salary, level, id) projects(code, name, type, value) Task: Find name from transactions where amount exceeds the minimum value from projects for the same code. SQL:
SELECT name FROM transactions AS txn WHERE amount > ( SELECT MIN(value) FROM projects AS prj WHERE prj.code = txn.code );
{ "outer_table": "transactions", "inner_table": "projects", "outer_alias": "txn", "inner_alias": "prj", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11883
train
v1
Schema: items (alias: lne)(id, code, salary, date) managers(id, level, type, code) Task: Select code from items where status exists in managers for the same code. SQL:
SELECT code FROM items AS lne WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.code = lne.code );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "code", "filter_col": "status", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_11884
train
v3
Schema: branches (alias: brc)(salary, value, status, level) orders(name, level, date, amount) Task: Retrieve code from branches with value above the COUNT(value) of orders rows sharing the same type. SQL:
SELECT code FROM branches AS brc WHERE value > ( SELECT COUNT(value) FROM orders AS ord WHERE ord.type = brc.type );
{ "outer_table": "branches", "inner_table": "orders", "outer_alias": "brc", "inner_alias": "ord", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_11885
train
v2
Schema: requests (alias: ordr)(status, id, level, amount) managers(level, salary, amount, code) Task: Find name from requests where a matching record exists in managers with the same level. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = ordr.level );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "name", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_11886
train
v3
Schema: products (alias: prod)(amount, salary, code, date) transactions(amount, level, status, value) Task: Retrieve code from products with salary above the MIN(value) of transactions rows sharing the same type. SQL:
SELECT code FROM products AS prod WHERE salary > ( SELECT MIN(value) FROM transactions AS txn WHERE txn.type = prod.type );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11887
train
v3
Schema: sales (alias: sale)(date, amount, name, salary) customers(type, value, name, date) Task: Find name from sales where value exceeds the total value from customers for the same level. SQL:
SELECT name FROM sales AS sale WHERE value > ( SELECT SUM(value) FROM customers AS cust WHERE cust.level = sale.level );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11888
train
v2
Schema: departments (alias: dept)(date, id, salary, type) orders(code, type, date, value) Task: Find id from departments where a matching record exists in orders with the same status. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = dept.status );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "id", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11889
train
v2
Schema: schedules (alias: schd)(code, id, salary, value) orders(value, status, id, salary) Task: Retrieve name from schedules that have at least one corresponding entry in orders sharing the same id. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = schd.id );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "name", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11890
train
v1
Schema: tasks (alias: tsk)(code, name, type, id) branches(name, code, amount, salary) Task: Find amount from tasks where code appears in branches entries with matching code. SQL:
SELECT amount FROM tasks AS tsk WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "branches", "outer_alias": "tsk", "inner_alias": "brc", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_11891
train
v3
Schema: branches (alias: brc)(value, type, date, code) managers(value, level, code, status) Task: Find salary from branches where salary exceeds the count of value from managers for the same level. SQL:
SELECT salary FROM branches AS brc WHERE salary > ( SELECT COUNT(value) FROM managers AS mgr WHERE mgr.level = brc.level );
{ "outer_table": "branches", "inner_table": "managers", "outer_alias": "brc", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_11892
train
v2
Schema: managers (alias: mgr)(status, name, id, code) categories(type, code, name, salary) Task: Find value from managers where a matching record exists in categories with the same id. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = mgr.id );
{ "outer_table": "managers", "inner_table": "categories", "outer_alias": "mgr", "inner_alias": "catg", "proj_col": "value", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11893
train
v2
Schema: requests (alias: ordr)(status, amount, level, code) shipments(name, amount, type, level) Task: Find salary from requests where a matching record exists in shipments with the same status. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = ordr.status );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "salary", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_11894
train
v1
Schema: invoices (alias: inv)(type, level, id, amount) tasks(amount, date, level, value) Task: Find name from invoices where id appears in tasks entries with matching level. SQL:
SELECT name FROM invoices AS inv WHERE id IN ( SELECT id FROM tasks AS tsk WHERE tsk.level = inv.level );
{ "outer_table": "invoices", "inner_table": "tasks", "outer_alias": "inv", "inner_alias": "tsk", "proj_col": "name", "filter_col": "id", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11895
train
v2
Schema: customers (alias: cust)(level, type, value, amount) categories(status, id, salary, type) Task: Find salary from customers where a matching record exists in categories with the same code. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = cust.code );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "salary", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11896
train
v1
Schema: accounts (alias: acct)(code, amount, date, salary) transactions(name, value, code, amount) Task: Retrieve salary from accounts whose code is found in transactions rows where status matches the outer record. SQL:
SELECT salary FROM accounts AS acct WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.status = acct.status );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11897
train
v3
Schema: transactions (alias: txn)(value, code, type, amount) orders(date, name, amount, status) Task: Find id from transactions where amount exceeds the average value from orders for the same status. SQL:
SELECT id FROM transactions AS txn WHERE amount > ( SELECT AVG(value) FROM orders AS ord WHERE ord.status = txn.status );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11898
train
v2
Schema: sales (alias: sale)(amount, name, code, id) orders(name, code, amount, type) Task: Find code from sales where a matching record exists in orders with the same status. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = sale.status );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "code", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11899
train