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: managers (alias: mgr)(level, code, salary, type) branches(id, amount, salary, status) Task: Find salary from managers where a matching record exists in branches with the same code. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.code = mgr.code );
{ "outer_table": "managers", "inner_table": "branches", "outer_alias": "mgr", "inner_alias": "brc", "proj_col": "salary", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09100
train
v3
Schema: requests (alias: ordr)(id, status, value, date) customers(amount, code, date, value) Task: Find id from requests where value exceeds the count of amount from customers for the same id. SQL:
SELECT id FROM requests AS ordr WHERE value > ( SELECT COUNT(amount) FROM customers AS cust WHERE cust.id = ordr.id );
{ "outer_table": "requests", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09101
train
v2
Schema: categories (alias: catg)(code, value, salary, type) schedules(salary, code, value, type) Task: Retrieve salary from categories that have at least one corresponding entry in schedules sharing the same type. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = catg.type );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "salary", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09102
train
v1
Schema: departments (alias: dept)(name, salary, level, code) shipments(name, salary, id, amount) Task: Select amount from departments where type exists in shipments for the same type. SQL:
SELECT amount FROM departments AS dept WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.type = dept.type );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09103
train
v2
Schema: staff (alias: empl)(amount, value, code, type) schedules(level, name, salary, amount) Task: Find salary from staff where a matching record exists in schedules with the same level. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = empl.level );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "salary", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09104
train
v2
Schema: accounts (alias: acct)(code, date, value, status) staff(type, level, salary, id) Task: Find name from accounts where a matching record exists in staff with the same level. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = acct.level );
{ "outer_table": "accounts", "inner_table": "staff", "outer_alias": "acct", "inner_alias": "empl", "proj_col": "name", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09105
train
v1
Schema: orders (alias: ord)(status, amount, level, value) sales(value, name, type, id) Task: Find id from orders where level appears in sales entries with matching id. SQL:
SELECT id FROM orders AS ord WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.id = ord.id );
{ "outer_table": "orders", "inner_table": "sales", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09106
train
v3
Schema: employees (alias: emp)(type, status, date, amount) categories(date, salary, name, type) Task: Retrieve value from employees with salary above the SUM(value) of categories rows sharing the same level. SQL:
SELECT value FROM employees AS emp WHERE salary > ( SELECT SUM(value) FROM categories AS catg WHERE catg.level = emp.level );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09107
train
v3
Schema: regions (alias: rgn)(type, value, amount, code) transactions(id, status, salary, date) Task: Retrieve name from regions with salary above the MIN(amount) of transactions rows sharing the same status. SQL:
SELECT name FROM regions AS rgn WHERE salary > ( SELECT MIN(amount) FROM transactions AS txn WHERE txn.status = rgn.status );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_09108
train
v3
Schema: accounts (alias: acct)(value, name, type, id) regions(name, salary, status, type) Task: Find name from accounts where amount exceeds the average value from regions for the same id. SQL:
SELECT name FROM accounts AS acct WHERE amount > ( SELECT AVG(value) FROM regions AS rgn WHERE rgn.id = acct.id );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09109
train
v1
Schema: employees (alias: emp)(amount, date, code, salary) tasks(amount, value, date, name) Task: Select id from employees where id exists in tasks for the same id. SQL:
SELECT id FROM employees AS emp WHERE id IN ( SELECT id FROM tasks AS tsk WHERE tsk.id = emp.id );
{ "outer_table": "employees", "inner_table": "tasks", "outer_alias": "emp", "inner_alias": "tsk", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09110
train
v1
Schema: customers (alias: cust)(date, code, name, status) regions(value, salary, date, status) Task: Retrieve name from customers whose status is found in regions rows where type matches the outer record. SQL:
SELECT name FROM customers AS cust WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.type = cust.type );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09111
train
v3
Schema: orders (alias: ord)(level, id, name, status) tasks(value, type, code, date) Task: Retrieve code from orders with salary above the COUNT(salary) of tasks rows sharing the same id. SQL:
SELECT code FROM orders AS ord WHERE salary > ( SELECT COUNT(salary) FROM tasks AS tsk WHERE tsk.id = ord.id );
{ "outer_table": "orders", "inner_table": "tasks", "outer_alias": "ord", "inner_alias": "tsk", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09112
train
v3
Schema: products (alias: prod)(status, date, type, value) sales(name, amount, level, date) Task: Find name from products where value exceeds the count of salary from sales for the same type. SQL:
SELECT name FROM products AS prod WHERE value > ( SELECT COUNT(salary) FROM sales AS sale WHERE sale.type = prod.type );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09113
train
v1
Schema: products (alias: prod)(salary, value, date, name) branches(code, amount, value, id) Task: Find value from products where id appears in branches entries with matching type. SQL:
SELECT value FROM products AS prod WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.type = prod.type );
{ "outer_table": "products", "inner_table": "branches", "outer_alias": "prod", "inner_alias": "brc", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09114
train
v3
Schema: schedules (alias: schd)(salary, name, type, code) customers(code, id, status, type) Task: Retrieve code from schedules with amount above the AVG(amount) of customers rows sharing the same id. SQL:
SELECT code FROM schedules AS schd WHERE amount > ( SELECT AVG(amount) FROM customers AS cust WHERE cust.id = schd.id );
{ "outer_table": "schedules", "inner_table": "customers", "outer_alias": "schd", "inner_alias": "cust", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09115
train
v1
Schema: requests (alias: ordr)(salary, date, code, id) staff(code, value, type, id) Task: Retrieve name from requests whose id is found in staff rows where type matches the outer record. SQL:
SELECT name FROM requests AS ordr WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.type = ordr.type );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "name", "filter_col": "id", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09116
train
v3
Schema: projects (alias: prj)(status, code, date, level) shipments(name, code, amount, type) Task: Retrieve value from projects with value above the SUM(value) of shipments rows sharing the same code. SQL:
SELECT value FROM projects AS prj WHERE value > ( SELECT SUM(value) FROM shipments AS shp WHERE shp.code = prj.code );
{ "outer_table": "projects", "inner_table": "shipments", "outer_alias": "prj", "inner_alias": "shp", "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_09117
train
v1
Schema: staff (alias: empl)(status, id, level, amount) regions(id, date, name, value) Task: Retrieve value from staff whose id is found in regions rows where id matches the outer record. SQL:
SELECT value FROM staff AS empl WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.id = empl.id );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09118
train
v2
Schema: schedules (alias: schd)(date, salary, type, code) shipments(status, name, amount, level) Task: Retrieve amount from schedules that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = schd.status );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "amount", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09119
train
v1
Schema: customers (alias: cust)(level, value, amount, salary) accounts(status, name, level, salary) Task: Find amount from customers where level appears in accounts entries with matching status. SQL:
SELECT amount FROM customers AS cust WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.status = cust.status );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09120
train
v3
Schema: accounts (alias: acct)(code, date, type, id) managers(status, id, code, name) Task: Retrieve value from accounts with amount above the COUNT(amount) of managers rows sharing the same code. SQL:
SELECT value FROM accounts AS acct WHERE amount > ( SELECT COUNT(amount) FROM managers AS mgr WHERE mgr.code = acct.code );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09121
train
v3
Schema: categories (alias: catg)(name, id, salary, status) products(salary, id, code, amount) Task: Find id from categories where salary exceeds the total amount from products for the same code. SQL:
SELECT id FROM categories AS catg WHERE salary > ( SELECT SUM(amount) FROM products AS prod WHERE prod.code = catg.code );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09122
train
v1
Schema: products (alias: prod)(date, name, code, amount) projects(level, id, amount, name) Task: Select name from products where level exists in projects for the same level. SQL:
SELECT name FROM products AS prod WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.level = prod.level );
{ "outer_table": "products", "inner_table": "projects", "outer_alias": "prod", "inner_alias": "prj", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09123
train
v1
Schema: transactions (alias: txn)(level, type, code, amount) sales(id, code, name, status) Task: Find code from transactions where code appears in sales entries with matching id. SQL:
SELECT code FROM transactions AS txn WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.id = txn.id );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09124
train
v1
Schema: invoices (alias: inv)(type, value, date, amount) sales(type, salary, date, name) Task: Retrieve name from invoices whose code is found in sales rows where status matches the outer record. SQL:
SELECT name FROM invoices AS inv WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.status = inv.status );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09125
train
v3
Schema: employees (alias: emp)(amount, type, value, status) schedules(amount, level, salary, status) Task: Find code from employees where salary exceeds the maximum value from schedules for the same code. SQL:
SELECT code FROM employees AS emp WHERE salary > ( SELECT MAX(value) FROM schedules AS schd WHERE schd.code = emp.code );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09126
train
v2
Schema: transactions (alias: txn)(id, salary, type, amount) items(salary, name, date, code) Task: Find name from transactions where a matching record exists in items with the same status. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = txn.status );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "name", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09127
train
v1
Schema: orders (alias: ord)(type, code, value, salary) employees(name, value, id, level) Task: Retrieve amount from orders whose code is found in employees rows where status matches the outer record. SQL:
SELECT amount FROM orders AS ord WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.status = ord.status );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09128
train
v3
Schema: items (alias: lne)(status, value, amount, id) orders(status, date, value, level) Task: Retrieve amount from items with amount above the COUNT(value) of orders rows sharing the same level. SQL:
SELECT amount FROM items AS lne WHERE amount > ( SELECT COUNT(value) FROM orders AS ord WHERE ord.level = lne.level );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09129
train
v2
Schema: departments (alias: dept)(level, salary, name, date) requests(amount, code, type, value) Task: Find value from departments where a matching record exists in requests with the same code. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = dept.code );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "value", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09130
train
v1
Schema: accounts (alias: acct)(amount, name, level, date) tasks(id, salary, value, amount) Task: Retrieve name from accounts whose id is found in tasks rows where id matches the outer record. SQL:
SELECT name FROM accounts AS acct WHERE id IN ( SELECT id FROM tasks AS tsk WHERE tsk.id = acct.id );
{ "outer_table": "accounts", "inner_table": "tasks", "outer_alias": "acct", "inner_alias": "tsk", "proj_col": "name", "filter_col": "id", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09131
train
v3
Schema: shipments (alias: shp)(date, status, name, type) customers(status, value, name, date) Task: Find value from shipments where amount exceeds the average amount from customers for the same id. SQL:
SELECT value FROM shipments AS shp WHERE amount > ( SELECT AVG(amount) FROM customers AS cust WHERE cust.id = shp.id );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_09132
train
v1
Schema: items (alias: lne)(name, code, status, salary) orders(id, value, status, date) Task: Retrieve amount from items whose code is found in orders rows where type matches the outer record. SQL:
SELECT amount FROM items AS lne WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.type = lne.type );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09133
train
v2
Schema: tasks (alias: tsk)(status, id, date, amount) branches(salary, value, date, type) Task: Retrieve salary from tasks that have at least one corresponding entry in branches sharing the same status. SQL:
SELECT salary 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": "salary", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09134
train
v3
Schema: accounts (alias: acct)(code, salary, id, status) items(code, name, amount, type) Task: Retrieve value from accounts with value above the MIN(value) of items rows sharing the same type. SQL:
SELECT value FROM accounts AS acct WHERE value > ( SELECT MIN(value) FROM items AS lne WHERE lne.type = acct.type );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09135
train
v1
Schema: requests (alias: ordr)(name, amount, salary, status) branches(date, id, salary, value) Task: Retrieve code from requests whose status is found in branches rows where type matches the outer record. SQL:
SELECT code FROM requests AS ordr WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.type = ordr.type );
{ "outer_table": "requests", "inner_table": "branches", "outer_alias": "ordr", "inner_alias": "brc", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09136
train
v1
Schema: schedules (alias: schd)(id, date, salary, type) orders(level, value, amount, status) Task: Find code from schedules where level appears in orders entries with matching type. SQL:
SELECT code FROM schedules AS schd WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.type = schd.type );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09137
train
v2
Schema: schedules (alias: schd)(code, value, type, name) orders(code, salary, name, date) Task: Find value from schedules where a matching record exists in orders with the same id. SQL:
SELECT value 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": "value", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09138
train
v3
Schema: requests (alias: ordr)(status, amount, id, code) accounts(value, name, level, id) Task: Find name from requests where value exceeds the minimum value from accounts for the same id. SQL:
SELECT name FROM requests AS ordr WHERE value > ( SELECT MIN(value) FROM accounts AS acct WHERE acct.id = ordr.id );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09139
train
v1
Schema: categories (alias: catg)(status, id, type, name) tasks(type, value, code, name) Task: Find id from categories where status appears in tasks entries with matching type. SQL:
SELECT id FROM categories AS catg WHERE status IN ( SELECT status FROM tasks AS tsk WHERE tsk.type = catg.type );
{ "outer_table": "categories", "inner_table": "tasks", "outer_alias": "catg", "inner_alias": "tsk", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09140
train
v3
Schema: invoices (alias: inv)(code, amount, level, date) categories(type, code, status, name) Task: Retrieve code from invoices with amount above the MAX(amount) of categories rows sharing the same status. SQL:
SELECT code FROM invoices AS inv WHERE amount > ( SELECT MAX(amount) FROM categories AS catg WHERE catg.status = inv.status );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09141
train
v1
Schema: managers (alias: mgr)(type, date, salary, status) categories(value, name, status, id) Task: Find salary from managers where status appears in categories entries with matching level. SQL:
SELECT salary FROM managers AS mgr WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.level = mgr.level );
{ "outer_table": "managers", "inner_table": "categories", "outer_alias": "mgr", "inner_alias": "catg", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09142
train
v1
Schema: categories (alias: catg)(type, date, name, level) projects(date, name, type, code) Task: Retrieve name from categories whose id is found in projects rows where id matches the outer record. SQL:
SELECT name FROM categories AS catg WHERE id IN ( SELECT id FROM projects AS prj WHERE prj.id = catg.id );
{ "outer_table": "categories", "inner_table": "projects", "outer_alias": "catg", "inner_alias": "prj", "proj_col": "name", "filter_col": "id", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09143
train
v2
Schema: sales (alias: sale)(salary, date, name, level) requests(amount, name, date, code) Task: Retrieve code from sales that have at least one corresponding entry in requests sharing the same status. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = sale.status );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "code", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09144
train
v2
Schema: tasks (alias: tsk)(name, date, salary, code) employees(date, code, id, level) Task: Retrieve name from tasks that have at least one corresponding entry in employees sharing the same level. SQL:
SELECT name FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "employees", "outer_alias": "tsk", "inner_alias": "emp", "proj_col": "name", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09145
train
v2
Schema: tasks (alias: tsk)(code, salary, type, amount) employees(amount, name, level, value) Task: Retrieve amount from tasks that have at least one corresponding entry in employees sharing the same type. SQL:
SELECT amount FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "employees", "outer_alias": "tsk", "inner_alias": "emp", "proj_col": "amount", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09146
train
v3
Schema: products (alias: prod)(id, salary, status, amount) projects(level, amount, value, name) Task: Find id from products where amount exceeds the minimum amount from projects for the same type. SQL:
SELECT id FROM products AS prod WHERE amount > ( SELECT MIN(amount) FROM projects AS prj WHERE prj.type = prod.type );
{ "outer_table": "products", "inner_table": "projects", "outer_alias": "prod", "inner_alias": "prj", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09147
train
v3
Schema: schedules (alias: schd)(code, salary, status, type) categories(value, code, date, type) Task: Find value from schedules where salary exceeds the count of salary from categories for the same id. SQL:
SELECT value FROM schedules AS schd WHERE salary > ( SELECT COUNT(salary) FROM categories AS catg WHERE catg.id = schd.id );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09148
train
v2
Schema: items (alias: lne)(date, amount, value, status) customers(date, id, level, code) Task: Retrieve id from items that have at least one corresponding entry in customers sharing the same type. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = lne.type );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "id", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09149
train
v3
Schema: shipments (alias: shp)(amount, salary, name, date) requests(id, date, code, name) Task: Retrieve value from shipments with amount above the MAX(amount) of requests rows sharing the same status. SQL:
SELECT value FROM shipments AS shp WHERE amount > ( SELECT MAX(amount) FROM requests AS ordr WHERE ordr.status = shp.status );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_09150
train
v2
Schema: customers (alias: cust)(date, salary, value, code) branches(salary, code, date, type) Task: Retrieve value from customers that have at least one corresponding entry in branches sharing the same type. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = cust.type );
{ "outer_table": "customers", "inner_table": "branches", "outer_alias": "cust", "inner_alias": "brc", "proj_col": "value", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09151
train
v3
Schema: requests (alias: ordr)(date, value, name, code) shipments(amount, salary, name, id) Task: Retrieve salary from requests with amount above the MIN(amount) of shipments rows sharing the same type. SQL:
SELECT salary FROM requests AS ordr WHERE amount > ( SELECT MIN(amount) FROM shipments AS shp WHERE shp.type = ordr.type );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09152
train
v1
Schema: regions (alias: rgn)(date, amount, status, type) transactions(type, amount, name, salary) Task: Find code from regions where level appears in transactions entries with matching status. SQL:
SELECT code FROM regions AS rgn WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.status = rgn.status );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_09153
train
v3
Schema: managers (alias: mgr)(code, amount, status, salary) accounts(value, id, amount, salary) Task: Retrieve id from managers with salary above the COUNT(amount) of accounts rows sharing the same status. SQL:
SELECT id FROM managers AS mgr WHERE salary > ( SELECT COUNT(amount) FROM accounts AS acct WHERE acct.status = mgr.status );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09154
train
v1
Schema: departments (alias: dept)(id, status, name, code) sales(value, id, level, name) Task: Find id from departments where id appears in sales entries with matching level. SQL:
SELECT id FROM departments AS dept WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.level = dept.level );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09155
train
v3
Schema: staff (alias: empl)(id, status, name, amount) orders(name, code, status, amount) Task: Find id from staff where value exceeds the total amount from orders for the same status. SQL:
SELECT id FROM staff AS empl WHERE value > ( SELECT SUM(amount) FROM orders AS ord WHERE ord.status = empl.status );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09156
train
v1
Schema: requests (alias: ordr)(value, status, code, salary) schedules(amount, code, name, id) Task: Retrieve code from requests whose status is found in schedules rows where status matches the outer record. SQL:
SELECT code FROM requests AS ordr WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.status = ordr.status );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "code", "filter_col": "status", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09157
train
v1
Schema: shipments (alias: shp)(value, status, level, date) accounts(name, amount, level, id) Task: Select value from shipments where code exists in accounts for the same status. SQL:
SELECT value FROM shipments AS shp WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.status = shp.status );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_09158
train
v1
Schema: requests (alias: ordr)(type, name, date, status) sales(code, name, status, amount) Task: Find id from requests where code appears in sales entries with matching status. SQL:
SELECT id FROM requests AS ordr WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.status = ordr.status );
{ "outer_table": "requests", "inner_table": "sales", "outer_alias": "ordr", "inner_alias": "sale", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09159
train
v3
Schema: employees (alias: emp)(salary, amount, name, level) managers(status, id, name, type) Task: Find amount from employees where salary exceeds the minimum amount from managers for the same code. SQL:
SELECT amount FROM employees AS emp WHERE salary > ( SELECT MIN(amount) FROM managers AS mgr WHERE mgr.code = emp.code );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09160
train
v3
Schema: employees (alias: emp)(level, id, value, code) products(type, level, name, status) Task: Retrieve code from employees with amount above the MAX(salary) of products rows sharing the same level. SQL:
SELECT code FROM employees AS emp WHERE amount > ( SELECT MAX(salary) FROM products AS prod WHERE prod.level = emp.level );
{ "outer_table": "employees", "inner_table": "products", "outer_alias": "emp", "inner_alias": "prod", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09161
train
v3
Schema: invoices (alias: inv)(date, salary, value, id) branches(type, amount, id, date) Task: Find name from invoices where amount exceeds the maximum salary from branches for the same id. SQL:
SELECT name FROM invoices AS inv WHERE amount > ( SELECT MAX(salary) FROM branches AS brc WHERE brc.id = inv.id );
{ "outer_table": "invoices", "inner_table": "branches", "outer_alias": "inv", "inner_alias": "brc", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09162
train
v1
Schema: invoices (alias: inv)(type, level, salary, code) products(type, id, value, name) Task: Retrieve name from invoices whose id is found in products rows where code matches the outer record. SQL:
SELECT name FROM invoices AS inv WHERE id IN ( SELECT id FROM products AS prod WHERE prod.code = inv.code );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09163
train
v2
Schema: departments (alias: dept)(type, code, amount, value) staff(code, salary, status, amount) Task: Retrieve id from departments that have at least one corresponding entry in staff sharing the same code. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = dept.code );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "id", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09164
train
v2
Schema: categories (alias: catg)(value, id, amount, date) employees(level, name, date, salary) Task: Retrieve code from categories that have at least one corresponding entry in employees sharing the same level. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = catg.level );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "code", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09165
train
v3
Schema: employees (alias: emp)(name, amount, salary, id) managers(amount, salary, status, name) Task: Find code from employees where value exceeds the count of value from managers for the same status. SQL:
SELECT code FROM employees AS emp WHERE value > ( SELECT COUNT(value) FROM managers AS mgr WHERE mgr.status = emp.status );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09166
train
v1
Schema: branches (alias: brc)(status, salary, date, code) products(code, name, id, status) Task: Select value from branches where type exists in products for the same id. SQL:
SELECT value FROM branches AS brc WHERE type IN ( SELECT type FROM products AS prod WHERE prod.id = brc.id );
{ "outer_table": "branches", "inner_table": "products", "outer_alias": "brc", "inner_alias": "prod", "proj_col": "value", "filter_col": "type", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_09167
train
v1
Schema: items (alias: lne)(status, code, name, id) staff(salary, id, value, name) Task: Select id from items where level exists in staff for the same code. SQL:
SELECT id FROM items AS lne WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.code = lne.code );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09168
train
v1
Schema: regions (alias: rgn)(amount, value, code, level) sales(name, salary, amount, value) Task: Retrieve amount from regions whose status is found in sales rows where id matches the outer record. SQL:
SELECT amount FROM regions AS rgn WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.id = rgn.id );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_09169
train
v1
Schema: requests (alias: ordr)(value, name, id, code) shipments(salary, level, type, name) Task: Retrieve code from requests whose code is found in shipments rows where id matches the outer record. SQL:
SELECT code FROM requests AS ordr WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.id = ordr.id );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09170
train
v3
Schema: regions (alias: rgn)(type, name, value, amount) shipments(status, date, salary, value) Task: Find code from regions where amount exceeds the maximum amount from shipments for the same id. SQL:
SELECT code FROM regions AS rgn WHERE amount > ( SELECT MAX(amount) FROM shipments AS shp WHERE shp.id = rgn.id );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "code", "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_09171
train
v2
Schema: customers (alias: cust)(amount, type, date, status) projects(level, amount, status, date) Task: Find name from customers where a matching record exists in projects with the same type. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = cust.type );
{ "outer_table": "customers", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "prj", "proj_col": "name", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09172
train
v2
Schema: employees (alias: emp)(code, date, salary, status) accounts(type, code, status, level) Task: Retrieve salary from employees that have at least one corresponding entry in accounts sharing the same type. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = emp.type );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "salary", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09173
train
v1
Schema: tasks (alias: tsk)(level, salary, value, code) accounts(date, code, value, name) Task: Select value from tasks where code exists in accounts for the same code. SQL:
SELECT value FROM tasks AS tsk WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "accounts", "outer_alias": "tsk", "inner_alias": "acct", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09174
train
v2
Schema: invoices (alias: inv)(name, value, code, type) managers(id, amount, value, date) Task: Find amount from invoices where a matching record exists in managers with the same status. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = inv.status );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "amount", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09175
train
v1
Schema: transactions (alias: txn)(code, type, id, amount) schedules(level, salary, id, value) Task: Select name from transactions where id exists in schedules for the same type. SQL:
SELECT name FROM transactions AS txn WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.type = txn.type );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "name", "filter_col": "id", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09176
train
v3
Schema: shipments (alias: shp)(value, amount, date, status) regions(code, level, name, date) Task: Retrieve amount from shipments with amount above the COUNT(value) of regions rows sharing the same level. SQL:
SELECT amount FROM shipments AS shp WHERE amount > ( SELECT COUNT(value) FROM regions AS rgn WHERE rgn.level = shp.level );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_09177
train
v2
Schema: staff (alias: empl)(salary, level, status, amount) accounts(value, id, code, level) Task: Find value from staff where a matching record exists in accounts with the same code. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = empl.code );
{ "outer_table": "staff", "inner_table": "accounts", "outer_alias": "empl", "inner_alias": "acct", "proj_col": "value", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09178
train
v2
Schema: departments (alias: dept)(date, status, value, amount) schedules(code, value, type, date) Task: Retrieve amount from departments that have at least one corresponding entry in schedules sharing the same id. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = dept.id );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "amount", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09179
train
v3
Schema: branches (alias: brc)(code, level, date, name) employees(level, name, type, salary) Task: Find name from branches where salary exceeds the count of value from employees for the same id. SQL:
SELECT name FROM branches AS brc WHERE salary > ( SELECT COUNT(value) FROM employees AS emp WHERE emp.id = brc.id );
{ "outer_table": "branches", "inner_table": "employees", "outer_alias": "brc", "inner_alias": "emp", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_09180
train
v1
Schema: regions (alias: rgn)(name, value, status, id) employees(date, name, amount, code) Task: Select salary from regions where code exists in employees for the same type. SQL:
SELECT salary FROM regions AS rgn WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.type = rgn.type );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_09181
train
v3
Schema: projects (alias: prj)(level, value, type, status) items(type, code, date, value) Task: Find id from projects where amount exceeds the maximum amount from items for the same type. SQL:
SELECT id FROM projects AS prj WHERE amount > ( SELECT MAX(amount) FROM items AS lne WHERE lne.type = prj.type );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "lne", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_09182
train
v1
Schema: items (alias: lne)(level, type, status, salary) requests(status, level, salary, name) Task: Retrieve amount from items whose status is found in requests rows where code matches the outer record. SQL:
SELECT amount FROM items AS lne WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.code = lne.code );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "status", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09183
train
v3
Schema: projects (alias: prj)(date, value, status, name) customers(salary, value, level, amount) Task: Retrieve amount from projects with salary above the MAX(amount) of customers rows sharing the same id. SQL:
SELECT amount FROM projects AS prj WHERE salary > ( SELECT MAX(amount) FROM customers AS cust WHERE cust.id = prj.id );
{ "outer_table": "projects", "inner_table": "customers", "outer_alias": "prj", "inner_alias": "cust", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_09184
train
v3
Schema: products (alias: prod)(code, type, date, status) employees(name, id, date, code) Task: Find amount from products where value exceeds the minimum salary from employees for the same id. SQL:
SELECT amount FROM products AS prod WHERE value > ( SELECT MIN(salary) FROM employees AS emp WHERE emp.id = prod.id );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09185
train
v1
Schema: orders (alias: ord)(name, type, date, amount) employees(value, type, code, name) Task: Retrieve value from orders whose type is found in employees rows where status matches the outer record. SQL:
SELECT value FROM orders AS ord WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.status = ord.status );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09186
train
v1
Schema: accounts (alias: acct)(level, code, salary, name) branches(id, date, status, type) Task: Find amount from accounts where type appears in branches entries with matching status. SQL:
SELECT amount FROM accounts AS acct WHERE type IN ( SELECT type FROM branches AS brc WHERE brc.status = acct.status );
{ "outer_table": "accounts", "inner_table": "branches", "outer_alias": "acct", "inner_alias": "brc", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09187
train
v1
Schema: branches (alias: brc)(status, code, value, id) projects(salary, amount, type, date) Task: Retrieve id from branches whose type is found in projects rows where level matches the outer record. SQL:
SELECT id FROM branches AS brc WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.level = brc.level );
{ "outer_table": "branches", "inner_table": "projects", "outer_alias": "brc", "inner_alias": "prj", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_09188
train
v1
Schema: shipments (alias: shp)(status, code, type, amount) managers(name, id, value, status) Task: Select value from shipments where level exists in managers for the same id. SQL:
SELECT value FROM shipments AS shp WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.id = shp.id );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "value", "filter_col": "level", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_09189
train
v1
Schema: orders (alias: ord)(status, id, amount, date) transactions(date, id, type, amount) Task: Retrieve id from orders whose status is found in transactions rows where status matches the outer record. SQL:
SELECT id FROM orders AS ord WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.status = ord.status );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09190
train
v1
Schema: items (alias: lne)(name, value, code, amount) customers(level, date, name, amount) Task: Retrieve code from items whose code is found in customers rows where type matches the outer record. SQL:
SELECT code FROM items AS lne WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.type = lne.type );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "code", "filter_col": "code", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09191
train
v2
Schema: employees (alias: emp)(salary, id, level, type) staff(amount, id, date, type) Task: Retrieve code from employees that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = emp.status );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "code", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09192
train
v3
Schema: sales (alias: sale)(level, amount, name, status) invoices(date, type, name, salary) Task: Find code from sales where value exceeds the average salary from invoices for the same type. SQL:
SELECT code FROM sales AS sale WHERE value > ( SELECT AVG(salary) FROM invoices AS inv WHERE inv.type = sale.type );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09193
train
v3
Schema: projects (alias: prj)(status, value, code, date) branches(type, level, code, amount) Task: Retrieve value from projects with salary above the AVG(value) of branches rows sharing the same type. SQL:
SELECT value FROM projects AS prj WHERE salary > ( SELECT AVG(value) FROM branches AS brc WHERE brc.type = prj.type );
{ "outer_table": "projects", "inner_table": "branches", "outer_alias": "prj", "inner_alias": "brc", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_09194
train
v2
Schema: requests (alias: ordr)(id, type, date, code) shipments(name, salary, status, id) Task: Retrieve amount from requests that have at least one corresponding entry in shipments sharing the same type. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = ordr.type );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "amount", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09195
train
v1
Schema: schedules (alias: schd)(level, value, salary, id) employees(type, level, id, amount) Task: Retrieve salary from schedules whose id is found in employees rows where id matches the outer record. SQL:
SELECT salary FROM schedules AS schd WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.id = schd.id );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09196
train
v2
Schema: projects (alias: prj)(name, id, date, status) managers(amount, id, status, date) Task: Retrieve code from projects that have at least one corresponding entry in managers sharing the same code. SQL:
SELECT code FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = prj.code );
{ "outer_table": "projects", "inner_table": "managers", "outer_alias": "prj", "inner_alias": "mgr", "proj_col": "code", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_09197
train
v1
Schema: products (alias: prod)(name, level, salary, amount) accounts(salary, code, amount, value) Task: Find value from products where status appears in accounts entries with matching type. SQL:
SELECT value FROM products AS prod WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.type = prod.type );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "value", "filter_col": "status", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09198
train
v3
Schema: shipments (alias: shp)(value, type, date, amount) staff(type, status, code, salary) Task: Find value from shipments where value exceeds the average salary from staff for the same status. SQL:
SELECT value FROM shipments AS shp WHERE value > ( SELECT AVG(salary) FROM staff AS empl WHERE empl.status = shp.status );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_09199
train