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: requests (alias: ordr)(level, date, name, status) branches(status, name, level, code) Task: Find id from requests where salary exceeds the count of salary from branches for the same status. SQL:
SELECT id FROM requests AS ordr WHERE salary > ( SELECT COUNT(salary) FROM branches AS brc WHERE brc.status = ordr.status );
{ "outer_table": "requests", "inner_table": "branches", "outer_alias": "ordr", "inner_alias": "brc", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04200
train
v3
Schema: sales (alias: sale)(id, amount, date, status) departments(value, name, type, salary) Task: Retrieve id from sales with amount above the MIN(salary) of departments rows sharing the same code. SQL:
SELECT id FROM sales AS sale WHERE amount > ( SELECT MIN(salary) FROM departments AS dept WHERE dept.code = sale.code );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04201
train
v1
Schema: accounts (alias: acct)(type, date, salary, amount) employees(name, salary, status, type) Task: Retrieve code from accounts whose type is found in employees rows where status matches the outer record. SQL:
SELECT code FROM accounts AS acct WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.status = acct.status );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04202
train
v2
Schema: products (alias: prod)(status, salary, code, name) categories(status, id, amount, name) Task: Retrieve id from products that have at least one corresponding entry in categories sharing the same level. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = prod.level );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "id", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04203
train
v2
Schema: departments (alias: dept)(id, status, date, value) branches(date, status, value, type) Task: Retrieve name from departments that have at least one corresponding entry in branches sharing the same status. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.status = dept.status );
{ "outer_table": "departments", "inner_table": "branches", "outer_alias": "dept", "inner_alias": "brc", "proj_col": "name", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04204
train
v3
Schema: sales (alias: sale)(salary, code, type, amount) schedules(id, salary, status, name) Task: Retrieve amount from sales with value above the MIN(salary) of schedules rows sharing the same level. SQL:
SELECT amount FROM sales AS sale WHERE value > ( SELECT MIN(salary) FROM schedules AS schd WHERE schd.level = sale.level );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04205
train
v1
Schema: projects (alias: prj)(level, status, amount, type) customers(status, value, level, code) Task: Retrieve amount from projects whose level is found in customers rows where id matches the outer record. SQL:
SELECT amount FROM projects AS prj WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.id = prj.id );
{ "outer_table": "projects", "inner_table": "customers", "outer_alias": "prj", "inner_alias": "cust", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04206
train
v3
Schema: employees (alias: emp)(name, id, date, value) schedules(date, level, id, value) Task: Find value from employees where amount exceeds the maximum value from schedules for the same status. SQL:
SELECT value FROM employees AS emp WHERE amount > ( SELECT MAX(value) FROM schedules AS schd WHERE schd.status = emp.status );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04207
train
v2
Schema: tasks (alias: tsk)(type, level, date, id) projects(code, date, type, value) Task: Retrieve id from tasks that have at least one corresponding entry in projects sharing the same id. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "projects", "outer_alias": "tsk", "inner_alias": "prj", "proj_col": "id", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04208
train
v3
Schema: items (alias: lne)(type, date, level, code) managers(id, code, status, amount) Task: Find id from items where amount exceeds the minimum value from managers for the same type. SQL:
SELECT id FROM items AS lne WHERE amount > ( SELECT MIN(value) FROM managers AS mgr WHERE mgr.type = lne.type );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04209
train
v2
Schema: invoices (alias: inv)(salary, value, id, status) accounts(level, date, type, value) Task: Retrieve code from invoices that have at least one corresponding entry in accounts sharing the same level. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = inv.level );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "code", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04210
train
v3
Schema: staff (alias: empl)(status, id, date, name) orders(level, type, id, status) Task: Retrieve code from staff with salary above the MAX(amount) of orders rows sharing the same status. SQL:
SELECT code FROM staff AS empl WHERE salary > ( SELECT MAX(amount) FROM orders AS ord WHERE ord.status = empl.status );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04211
train
v3
Schema: items (alias: lne)(id, name, level, value) projects(type, salary, code, date) Task: Find salary from items where value exceeds the maximum value from projects for the same level. SQL:
SELECT salary FROM items AS lne WHERE value > ( SELECT MAX(value) FROM projects AS prj WHERE prj.level = lne.level );
{ "outer_table": "items", "inner_table": "projects", "outer_alias": "lne", "inner_alias": "prj", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04212
train
v1
Schema: employees (alias: emp)(name, value, type, status) invoices(code, type, level, amount) Task: Find code from employees where level appears in invoices entries with matching type. SQL:
SELECT code FROM employees AS emp WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.type = emp.type );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04213
train
v2
Schema: projects (alias: prj)(salary, level, code, amount) orders(name, date, value, type) Task: Retrieve id from projects that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT id FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = prj.level );
{ "outer_table": "projects", "inner_table": "orders", "outer_alias": "prj", "inner_alias": "ord", "proj_col": "id", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04214
train
v2
Schema: invoices (alias: inv)(amount, id, salary, value) schedules(code, name, id, status) Task: Find code from invoices where a matching record exists in schedules with the same status. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = inv.status );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "code", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04215
train
v2
Schema: managers (alias: mgr)(name, code, amount, salary) items(status, date, salary, value) Task: Find id from managers where a matching record exists in items with the same status. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = mgr.status );
{ "outer_table": "managers", "inner_table": "items", "outer_alias": "mgr", "inner_alias": "lne", "proj_col": "id", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04216
train
v2
Schema: items (alias: lne)(salary, level, id, date) orders(amount, status, salary, type) Task: Retrieve value from items that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = lne.code );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "value", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04217
train
v2
Schema: regions (alias: rgn)(type, status, salary, id) requests(amount, name, id, salary) Task: Retrieve name from regions that have at least one corresponding entry in requests sharing the same code. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = rgn.code );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "name", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04218
train
v2
Schema: tasks (alias: tsk)(salary, id, name, type) invoices(date, salary, value, status) Task: Retrieve id from tasks that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "invoices", "outer_alias": "tsk", "inner_alias": "inv", "proj_col": "id", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04219
train
v1
Schema: customers (alias: cust)(level, value, code, type) categories(name, value, salary, status) Task: Find salary from customers where level appears in categories entries with matching type. SQL:
SELECT salary FROM customers AS cust WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.type = cust.type );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "salary", "filter_col": "level", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04220
train
v2
Schema: departments (alias: dept)(date, type, code, level) sales(status, type, salary, value) Task: Find name from departments where a matching record exists in sales with the same type. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = dept.type );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "name", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04221
train
v3
Schema: customers (alias: cust)(type, id, code, amount) shipments(date, name, value, level) Task: Find amount from customers where value exceeds the average salary from shipments for the same code. SQL:
SELECT amount FROM customers AS cust WHERE value > ( SELECT AVG(salary) FROM shipments AS shp WHERE shp.code = cust.code );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04222
train
v3
Schema: transactions (alias: txn)(status, amount, salary, level) accounts(type, status, value, level) Task: Find id from transactions where salary exceeds the minimum amount from accounts for the same code. SQL:
SELECT id FROM transactions AS txn WHERE salary > ( SELECT MIN(amount) FROM accounts AS acct WHERE acct.code = txn.code );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04223
train
v1
Schema: invoices (alias: inv)(level, amount, name, salary) managers(level, id, status, amount) Task: Select code from invoices where code exists in managers for the same type. SQL:
SELECT code FROM invoices AS inv WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.type = inv.type );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "code", "filter_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04224
train
v3
Schema: projects (alias: prj)(date, status, type, value) categories(name, date, level, code) Task: Find amount from projects where value exceeds the total amount from categories for the same code. SQL:
SELECT amount FROM projects AS prj WHERE value > ( SELECT SUM(amount) FROM categories AS catg WHERE catg.code = prj.code );
{ "outer_table": "projects", "inner_table": "categories", "outer_alias": "prj", "inner_alias": "catg", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04225
train
v2
Schema: customers (alias: cust)(id, status, salary, level) requests(date, name, type, salary) Task: Retrieve salary from customers that have at least one corresponding entry in requests sharing the same status. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = cust.status );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "salary", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04226
train
v1
Schema: projects (alias: prj)(type, code, date, level) products(name, level, type, code) Task: Select amount from projects where level exists in products for the same code. SQL:
SELECT amount FROM projects AS prj WHERE level IN ( SELECT level FROM products AS prod WHERE prod.code = prj.code );
{ "outer_table": "projects", "inner_table": "products", "outer_alias": "prj", "inner_alias": "prod", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04227
train
v3
Schema: shipments (alias: shp)(value, code, date, status) invoices(amount, status, id, date) Task: Find amount from shipments where salary exceeds the total value from invoices for the same code. SQL:
SELECT amount FROM shipments AS shp WHERE salary > ( SELECT SUM(value) FROM invoices AS inv WHERE inv.code = shp.code );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "amount", "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_04228
train
v1
Schema: categories (alias: catg)(date, id, salary, name) orders(level, type, date, id) Task: Find amount from categories where type appears in orders entries with matching id. SQL:
SELECT amount FROM categories AS catg WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.id = catg.id );
{ "outer_table": "categories", "inner_table": "orders", "outer_alias": "catg", "inner_alias": "ord", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04229
train
v2
Schema: accounts (alias: acct)(date, amount, salary, id) shipments(name, date, status, value) Task: Find amount from accounts where a matching record exists in shipments with the same id. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = acct.id );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "amount", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04230
train
v1
Schema: employees (alias: emp)(level, code, date, value) requests(type, amount, level, date) Task: Select code from employees where level exists in requests for the same type. SQL:
SELECT code FROM employees AS emp WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.type = emp.type );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04231
train
v3
Schema: orders (alias: ord)(code, date, name, id) staff(level, amount, code, id) Task: Find code from orders where salary exceeds the maximum amount from staff for the same code. SQL:
SELECT code FROM orders AS ord WHERE salary > ( SELECT MAX(amount) FROM staff AS empl WHERE empl.code = ord.code );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04232
train
v2
Schema: accounts (alias: acct)(name, status, value, type) products(date, status, name, type) Task: Find value from accounts where a matching record exists in products with the same level. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = acct.level );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "value", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04233
train
v3
Schema: regions (alias: rgn)(code, type, value, name) accounts(id, code, date, type) Task: Retrieve name from regions with value above the MAX(value) of accounts rows sharing the same code. SQL:
SELECT name FROM regions AS rgn WHERE value > ( SELECT MAX(value) FROM accounts AS acct WHERE acct.code = rgn.code );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "rgn", "inner_alias": "acct", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04234
train
v3
Schema: products (alias: prod)(status, date, level, salary) sales(type, salary, id, code) Task: Find id from products where amount exceeds the average salary from sales for the same level. SQL:
SELECT id FROM products AS prod WHERE amount > ( SELECT AVG(salary) FROM sales AS sale WHERE sale.level = prod.level );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04235
train
v1
Schema: shipments (alias: shp)(level, amount, code, id) transactions(date, amount, id, salary) Task: Find salary from shipments where type appears in transactions entries with matching type. SQL:
SELECT salary FROM shipments AS shp WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.type = shp.type );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04236
train
v1
Schema: items (alias: lne)(status, id, salary, level) staff(salary, date, amount, id) Task: Retrieve code from items whose code is found in staff rows where code matches the outer record. SQL:
SELECT code FROM items AS lne WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.code = lne.code );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04237
train
v3
Schema: invoices (alias: inv)(amount, code, id, status) staff(amount, date, code, status) Task: Find id from invoices where value exceeds the count of salary from staff for the same level. SQL:
SELECT id FROM invoices AS inv WHERE value > ( SELECT COUNT(salary) FROM staff AS empl WHERE empl.level = inv.level );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04238
train
v3
Schema: staff (alias: empl)(level, status, id, value) invoices(status, id, salary, date) Task: Retrieve salary from staff with value above the MAX(salary) of invoices rows sharing the same type. SQL:
SELECT salary FROM staff AS empl WHERE value > ( SELECT MAX(salary) FROM invoices AS inv WHERE inv.type = empl.type );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04239
train
v3
Schema: regions (alias: rgn)(value, salary, type, amount) branches(name, status, id, date) Task: Retrieve salary from regions with amount above the COUNT(value) of branches rows sharing the same status. SQL:
SELECT salary FROM regions AS rgn WHERE amount > ( SELECT COUNT(value) FROM branches AS brc WHERE brc.status = rgn.status );
{ "outer_table": "regions", "inner_table": "branches", "outer_alias": "rgn", "inner_alias": "brc", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04240
train
v2
Schema: managers (alias: mgr)(type, amount, id, level) transactions(status, id, salary, type) Task: Find code from managers where a matching record exists in transactions with the same code. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = mgr.code );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "code", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04241
train
v1
Schema: shipments (alias: shp)(type, date, salary, level) invoices(level, value, code, type) Task: Retrieve amount from shipments whose type is found in invoices rows where status matches the outer record. SQL:
SELECT amount FROM shipments AS shp WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.status = shp.status );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04242
train
v1
Schema: products (alias: prod)(type, id, status, salary) schedules(salary, type, name, level) Task: Find salary from products where status appears in schedules entries with matching id. SQL:
SELECT salary FROM products AS prod WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.id = prod.id );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "salary", "filter_col": "status", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04243
train
v1
Schema: accounts (alias: acct)(status, value, date, id) regions(name, code, status, type) Task: Retrieve id from accounts whose level is found in regions rows where type matches the outer record. SQL:
SELECT id FROM accounts AS acct WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.type = acct.type );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04244
train
v2
Schema: accounts (alias: acct)(date, name, salary, level) sales(code, status, name, salary) Task: Find value from accounts where a matching record exists in sales with the same code. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = acct.code );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "value", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04245
train
v2
Schema: staff (alias: empl)(salary, type, value, amount) regions(date, name, value, code) Task: Find amount from staff where a matching record exists in regions with the same type. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = empl.type );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "amount", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04246
train
v1
Schema: shipments (alias: shp)(status, type, code, name) managers(status, amount, name, level) Task: Retrieve code from shipments whose level is found in managers rows where code matches the outer record. SQL:
SELECT code FROM shipments AS shp WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.code = shp.code );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04247
train
v3
Schema: tasks (alias: tsk)(date, level, amount, status) accounts(code, id, salary, amount) Task: Retrieve name from tasks with amount above the MAX(salary) of accounts rows sharing the same code. SQL:
SELECT name FROM tasks AS tsk WHERE amount > ( SELECT MAX(salary) FROM accounts AS acct WHERE acct.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "accounts", "outer_alias": "tsk", "inner_alias": "acct", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04248
train
v3
Schema: managers (alias: mgr)(name, salary, status, date) orders(date, id, code, type) Task: Retrieve name from managers with salary above the AVG(salary) of orders rows sharing the same code. SQL:
SELECT name FROM managers AS mgr WHERE salary > ( SELECT AVG(salary) FROM orders AS ord WHERE ord.code = mgr.code );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04249
train
v1
Schema: staff (alias: empl)(name, status, value, salary) shipments(code, salary, status, id) Task: Select value from staff where id exists in shipments for the same type. SQL:
SELECT value FROM staff AS empl WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.type = empl.type );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04250
train
v2
Schema: staff (alias: empl)(code, level, amount, name) categories(status, code, salary, type) Task: Find code from staff where a matching record exists in categories with the same id. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = empl.id );
{ "outer_table": "staff", "inner_table": "categories", "outer_alias": "empl", "inner_alias": "catg", "proj_col": "code", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04251
train
v1
Schema: employees (alias: emp)(name, date, code, id) accounts(value, type, status, name) Task: Select salary from employees where status exists in accounts for the same type. SQL:
SELECT salary FROM employees AS emp WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.type = emp.type );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04252
train
v1
Schema: accounts (alias: acct)(status, code, level, id) transactions(level, name, amount, salary) Task: Retrieve amount from accounts whose type is found in transactions rows where code matches the outer record. SQL:
SELECT amount FROM accounts AS acct WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.code = acct.code );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "amount", "filter_col": "type", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04253
train
v3
Schema: managers (alias: mgr)(name, status, value, type) schedules(status, value, date, type) Task: Retrieve name from managers with salary above the SUM(amount) of schedules rows sharing the same id. SQL:
SELECT name FROM managers AS mgr WHERE salary > ( SELECT SUM(amount) FROM schedules AS schd WHERE schd.id = mgr.id );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04254
train
v1
Schema: departments (alias: dept)(type, salary, code, amount) managers(status, name, code, value) Task: Retrieve id from departments whose status is found in managers rows where id matches the outer record. SQL:
SELECT id FROM departments AS dept WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.id = dept.id );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04255
train
v1
Schema: shipments (alias: shp)(value, type, salary, status) customers(salary, type, name, status) Task: Retrieve salary from shipments whose status is found in customers rows where level matches the outer record. SQL:
SELECT salary FROM shipments AS shp WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.level = shp.level );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04256
train
v1
Schema: items (alias: lne)(salary, status, name, level) schedules(date, level, name, id) Task: Retrieve id from items whose level is found in schedules rows where id matches the outer record. SQL:
SELECT id FROM items AS lne WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.id = lne.id );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04257
train
v3
Schema: accounts (alias: acct)(status, value, level, date) staff(date, name, level, status) Task: Retrieve name from accounts with amount above the MIN(amount) of staff rows sharing the same status. SQL:
SELECT name FROM accounts AS acct WHERE amount > ( SELECT MIN(amount) FROM staff AS empl WHERE empl.status = acct.status );
{ "outer_table": "accounts", "inner_table": "staff", "outer_alias": "acct", "inner_alias": "empl", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04258
train
v2
Schema: staff (alias: empl)(value, type, code, level) regions(code, value, status, name) Task: Find id from staff where a matching record exists in regions with the same level. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = empl.level );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "id", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04259
train
v3
Schema: transactions (alias: txn)(value, name, code, status) orders(level, type, name, value) Task: Find amount from transactions where salary exceeds the count of salary from orders for the same status. SQL:
SELECT amount FROM transactions AS txn WHERE salary > ( SELECT COUNT(salary) FROM orders AS ord WHERE ord.status = txn.status );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04260
train
v3
Schema: items (alias: lne)(name, amount, level, salary) employees(id, salary, level, value) Task: Find value from items where amount exceeds the maximum salary from employees for the same code. SQL:
SELECT value FROM items AS lne WHERE amount > ( SELECT MAX(salary) FROM employees AS emp WHERE emp.code = lne.code );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04261
train
v2
Schema: items (alias: lne)(status, value, date, type) transactions(level, date, status, amount) Task: Retrieve id from items that have at least one corresponding entry in transactions sharing the same id. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = lne.id );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "id", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04262
train
v2
Schema: products (alias: prod)(amount, level, value, name) shipments(date, salary, id, name) Task: Find name from products where a matching record exists in shipments with the same level. SQL:
SELECT name 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": "name", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04263
train
v1
Schema: regions (alias: rgn)(status, code, salary, level) invoices(amount, name, status, type) Task: Retrieve code from regions whose type is found in invoices rows where level matches the outer record. SQL:
SELECT code FROM regions AS rgn WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.level = rgn.level );
{ "outer_table": "regions", "inner_table": "invoices", "outer_alias": "rgn", "inner_alias": "inv", "proj_col": "code", "filter_col": "type", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04264
train
v1
Schema: employees (alias: emp)(code, id, date, value) schedules(salary, status, date, name) Task: Select id from employees where type exists in schedules for the same level. SQL:
SELECT id FROM employees AS emp WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.level = emp.level );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04265
train
v2
Schema: schedules (alias: schd)(code, id, status, salary) invoices(name, amount, value, date) Task: Find code from schedules where a matching record exists in invoices with the same level. SQL:
SELECT code FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = schd.level );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "code", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04266
train
v1
Schema: customers (alias: cust)(date, value, name, code) invoices(date, status, code, name) Task: Find amount from customers where code appears in invoices entries with matching status. SQL:
SELECT amount FROM customers AS cust WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.status = cust.status );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04267
train
v3
Schema: orders (alias: ord)(salary, name, value, code) products(date, type, name, amount) Task: Find code from orders where value exceeds the maximum salary from products for the same status. SQL:
SELECT code FROM orders AS ord WHERE value > ( SELECT MAX(salary) FROM products AS prod WHERE prod.status = ord.status );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04268
train
v1
Schema: categories (alias: catg)(name, id, code, type) departments(type, value, name, level) Task: Select salary from categories where code exists in departments for the same id. SQL:
SELECT salary FROM categories AS catg WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.id = catg.id );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04269
train
v3
Schema: customers (alias: cust)(date, id, value, status) projects(amount, date, value, salary) Task: Retrieve value from customers with amount above the COUNT(salary) of projects rows sharing the same level. SQL:
SELECT value FROM customers AS cust WHERE amount > ( 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": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04270
train
v2
Schema: categories (alias: catg)(salary, level, date, status) products(type, date, code, value) Task: Retrieve id from categories that have at least one corresponding entry in products sharing the same id. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = catg.id );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "id", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04271
train
v3
Schema: transactions (alias: txn)(level, date, salary, value) products(level, salary, value, amount) Task: Find amount from transactions where salary exceeds the count of salary from products for the same status. SQL:
SELECT amount FROM transactions AS txn WHERE salary > ( SELECT COUNT(salary) FROM products AS prod WHERE prod.status = txn.status );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04272
train
v3
Schema: requests (alias: ordr)(amount, value, status, level) departments(name, id, type, value) Task: Retrieve code from requests with amount above the AVG(value) of departments rows sharing the same type. SQL:
SELECT code FROM requests AS ordr WHERE amount > ( SELECT AVG(value) FROM departments AS dept WHERE dept.type = ordr.type );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04273
train
v2
Schema: sales (alias: sale)(type, code, status, salary) tasks(name, date, amount, type) Task: Retrieve amount from sales that have at least one corresponding entry in tasks sharing the same code. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.code = sale.code );
{ "outer_table": "sales", "inner_table": "tasks", "outer_alias": "sale", "inner_alias": "tsk", "proj_col": "amount", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04274
train
v1
Schema: staff (alias: empl)(salary, amount, date, type) projects(id, value, code, salary) Task: Retrieve value from staff whose id is found in projects rows where code matches the outer record. SQL:
SELECT value FROM staff AS empl WHERE id IN ( SELECT id FROM projects AS prj WHERE prj.code = empl.code );
{ "outer_table": "staff", "inner_table": "projects", "outer_alias": "empl", "inner_alias": "prj", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04275
train
v3
Schema: sales (alias: sale)(status, salary, name, amount) staff(amount, salary, id, value) Task: Retrieve id from sales with amount above the SUM(amount) of staff rows sharing the same id. SQL:
SELECT id FROM sales AS sale WHERE amount > ( SELECT SUM(amount) FROM staff AS empl WHERE empl.id = sale.id );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04276
train
v2
Schema: orders (alias: ord)(level, type, code, status) products(value, status, name, amount) Task: Find amount from orders where a matching record exists in products with the same id. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = ord.id );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "amount", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04277
train
v3
Schema: staff (alias: empl)(amount, date, value, status) transactions(type, code, status, salary) Task: Find id from staff where amount exceeds the maximum salary from transactions for the same status. SQL:
SELECT id FROM staff AS empl WHERE amount > ( SELECT MAX(salary) FROM transactions AS txn WHERE txn.status = empl.status );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "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_04278
train
v3
Schema: schedules (alias: schd)(type, status, value, name) projects(salary, level, date, code) Task: Find id from schedules where amount exceeds the total salary from projects for the same level. SQL:
SELECT id FROM schedules AS schd WHERE amount > ( SELECT SUM(salary) FROM projects AS prj WHERE prj.level = schd.level );
{ "outer_table": "schedules", "inner_table": "projects", "outer_alias": "schd", "inner_alias": "prj", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04279
train
v1
Schema: items (alias: lne)(level, code, status, value) projects(name, id, level, status) Task: Retrieve amount from items whose id is found in projects rows where type matches the outer record. SQL:
SELECT amount FROM items AS lne WHERE id IN ( SELECT id FROM projects AS prj WHERE prj.type = lne.type );
{ "outer_table": "items", "inner_table": "projects", "outer_alias": "lne", "inner_alias": "prj", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04280
train
v3
Schema: sales (alias: sale)(amount, code, status, level) staff(level, type, date, id) Task: Retrieve id from sales with value above the MIN(amount) of staff rows sharing the same type. SQL:
SELECT id FROM sales AS sale WHERE value > ( SELECT MIN(amount) FROM staff AS empl WHERE empl.type = sale.type );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04281
train
v3
Schema: invoices (alias: inv)(id, type, status, code) orders(code, level, date, name) Task: Retrieve value from invoices with salary above the MIN(amount) of orders rows sharing the same status. SQL:
SELECT value FROM invoices AS inv WHERE salary > ( SELECT MIN(amount) FROM orders AS ord WHERE ord.status = inv.status );
{ "outer_table": "invoices", "inner_table": "orders", "outer_alias": "inv", "inner_alias": "ord", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04282
train
v1
Schema: sales (alias: sale)(id, value, salary, type) managers(date, type, id, code) Task: Retrieve code from sales whose code is found in managers rows where status matches the outer record. SQL:
SELECT code FROM sales AS sale WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.status = sale.status );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "code", "filter_col": "code", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04283
train
v2
Schema: products (alias: prod)(name, code, level, salary) sales(value, level, type, name) Task: Find salary from products where a matching record exists in sales with the same type. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = prod.type );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "salary", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04284
train
v2
Schema: orders (alias: ord)(status, name, type, salary) transactions(salary, amount, type, level) Task: Retrieve id from orders that have at least one corresponding entry in transactions sharing the same id. SQL:
SELECT id FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = ord.id );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "id", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04285
train
v3
Schema: employees (alias: emp)(code, date, value, id) accounts(salary, status, date, name) Task: Find name from employees where value exceeds the minimum amount from accounts for the same status. SQL:
SELECT name FROM employees AS emp WHERE value > ( SELECT MIN(amount) FROM accounts AS acct WHERE acct.status = emp.status );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04286
train
v3
Schema: projects (alias: prj)(date, salary, id, status) schedules(amount, name, code, id) Task: Retrieve id from projects with salary above the SUM(amount) of schedules rows sharing the same type. SQL:
SELECT id FROM projects AS prj WHERE salary > ( SELECT SUM(amount) FROM schedules AS schd WHERE schd.type = prj.type );
{ "outer_table": "projects", "inner_table": "schedules", "outer_alias": "prj", "inner_alias": "schd", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04287
train
v3
Schema: schedules (alias: schd)(date, amount, id, status) projects(code, status, amount, salary) Task: Find code from schedules where amount exceeds the average amount from projects for the same code. SQL:
SELECT code FROM schedules AS schd WHERE amount > ( SELECT AVG(amount) FROM projects AS prj WHERE prj.code = schd.code );
{ "outer_table": "schedules", "inner_table": "projects", "outer_alias": "schd", "inner_alias": "prj", "proj_col": "code", "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_04288
train
v3
Schema: transactions (alias: txn)(name, status, amount, code) staff(type, salary, date, amount) Task: Find code from transactions where value exceeds the total salary from staff for the same level. SQL:
SELECT code FROM transactions AS txn WHERE value > ( SELECT SUM(salary) FROM staff AS empl WHERE empl.level = txn.level );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04289
train
v2
Schema: regions (alias: rgn)(status, salary, type, id) customers(level, name, value, date) Task: Retrieve name from regions that have at least one corresponding entry in customers sharing the same type. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = rgn.type );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "name", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04290
train
v2
Schema: projects (alias: prj)(level, status, value, code) transactions(id, value, salary, amount) Task: Find name from projects where a matching record exists in transactions with the same level. SQL:
SELECT name FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = prj.level );
{ "outer_table": "projects", "inner_table": "transactions", "outer_alias": "prj", "inner_alias": "txn", "proj_col": "name", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04291
train
v3
Schema: branches (alias: brc)(code, level, id, date) sales(level, name, status, code) Task: Retrieve id from branches with salary above the AVG(amount) of sales rows sharing the same type. SQL:
SELECT id FROM branches AS brc WHERE salary > ( SELECT AVG(amount) FROM sales AS sale WHERE sale.type = brc.type );
{ "outer_table": "branches", "inner_table": "sales", "outer_alias": "brc", "inner_alias": "sale", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04292
train
v3
Schema: items (alias: lne)(value, name, status, id) tasks(level, amount, value, name) Task: Retrieve name from items with value above the MAX(amount) of tasks rows sharing the same code. SQL:
SELECT name FROM items AS lne WHERE value > ( SELECT MAX(amount) FROM tasks AS tsk WHERE tsk.code = lne.code );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04293
train
v1
Schema: categories (alias: catg)(type, value, name, salary) tasks(amount, id, value, status) Task: Select value from categories where type exists in tasks for the same code. SQL:
SELECT value FROM categories AS catg WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.code = catg.code );
{ "outer_table": "categories", "inner_table": "tasks", "outer_alias": "catg", "inner_alias": "tsk", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04294
train
v2
Schema: accounts (alias: acct)(type, amount, salary, id) invoices(code, name, date, level) Task: Retrieve code from accounts that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = acct.type );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "code", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04295
train
v1
Schema: managers (alias: mgr)(name, type, value, id) transactions(value, salary, date, name) Task: Find salary from managers where status appears in transactions entries with matching status. SQL:
SELECT salary FROM managers AS mgr WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.status = mgr.status );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04296
train
v1
Schema: requests (alias: ordr)(id, name, value, amount) invoices(amount, salary, type, status) Task: Find amount from requests where type appears in invoices entries with matching status. SQL:
SELECT amount FROM requests AS ordr WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.status = ordr.status );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04297
train
v3
Schema: customers (alias: cust)(type, status, salary, name) shipments(status, value, code, date) Task: Retrieve value from customers with amount above the SUM(salary) of shipments rows sharing the same type. SQL:
SELECT value FROM customers AS cust WHERE amount > ( SELECT SUM(salary) FROM shipments AS shp WHERE shp.type = cust.type );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04298
train
v3
Schema: managers (alias: mgr)(type, salary, level, value) sales(salary, type, code, date) Task: Retrieve value from managers with salary above the MIN(value) of sales rows sharing the same level. SQL:
SELECT value FROM managers AS mgr WHERE salary > ( SELECT MIN(value) FROM sales AS sale WHERE sale.level = mgr.level );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04299
train