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: items (alias: lne)(code, name, value, id) products(date, type, status, level) Task: Retrieve id from items with amount above the COUNT(salary) of products rows sharing the same id. SQL:
SELECT id FROM items AS lne WHERE amount > ( SELECT COUNT(salary) FROM products AS prod WHERE prod.id = lne.id );
{ "outer_table": "items", "inner_table": "products", "outer_alias": "lne", "inner_alias": "prod", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_11300
train
v2
Schema: transactions (alias: txn)(code, date, type, name) staff(date, salary, level, value) Task: Find salary from transactions where a matching record exists in staff with the same type. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = txn.type );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "salary", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11301
train
v2
Schema: managers (alias: mgr)(type, salary, value, amount) regions(date, id, salary, name) Task: Find salary from managers where a matching record exists in regions with the same status. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = mgr.status );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "salary", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11302
train
v3
Schema: requests (alias: ordr)(amount, name, salary, value) transactions(salary, code, type, level) Task: Find amount from requests where value exceeds the maximum amount from transactions for the same status. SQL:
SELECT amount FROM requests AS ordr WHERE value > ( SELECT MAX(amount) FROM transactions AS txn WHERE txn.status = ordr.status );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_11303
train
v3
Schema: shipments (alias: shp)(level, salary, date, status) requests(level, status, date, value) Task: Retrieve salary from shipments with amount above the MAX(amount) of requests rows sharing the same type. SQL:
SELECT salary FROM shipments AS shp WHERE amount > ( SELECT MAX(amount) FROM requests AS ordr WHERE ordr.type = shp.type );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "salary", "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_11304
train
v1
Schema: schedules (alias: schd)(code, status, amount, id) staff(date, type, code, salary) Task: Retrieve amount from schedules whose id is found in staff rows where level matches the outer record. SQL:
SELECT amount FROM schedules AS schd WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.level = schd.level );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11305
train
v3
Schema: schedules (alias: schd)(code, date, value, salary) staff(value, code, id, salary) Task: Find value from schedules where salary exceeds the count of value from staff for the same id. SQL:
SELECT value FROM schedules AS schd WHERE salary > ( SELECT COUNT(value) FROM staff AS empl WHERE empl.id = schd.id );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11306
train
v1
Schema: tasks (alias: tsk)(salary, name, status, date) accounts(type, level, status, value) Task: Find code from tasks where id appears in accounts entries with matching id. SQL:
SELECT code FROM tasks AS tsk WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "accounts", "outer_alias": "tsk", "inner_alias": "acct", "proj_col": "code", "filter_col": "id", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_11307
train
v2
Schema: categories (alias: catg)(salary, date, type, code) sales(status, level, type, value) Task: Find id from categories where a matching record exists in sales with the same status. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = catg.status );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "id", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11308
train
v2
Schema: invoices (alias: inv)(name, date, code, level) regions(type, amount, level, salary) Task: Retrieve id from invoices that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = inv.level );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "id", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11309
train
v1
Schema: managers (alias: mgr)(status, amount, value, type) customers(value, code, date, status) Task: Retrieve name from managers whose code is found in customers rows where id matches the outer record. SQL:
SELECT name FROM managers AS mgr WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.id = mgr.id );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11310
train
v3
Schema: items (alias: lne)(salary, value, date, amount) departments(type, name, amount, code) Task: Retrieve name from items with amount above the COUNT(amount) of departments rows sharing the same status. SQL:
SELECT name FROM items AS lne WHERE amount > ( SELECT COUNT(amount) FROM departments AS dept WHERE dept.status = lne.status );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_11311
train
v3
Schema: requests (alias: ordr)(code, type, id, level) sales(status, salary, type, value) Task: Retrieve amount from requests with salary above the AVG(salary) of sales rows sharing the same code. SQL:
SELECT amount FROM requests AS ordr WHERE salary > ( SELECT AVG(salary) FROM sales AS sale WHERE sale.code = ordr.code );
{ "outer_table": "requests", "inner_table": "sales", "outer_alias": "ordr", "inner_alias": "sale", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_11312
train
v2
Schema: invoices (alias: inv)(value, code, type, name) items(value, type, code, date) Task: Retrieve code from invoices that have at least one corresponding entry in items sharing the same type. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = inv.type );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11313
train
v1
Schema: schedules (alias: schd)(date, status, type, amount) shipments(level, code, value, date) Task: Find id from schedules where level appears in shipments entries with matching id. SQL:
SELECT id FROM schedules AS schd WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.id = schd.id );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11314
train
v3
Schema: shipments (alias: shp)(type, name, date, salary) managers(value, amount, type, level) Task: Find value from shipments where salary exceeds the total value from managers for the same type. SQL:
SELECT value FROM shipments AS shp WHERE salary > ( SELECT SUM(value) FROM managers AS mgr WHERE mgr.type = shp.type );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_11315
train
v1
Schema: schedules (alias: schd)(type, name, amount, id) orders(status, type, level, id) Task: Retrieve code from schedules whose type is found in orders rows where code matches the outer record. SQL:
SELECT code FROM schedules AS schd WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.code = schd.code );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11316
train
v2
Schema: customers (alias: cust)(level, date, name, amount) projects(type, id, amount, salary) Task: Find salary from customers where a matching record exists in projects with the same id. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.id = cust.id );
{ "outer_table": "customers", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "prj", "proj_col": "salary", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11317
train
v1
Schema: items (alias: lne)(id, level, salary, value) sales(type, date, level, amount) Task: Find value from items where code appears in sales entries with matching type. SQL:
SELECT value FROM items AS lne WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.type = lne.type );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_11318
train
v1
Schema: items (alias: lne)(name, value, date, amount) regions(salary, date, value, type) Task: Retrieve name from items whose status is found in regions rows where code matches the outer record. SQL:
SELECT name FROM items AS lne WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.code = lne.code );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_11319
train
v3
Schema: invoices (alias: inv)(salary, level, type, code) projects(status, type, salary, name) Task: Find name from invoices where amount exceeds the count of amount from projects for the same status. SQL:
SELECT name FROM invoices AS inv WHERE amount > ( SELECT COUNT(amount) FROM projects AS prj WHERE prj.status = inv.status );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "inv", "inner_alias": "prj", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11320
train
v1
Schema: schedules (alias: schd)(name, status, amount, value) regions(value, status, salary, name) Task: Retrieve name from schedules whose status is found in regions rows where status matches the outer record. SQL:
SELECT name FROM schedules AS schd WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.status = schd.status );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11321
train
v2
Schema: items (alias: lne)(type, salary, date, id) schedules(status, id, salary, code) Task: Find value from items where a matching record exists in schedules with the same status. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = lne.status );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "value", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_11322
train
v3
Schema: sales (alias: sale)(type, status, date, value) invoices(status, id, level, type) Task: Retrieve salary from sales with salary above the SUM(value) of invoices rows sharing the same code. SQL:
SELECT salary FROM sales AS sale WHERE salary > ( SELECT SUM(value) FROM invoices AS inv WHERE inv.code = sale.code );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11323
train
v1
Schema: orders (alias: ord)(id, level, type, value) categories(status, amount, type, level) Task: Find amount from orders where level appears in categories entries with matching code. SQL:
SELECT amount FROM orders AS ord WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.code = ord.code );
{ "outer_table": "orders", "inner_table": "categories", "outer_alias": "ord", "inner_alias": "catg", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11324
train
v2
Schema: items (alias: lne)(date, code, status, salary) shipments(amount, value, name, level) Task: Retrieve id from items that have at least one corresponding entry in shipments sharing the same type. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = lne.type );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "id", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_11325
train
v1
Schema: requests (alias: ordr)(amount, id, code, level) regions(id, name, value, status) Task: Find salary from requests where type appears in regions entries with matching type. SQL:
SELECT salary FROM requests AS ordr WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.type = ordr.type );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_11326
train
v2
Schema: sales (alias: sale)(amount, salary, name, id) customers(code, id, salary, name) Task: Find value from sales where a matching record exists in customers with the same status. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = sale.status );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "value", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11327
train
v1
Schema: customers (alias: cust)(value, status, code, type) employees(id, type, value, amount) Task: Retrieve salary from customers whose level is found in employees rows where id matches the outer record. SQL:
SELECT salary FROM customers AS cust WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.id = cust.id );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "salary", "filter_col": "level", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11328
train
v3
Schema: transactions (alias: txn)(value, type, name, id) employees(amount, name, id, level) Task: Find id from transactions where amount exceeds the average value from employees for the same code. SQL:
SELECT id FROM transactions AS txn WHERE amount > ( SELECT AVG(value) FROM employees AS emp WHERE emp.code = txn.code );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11329
train
v1
Schema: departments (alias: dept)(code, value, level, id) branches(code, name, status, amount) Task: Retrieve name from departments whose status is found in branches rows where status matches the outer record. SQL:
SELECT name FROM departments AS dept WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.status = dept.status );
{ "outer_table": "departments", "inner_table": "branches", "outer_alias": "dept", "inner_alias": "brc", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11330
train
v2
Schema: transactions (alias: txn)(level, value, amount, status) regions(amount, value, date, code) Task: Find id from transactions where a matching record exists in regions with the same id. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = txn.id );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "id", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11331
train
v3
Schema: orders (alias: ord)(code, level, value, date) requests(salary, code, date, amount) Task: Find amount from orders where value exceeds the count of salary from requests for the same level. SQL:
SELECT amount FROM orders AS ord WHERE value > ( SELECT COUNT(salary) FROM requests AS ordr WHERE ordr.level = ord.level );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11332
train
v1
Schema: schedules (alias: schd)(value, type, code, status) regions(id, level, status, amount) Task: Retrieve salary from schedules whose level is found in regions rows where code matches the outer record. SQL:
SELECT salary FROM schedules AS schd WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.code = schd.code );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "level", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11333
train
v1
Schema: invoices (alias: inv)(value, name, date, amount) managers(name, salary, status, value) Task: Retrieve amount from invoices whose id is found in managers rows where id matches the outer record. SQL:
SELECT amount FROM invoices AS inv WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.id = inv.id );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "id", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11334
train
v3
Schema: products (alias: prod)(date, type, salary, value) items(type, id, level, code) Task: Find salary from products where amount exceeds the total amount from items for the same id. SQL:
SELECT salary FROM products AS prod WHERE amount > ( SELECT SUM(amount) FROM items AS lne WHERE lne.id = prod.id );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11335
train
v2
Schema: categories (alias: catg)(level, type, name, date) schedules(code, level, value, status) Task: Find code from categories where a matching record exists in schedules with the same id. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = catg.id );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "code", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11336
train
v1
Schema: tasks (alias: tsk)(level, name, id, code) branches(date, id, amount, code) Task: Select code from tasks where code exists in branches for the same level. SQL:
SELECT code FROM tasks AS tsk WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "branches", "outer_alias": "tsk", "inner_alias": "brc", "proj_col": "code", "filter_col": "code", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_11337
train
v3
Schema: employees (alias: emp)(code, name, type, status) transactions(level, date, status, name) Task: Retrieve code from employees with value above the COUNT(amount) of transactions rows sharing the same id. SQL:
SELECT code FROM employees AS emp WHERE value > ( SELECT COUNT(amount) FROM transactions AS txn WHERE txn.id = emp.id );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11338
train
v2
Schema: managers (alias: mgr)(level, status, type, id) requests(amount, status, type, value) Task: Find value from managers where a matching record exists in requests with the same code. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = mgr.code );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "value", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11339
train
v2
Schema: products (alias: prod)(value, code, level, type) projects(code, level, value, date) Task: Find code from products where a matching record exists in projects with the same level. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.level = prod.level );
{ "outer_table": "products", "inner_table": "projects", "outer_alias": "prod", "inner_alias": "prj", "proj_col": "code", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11340
train
v3
Schema: staff (alias: empl)(status, amount, date, code) tasks(amount, type, salary, value) Task: Retrieve salary from staff with value above the SUM(salary) of tasks rows sharing the same id. SQL:
SELECT salary FROM staff AS empl WHERE value > ( SELECT SUM(salary) FROM tasks AS tsk WHERE tsk.id = empl.id );
{ "outer_table": "staff", "inner_table": "tasks", "outer_alias": "empl", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_11341
train
v2
Schema: shipments (alias: shp)(status, id, type, code) transactions(salary, type, level, value) Task: Retrieve name from shipments that have at least one corresponding entry in transactions sharing the same status. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = shp.status );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "name", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_11342
train
v3
Schema: sales (alias: sale)(amount, salary, value, code) products(type, date, level, name) Task: Retrieve salary from sales with amount above the SUM(value) of products rows sharing the same code. SQL:
SELECT salary FROM sales AS sale WHERE amount > ( SELECT SUM(value) FROM products AS prod WHERE prod.code = sale.code );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11343
train
v3
Schema: branches (alias: brc)(date, level, salary, type) customers(code, name, salary, status) Task: Find salary from branches where salary exceeds the minimum amount from customers for the same level. SQL:
SELECT salary FROM branches AS brc WHERE salary > ( SELECT MIN(amount) FROM customers AS cust WHERE cust.level = brc.level );
{ "outer_table": "branches", "inner_table": "customers", "outer_alias": "brc", "inner_alias": "cust", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_11344
train
v1
Schema: transactions (alias: txn)(value, level, amount, type) orders(code, status, salary, name) Task: Find amount from transactions where code appears in orders entries with matching code. SQL:
SELECT amount FROM transactions AS txn WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.code = txn.code );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11345
train
v2
Schema: products (alias: prod)(level, value, id, status) customers(value, date, name, id) Task: Retrieve value from products that have at least one corresponding entry in customers sharing the same level. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = prod.level );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "value", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11346
train
v3
Schema: customers (alias: cust)(level, amount, id, code) invoices(value, type, id, level) Task: Retrieve id from customers with salary above the COUNT(amount) of invoices rows sharing the same id. SQL:
SELECT id FROM customers AS cust WHERE salary > ( SELECT COUNT(amount) FROM invoices AS inv WHERE inv.id = cust.id );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11347
train
v2
Schema: staff (alias: empl)(level, id, type, amount) categories(type, name, amount, id) Task: Find salary from staff where a matching record exists in categories with the same type. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = empl.type );
{ "outer_table": "staff", "inner_table": "categories", "outer_alias": "empl", "inner_alias": "catg", "proj_col": "salary", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_11348
train
v3
Schema: items (alias: lne)(amount, level, status, type) sales(level, id, name, date) Task: Retrieve id from items with value above the MAX(salary) of sales rows sharing the same type. SQL:
SELECT id FROM items AS lne WHERE value > ( SELECT MAX(salary) FROM sales AS sale WHERE sale.type = lne.type );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_11349
train
v1
Schema: departments (alias: dept)(name, level, status, code) projects(date, salary, status, name) Task: Find salary from departments where status appears in projects entries with matching level. SQL:
SELECT salary FROM departments AS dept WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.level = dept.level );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11350
train
v2
Schema: managers (alias: mgr)(type, level, amount, date) employees(amount, value, type, name) Task: Find code from managers where a matching record exists in employees with the same level. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = mgr.level );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "code", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11351
train
v1
Schema: invoices (alias: inv)(type, salary, code, amount) items(level, id, status, date) Task: Select value from invoices where status exists in items for the same code. SQL:
SELECT value FROM invoices AS inv WHERE status IN ( SELECT status FROM items AS lne WHERE lne.code = inv.code );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "value", "filter_col": "status", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11352
train
v3
Schema: managers (alias: mgr)(type, status, date, id) employees(salary, code, date, name) Task: Retrieve salary from managers with amount above the MIN(value) of employees rows sharing the same level. SQL:
SELECT salary FROM managers AS mgr WHERE amount > ( SELECT MIN(value) FROM employees AS emp WHERE emp.level = mgr.level );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11353
train
v3
Schema: projects (alias: prj)(id, type, status, name) requests(id, amount, level, type) Task: Retrieve value from projects with value above the COUNT(salary) of requests rows sharing the same level. SQL:
SELECT value FROM projects AS prj WHERE value > ( SELECT COUNT(salary) FROM requests AS ordr WHERE ordr.level = prj.level );
{ "outer_table": "projects", "inner_table": "requests", "outer_alias": "prj", "inner_alias": "ordr", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_11354
train
v1
Schema: tasks (alias: tsk)(date, id, status, name) employees(salary, code, date, level) Task: Find amount from tasks where level appears in employees entries with matching id. SQL:
SELECT amount FROM tasks AS tsk WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "employees", "outer_alias": "tsk", "inner_alias": "emp", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_11355
train
v2
Schema: accounts (alias: acct)(type, salary, amount, date) transactions(salary, amount, level, code) Task: Find salary from accounts where a matching record exists in transactions with the same code. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = acct.code );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "salary", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11356
train
v3
Schema: regions (alias: rgn)(salary, code, id, amount) transactions(amount, status, type, name) Task: Find value from regions where amount exceeds the total amount from transactions for the same status. SQL:
SELECT value FROM regions AS rgn WHERE amount > ( SELECT SUM(amount) FROM transactions AS txn WHERE txn.status = rgn.status );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_11357
train
v3
Schema: invoices (alias: inv)(date, salary, value, id) categories(status, code, id, amount) Task: Find amount from invoices where amount exceeds the total amount from categories for the same type. SQL:
SELECT amount FROM invoices AS inv WHERE amount > ( SELECT SUM(amount) FROM categories AS catg WHERE catg.type = inv.type );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11358
train
v1
Schema: invoices (alias: inv)(name, date, value, salary) shipments(code, value, type, level) Task: Retrieve code from invoices whose code is found in shipments rows where status matches the outer record. SQL:
SELECT code FROM invoices AS inv WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.status = inv.status );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "code", "filter_col": "code", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11359
train
v1
Schema: tasks (alias: tsk)(level, value, salary, date) invoices(date, status, amount, name) Task: Retrieve salary from tasks whose type is found in invoices rows where id matches the outer record. SQL:
SELECT salary FROM tasks AS tsk WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "invoices", "outer_alias": "tsk", "inner_alias": "inv", "proj_col": "salary", "filter_col": "type", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_11360
train
v3
Schema: transactions (alias: txn)(salary, status, code, value) shipments(type, status, salary, code) Task: Find salary from transactions where amount exceeds the minimum value from shipments for the same status. SQL:
SELECT salary FROM transactions AS txn WHERE amount > ( SELECT MIN(value) FROM shipments AS shp WHERE shp.status = txn.status );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11361
train
v2
Schema: tasks (alias: tsk)(date, level, code, name) employees(status, date, salary, code) Task: Retrieve id from tasks that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "employees", "outer_alias": "tsk", "inner_alias": "emp", "proj_col": "id", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_11362
train
v1
Schema: staff (alias: empl)(value, code, date, level) shipments(name, date, status, amount) Task: Retrieve value from staff whose status is found in shipments rows where code matches the outer record. SQL:
SELECT value FROM staff AS empl WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.code = empl.code );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "value", "filter_col": "status", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_11363
train
v1
Schema: schedules (alias: schd)(amount, salary, level, date) sales(name, amount, value, id) Task: Select value from schedules where status exists in sales for the same id. SQL:
SELECT value FROM schedules AS schd WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.id = schd.id );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11364
train
v1
Schema: products (alias: prod)(status, type, code, id) shipments(id, name, salary, amount) Task: Select salary from products where type exists in shipments for the same status. SQL:
SELECT salary FROM products AS prod WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.status = prod.status );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "salary", "filter_col": "type", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11365
train
v3
Schema: employees (alias: emp)(amount, status, salary, name) items(id, date, code, status) Task: Find id from employees where value exceeds the count of value from items for the same status. SQL:
SELECT id FROM employees AS emp WHERE value > ( SELECT COUNT(value) FROM items AS lne WHERE lne.status = emp.status );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11366
train
v3
Schema: tasks (alias: tsk)(type, value, status, level) items(amount, status, date, code) Task: Find id from tasks where value exceeds the count of salary from items for the same status. SQL:
SELECT id FROM tasks AS tsk WHERE value > ( SELECT COUNT(salary) FROM items AS lne WHERE lne.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "items", "outer_alias": "tsk", "inner_alias": "lne", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_11367
train
v3
Schema: transactions (alias: txn)(id, amount, code, value) categories(salary, status, id, amount) Task: Find code from transactions where salary exceeds the minimum salary from categories for the same status. SQL:
SELECT code FROM transactions AS txn WHERE salary > ( SELECT MIN(salary) FROM categories AS catg WHERE catg.status = txn.status );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11368
train
v3
Schema: shipments (alias: shp)(status, salary, name, date) customers(value, date, id, amount) Task: Retrieve name from shipments with salary above the MIN(amount) of customers rows sharing the same type. SQL:
SELECT name FROM shipments AS shp WHERE salary > ( SELECT MIN(amount) FROM customers AS cust WHERE cust.type = shp.type );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_11369
train
v1
Schema: transactions (alias: txn)(date, value, name, salary) regions(id, type, date, status) Task: Retrieve value from transactions whose status is found in regions rows where status matches the outer record. SQL:
SELECT value FROM transactions AS txn WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.status = txn.status );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11370
train
v3
Schema: schedules (alias: schd)(value, status, type, amount) accounts(name, date, value, code) Task: Find salary from schedules where salary exceeds the total amount from accounts for the same level. SQL:
SELECT salary FROM schedules AS schd WHERE salary > ( SELECT SUM(amount) FROM accounts AS acct WHERE acct.level = schd.level );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11371
train
v1
Schema: schedules (alias: schd)(type, date, salary, code) products(name, level, salary, id) Task: Find amount from schedules where code appears in products entries with matching level. SQL:
SELECT amount FROM schedules AS schd WHERE code IN ( SELECT code FROM products AS prod WHERE prod.level = schd.level );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11372
train
v1
Schema: staff (alias: empl)(status, name, value, amount) items(date, status, code, type) Task: Retrieve salary from staff whose level is found in items rows where code matches the outer record. SQL:
SELECT salary FROM staff AS empl WHERE level IN ( SELECT level FROM items AS lne WHERE lne.code = empl.code );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "salary", "filter_col": "level", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_11373
train
v2
Schema: staff (alias: empl)(code, salary, status, name) products(name, level, status, amount) Task: Retrieve amount from staff that have at least one corresponding entry in products sharing the same level. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = empl.level );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "amount", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_11374
train
v1
Schema: accounts (alias: acct)(level, date, type, amount) customers(level, value, salary, code) Task: Retrieve amount from accounts whose status is found in customers rows where id matches the outer record. SQL:
SELECT amount FROM accounts AS acct WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.id = acct.id );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11375
train
v1
Schema: items (alias: lne)(value, code, level, amount) sales(salary, value, code, amount) Task: Select salary from items where code exists in sales for the same type. SQL:
SELECT salary FROM items AS lne WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.type = lne.type );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_11376
train
v2
Schema: staff (alias: empl)(status, id, date, amount) accounts(name, amount, id, code) Task: Retrieve salary from staff that have at least one corresponding entry in accounts sharing the same id. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = empl.id );
{ "outer_table": "staff", "inner_table": "accounts", "outer_alias": "empl", "inner_alias": "acct", "proj_col": "salary", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_11377
train
v2
Schema: accounts (alias: acct)(value, date, amount, salary) invoices(type, amount, date, level) Task: Find amount from accounts where a matching record exists in invoices with the same type. SQL:
SELECT amount 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": "amount", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11378
train
v2
Schema: items (alias: lne)(type, name, salary, level) departments(status, salary, type, value) Task: Find name from items where a matching record exists in departments with the same type. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = lne.type );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "name", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_11379
train
v2
Schema: employees (alias: emp)(salary, amount, id, value) managers(name, level, code, date) Task: Find name from employees where a matching record exists in managers with the same type. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = emp.type );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "name", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11380
train
v2
Schema: shipments (alias: shp)(date, code, id, salary) tasks(date, code, status, value) Task: Find name from shipments where a matching record exists in tasks with the same level. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.level = shp.level );
{ "outer_table": "shipments", "inner_table": "tasks", "outer_alias": "shp", "inner_alias": "tsk", "proj_col": "name", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_11381
train
v1
Schema: items (alias: lne)(date, code, type, id) transactions(code, type, value, date) Task: Select salary from items where status exists in transactions for the same type. SQL:
SELECT salary FROM items AS lne WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.type = lne.type );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_11382
train
v3
Schema: sales (alias: sale)(status, code, value, amount) departments(id, type, code, level) Task: Find name from sales where amount exceeds the average salary from departments for the same code. SQL:
SELECT name FROM sales AS sale WHERE amount > ( SELECT AVG(salary) FROM departments AS dept WHERE dept.code = sale.code );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11383
train
v2
Schema: transactions (alias: txn)(type, status, value, id) branches(code, id, level, status) Task: Find salary from transactions where a matching record exists in branches with the same status. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.status = txn.status );
{ "outer_table": "transactions", "inner_table": "branches", "outer_alias": "txn", "inner_alias": "brc", "proj_col": "salary", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11384
train
v1
Schema: categories (alias: catg)(value, id, level, date) customers(id, code, value, level) Task: Find salary from categories where level appears in customers entries with matching id. SQL:
SELECT salary FROM categories AS catg WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.id = catg.id );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "salary", "filter_col": "level", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11385
train
v1
Schema: schedules (alias: schd)(code, salary, date, type) departments(salary, date, type, name) Task: Select salary from schedules where code exists in departments for the same level. SQL:
SELECT salary FROM schedules AS schd WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.level = schd.level );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "salary", "filter_col": "code", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11386
train
v3
Schema: departments (alias: dept)(type, name, level, code) categories(salary, status, value, date) Task: Retrieve salary from departments with value above the COUNT(salary) of categories rows sharing the same type. SQL:
SELECT salary FROM departments AS dept WHERE value > ( SELECT COUNT(salary) FROM categories AS catg WHERE catg.type = dept.type );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11387
train
v2
Schema: staff (alias: empl)(salary, date, amount, code) shipments(salary, name, type, code) Task: Find code from staff where a matching record exists in shipments with the same code. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = empl.code );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "code", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_11388
train
v2
Schema: branches (alias: brc)(name, date, code, value) tasks(value, id, type, date) Task: Retrieve amount from branches that have at least one corresponding entry in tasks sharing the same id. SQL:
SELECT amount FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.id = brc.id );
{ "outer_table": "branches", "inner_table": "tasks", "outer_alias": "brc", "inner_alias": "tsk", "proj_col": "amount", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_11389
train
v1
Schema: branches (alias: brc)(type, salary, id, value) requests(code, id, type, salary) Task: Find code from branches where status appears in requests entries with matching status. SQL:
SELECT code FROM branches AS brc WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.status = brc.status );
{ "outer_table": "branches", "inner_table": "requests", "outer_alias": "brc", "inner_alias": "ordr", "proj_col": "code", "filter_col": "status", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_11390
train
v2
Schema: schedules (alias: schd)(level, status, id, date) employees(name, level, status, id) Task: Find salary from schedules where a matching record exists in employees with the same type. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = schd.type );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "salary", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_11391
train
v3
Schema: regions (alias: rgn)(type, amount, name, level) products(amount, value, level, date) Task: Find salary from regions where amount exceeds the average amount from products for the same status. SQL:
SELECT salary FROM regions AS rgn WHERE amount > ( SELECT AVG(amount) FROM products AS prod WHERE prod.status = rgn.status );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_11392
train
v3
Schema: customers (alias: cust)(id, amount, value, status) projects(level, value, amount, date) Task: Find name from customers where amount exceeds the total salary from projects for the same type. SQL:
SELECT name FROM customers AS cust WHERE amount > ( SELECT SUM(salary) FROM projects AS prj WHERE prj.type = cust.type );
{ "outer_table": "customers", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "prj", "proj_col": "name", "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_11393
train
v3
Schema: staff (alias: empl)(id, date, type, value) items(id, date, type, amount) Task: Find code from staff where value exceeds the maximum amount from items for the same status. SQL:
SELECT code FROM staff AS empl WHERE value > ( SELECT MAX(amount) FROM items AS lne WHERE lne.status = empl.status );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_11394
train
v3
Schema: products (alias: prod)(code, level, status, salary) categories(date, value, level, salary) Task: Find salary from products where value exceeds the count of amount from categories for the same code. SQL:
SELECT salary FROM products AS prod WHERE value > ( SELECT COUNT(amount) FROM categories AS catg WHERE catg.code = prod.code );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11395
train
v3
Schema: items (alias: lne)(code, salary, value, type) invoices(id, amount, code, date) Task: Find name from items where salary exceeds the total salary from invoices for the same id. SQL:
SELECT name FROM items AS lne WHERE salary > ( SELECT SUM(salary) FROM invoices AS inv WHERE inv.id = lne.id );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_11396
train
v3
Schema: products (alias: prod)(type, value, salary, amount) invoices(level, salary, status, code) Task: Find salary from products where amount exceeds the minimum salary from invoices for the same status. SQL:
SELECT salary FROM products AS prod WHERE amount > ( SELECT MIN(salary) FROM invoices AS inv WHERE inv.status = prod.status );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11397
train
v2
Schema: employees (alias: emp)(type, level, amount, id) invoices(name, type, status, value) Task: Find salary from employees where a matching record exists in invoices with the same status. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = emp.status );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "salary", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11398
train
v1
Schema: employees (alias: emp)(date, level, code, amount) items(status, date, type, code) Task: Find code from employees where id appears in items entries with matching type. SQL:
SELECT code FROM employees AS emp WHERE id IN ( SELECT id FROM items AS lne WHERE lne.type = emp.type );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "code", "filter_col": "id", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_11399
train