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: departments (alias: dept)(code, date, status, value) customers(name, level, type, id) Task: Find salary from departments where salary exceeds the count of amount from customers for the same id. SQL:
SELECT salary FROM departments AS dept WHERE salary > ( SELECT COUNT(amount) FROM customers AS cust WHERE cust.id = dept.id );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11200
train
v3
Schema: projects (alias: prj)(name, status, value, id) departments(id, level, status, value) Task: Find id from projects where salary exceeds the minimum salary from departments for the same code. SQL:
SELECT id FROM projects AS prj WHERE salary > ( SELECT MIN(salary) FROM departments AS dept WHERE dept.code = prj.code );
{ "outer_table": "projects", "inner_table": "departments", "outer_alias": "prj", "inner_alias": "dept", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_11201
train
v2
Schema: customers (alias: cust)(amount, value, salary, level) managers(name, code, value, level) Task: Retrieve value from customers that have at least one corresponding entry in managers sharing the same id. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = cust.id );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "value", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11202
train
v2
Schema: customers (alias: cust)(value, level, salary, name) departments(id, name, type, code) Task: Retrieve id from customers that have at least one corresponding entry in departments sharing the same type. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = cust.type );
{ "outer_table": "customers", "inner_table": "departments", "outer_alias": "cust", "inner_alias": "dept", "proj_col": "id", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11203
train
v1
Schema: managers (alias: mgr)(date, code, type, status) employees(level, type, status, value) Task: Select value from managers where id exists in employees for the same type. SQL:
SELECT value FROM managers AS mgr WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.type = mgr.type );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11204
train
v3
Schema: schedules (alias: schd)(code, status, date, type) regions(date, amount, level, status) Task: Find name from schedules where salary exceeds the average value from regions for the same id. SQL:
SELECT name FROM schedules AS schd WHERE salary > ( SELECT AVG(value) FROM regions AS rgn WHERE rgn.id = schd.id );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11205
train
v1
Schema: requests (alias: ordr)(amount, date, level, name) regions(code, type, name, date) Task: Select salary from requests where id exists in regions for the same status. SQL:
SELECT salary FROM requests AS ordr WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.status = ordr.status );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_11206
train
v2
Schema: regions (alias: rgn)(level, date, code, salary) sales(name, level, id, value) Task: Find code from regions where a matching record exists in sales with the same type. SQL:
SELECT code FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = rgn.type );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "code", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_11207
train
v2
Schema: transactions (alias: txn)(code, status, date, value) sales(value, date, type, salary) Task: Retrieve name from transactions that have at least one corresponding entry in sales sharing the same type. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = txn.type );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "name", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11208
train
v2
Schema: departments (alias: dept)(status, salary, amount, name) products(status, salary, date, type) Task: Retrieve code from departments that have at least one corresponding entry in products sharing the same status. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = dept.status );
{ "outer_table": "departments", "inner_table": "products", "outer_alias": "dept", "inner_alias": "prod", "proj_col": "code", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11209
train
v1
Schema: regions (alias: rgn)(date, code, name, salary) categories(name, type, amount, code) Task: Find id from regions where level appears in categories entries with matching level. SQL:
SELECT id FROM regions AS rgn WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.level = rgn.level );
{ "outer_table": "regions", "inner_table": "categories", "outer_alias": "rgn", "inner_alias": "catg", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_11210
train
v3
Schema: categories (alias: catg)(name, date, salary, code) tasks(status, value, level, id) Task: Retrieve amount from categories with value above the SUM(value) of tasks rows sharing the same id. SQL:
SELECT amount FROM categories AS catg WHERE value > ( SELECT SUM(value) FROM tasks AS tsk WHERE tsk.id = catg.id );
{ "outer_table": "categories", "inner_table": "tasks", "outer_alias": "catg", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11211
train
v1
Schema: requests (alias: ordr)(date, amount, value, code) items(id, name, amount, value) Task: Select value from requests where type exists in items for the same code. SQL:
SELECT value FROM requests AS ordr WHERE type IN ( SELECT type FROM items AS lne WHERE lne.code = ordr.code );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_11212
train
v1
Schema: accounts (alias: acct)(type, level, amount, id) transactions(salary, status, type, value) Task: Find name from accounts where type appears in transactions entries with matching level. SQL:
SELECT name FROM accounts AS acct WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.level = acct.level );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11213
train
v2
Schema: categories (alias: catg)(status, type, level, date) invoices(value, code, level, id) Task: Find salary from categories where a matching record exists in invoices with the same id. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = catg.id );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "salary", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11214
train
v3
Schema: managers (alias: mgr)(type, name, value, salary) products(value, name, type, status) Task: Retrieve code from managers with amount above the AVG(salary) of products rows sharing the same code. SQL:
SELECT code FROM managers AS mgr WHERE amount > ( SELECT AVG(salary) FROM products AS prod WHERE prod.code = mgr.code );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11215
train
v2
Schema: customers (alias: cust)(level, name, date, type) projects(level, value, name, type) Task: Retrieve name from customers that have at least one corresponding entry in projects sharing 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_11216
train
v3
Schema: shipments (alias: shp)(salary, type, id, level) regions(code, name, salary, date) Task: Find amount from shipments where amount exceeds the maximum amount from regions for the same type. SQL:
SELECT amount FROM shipments AS shp WHERE amount > ( SELECT MAX(amount) FROM regions AS rgn WHERE rgn.type = shp.type );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_11217
train
v1
Schema: departments (alias: dept)(amount, type, salary, value) customers(code, date, level, status) Task: Find value from departments where level appears in customers entries with matching code. SQL:
SELECT value FROM departments AS dept WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.code = dept.code );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11218
train
v1
Schema: orders (alias: ord)(date, name, type, code) products(code, id, level, status) Task: Select code from orders where level exists in products for the same level. SQL:
SELECT code FROM orders AS ord WHERE level IN ( SELECT level FROM products AS prod WHERE prod.level = ord.level );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "code", "filter_col": "level", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11219
train
v3
Schema: invoices (alias: inv)(date, name, type, code) regions(level, name, amount, date) Task: Retrieve value from invoices with salary above the SUM(salary) of regions rows sharing the same code. SQL:
SELECT value FROM invoices AS inv WHERE salary > ( SELECT SUM(salary) FROM regions AS rgn WHERE rgn.code = inv.code );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11220
train
v2
Schema: categories (alias: catg)(type, level, status, code) products(amount, value, id, status) Task: Find amount from categories where a matching record exists in products with the same status. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = catg.status );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "amount", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11221
train
v3
Schema: schedules (alias: schd)(amount, level, date, salary) regions(salary, level, name, amount) Task: Retrieve code from schedules with amount above the MAX(value) of regions rows sharing the same type. SQL:
SELECT code FROM schedules AS schd WHERE amount > ( SELECT MAX(value) FROM regions AS rgn WHERE rgn.type = schd.type );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11222
train
v3
Schema: invoices (alias: inv)(date, name, status, code) shipments(status, name, value, code) Task: Retrieve code from invoices with salary above the MAX(salary) of shipments rows sharing the same code. SQL:
SELECT code FROM invoices AS inv WHERE salary > ( SELECT MAX(salary) FROM shipments AS shp WHERE shp.code = inv.code );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11223
train
v3
Schema: managers (alias: mgr)(id, amount, date, level) branches(salary, type, amount, code) Task: Find id from managers where value exceeds the maximum salary from branches for the same type. SQL:
SELECT id FROM managers AS mgr WHERE value > ( SELECT MAX(salary) FROM branches AS brc WHERE brc.type = mgr.type );
{ "outer_table": "managers", "inner_table": "branches", "outer_alias": "mgr", "inner_alias": "brc", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11224
train
v2
Schema: products (alias: prod)(value, type, status, code) staff(date, code, type, id) Task: Find id from products where a matching record exists in staff with the same id. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = prod.id );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "id", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11225
train
v2
Schema: branches (alias: brc)(salary, date, name, amount) departments(value, amount, name, code) Task: Find salary from branches where a matching record exists in departments with the same type. SQL:
SELECT salary FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = brc.type );
{ "outer_table": "branches", "inner_table": "departments", "outer_alias": "brc", "inner_alias": "dept", "proj_col": "salary", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_11226
train
v2
Schema: managers (alias: mgr)(salary, level, code, type) categories(amount, id, status, name) Task: Find name from managers where a matching record exists in categories with the same id. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = mgr.id );
{ "outer_table": "managers", "inner_table": "categories", "outer_alias": "mgr", "inner_alias": "catg", "proj_col": "name", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11227
train
v3
Schema: shipments (alias: shp)(id, value, name, date) transactions(status, salary, id, date) Task: Find code from shipments where value exceeds the average salary from transactions for the same id. SQL:
SELECT code FROM shipments AS shp WHERE value > ( SELECT AVG(salary) FROM transactions AS txn WHERE txn.id = shp.id );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_11228
train
v2
Schema: products (alias: prod)(date, id, level, amount) shipments(date, status, value, code) Task: Find code from products where a matching record exists in shipments with the same level. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = prod.level );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "code", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11229
train
v3
Schema: sales (alias: sale)(value, level, code, salary) orders(id, amount, type, code) Task: Find name from sales where value exceeds the minimum value from orders for the same level. SQL:
SELECT name FROM sales AS sale WHERE value > ( SELECT MIN(value) FROM orders AS ord WHERE ord.level = sale.level );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11230
train
v1
Schema: tasks (alias: tsk)(date, salary, code, level) shipments(date, salary, level, code) Task: Find value from tasks where status appears in shipments entries with matching id. SQL:
SELECT value FROM tasks AS tsk WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "shipments", "outer_alias": "tsk", "inner_alias": "shp", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_11231
train
v2
Schema: departments (alias: dept)(name, date, type, level) accounts(amount, type, id, value) Task: Find amount from departments where a matching record exists in accounts with the same code. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = dept.code );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "amount", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11232
train
v1
Schema: orders (alias: ord)(type, name, level, amount) products(date, code, level, id) Task: Find name from orders where status appears in products entries with matching code. SQL:
SELECT name FROM orders AS ord WHERE status IN ( SELECT status FROM products AS prod WHERE prod.code = ord.code );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11233
train
v1
Schema: invoices (alias: inv)(salary, id, date, value) orders(status, amount, name, value) Task: Retrieve amount from invoices whose id is found in orders rows where id matches the outer record. SQL:
SELECT amount FROM invoices AS inv WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.id = inv.id );
{ "outer_table": "invoices", "inner_table": "orders", "outer_alias": "inv", "inner_alias": "ord", "proj_col": "amount", "filter_col": "id", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11234
train
v3
Schema: invoices (alias: inv)(salary, value, type, level) schedules(value, status, salary, date) Task: Retrieve value from invoices with amount above the MAX(value) of schedules rows sharing the same status. SQL:
SELECT value FROM invoices AS inv WHERE amount > ( SELECT MAX(value) FROM schedules AS schd WHERE schd.status = inv.status );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11235
train
v3
Schema: accounts (alias: acct)(type, level, value, id) branches(code, date, id, salary) Task: Retrieve amount from accounts with salary above the MAX(value) of branches rows sharing the same code. SQL:
SELECT amount FROM accounts AS acct WHERE salary > ( SELECT MAX(value) FROM branches AS brc WHERE brc.code = acct.code );
{ "outer_table": "accounts", "inner_table": "branches", "outer_alias": "acct", "inner_alias": "brc", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11236
train
v1
Schema: accounts (alias: acct)(amount, code, date, status) branches(amount, date, salary, type) Task: Select amount from accounts where code exists in branches for the same id. SQL:
SELECT amount FROM accounts AS acct WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.id = acct.id );
{ "outer_table": "accounts", "inner_table": "branches", "outer_alias": "acct", "inner_alias": "brc", "proj_col": "amount", "filter_col": "code", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11237
train
v2
Schema: employees (alias: emp)(value, date, status, level) customers(id, type, status, value) Task: Retrieve name from employees that have at least one corresponding entry in customers sharing the same level. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = emp.level );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "name", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11238
train
v1
Schema: items (alias: lne)(amount, status, name, value) projects(status, salary, date, id) Task: Retrieve value from items whose status is found in projects rows where level matches the outer record. SQL:
SELECT value FROM items AS lne WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.level = lne.level );
{ "outer_table": "items", "inner_table": "projects", "outer_alias": "lne", "inner_alias": "prj", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_11239
train
v1
Schema: managers (alias: mgr)(amount, id, date, level) regions(code, value, id, type) Task: Retrieve name from managers whose type is found in regions rows where status matches the outer record. SQL:
SELECT name FROM managers AS mgr WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.status = mgr.status );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "name", "filter_col": "type", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11240
train
v1
Schema: sales (alias: sale)(type, status, name, level) customers(id, type, code, date) Task: Retrieve code from sales whose code is found in customers rows where code matches the outer record. SQL:
SELECT code FROM sales AS sale WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.code = sale.code );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11241
train
v3
Schema: employees (alias: emp)(date, value, salary, id) projects(code, level, status, name) Task: Retrieve amount from employees with salary above the AVG(value) of projects rows sharing the same code. SQL:
SELECT amount FROM employees AS emp WHERE salary > ( SELECT AVG(value) FROM projects AS prj WHERE prj.code = emp.code );
{ "outer_table": "employees", "inner_table": "projects", "outer_alias": "emp", "inner_alias": "prj", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11242
train
v3
Schema: invoices (alias: inv)(code, type, date, status) products(code, value, id, status) Task: Retrieve value from invoices with amount above the SUM(salary) of products rows sharing the same level. SQL:
SELECT value FROM invoices AS inv WHERE amount > ( SELECT SUM(salary) FROM products AS prod WHERE prod.level = inv.level );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11243
train
v3
Schema: employees (alias: emp)(id, name, type, salary) accounts(value, status, date, name) Task: Find value from employees where value exceeds the minimum salary from accounts for the same status. SQL:
SELECT value FROM employees AS emp WHERE value > ( SELECT MIN(salary) FROM accounts AS acct WHERE acct.status = emp.status );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11244
train
v3
Schema: departments (alias: dept)(name, level, code, type) invoices(date, amount, id, name) Task: Find salary from departments where value exceeds the total amount from invoices for the same status. SQL:
SELECT salary FROM departments AS dept WHERE value > ( SELECT SUM(amount) FROM invoices AS inv WHERE inv.status = dept.status );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11245
train
v2
Schema: tasks (alias: tsk)(value, salary, code, date) staff(id, name, date, value) Task: Find salary from tasks where a matching record exists in staff with the same id. SQL:
SELECT salary FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "staff", "outer_alias": "tsk", "inner_alias": "empl", "proj_col": "salary", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_11246
train
v3
Schema: products (alias: prod)(value, date, type, salary) orders(type, code, salary, status) Task: Retrieve salary from products with value above the SUM(amount) of orders rows sharing the same id. SQL:
SELECT salary FROM products AS prod WHERE value > ( SELECT SUM(amount) FROM orders AS ord WHERE ord.id = prod.id );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11247
train
v1
Schema: orders (alias: ord)(status, date, type, id) items(amount, salary, name, type) Task: Retrieve name from orders whose code is found in items rows where status matches the outer record. SQL:
SELECT name FROM orders AS ord WHERE code IN ( SELECT code FROM items AS lne WHERE lne.status = ord.status );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11248
train
v2
Schema: departments (alias: dept)(date, type, id, code) customers(type, date, code, status) Task: Retrieve amount from departments that have at least one corresponding entry in customers sharing the same id. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = dept.id );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "amount", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11249
train
v2
Schema: managers (alias: mgr)(value, salary, amount, code) requests(value, name, code, salary) Task: Find name from managers where a matching record exists in requests with the same level. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = mgr.level );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "name", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11250
train
v3
Schema: staff (alias: empl)(code, salary, value, id) requests(level, amount, status, value) Task: Find id from staff where amount exceeds the maximum salary from requests for the same status. SQL:
SELECT id FROM staff AS empl WHERE amount > ( SELECT MAX(salary) FROM requests AS ordr WHERE ordr.status = empl.status );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_11251
train
v1
Schema: customers (alias: cust)(type, name, code, amount) tasks(code, name, level, type) Task: Retrieve salary from customers whose level is found in tasks rows where code matches the outer record. SQL:
SELECT salary FROM customers AS cust WHERE level IN ( SELECT level FROM tasks AS tsk WHERE tsk.code = cust.code );
{ "outer_table": "customers", "inner_table": "tasks", "outer_alias": "cust", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "level", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11252
train
v1
Schema: branches (alias: brc)(status, id, salary, date) categories(name, type, date, status) Task: Select name from branches where status exists in categories for the same level. SQL:
SELECT name FROM branches AS brc WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.level = brc.level );
{ "outer_table": "branches", "inner_table": "categories", "outer_alias": "brc", "inner_alias": "catg", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_11253
train
v3
Schema: staff (alias: empl)(type, name, level, amount) branches(type, id, amount, value) Task: Find salary from staff where salary exceeds the minimum amount from branches for the same status. SQL:
SELECT salary FROM staff AS empl WHERE salary > ( SELECT MIN(amount) FROM branches AS brc WHERE brc.status = empl.status );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_11254
train
v2
Schema: projects (alias: prj)(amount, date, level, salary) invoices(name, level, type, salary) Task: Retrieve value from projects that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT value FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = prj.type );
{ "outer_table": "projects", "inner_table": "invoices", "outer_alias": "prj", "inner_alias": "inv", "proj_col": "value", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_11255
train
v2
Schema: branches (alias: brc)(name, value, amount, date) requests(level, date, code, value) Task: Retrieve code from branches that have at least one corresponding entry in requests sharing the same id. SQL:
SELECT code FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = brc.id );
{ "outer_table": "branches", "inner_table": "requests", "outer_alias": "brc", "inner_alias": "ordr", "proj_col": "code", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_11256
train
v3
Schema: transactions (alias: txn)(code, date, value, amount) sales(level, date, value, code) Task: Find amount from transactions where salary exceeds the minimum amount from sales for the same status. SQL:
SELECT amount FROM transactions AS txn WHERE salary > ( SELECT MIN(amount) FROM sales AS sale WHERE sale.status = txn.status );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11257
train
v1
Schema: managers (alias: mgr)(level, amount, code, value) tasks(value, date, code, type) Task: Find amount from managers where code appears in tasks entries with matching status. SQL:
SELECT amount FROM managers AS mgr WHERE code IN ( SELECT code FROM tasks AS tsk WHERE tsk.status = mgr.status );
{ "outer_table": "managers", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11258
train
v2
Schema: items (alias: lne)(amount, level, status, id) products(date, salary, name, level) Task: Find value from items where a matching record exists in products with the same status. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = lne.status );
{ "outer_table": "items", "inner_table": "products", "outer_alias": "lne", "inner_alias": "prod", "proj_col": "value", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_11259
train
v2
Schema: staff (alias: empl)(amount, level, value, name) employees(name, salary, type, id) Task: Retrieve value from staff that have at least one corresponding entry in employees sharing the same code. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = empl.code );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "value", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_11260
train
v3
Schema: branches (alias: brc)(id, type, date, value) departments(type, level, name, status) Task: Retrieve id from branches with value above the MIN(value) of departments rows sharing the same id. SQL:
SELECT id FROM branches AS brc WHERE value > ( SELECT MIN(value) FROM departments AS dept WHERE dept.id = brc.id );
{ "outer_table": "branches", "inner_table": "departments", "outer_alias": "brc", "inner_alias": "dept", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_11261
train
v2
Schema: regions (alias: rgn)(name, amount, type, date) tasks(date, id, level, amount) Task: Find name from regions where a matching record exists in tasks with the same type. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.type = rgn.type );
{ "outer_table": "regions", "inner_table": "tasks", "outer_alias": "rgn", "inner_alias": "tsk", "proj_col": "name", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_11262
train
v3
Schema: invoices (alias: inv)(id, amount, type, date) staff(date, name, amount, status) Task: Retrieve salary from invoices with salary above the SUM(amount) of staff rows sharing the same level. SQL:
SELECT salary FROM invoices AS inv WHERE salary > ( SELECT SUM(amount) FROM staff AS empl WHERE empl.level = inv.level );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11263
train
v1
Schema: managers (alias: mgr)(status, amount, code, type) staff(salary, name, code, amount) Task: Find code from managers where id appears in staff entries with matching id. SQL:
SELECT code FROM managers AS mgr WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.id = mgr.id );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "code", "filter_col": "id", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11264
train
v2
Schema: projects (alias: prj)(id, name, value, status) customers(type, salary, code, id) Task: Find value from projects where a matching record exists in customers with the same type. SQL:
SELECT value FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = prj.type );
{ "outer_table": "projects", "inner_table": "customers", "outer_alias": "prj", "inner_alias": "cust", "proj_col": "value", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_11265
train
v1
Schema: regions (alias: rgn)(value, name, salary, amount) schedules(level, amount, salary, value) Task: Select name from regions where id exists in schedules for the same id. SQL:
SELECT name FROM regions AS rgn WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.id = rgn.id );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "name", "filter_col": "id", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_11266
train
v2
Schema: managers (alias: mgr)(level, date, type, value) departments(value, amount, id, code) Task: Find code from managers where a matching record exists in departments with the same code. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = mgr.code );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "code", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11267
train
v1
Schema: branches (alias: brc)(level, salary, id, date) invoices(salary, name, value, type) Task: Retrieve name from branches whose id is found in invoices rows where level matches the outer record. SQL:
SELECT name FROM branches AS brc WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.level = brc.level );
{ "outer_table": "branches", "inner_table": "invoices", "outer_alias": "brc", "inner_alias": "inv", "proj_col": "name", "filter_col": "id", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_11268
train
v3
Schema: regions (alias: rgn)(status, amount, level, salary) transactions(code, status, salary, amount) Task: Retrieve salary from regions with value above the AVG(amount) of transactions rows sharing the same code. SQL:
SELECT salary FROM regions AS rgn WHERE value > ( SELECT AVG(amount) FROM transactions AS txn WHERE txn.code = rgn.code );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_11269
train
v3
Schema: staff (alias: empl)(code, level, status, id) categories(code, date, name, id) Task: Find amount from staff where salary exceeds the total value from categories for the same level. SQL:
SELECT amount FROM staff AS empl WHERE salary > ( SELECT SUM(value) FROM categories AS catg WHERE catg.level = empl.level );
{ "outer_table": "staff", "inner_table": "categories", "outer_alias": "empl", "inner_alias": "catg", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_11270
train
v3
Schema: shipments (alias: shp)(status, code, date, amount) sales(status, amount, date, value) Task: Retrieve name from shipments with salary above the SUM(value) of sales rows sharing the same id. SQL:
SELECT name FROM shipments AS shp WHERE salary > ( SELECT SUM(value) FROM sales AS sale WHERE sale.id = shp.id );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_11271
train
v2
Schema: accounts (alias: acct)(level, date, amount, name) products(date, type, salary, level) Task: Retrieve amount from accounts that have at least one corresponding entry in products sharing the same type. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = acct.type );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "amount", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11272
train
v2
Schema: projects (alias: prj)(status, type, id, name) sales(name, code, status, value) Task: Find code from projects where a matching record exists in sales with the same level. SQL:
SELECT code FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = prj.level );
{ "outer_table": "projects", "inner_table": "sales", "outer_alias": "prj", "inner_alias": "sale", "proj_col": "code", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_11273
train
v1
Schema: customers (alias: cust)(level, salary, type, id) orders(name, id, level, amount) Task: Retrieve id from customers whose status is found in orders rows where code matches the outer record. SQL:
SELECT id FROM customers AS cust WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.code = cust.code );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11274
train
v2
Schema: schedules (alias: schd)(value, amount, type, name) branches(date, name, type, level) Task: Retrieve salary from schedules that have at least one corresponding entry in branches sharing the same id. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.id = schd.id );
{ "outer_table": "schedules", "inner_table": "branches", "outer_alias": "schd", "inner_alias": "brc", "proj_col": "salary", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11275
train
v2
Schema: invoices (alias: inv)(name, status, value, date) customers(id, code, status, salary) Task: Find amount from invoices where a matching record exists in customers with the same id. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = inv.id );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "amount", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11276
train
v1
Schema: sales (alias: sale)(value, amount, status, name) departments(type, value, name, id) Task: Select value from sales where level exists in departments for the same level. SQL:
SELECT value FROM sales AS sale WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.level = sale.level );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11277
train
v3
Schema: shipments (alias: shp)(date, salary, status, amount) customers(type, amount, salary, name) Task: Retrieve name from shipments with amount above the MAX(salary) of customers rows sharing the same code. SQL:
SELECT name FROM shipments AS shp WHERE amount > ( SELECT MAX(salary) FROM customers AS cust WHERE cust.code = shp.code );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_11278
train
v1
Schema: managers (alias: mgr)(id, status, type, name) tasks(salary, type, level, status) Task: Select code from managers where code exists in tasks for the same id. SQL:
SELECT code FROM managers AS mgr WHERE code IN ( SELECT code FROM tasks AS tsk WHERE tsk.id = mgr.id );
{ "outer_table": "managers", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "tsk", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11279
train
v1
Schema: requests (alias: ordr)(status, date, level, value) departments(amount, name, date, status) Task: Find salary from requests where id appears in departments entries with matching id. SQL:
SELECT salary FROM requests AS ordr WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.id = ordr.id );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_11280
train
v3
Schema: categories (alias: catg)(id, type, date, status) employees(value, type, name, level) Task: Find amount from categories where salary exceeds the average value from employees for the same code. SQL:
SELECT amount FROM categories AS catg WHERE salary > ( SELECT AVG(value) FROM employees AS emp WHERE emp.code = catg.code );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11281
train
v1
Schema: employees (alias: emp)(name, type, status, code) categories(name, code, value, id) Task: Find id from employees where level appears in categories entries with matching level. SQL:
SELECT id FROM employees AS emp WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.level = emp.level );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11282
train
v1
Schema: departments (alias: dept)(code, date, type, value) schedules(code, name, salary, type) Task: Find code from departments where status appears in schedules entries with matching code. SQL:
SELECT code FROM departments AS dept WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.code = dept.code );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "code", "filter_col": "status", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11283
train
v3
Schema: products (alias: prod)(status, code, date, name) sales(id, status, name, level) Task: Find name from products where amount exceeds the total value from sales for the same code. SQL:
SELECT name FROM products AS prod WHERE amount > ( SELECT SUM(value) FROM sales AS sale WHERE sale.code = prod.code );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11284
train
v2
Schema: categories (alias: catg)(value, id, code, status) tasks(id, level, code, status) Task: Retrieve id from categories that have at least one corresponding entry in tasks sharing the same level. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.level = catg.level );
{ "outer_table": "categories", "inner_table": "tasks", "outer_alias": "catg", "inner_alias": "tsk", "proj_col": "id", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11285
train
v3
Schema: tasks (alias: tsk)(salary, date, name, level) requests(type, name, status, value) Task: Find salary from tasks where amount exceeds the average amount from requests for the same status. SQL:
SELECT salary FROM tasks AS tsk WHERE amount > ( SELECT AVG(amount) FROM requests AS ordr WHERE ordr.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "requests", "outer_alias": "tsk", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_11286
train
v2
Schema: categories (alias: catg)(name, date, code, status) orders(type, code, id, salary) Task: Find name from categories where a matching record exists in orders with the same code. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = catg.code );
{ "outer_table": "categories", "inner_table": "orders", "outer_alias": "catg", "inner_alias": "ord", "proj_col": "name", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11287
train
v3
Schema: regions (alias: rgn)(id, value, level, name) managers(type, salary, date, name) Task: Find code from regions where value exceeds the minimum salary from managers for the same id. SQL:
SELECT code FROM regions AS rgn WHERE value > ( SELECT MIN(salary) FROM managers AS mgr WHERE mgr.id = rgn.id );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_11288
train
v2
Schema: items (alias: lne)(status, level, name, salary) managers(id, name, value, salary) Task: Retrieve name from items that have at least one corresponding entry in managers sharing the same level. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = lne.level );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "name", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_11289
train
v2
Schema: projects (alias: prj)(code, value, amount, date) sales(value, status, date, id) Task: Find id from projects where a matching record exists in sales with the same code. SQL:
SELECT id FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = prj.code );
{ "outer_table": "projects", "inner_table": "sales", "outer_alias": "prj", "inner_alias": "sale", "proj_col": "id", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_11290
train
v1
Schema: tasks (alias: tsk)(level, type, value, status) managers(salary, name, status, level) Task: Retrieve amount from tasks whose level is found in managers rows where status matches the outer record. SQL:
SELECT amount FROM tasks AS tsk WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "managers", "outer_alias": "tsk", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_11291
train
v2
Schema: employees (alias: emp)(code, level, value, name) items(type, level, code, name) Task: Retrieve amount from employees that have at least one corresponding entry in items sharing the same status. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = emp.status );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "amount", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11292
train
v2
Schema: tasks (alias: tsk)(value, type, id, code) orders(amount, status, id, code) Task: Find id from tasks where a matching record exists in orders with the same code. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "orders", "outer_alias": "tsk", "inner_alias": "ord", "proj_col": "id", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_11293
train
v3
Schema: items (alias: lne)(date, level, salary, type) products(name, type, amount, level) Task: Retrieve name from items with salary above the AVG(salary) of products rows sharing the same code. SQL:
SELECT name FROM items AS lne WHERE salary > ( SELECT AVG(salary) FROM products AS prod WHERE prod.code = lne.code );
{ "outer_table": "items", "inner_table": "products", "outer_alias": "lne", "inner_alias": "prod", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_11294
train
v3
Schema: categories (alias: catg)(name, code, date, type) requests(value, amount, id, salary) Task: Retrieve id from categories with value above the MAX(value) of requests rows sharing the same status. SQL:
SELECT id FROM categories AS catg WHERE value > ( SELECT MAX(value) FROM requests AS ordr WHERE ordr.status = catg.status );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11295
train
v2
Schema: requests (alias: ordr)(type, status, salary, value) sales(status, level, name, value) Task: Retrieve salary from requests that have at least one corresponding entry in sales sharing the same level. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = ordr.level );
{ "outer_table": "requests", "inner_table": "sales", "outer_alias": "ordr", "inner_alias": "sale", "proj_col": "salary", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_11296
train
v3
Schema: departments (alias: dept)(level, status, type, salary) invoices(type, code, status, amount) Task: Retrieve salary from departments with value above the AVG(salary) of invoices rows sharing the same status. SQL:
SELECT salary FROM departments AS dept WHERE value > ( SELECT AVG(salary) FROM invoices AS inv WHERE inv.status = dept.status );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11297
train
v1
Schema: items (alias: lne)(amount, date, code, status) customers(value, salary, type, name) Task: Find id from items where type appears in customers entries with matching type. SQL:
SELECT id FROM items AS lne WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.type = lne.type );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "id", "filter_col": "type", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_11298
train
v2
Schema: categories (alias: catg)(date, type, code, amount) items(date, id, amount, status) Task: Retrieve code from categories that have at least one corresponding entry in items sharing the same id. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.id = catg.id );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "code", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11299
train