variant
stringclasses
3 values
prompt
stringlengths
160
237
sql
stringlengths
102
141
metadata
unknown
token_group
stringclasses
2 values
id
stringlengths
24
24
split
stringclasses
1 value
v3
Schema: tasks (alias: tsk)(value, status, type, date) categories(name, value, salary, level) Task: Find name from tasks where amount exceeds the count of salary from categories for the same code. SQL:
SELECT name FROM tasks AS tsk WHERE amount > ( SELECT COUNT(salary) FROM categories AS catg WHERE catg.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "categories", "outer_alias": "tsk", "inner_alias": "catg", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15200
train
v3
Schema: orders (alias: ord)(level, salary, type, value) employees(value, salary, date, amount) Task: Find code from orders where value exceeds the count of salary from employees for the same id. SQL:
SELECT code FROM orders AS ord WHERE value > ( SELECT COUNT(salary) FROM employees AS emp WHERE emp.id = ord.id );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15201
train
v2
Schema: schedules (alias: schd)(amount, type, level, value) invoices(code, amount, type, id) Task: Find amount from schedules where a matching record exists in invoices with the same code. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = schd.code );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "amount", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15202
train
v1
Schema: invoices (alias: inv)(value, amount, level, type) orders(code, salary, type, value) Task: Retrieve value from invoices whose code is found in orders rows where type matches the outer record. SQL:
SELECT value FROM invoices AS inv WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.type = inv.type );
{ "outer_table": "invoices", "inner_table": "orders", "outer_alias": "inv", "inner_alias": "ord", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15203
train
v3
Schema: shipments (alias: shp)(name, type, id, salary) accounts(value, level, date, type) Task: Find id from shipments where salary exceeds the total value from accounts for the same code. SQL:
SELECT id FROM shipments AS shp WHERE salary > ( SELECT SUM(value) FROM accounts AS acct WHERE acct.code = shp.code );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15204
train
v3
Schema: invoices (alias: inv)(amount, code, type, date) schedules(value, salary, code, status) Task: Find code from invoices where value exceeds the maximum value from schedules for the same type. SQL:
SELECT code FROM invoices AS inv WHERE value > ( SELECT MAX(value) FROM schedules AS schd WHERE schd.type = inv.type );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15205
train
v3
Schema: branches (alias: brc)(status, value, level, id) accounts(value, id, level, status) Task: Find value from branches where value exceeds the average value from accounts for the same level. SQL:
SELECT value FROM branches AS brc WHERE value > ( SELECT AVG(value) FROM accounts AS acct WHERE acct.level = brc.level );
{ "outer_table": "branches", "inner_table": "accounts", "outer_alias": "brc", "inner_alias": "acct", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_15206
train
v1
Schema: products (alias: prod)(level, code, date, type) departments(value, name, id, code) Task: Select code from products where code exists in departments for the same code. SQL:
SELECT code FROM products AS prod WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.code = prod.code );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15207
train
v3
Schema: orders (alias: ord)(salary, name, value, level) departments(id, salary, name, date) Task: Find code from orders where salary exceeds the average salary from departments for the same level. SQL:
SELECT code FROM orders AS ord WHERE salary > ( SELECT AVG(salary) FROM departments AS dept WHERE dept.level = ord.level );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15208
train
v2
Schema: tasks (alias: tsk)(level, name, id, code) items(salary, date, level, value) Task: Retrieve value from tasks that have at least one corresponding entry in items sharing the same status. SQL:
SELECT value FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "items", "outer_alias": "tsk", "inner_alias": "lne", "proj_col": "value", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15209
train
v1
Schema: tasks (alias: tsk)(salary, amount, status, value) products(code, value, level, amount) Task: Find amount from tasks where code appears in products entries with matching code. SQL:
SELECT amount FROM tasks AS tsk WHERE code IN ( SELECT code FROM products AS prod WHERE prod.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "products", "outer_alias": "tsk", "inner_alias": "prod", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15210
train
v3
Schema: staff (alias: empl)(code, id, status, amount) items(code, type, level, name) Task: Retrieve id from staff with value above the MIN(value) of items rows sharing the same status. SQL:
SELECT id FROM staff AS empl WHERE value > ( SELECT MIN(value) FROM items AS lne WHERE lne.status = empl.status );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_15211
train
v2
Schema: sales (alias: sale)(salary, value, type, code) customers(amount, id, date, name) Task: Find id from sales where a matching record exists in customers with the same status. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = sale.status );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "id", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15212
train
v2
Schema: customers (alias: cust)(id, type, code, level) staff(level, value, code, date) Task: Retrieve code from customers that have at least one corresponding entry in staff sharing the same id. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = cust.id );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "code", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15213
train
v1
Schema: projects (alias: prj)(status, code, type, date) requests(name, date, salary, level) Task: Find value from projects where level appears in requests entries with matching id. SQL:
SELECT value FROM projects AS prj WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.id = prj.id );
{ "outer_table": "projects", "inner_table": "requests", "outer_alias": "prj", "inner_alias": "ordr", "proj_col": "value", "filter_col": "level", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_15214
train
v2
Schema: projects (alias: prj)(status, value, type, code) transactions(value, status, type, date) Task: Find amount from projects where a matching record exists in transactions with the same id. SQL:
SELECT amount FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = prj.id );
{ "outer_table": "projects", "inner_table": "transactions", "outer_alias": "prj", "inner_alias": "txn", "proj_col": "amount", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_15215
train
v1
Schema: branches (alias: brc)(code, salary, id, value) sales(value, type, amount, level) Task: Retrieve amount from branches whose status is found in sales rows where id matches the outer record. SQL:
SELECT amount FROM branches AS brc WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.id = brc.id );
{ "outer_table": "branches", "inner_table": "sales", "outer_alias": "brc", "inner_alias": "sale", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_15216
train
v3
Schema: accounts (alias: acct)(salary, name, status, amount) sales(type, name, salary, level) Task: Retrieve name from accounts with amount above the MAX(salary) of sales rows sharing the same status. SQL:
SELECT name FROM accounts AS acct WHERE amount > ( SELECT MAX(salary) FROM sales AS sale WHERE sale.status = acct.status );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15217
train
v1
Schema: employees (alias: emp)(value, amount, status, type) shipments(code, value, salary, level) Task: Retrieve salary from employees whose code is found in shipments rows where level matches the outer record. SQL:
SELECT salary FROM employees AS emp WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.level = emp.level );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "salary", "filter_col": "code", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15218
train
v1
Schema: schedules (alias: schd)(salary, date, level, name) requests(salary, id, value, name) Task: Find amount from schedules where type appears in requests entries with matching level. SQL:
SELECT amount FROM schedules AS schd WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.level = schd.level );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15219
train
v3
Schema: sales (alias: sale)(status, type, value, code) staff(level, salary, value, name) Task: Find code from sales where salary exceeds the minimum value from staff for the same id. SQL:
SELECT code FROM sales AS sale WHERE salary > ( SELECT MIN(value) FROM staff AS empl WHERE empl.id = sale.id );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15220
train
v3
Schema: customers (alias: cust)(status, value, name, id) employees(amount, date, salary, id) Task: Retrieve id from customers with amount above the SUM(salary) of employees rows sharing the same level. SQL:
SELECT id FROM customers AS cust WHERE amount > ( SELECT SUM(salary) FROM employees AS emp WHERE emp.level = cust.level );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15221
train
v2
Schema: tasks (alias: tsk)(amount, code, date, name) staff(level, salary, date, status) Task: Retrieve code from tasks that have at least one corresponding entry in staff sharing the same code. SQL:
SELECT code FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "staff", "outer_alias": "tsk", "inner_alias": "empl", "proj_col": "code", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15222
train
v1
Schema: projects (alias: prj)(name, value, level, id) employees(type, date, code, level) Task: Find id from projects where code appears in employees entries with matching level. SQL:
SELECT id FROM projects AS prj WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.level = prj.level );
{ "outer_table": "projects", "inner_table": "employees", "outer_alias": "prj", "inner_alias": "emp", "proj_col": "id", "filter_col": "code", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_15223
train
v3
Schema: accounts (alias: acct)(amount, date, level, name) projects(level, salary, amount, value) Task: Retrieve salary from accounts with salary above the COUNT(amount) of projects rows sharing the same code. SQL:
SELECT salary FROM accounts AS acct WHERE salary > ( SELECT COUNT(amount) FROM projects AS prj WHERE prj.code = acct.code );
{ "outer_table": "accounts", "inner_table": "projects", "outer_alias": "acct", "inner_alias": "prj", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15224
train
v2
Schema: branches (alias: brc)(date, code, status, amount) transactions(type, amount, status, name) Task: Retrieve id from branches that have at least one corresponding entry in transactions sharing the same code. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = brc.code );
{ "outer_table": "branches", "inner_table": "transactions", "outer_alias": "brc", "inner_alias": "txn", "proj_col": "id", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_15225
train
v1
Schema: products (alias: prod)(name, code, status, level) customers(level, id, name, amount) Task: Find id from products where id appears in customers entries with matching code. SQL:
SELECT id FROM products AS prod WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.code = prod.code );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "id", "filter_col": "id", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15226
train
v3
Schema: departments (alias: dept)(status, type, value, code) schedules(code, id, amount, salary) Task: Find value from departments where amount exceeds the maximum value from schedules for the same id. SQL:
SELECT value FROM departments AS dept WHERE amount > ( SELECT MAX(value) FROM schedules AS schd WHERE schd.id = dept.id );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15227
train
v3
Schema: managers (alias: mgr)(level, name, status, amount) regions(level, salary, type, id) Task: Retrieve id from managers with amount above the SUM(salary) of regions rows sharing the same status. SQL:
SELECT id FROM managers AS mgr WHERE amount > ( SELECT SUM(salary) FROM regions AS rgn WHERE rgn.status = mgr.status );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15228
train
v1
Schema: orders (alias: ord)(value, code, name, type) accounts(status, level, code, salary) Task: Select id from orders where id exists in accounts for the same type. SQL:
SELECT id FROM orders AS ord WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.type = ord.type );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15229
train
v3
Schema: departments (alias: dept)(status, date, name, id) sales(amount, type, salary, id) Task: Find salary from departments where value exceeds the average salary from sales for the same id. SQL:
SELECT salary FROM departments AS dept WHERE value > ( SELECT AVG(salary) FROM sales AS sale WHERE sale.id = dept.id );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15230
train
v3
Schema: products (alias: prod)(salary, amount, id, type) categories(level, salary, date, code) Task: Find code from products where amount exceeds the total amount from categories for the same code. SQL:
SELECT code FROM products AS prod WHERE amount > ( SELECT SUM(amount) FROM categories AS catg WHERE catg.code = prod.code );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15231
train
v2
Schema: projects (alias: prj)(salary, amount, name, id) transactions(value, amount, id, level) Task: Retrieve code from projects that have at least one corresponding entry in transactions sharing the same type. SQL:
SELECT code FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = prj.type );
{ "outer_table": "projects", "inner_table": "transactions", "outer_alias": "prj", "inner_alias": "txn", "proj_col": "code", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_15232
train
v2
Schema: schedules (alias: schd)(value, date, type, name) sales(name, status, salary, amount) Task: Retrieve name from schedules that have at least one corresponding entry in sales sharing the same type. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = schd.type );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "name", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15233
train
v1
Schema: staff (alias: empl)(level, code, amount, status) shipments(name, date, value, amount) Task: Find value from staff where status appears in shipments entries with matching status. SQL:
SELECT value FROM staff AS empl WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.status = empl.status );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_15234
train
v1
Schema: departments (alias: dept)(amount, level, salary, name) employees(date, name, id, type) Task: Retrieve salary from departments whose type is found in employees rows where code matches the outer record. SQL:
SELECT salary FROM departments AS dept WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.code = dept.code );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "salary", "filter_col": "type", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15235
train
v1
Schema: schedules (alias: schd)(amount, value, salary, level) categories(level, amount, code, status) Task: Find name from schedules where type appears in categories entries with matching id. SQL:
SELECT name FROM schedules AS schd WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.id = schd.id );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "name", "filter_col": "type", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15236
train
v3
Schema: tasks (alias: tsk)(id, salary, amount, status) items(date, code, type, status) Task: Find code from tasks where salary exceeds the minimum value from items for the same type. SQL:
SELECT code FROM tasks AS tsk WHERE salary > ( SELECT MIN(value) FROM items AS lne WHERE lne.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "items", "outer_alias": "tsk", "inner_alias": "lne", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15237
train
v1
Schema: regions (alias: rgn)(value, salary, type, amount) orders(level, amount, name, status) Task: Retrieve name from regions whose level is found in orders rows where status matches the outer record. SQL:
SELECT name FROM regions AS rgn WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.status = rgn.status );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_15238
train
v1
Schema: regions (alias: rgn)(date, salary, level, type) orders(type, date, id, code) Task: Find name from regions where level appears in orders entries with matching level. SQL:
SELECT name FROM regions AS rgn WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.level = rgn.level );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_15239
train
v1
Schema: products (alias: prod)(type, value, date, name) invoices(status, date, name, value) Task: Retrieve value from products whose code is found in invoices rows where type matches the outer record. SQL:
SELECT value FROM products AS prod WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.type = prod.type );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15240
train
v3
Schema: items (alias: lne)(code, status, type, salary) customers(date, name, id, value) Task: Retrieve salary from items with value above the MAX(salary) of customers rows sharing the same type. SQL:
SELECT salary FROM items AS lne WHERE value > ( SELECT MAX(salary) FROM customers AS cust WHERE cust.type = lne.type );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15241
train
v2
Schema: tasks (alias: tsk)(date, code, value, salary) branches(id, date, type, status) Task: Retrieve value from tasks that have at least one corresponding entry in branches sharing the same type. SQL:
SELECT value FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "branches", "outer_alias": "tsk", "inner_alias": "brc", "proj_col": "value", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15242
train
v3
Schema: schedules (alias: schd)(value, code, level, name) transactions(level, date, salary, status) Task: Find amount from schedules where value exceeds the count of amount from transactions for the same id. SQL:
SELECT amount FROM schedules AS schd WHERE value > ( SELECT COUNT(amount) FROM transactions AS txn WHERE txn.id = schd.id );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15243
train
v3
Schema: managers (alias: mgr)(status, date, value, type) orders(id, amount, code, date) Task: Retrieve value from managers with value above the SUM(salary) of orders rows sharing the same id. SQL:
SELECT value FROM managers AS mgr WHERE value > ( SELECT SUM(salary) FROM orders AS ord WHERE ord.id = mgr.id );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15244
train
v1
Schema: employees (alias: emp)(type, id, name, code) branches(type, date, name, amount) Task: Find id from employees where type appears in branches entries with matching status. SQL:
SELECT id FROM employees AS emp WHERE type IN ( SELECT type FROM branches AS brc WHERE brc.status = emp.status );
{ "outer_table": "employees", "inner_table": "branches", "outer_alias": "emp", "inner_alias": "brc", "proj_col": "id", "filter_col": "type", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15245
train
v2
Schema: schedules (alias: schd)(type, value, status, level) orders(salary, level, value, status) Task: Retrieve salary from schedules that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = schd.level );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "salary", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15246
train
v1
Schema: tasks (alias: tsk)(type, code, id, amount) projects(id, name, value, level) Task: Retrieve value from tasks whose code is found in projects rows where type matches the outer record. SQL:
SELECT value FROM tasks AS tsk WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "projects", "outer_alias": "tsk", "inner_alias": "prj", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15247
train
v3
Schema: transactions (alias: txn)(value, date, amount, id) projects(salary, status, amount, type) Task: Find salary from transactions where value exceeds the minimum value from projects for the same code. SQL:
SELECT salary FROM transactions AS txn WHERE value > ( SELECT MIN(value) FROM projects AS prj WHERE prj.code = txn.code );
{ "outer_table": "transactions", "inner_table": "projects", "outer_alias": "txn", "inner_alias": "prj", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15248
train
v3
Schema: staff (alias: empl)(level, name, id, type) orders(salary, amount, level, value) Task: Retrieve salary from staff with value above the MIN(value) of orders rows sharing the same level. SQL:
SELECT salary FROM staff AS empl WHERE value > ( SELECT MIN(value) FROM orders AS ord WHERE ord.level = empl.level );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_15249
train
v1
Schema: transactions (alias: txn)(date, name, id, level) accounts(name, id, level, amount) Task: Retrieve amount from transactions whose code is found in accounts rows where code matches the outer record. SQL:
SELECT amount FROM transactions AS txn WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.code = txn.code );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15250
train
v2
Schema: staff (alias: empl)(id, date, amount, level) invoices(code, level, status, name) Task: Retrieve id from staff that have at least one corresponding entry in invoices sharing the same code. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = empl.code );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "id", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_15251
train
v1
Schema: accounts (alias: acct)(code, level, status, date) regions(amount, id, level, name) Task: Select code from accounts where code exists in regions for the same code. SQL:
SELECT code FROM accounts AS acct WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.code = acct.code );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15252
train
v1
Schema: categories (alias: catg)(status, name, amount, id) accounts(salary, name, status, level) Task: Select salary from categories where type exists in accounts for the same level. SQL:
SELECT salary FROM categories AS catg WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.level = catg.level );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "salary", "filter_col": "type", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15253
train
v2
Schema: branches (alias: brc)(amount, date, level, id) customers(salary, date, level, id) Task: Find id from branches where a matching record exists in customers with the same code. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = brc.code );
{ "outer_table": "branches", "inner_table": "customers", "outer_alias": "brc", "inner_alias": "cust", "proj_col": "id", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_15254
train
v1
Schema: items (alias: lne)(status, code, name, value) transactions(level, id, status, name) Task: Find code from items where id appears in transactions entries with matching id. SQL:
SELECT code FROM items AS lne WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.id = lne.id );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "code", "filter_col": "id", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15255
train
v1
Schema: items (alias: lne)(level, type, name, code) customers(status, salary, level, name) Task: Retrieve amount from items whose id is found in customers rows where code matches the outer record. SQL:
SELECT amount FROM items AS lne WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.code = lne.code );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15256
train
v3
Schema: projects (alias: prj)(date, name, id, amount) staff(amount, status, type, value) Task: Find salary from projects where value exceeds the total amount from staff for the same type. SQL:
SELECT salary FROM projects AS prj WHERE value > ( SELECT SUM(amount) FROM staff AS empl WHERE empl.type = prj.type );
{ "outer_table": "projects", "inner_table": "staff", "outer_alias": "prj", "inner_alias": "empl", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_15257
train
v1
Schema: requests (alias: ordr)(type, amount, id, salary) sales(level, status, salary, id) Task: Find salary from requests where id appears in sales entries with matching code. SQL:
SELECT salary FROM requests AS ordr WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.code = ordr.code );
{ "outer_table": "requests", "inner_table": "sales", "outer_alias": "ordr", "inner_alias": "sale", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_15258
train
v3
Schema: accounts (alias: acct)(name, id, date, status) items(code, value, salary, amount) Task: Find salary from accounts where value exceeds the total amount from items for the same type. SQL:
SELECT salary FROM accounts AS acct WHERE value > ( SELECT SUM(amount) FROM items AS lne WHERE lne.type = acct.type );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15259
train
v3
Schema: customers (alias: cust)(id, type, value, code) projects(amount, status, type, code) Task: Find name from customers where salary exceeds the count of salary from projects for the same level. SQL:
SELECT name FROM customers AS cust WHERE salary > ( SELECT COUNT(salary) FROM projects AS prj WHERE prj.level = cust.level );
{ "outer_table": "customers", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "prj", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15260
train
v1
Schema: branches (alias: brc)(type, status, value, level) projects(type, salary, name, id) Task: Select salary from branches where code exists in projects for the same code. SQL:
SELECT salary FROM branches AS brc WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.code = brc.code );
{ "outer_table": "branches", "inner_table": "projects", "outer_alias": "brc", "inner_alias": "prj", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_15261
train
v2
Schema: orders (alias: ord)(status, value, type, name) customers(name, value, amount, salary) Task: Find amount from orders where a matching record exists in customers with the same level. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = ord.level );
{ "outer_table": "orders", "inner_table": "customers", "outer_alias": "ord", "inner_alias": "cust", "proj_col": "amount", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15262
train
v2
Schema: managers (alias: mgr)(salary, type, status, amount) projects(salary, id, date, value) Task: Retrieve name from managers that have at least one corresponding entry in projects sharing the same code. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.code = mgr.code );
{ "outer_table": "managers", "inner_table": "projects", "outer_alias": "mgr", "inner_alias": "prj", "proj_col": "name", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15263
train
v2
Schema: branches (alias: brc)(id, code, amount, date) managers(status, salary, level, id) Task: Find amount from branches where a matching record exists in managers with the same status. SQL:
SELECT amount FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = brc.status );
{ "outer_table": "branches", "inner_table": "managers", "outer_alias": "brc", "inner_alias": "mgr", "proj_col": "amount", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_15264
train
v3
Schema: managers (alias: mgr)(value, status, type, amount) employees(value, code, name, salary) Task: Retrieve value from managers with salary above the AVG(value) of employees rows sharing the same id. SQL:
SELECT value FROM managers AS mgr WHERE salary > ( SELECT AVG(value) FROM employees AS emp WHERE emp.id = mgr.id );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15265
train
v1
Schema: branches (alias: brc)(status, date, value, code) managers(value, code, date, status) Task: Select amount from branches where type exists in managers for the same status. SQL:
SELECT amount FROM branches AS brc WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.status = brc.status );
{ "outer_table": "branches", "inner_table": "managers", "outer_alias": "brc", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_15266
train
v3
Schema: managers (alias: mgr)(name, id, code, amount) transactions(name, date, value, type) Task: Retrieve code from managers with value above the MAX(value) of transactions rows sharing the same type. SQL:
SELECT code FROM managers AS mgr WHERE value > ( SELECT MAX(value) FROM transactions AS txn WHERE txn.type = mgr.type );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15267
train
v2
Schema: projects (alias: prj)(code, status, id, date) departments(salary, status, id, level) Task: Find salary from projects where a matching record exists in departments with the same code. SQL:
SELECT salary FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = prj.code );
{ "outer_table": "projects", "inner_table": "departments", "outer_alias": "prj", "inner_alias": "dept", "proj_col": "salary", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_15268
train
v2
Schema: managers (alias: mgr)(amount, value, id, level) customers(level, value, date, id) Task: Find name from managers where a matching record exists in customers with the same code. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = mgr.code );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "name", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15269
train
v1
Schema: items (alias: lne)(date, name, status, level) transactions(date, salary, type, value) Task: Select salary from items where type exists in transactions for the same level. SQL:
SELECT salary FROM items AS lne WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.level = lne.level );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "salary", "filter_col": "type", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15270
train
v1
Schema: schedules (alias: schd)(amount, level, code, id) products(value, salary, level, status) Task: Find name from schedules where level appears in products entries with matching status. SQL:
SELECT name FROM schedules AS schd WHERE level IN ( SELECT level FROM products AS prod WHERE prod.status = schd.status );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15271
train
v2
Schema: projects (alias: prj)(type, amount, date, status) regions(id, value, level, salary) Task: Retrieve name from projects that have at least one corresponding entry in regions sharing the same id. SQL:
SELECT name FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = prj.id );
{ "outer_table": "projects", "inner_table": "regions", "outer_alias": "prj", "inner_alias": "rgn", "proj_col": "name", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_15272
train
v3
Schema: transactions (alias: txn)(salary, name, amount, status) accounts(code, type, salary, amount) Task: Retrieve amount from transactions with amount above the COUNT(amount) of accounts rows sharing the same code. SQL:
SELECT amount FROM transactions AS txn WHERE amount > ( SELECT COUNT(amount) FROM accounts AS acct WHERE acct.code = txn.code );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15273
train
v2
Schema: schedules (alias: schd)(amount, code, name, type) customers(code, type, amount, id) Task: Find value from schedules where a matching record exists in customers with the same level. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = schd.level );
{ "outer_table": "schedules", "inner_table": "customers", "outer_alias": "schd", "inner_alias": "cust", "proj_col": "value", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15274
train
v2
Schema: customers (alias: cust)(date, name, amount, level) schedules(amount, date, value, salary) Task: Find name from customers where a matching record exists in schedules with the same type. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = cust.type );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "name", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15275
train
v2
Schema: employees (alias: emp)(date, id, status, amount) shipments(status, salary, name, date) Task: Retrieve id from employees that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = emp.status );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "id", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15276
train
v3
Schema: orders (alias: ord)(amount, type, code, id) accounts(value, status, salary, id) Task: Retrieve id from orders with amount above the MIN(salary) of accounts rows sharing the same id. SQL:
SELECT id FROM orders AS ord WHERE amount > ( SELECT MIN(salary) FROM accounts AS acct WHERE acct.id = ord.id );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15277
train
v2
Schema: invoices (alias: inv)(level, type, salary, name) accounts(level, date, code, status) Task: Find amount from invoices where a matching record exists in accounts with the same status. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = inv.status );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "amount", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15278
train
v3
Schema: branches (alias: brc)(type, value, name, code) products(salary, id, level, type) Task: Retrieve value from branches with amount above the MIN(salary) of products rows sharing the same id. SQL:
SELECT value FROM branches AS brc WHERE amount > ( SELECT MIN(salary) 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": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_15279
train
v3
Schema: schedules (alias: schd)(type, amount, code, value) projects(date, amount, name, type) Task: Retrieve amount from schedules with amount above the MIN(salary) of projects rows sharing the same level. SQL:
SELECT amount FROM schedules AS schd WHERE amount > ( SELECT MIN(salary) FROM projects AS prj WHERE prj.level = schd.level );
{ "outer_table": "schedules", "inner_table": "projects", "outer_alias": "schd", "inner_alias": "prj", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15280
train
v3
Schema: categories (alias: catg)(level, value, amount, type) items(id, amount, salary, level) Task: Find salary from categories where amount exceeds the maximum salary from items for the same id. SQL:
SELECT salary FROM categories AS catg WHERE amount > ( SELECT MAX(salary) FROM items AS lne WHERE lne.id = catg.id );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15281
train
v2
Schema: orders (alias: ord)(code, value, type, status) branches(type, name, id, date) Task: Find value from orders where a matching record exists in branches with the same status. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.status = ord.status );
{ "outer_table": "orders", "inner_table": "branches", "outer_alias": "ord", "inner_alias": "brc", "proj_col": "value", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15282
train
v1
Schema: staff (alias: empl)(type, salary, id, status) products(date, id, code, status) Task: Retrieve name from staff whose status is found in products rows where level matches the outer record. SQL:
SELECT name FROM staff AS empl WHERE status IN ( SELECT status FROM products AS prod WHERE prod.level = empl.level );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_15283
train
v1
Schema: projects (alias: prj)(salary, type, name, date) regions(status, name, amount, level) Task: Find code from projects where type appears in regions entries with matching id. SQL:
SELECT code FROM projects AS prj WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.id = prj.id );
{ "outer_table": "projects", "inner_table": "regions", "outer_alias": "prj", "inner_alias": "rgn", "proj_col": "code", "filter_col": "type", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_15284
train
v3
Schema: transactions (alias: txn)(salary, value, status, level) products(date, code, salary, name) Task: Find salary from transactions where amount exceeds the count of amount from products for the same type. SQL:
SELECT salary FROM transactions AS txn WHERE amount > ( SELECT COUNT(amount) FROM products AS prod WHERE prod.type = txn.type );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15285
train
v3
Schema: products (alias: prod)(date, value, name, type) categories(id, status, value, date) Task: Retrieve name from products with value above the AVG(value) of categories rows sharing the same code. SQL:
SELECT name FROM products AS prod WHERE value > ( SELECT AVG(value) FROM categories AS catg WHERE catg.code = prod.code );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15286
train
v3
Schema: products (alias: prod)(type, id, amount, date) shipments(id, amount, salary, code) Task: Retrieve salary from products with salary above the MIN(amount) of shipments rows sharing the same status. SQL:
SELECT salary FROM products AS prod WHERE salary > ( SELECT MIN(amount) FROM shipments AS shp WHERE shp.status = prod.status );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15287
train
v2
Schema: sales (alias: sale)(id, amount, code, date) customers(salary, amount, date, code) Task: Find salary from sales where a matching record exists in customers with the same level. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = sale.level );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "salary", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15288
train
v1
Schema: schedules (alias: schd)(name, status, level, id) projects(date, id, amount, status) Task: Find id from schedules where status appears in projects entries with matching status. SQL:
SELECT id FROM schedules AS schd WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.status = schd.status );
{ "outer_table": "schedules", "inner_table": "projects", "outer_alias": "schd", "inner_alias": "prj", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15289
train
v1
Schema: accounts (alias: acct)(type, name, salary, level) sales(code, status, amount, date) Task: Retrieve id from accounts whose level is found in sales rows where status matches the outer record. SQL:
SELECT id FROM accounts AS acct WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.status = acct.status );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15290
train
v3
Schema: projects (alias: prj)(amount, name, id, code) invoices(value, status, name, code) Task: Find salary from projects where salary exceeds the minimum value from invoices for the same code. SQL:
SELECT salary FROM projects AS prj WHERE salary > ( SELECT MIN(value) FROM invoices AS inv WHERE inv.code = prj.code );
{ "outer_table": "projects", "inner_table": "invoices", "outer_alias": "prj", "inner_alias": "inv", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_15291
train
v1
Schema: managers (alias: mgr)(level, value, name, status) projects(id, name, date, type) Task: Select id from managers where id exists in projects for the same level. SQL:
SELECT id FROM managers AS mgr WHERE id IN ( SELECT id FROM projects AS prj WHERE prj.level = mgr.level );
{ "outer_table": "managers", "inner_table": "projects", "outer_alias": "mgr", "inner_alias": "prj", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15292
train
v2
Schema: departments (alias: dept)(salary, status, code, name) staff(code, type, name, id) Task: Find id from departments where a matching record exists in staff with the same status. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = dept.status );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "id", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15293
train
v1
Schema: requests (alias: ordr)(level, status, id, type) employees(date, type, name, id) Task: Find salary from requests where code appears in employees entries with matching code. SQL:
SELECT salary FROM requests AS ordr WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.code = ordr.code );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_15294
train
v2
Schema: accounts (alias: acct)(type, status, id, level) departments(type, amount, date, salary) Task: Find code from accounts where a matching record exists in departments with the same status. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = acct.status );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "code", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15295
train
v1
Schema: shipments (alias: shp)(amount, id, salary, code) projects(salary, level, code, date) Task: Select code from shipments where type exists in projects for the same status. SQL:
SELECT code FROM shipments AS shp WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.status = shp.status );
{ "outer_table": "shipments", "inner_table": "projects", "outer_alias": "shp", "inner_alias": "prj", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15296
train
v1
Schema: orders (alias: ord)(salary, id, date, amount) shipments(code, id, value, status) Task: Retrieve id from orders whose code is found in shipments rows where id matches the outer record. SQL:
SELECT id FROM orders AS ord WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.id = ord.id );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "id", "filter_col": "code", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15297
train
v2
Schema: employees (alias: emp)(type, status, amount, name) shipments(name, status, id, type) Task: Find code from employees where a matching record exists in shipments with the same type. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = emp.type );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "code", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15298
train
v3
Schema: schedules (alias: schd)(name, id, level, value) tasks(code, value, amount, name) Task: Find name from schedules where amount exceeds the average amount from tasks for the same code. SQL:
SELECT name FROM schedules AS schd WHERE amount > ( SELECT AVG(amount) FROM tasks AS tsk WHERE tsk.code = schd.code );
{ "outer_table": "schedules", "inner_table": "tasks", "outer_alias": "schd", "inner_alias": "tsk", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15299
train