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: shipments (alias: shp)(date, salary, id, code) staff(amount, status, value, code) Task: Retrieve code from shipments that have at least one corresponding entry in staff sharing the same id. SQL:
SELECT code FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = shp.id );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "code", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_06000
train
v3
Schema: tasks (alias: tsk)(amount, id, type, date) schedules(status, date, value, level) Task: Retrieve name from tasks with amount above the MIN(value) of schedules rows sharing the same status. SQL:
SELECT name FROM tasks AS tsk WHERE amount > ( SELECT MIN(value) FROM schedules AS schd WHERE schd.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "schedules", "outer_alias": "tsk", "inner_alias": "schd", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_06001
train
v1
Schema: sales (alias: sale)(status, salary, value, type) orders(code, date, status, id) Task: Select name from sales where level exists in orders for the same 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_06002
train
v2
Schema: accounts (alias: acct)(date, status, level, amount) projects(name, type, date, status) Task: Find salary from accounts where a matching record exists in projects with the same type. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = acct.type );
{ "outer_table": "accounts", "inner_table": "projects", "outer_alias": "acct", "inner_alias": "prj", "proj_col": "salary", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06003
train
v1
Schema: customers (alias: cust)(value, level, salary, date) projects(date, value, name, type) Task: Find name from customers where code appears in projects entries with matching status. SQL:
SELECT name FROM customers AS cust WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.status = cust.status );
{ "outer_table": "customers", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "prj", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06004
train
v2
Schema: tasks (alias: tsk)(salary, name, level, status) branches(level, status, value, amount) Task: Retrieve code from tasks that have at least one corresponding entry in branches sharing the same status. SQL:
SELECT code FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "branches", "outer_alias": "tsk", "inner_alias": "brc", "proj_col": "code", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_06005
train
v1
Schema: requests (alias: ordr)(level, type, status, date) items(value, level, salary, type) Task: Retrieve salary from requests whose id is found in items rows where status matches the outer record. SQL:
SELECT salary FROM requests AS ordr WHERE id IN ( SELECT id FROM items AS lne WHERE lne.status = ordr.status );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06006
train
v3
Schema: departments (alias: dept)(level, type, value, code) orders(date, value, amount, status) Task: Retrieve amount from departments with salary above the MIN(value) of orders rows sharing the same level. SQL:
SELECT amount FROM departments AS dept WHERE salary > ( SELECT MIN(value) 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": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06007
train
v1
Schema: categories (alias: catg)(value, code, name, type) regions(date, name, level, amount) Task: Find value from categories where id appears in regions entries with matching status. SQL:
SELECT value FROM categories AS catg WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.status = catg.status );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06008
train
v1
Schema: requests (alias: ordr)(value, code, name, type) transactions(id, name, type, status) Task: Find value from requests where code appears in transactions entries with matching level. SQL:
SELECT value FROM requests AS ordr WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.level = ordr.level );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06009
train
v2
Schema: customers (alias: cust)(date, level, status, value) departments(salary, id, type, status) Task: Retrieve value from customers that have at least one corresponding entry in departments sharing the same status. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = cust.status );
{ "outer_table": "customers", "inner_table": "departments", "outer_alias": "cust", "inner_alias": "dept", "proj_col": "value", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06010
train
v2
Schema: branches (alias: brc)(level, date, value, salary) managers(date, id, salary, level) Task: Find id from branches where a matching record exists in managers with the same code. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = brc.code );
{ "outer_table": "branches", "inner_table": "managers", "outer_alias": "brc", "inner_alias": "mgr", "proj_col": "id", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_06011
train
v3
Schema: regions (alias: rgn)(id, salary, amount, name) projects(type, level, amount, id) Task: Find id from regions where amount exceeds the maximum amount from projects for the same id. SQL:
SELECT id FROM regions AS rgn WHERE amount > ( SELECT MAX(amount) FROM projects AS prj WHERE prj.id = rgn.id );
{ "outer_table": "regions", "inner_table": "projects", "outer_alias": "rgn", "inner_alias": "prj", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06012
train
v2
Schema: sales (alias: sale)(id, code, status, type) requests(level, salary, status, id) Task: Retrieve salary from sales that have at least one corresponding entry in requests sharing the same code. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = sale.code );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "salary", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06013
train
v1
Schema: shipments (alias: shp)(name, status, type, date) projects(level, date, type, id) Task: Find value from shipments where level appears in projects entries with matching type. SQL:
SELECT value FROM shipments AS shp WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.type = shp.type );
{ "outer_table": "shipments", "inner_table": "projects", "outer_alias": "shp", "inner_alias": "prj", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_06014
train
v1
Schema: orders (alias: ord)(name, amount, date, value) managers(id, type, code, name) Task: Find amount from orders where code appears in managers entries with matching id. SQL:
SELECT amount FROM orders AS ord WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.id = ord.id );
{ "outer_table": "orders", "inner_table": "managers", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "code", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06015
train
v1
Schema: invoices (alias: inv)(salary, amount, date, value) projects(value, code, date, level) Task: Select name from invoices where type exists in projects for the same type. SQL:
SELECT name FROM invoices AS inv WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.type = inv.type );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "inv", "inner_alias": "prj", "proj_col": "name", "filter_col": "type", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06016
train
v1
Schema: tasks (alias: tsk)(date, status, level, id) transactions(value, id, amount, name) Task: Retrieve salary from tasks whose level is found in transactions rows where level matches the outer record. SQL:
SELECT salary FROM tasks AS tsk WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "transactions", "outer_alias": "tsk", "inner_alias": "txn", "proj_col": "salary", "filter_col": "level", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_06017
train
v3
Schema: managers (alias: mgr)(amount, level, name, code) products(date, name, level, salary) Task: Find id from managers where salary exceeds the maximum value from products for the same level. SQL:
SELECT id FROM managers AS mgr WHERE salary > ( SELECT MAX(value) FROM products AS prod WHERE prod.level = mgr.level );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06018
train
v1
Schema: staff (alias: empl)(amount, value, level, code) requests(level, id, code, status) Task: Find value from staff where status appears in requests entries with matching code. SQL:
SELECT value FROM staff AS empl WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.code = empl.code );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "value", "filter_col": "status", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_06019
train
v2
Schema: transactions (alias: txn)(type, date, salary, level) invoices(amount, level, salary, type) Task: Find name from transactions where a matching record exists in invoices with the same type. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = txn.type );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "name", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06020
train
v3
Schema: transactions (alias: txn)(type, date, name, level) regions(type, code, amount, status) Task: Find salary from transactions where salary exceeds the average value from regions for the same level. SQL:
SELECT salary FROM transactions AS txn WHERE salary > ( SELECT AVG(value) FROM regions AS rgn WHERE rgn.level = txn.level );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06021
train
v2
Schema: orders (alias: ord)(salary, amount, status, value) schedules(date, status, type, id) Task: Find id from orders where a matching record exists in schedules with the same id. SQL:
SELECT id FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = ord.id );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "id", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06022
train
v1
Schema: customers (alias: cust)(date, code, status, salary) projects(salary, amount, date, code) Task: Retrieve id from customers whose status is found in projects rows where code matches the outer record. SQL:
SELECT id FROM customers AS cust WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.code = cust.code );
{ "outer_table": "customers", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "prj", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06023
train
v1
Schema: products (alias: prod)(value, level, status, type) projects(code, status, level, value) Task: Select code from products where id exists in projects for the same code. SQL:
SELECT code FROM products AS prod WHERE id IN ( SELECT id FROM projects AS prj WHERE prj.code = prod.code );
{ "outer_table": "products", "inner_table": "projects", "outer_alias": "prod", "inner_alias": "prj", "proj_col": "code", "filter_col": "id", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06024
train
v1
Schema: sales (alias: sale)(type, salary, id, status) shipments(salary, amount, id, code) Task: Find name from sales where status appears in shipments entries with matching id. SQL:
SELECT name FROM sales AS sale WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.id = sale.id );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06025
train
v3
Schema: transactions (alias: txn)(id, name, value, type) schedules(code, date, status, salary) Task: Find code from transactions where salary exceeds the maximum amount from schedules for the same id. SQL:
SELECT code FROM transactions AS txn WHERE salary > ( SELECT MAX(amount) FROM schedules AS schd WHERE schd.id = txn.id );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06026
train
v3
Schema: employees (alias: emp)(date, level, name, type) staff(code, status, salary, level) Task: Find value from employees where value exceeds the count of salary from staff for the same id. SQL:
SELECT value FROM employees AS emp WHERE value > ( SELECT COUNT(salary) FROM staff AS empl WHERE empl.id = emp.id );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06027
train
v2
Schema: schedules (alias: schd)(name, code, value, type) regions(type, id, value, name) Task: Retrieve name from schedules that have at least one corresponding entry in regions sharing the same type. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = schd.type );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "name", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06028
train
v3
Schema: items (alias: lne)(status, salary, code, id) sales(level, salary, date, name) Task: Find name from items where amount exceeds the minimum value from sales for the same type. SQL:
SELECT name FROM items AS lne WHERE amount > ( SELECT MIN(value) FROM sales AS sale WHERE sale.type = lne.type );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06029
train
v1
Schema: requests (alias: ordr)(date, amount, value, code) invoices(status, amount, level, date) Task: Retrieve salary from requests whose type is found in invoices rows where code matches the outer record. SQL:
SELECT salary FROM requests AS ordr WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.code = ordr.code );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "salary", "filter_col": "type", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06030
train
v3
Schema: managers (alias: mgr)(type, name, salary, id) items(code, amount, date, id) Task: Find code from managers where value exceeds the average salary from items for the same status. SQL:
SELECT code FROM managers AS mgr WHERE value > ( SELECT AVG(salary) FROM items AS lne WHERE lne.status = mgr.status );
{ "outer_table": "managers", "inner_table": "items", "outer_alias": "mgr", "inner_alias": "lne", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06031
train
v2
Schema: sales (alias: sale)(code, type, level, amount) products(status, type, level, id) Task: Retrieve id from sales that have at least one corresponding entry in products sharing the same level. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = sale.level );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "id", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06032
train
v3
Schema: products (alias: prod)(salary, level, status, id) schedules(status, code, type, level) Task: Find name from products where amount exceeds the minimum value from schedules for the same status. SQL:
SELECT name FROM products AS prod WHERE amount > ( SELECT MIN(value) FROM schedules AS schd WHERE schd.status = prod.status );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06033
train
v2
Schema: regions (alias: rgn)(id, value, name, salary) products(code, level, id, date) Task: Retrieve salary from regions that have at least one corresponding entry in products sharing the same code. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = rgn.code );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "salary", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06034
train
v2
Schema: items (alias: lne)(amount, type, level, value) products(amount, code, value, id) Task: Retrieve value from items that have at least one corresponding entry in products sharing the same id. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = lne.id );
{ "outer_table": "items", "inner_table": "products", "outer_alias": "lne", "inner_alias": "prod", "proj_col": "value", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06035
train
v2
Schema: regions (alias: rgn)(amount, level, name, status) accounts(value, date, status, type) Task: Find name from regions where a matching record exists in accounts with the same status. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = rgn.status );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "rgn", "inner_alias": "acct", "proj_col": "name", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06036
train
v1
Schema: orders (alias: ord)(type, date, level, code) sales(id, value, amount, status) Task: Find name from orders where status appears in sales entries with matching status. SQL:
SELECT name FROM orders AS ord WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.status = ord.status );
{ "outer_table": "orders", "inner_table": "sales", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06037
train
v3
Schema: items (alias: lne)(amount, name, salary, status) employees(date, level, amount, type) Task: Retrieve code from items with value above the SUM(salary) of employees rows sharing the same level. SQL:
SELECT code FROM items AS lne WHERE value > ( SELECT SUM(salary) FROM employees AS emp WHERE emp.level = lne.level );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06038
train
v2
Schema: projects (alias: prj)(code, status, date, type) categories(value, date, status, amount) Task: Retrieve amount from projects that have at least one corresponding entry in categories sharing the same type. SQL:
SELECT amount FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = prj.type );
{ "outer_table": "projects", "inner_table": "categories", "outer_alias": "prj", "inner_alias": "catg", "proj_col": "amount", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06039
train
v1
Schema: projects (alias: prj)(name, type, amount, code) tasks(id, name, date, type) Task: Retrieve amount from projects whose id is found in tasks rows where id matches the outer record. SQL:
SELECT amount FROM projects AS prj WHERE id IN ( SELECT id FROM tasks AS tsk WHERE tsk.id = prj.id );
{ "outer_table": "projects", "inner_table": "tasks", "outer_alias": "prj", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "id", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06040
train
v2
Schema: customers (alias: cust)(status, level, date, amount) staff(type, level, name, status) Task: Retrieve value from customers that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = cust.type );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "value", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06041
train
v1
Schema: customers (alias: cust)(value, level, salary, amount) tasks(level, value, status, amount) Task: Retrieve salary from customers whose id is found in tasks rows where level matches the outer record. SQL:
SELECT salary FROM customers AS cust WHERE id IN ( SELECT id FROM tasks AS tsk WHERE tsk.level = cust.level );
{ "outer_table": "customers", "inner_table": "tasks", "outer_alias": "cust", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "id", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06042
train
v2
Schema: requests (alias: ordr)(type, level, name, id) orders(salary, date, code, status) Task: Retrieve code from requests that have at least one corresponding entry in orders sharing the same id. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = ordr.id );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "code", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06043
train
v2
Schema: products (alias: prod)(id, type, status, value) requests(status, value, code, salary) Task: Retrieve value from products that have at least one corresponding entry in requests sharing the same code. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = prod.code );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "value", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06044
train
v3
Schema: branches (alias: brc)(level, id, value, date) schedules(value, type, status, name) Task: Find id from branches where salary exceeds the maximum value from schedules for the same code. SQL:
SELECT id FROM branches AS brc WHERE salary > ( SELECT MAX(value) FROM schedules AS schd WHERE schd.code = brc.code );
{ "outer_table": "branches", "inner_table": "schedules", "outer_alias": "brc", "inner_alias": "schd", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_06045
train
v3
Schema: shipments (alias: shp)(date, status, value, name) sales(id, type, date, value) Task: Find value from shipments where value exceeds the average salary from sales for the same id. SQL:
SELECT value FROM shipments AS shp WHERE value > ( SELECT AVG(salary) FROM sales AS sale WHERE sale.id = shp.id );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_06046
train
v2
Schema: customers (alias: cust)(salary, code, type, id) transactions(name, date, id, salary) Task: Find id from customers where a matching record exists in transactions with the same level. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = cust.level );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "id", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06047
train
v3
Schema: employees (alias: emp)(status, date, id, name) managers(status, amount, date, salary) Task: Find value from employees where salary exceeds the count of amount from managers for the same code. SQL:
SELECT value FROM employees AS emp WHERE salary > ( SELECT COUNT(amount) FROM managers AS mgr WHERE mgr.code = emp.code );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06048
train
v1
Schema: departments (alias: dept)(type, value, salary, date) orders(value, level, status, type) Task: Find id from departments where id appears in orders entries with matching code. SQL:
SELECT id FROM departments AS dept WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.code = dept.code );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "id", "filter_col": "id", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06049
train
v1
Schema: schedules (alias: schd)(status, date, type, id) branches(type, value, amount, level) Task: Find name from schedules where id appears in branches entries with matching type. SQL:
SELECT name FROM schedules AS schd WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.type = schd.type );
{ "outer_table": "schedules", "inner_table": "branches", "outer_alias": "schd", "inner_alias": "brc", "proj_col": "name", "filter_col": "id", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06050
train
v2
Schema: requests (alias: ordr)(status, amount, code, id) products(type, name, id, code) Task: Find value from requests where a matching record exists in products with the same type. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = ordr.type );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "value", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06051
train
v1
Schema: categories (alias: catg)(name, code, amount, salary) transactions(level, code, value, id) Task: Find code from categories where code appears in transactions entries with matching code. SQL:
SELECT code FROM categories AS catg WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.code = catg.code );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06052
train
v3
Schema: projects (alias: prj)(name, level, amount, value) sales(code, name, status, salary) Task: Find id from projects where value exceeds the maximum salary from sales for the same level. SQL:
SELECT id FROM projects AS prj WHERE value > ( SELECT MAX(salary) FROM sales AS sale WHERE sale.level = prj.level );
{ "outer_table": "projects", "inner_table": "sales", "outer_alias": "prj", "inner_alias": "sale", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06053
train
v3
Schema: sales (alias: sale)(date, value, salary, status) transactions(level, salary, value, name) Task: Find name from sales where salary exceeds the average salary from transactions for the same status. SQL:
SELECT name FROM sales AS sale WHERE salary > ( SELECT AVG(salary) FROM transactions AS txn WHERE txn.status = sale.status );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06054
train
v1
Schema: customers (alias: cust)(type, id, name, amount) products(amount, name, type, value) Task: Find name from customers where code appears in products entries with matching code. SQL:
SELECT name FROM customers AS cust WHERE code IN ( SELECT code FROM products AS prod WHERE prod.code = cust.code );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06055
train
v3
Schema: projects (alias: prj)(name, level, code, date) employees(amount, name, status, type) Task: Find value from projects where salary exceeds the minimum salary from employees for the same level. SQL:
SELECT value FROM projects AS prj WHERE salary > ( SELECT MIN(salary) FROM employees AS emp WHERE emp.level = prj.level );
{ "outer_table": "projects", "inner_table": "employees", "outer_alias": "prj", "inner_alias": "emp", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06056
train
v3
Schema: projects (alias: prj)(name, type, level, date) transactions(name, amount, code, id) Task: Retrieve value from projects with value above the SUM(value) of transactions rows sharing the same code. SQL:
SELECT value FROM projects AS prj WHERE value > ( SELECT SUM(value) FROM transactions AS txn WHERE txn.code = prj.code );
{ "outer_table": "projects", "inner_table": "transactions", "outer_alias": "prj", "inner_alias": "txn", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06057
train
v2
Schema: accounts (alias: acct)(id, status, name, salary) projects(date, value, amount, id) Task: Retrieve salary from accounts that have at least one corresponding entry in projects sharing the same type. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = acct.type );
{ "outer_table": "accounts", "inner_table": "projects", "outer_alias": "acct", "inner_alias": "prj", "proj_col": "salary", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06058
train
v2
Schema: products (alias: prod)(name, salary, value, code) departments(value, date, code, name) Task: Retrieve amount from products that have at least one corresponding entry in departments sharing the same code. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = prod.code );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "amount", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06059
train
v1
Schema: orders (alias: ord)(id, date, code, value) products(status, amount, date, code) Task: Find name from orders where code appears in products entries with matching code. SQL:
SELECT name FROM orders AS ord WHERE code IN ( SELECT code FROM products AS prod WHERE prod.code = ord.code );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06060
train
v3
Schema: orders (alias: ord)(level, amount, value, id) employees(name, value, level, type) Task: Find salary from orders where amount exceeds the maximum amount from employees for the same id. SQL:
SELECT salary FROM orders AS ord WHERE amount > ( SELECT MAX(amount) FROM employees AS emp WHERE emp.id = ord.id );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06061
train
v2
Schema: projects (alias: prj)(salary, status, id, date) schedules(id, date, salary, code) Task: Find code from projects where a matching record exists in schedules with the same status. SQL:
SELECT code FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = prj.status );
{ "outer_table": "projects", "inner_table": "schedules", "outer_alias": "prj", "inner_alias": "schd", "proj_col": "code", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06062
train
v1
Schema: categories (alias: catg)(type, status, name, date) accounts(amount, level, salary, type) Task: Retrieve id from categories whose status is found in accounts rows where code matches the outer record. SQL:
SELECT id FROM categories AS catg WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.code = catg.code );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06063
train
v2
Schema: customers (alias: cust)(value, id, status, date) staff(amount, value, salary, id) Task: Find amount from customers where a matching record exists in staff with the same type. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = cust.type );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "amount", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06064
train
v1
Schema: invoices (alias: inv)(status, name, type, id) sales(type, value, amount, date) Task: Retrieve code from invoices whose status is found in sales rows where code matches the outer record. SQL:
SELECT code FROM invoices AS inv WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.code = inv.code );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "code", "filter_col": "status", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06065
train
v3
Schema: products (alias: prod)(salary, date, amount, status) transactions(id, level, name, date) Task: Retrieve id from products with value above the MAX(amount) of transactions rows sharing the same type. SQL:
SELECT id FROM products AS prod WHERE value > ( SELECT MAX(amount) FROM transactions AS txn WHERE txn.type = prod.type );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06066
train
v3
Schema: managers (alias: mgr)(status, code, id, name) branches(value, level, id, amount) Task: Retrieve salary from managers with amount above the COUNT(value) of branches rows sharing the same id. SQL:
SELECT salary FROM managers AS mgr WHERE amount > ( SELECT COUNT(value) FROM branches AS brc WHERE brc.id = mgr.id );
{ "outer_table": "managers", "inner_table": "branches", "outer_alias": "mgr", "inner_alias": "brc", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06067
train
v2
Schema: products (alias: prod)(salary, id, level, status) schedules(type, date, code, amount) Task: Find code from products where a matching record exists in schedules with the same type. SQL:
SELECT code 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": "code", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06068
train
v3
Schema: branches (alias: brc)(level, code, type, name) sales(status, id, salary, date) Task: Find name from branches where salary exceeds the average value from sales for the same status. SQL:
SELECT name FROM branches AS brc WHERE salary > ( SELECT AVG(value) FROM sales AS sale WHERE sale.status = brc.status );
{ "outer_table": "branches", "inner_table": "sales", "outer_alias": "brc", "inner_alias": "sale", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_06069
train
v2
Schema: schedules (alias: schd)(name, level, code, salary) items(amount, id, type, status) Task: Retrieve id from schedules that have at least one corresponding entry in items sharing the same code. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = schd.code );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "id", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06070
train
v3
Schema: branches (alias: brc)(level, code, value, salary) employees(name, amount, code, value) Task: Retrieve amount from branches with salary above the COUNT(salary) of employees rows sharing the same type. SQL:
SELECT amount FROM branches AS brc WHERE salary > ( SELECT COUNT(salary) FROM employees AS emp WHERE emp.type = brc.type );
{ "outer_table": "branches", "inner_table": "employees", "outer_alias": "brc", "inner_alias": "emp", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_06071
train
v1
Schema: projects (alias: prj)(amount, level, salary, value) employees(type, id, amount, level) Task: Retrieve id from projects whose level is found in employees rows where id matches the outer record. SQL:
SELECT id FROM projects AS prj WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.id = prj.id );
{ "outer_table": "projects", "inner_table": "employees", "outer_alias": "prj", "inner_alias": "emp", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06072
train
v3
Schema: accounts (alias: acct)(date, level, code, type) orders(status, code, id, salary) Task: Find code from accounts where amount exceeds the maximum salary from orders for the same code. SQL:
SELECT code FROM accounts AS acct WHERE amount > ( SELECT MAX(salary) FROM orders AS ord WHERE ord.code = acct.code );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06073
train
v1
Schema: tasks (alias: tsk)(name, id, type, level) transactions(name, code, type, salary) Task: Retrieve amount from tasks whose id is found in transactions rows where type matches the outer record. SQL:
SELECT amount FROM tasks AS tsk WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "transactions", "outer_alias": "tsk", "inner_alias": "txn", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_06074
train
v1
Schema: items (alias: lne)(id, code, date, level) shipments(code, salary, value, id) Task: Find name from items where status appears in shipments entries with matching id. SQL:
SELECT name FROM items AS lne WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.id = lne.id );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06075
train
v3
Schema: orders (alias: ord)(salary, type, name, level) regions(date, status, name, code) Task: Retrieve code from orders with value above the AVG(value) of regions rows sharing the same id. SQL:
SELECT code FROM orders AS ord WHERE value > ( SELECT AVG(value) FROM regions AS rgn WHERE rgn.id = ord.id );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06076
train
v1
Schema: departments (alias: dept)(type, salary, date, value) accounts(level, date, type, name) Task: Select id from departments where status exists in accounts for the same type. SQL:
SELECT id FROM departments AS dept WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.type = dept.type );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06077
train
v3
Schema: sales (alias: sale)(code, id, value, amount) transactions(code, salary, date, id) Task: Find amount from sales where amount exceeds the average amount from transactions for the same id. SQL:
SELECT amount FROM sales AS sale WHERE amount > ( SELECT AVG(amount) FROM transactions AS txn WHERE txn.id = sale.id );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06078
train
v3
Schema: products (alias: prod)(amount, date, code, salary) items(value, salary, level, code) Task: Find name from products where value exceeds the count of amount from items for the same status. SQL:
SELECT name FROM products AS prod WHERE value > ( SELECT COUNT(amount) FROM items AS lne WHERE lne.status = prod.status );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06079
train
v1
Schema: departments (alias: dept)(level, salary, name, code) schedules(id, amount, salary, level) Task: Find salary from departments where id appears in schedules entries with matching code. SQL:
SELECT salary FROM departments AS dept WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.code = dept.code );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06080
train
v2
Schema: items (alias: lne)(name, value, code, date) categories(value, amount, id, status) Task: Find code from items where a matching record exists in categories with the same id. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = lne.id );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "code", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_06081
train
v3
Schema: categories (alias: catg)(level, status, code, value) orders(date, name, level, type) Task: Retrieve salary from categories with salary above the SUM(amount) of orders rows sharing the same type. SQL:
SELECT salary FROM categories AS catg WHERE salary > ( SELECT SUM(amount) FROM orders AS ord WHERE ord.type = catg.type );
{ "outer_table": "categories", "inner_table": "orders", "outer_alias": "catg", "inner_alias": "ord", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06082
train
v2
Schema: categories (alias: catg)(salary, type, date, amount) accounts(amount, code, id, name) Task: Find id from categories where a matching record exists in accounts with the same id. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = catg.id );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "id", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06083
train
v3
Schema: transactions (alias: txn)(date, amount, name, code) customers(amount, id, status, code) Task: Find id from transactions where amount exceeds the maximum salary from customers for the same code. SQL:
SELECT id FROM transactions AS txn WHERE amount > ( SELECT MAX(salary) FROM customers AS cust WHERE cust.code = txn.code );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06084
train
v1
Schema: transactions (alias: txn)(name, id, value, amount) regions(id, value, amount, date) Task: Select salary from transactions where status exists in regions for the same type. SQL:
SELECT salary FROM transactions AS txn WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.type = txn.type );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06085
train
v2
Schema: tasks (alias: tsk)(level, amount, status, name) schedules(type, id, amount, level) Task: Find name from tasks where a matching record exists in schedules with the same id. SQL:
SELECT name FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "schedules", "outer_alias": "tsk", "inner_alias": "schd", "proj_col": "name", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_06086
train
v1
Schema: regions (alias: rgn)(amount, name, id, type) managers(value, level, salary, type) Task: Select value from regions where type exists in managers for the same type. SQL:
SELECT value FROM regions AS rgn WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.type = rgn.type );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "value", "filter_col": "type", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_06087
train
v3
Schema: requests (alias: ordr)(status, salary, type, value) orders(status, id, salary, date) Task: Retrieve id from requests with salary above the MIN(value) of orders rows sharing the same code. SQL:
SELECT id FROM requests AS ordr WHERE salary > ( SELECT MIN(value) 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": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_06088
train
v3
Schema: employees (alias: emp)(value, level, status, amount) tasks(date, level, value, status) Task: Retrieve value from employees with amount above the MIN(value) of tasks rows sharing the same level. SQL:
SELECT value FROM employees AS emp WHERE amount > ( SELECT MIN(value) FROM tasks AS tsk WHERE tsk.level = emp.level );
{ "outer_table": "employees", "inner_table": "tasks", "outer_alias": "emp", "inner_alias": "tsk", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06089
train
v1
Schema: projects (alias: prj)(status, type, date, salary) tasks(name, value, amount, code) Task: Select amount from projects where id exists in tasks for the same level. SQL:
SELECT amount FROM projects AS prj WHERE id IN ( SELECT id FROM tasks AS tsk WHERE tsk.level = prj.level );
{ "outer_table": "projects", "inner_table": "tasks", "outer_alias": "prj", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_06090
train
v1
Schema: schedules (alias: schd)(name, type, id, value) departments(id, type, status, salary) Task: Find value from schedules where type appears in departments entries with matching status. SQL:
SELECT value FROM schedules AS schd WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.status = schd.status );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06091
train
v2
Schema: employees (alias: emp)(status, code, name, level) transactions(value, name, status, id) Task: Retrieve code from employees that have at least one corresponding entry in transactions sharing the same type. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = emp.type );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "code", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06092
train
v1
Schema: staff (alias: empl)(id, type, date, value) managers(status, value, date, type) Task: Retrieve salary from staff whose id is found in managers rows where level matches the outer record. SQL:
SELECT salary FROM staff AS empl WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.level = empl.level );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "id", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_06093
train
v1
Schema: branches (alias: brc)(date, status, type, name) staff(value, name, salary, type) Task: Find salary from branches where id appears in staff entries with matching status. SQL:
SELECT salary FROM branches AS brc WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.status = brc.status );
{ "outer_table": "branches", "inner_table": "staff", "outer_alias": "brc", "inner_alias": "empl", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_06094
train
v3
Schema: schedules (alias: schd)(date, id, value, code) sales(salary, name, id, level) Task: Find salary from schedules where amount exceeds the count of amount from sales for the same type. SQL:
SELECT salary FROM schedules AS schd WHERE amount > ( SELECT COUNT(amount) FROM sales AS sale WHERE sale.type = schd.type );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_06095
train
v1
Schema: managers (alias: mgr)(id, salary, code, level) tasks(value, id, name, code) Task: Retrieve name from managers whose status is found in tasks rows where status matches the outer record. SQL:
SELECT name FROM managers AS mgr WHERE status IN ( SELECT status FROM tasks AS tsk WHERE tsk.status = mgr.status );
{ "outer_table": "managers", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "tsk", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06096
train
v1
Schema: customers (alias: cust)(type, level, status, salary) categories(level, salary, code, value) Task: Select name from customers where level exists in categories for the same type. SQL:
SELECT name FROM customers AS cust WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.type = cust.type );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06097
train
v3
Schema: customers (alias: cust)(salary, date, code, status) shipments(type, salary, level, status) Task: Find salary from customers where salary exceeds the minimum value from shipments for the same type. SQL:
SELECT salary FROM customers AS cust WHERE salary > ( SELECT MIN(value) FROM shipments AS shp WHERE shp.type = cust.type );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_06098
train
v3
Schema: shipments (alias: shp)(name, level, amount, id) orders(type, date, name, code) Task: Find name from shipments where amount exceeds the total salary from orders for the same code. SQL:
SELECT name FROM shipments AS shp WHERE amount > ( SELECT SUM(salary) FROM orders AS ord WHERE ord.code = shp.code );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_06099
train