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: invoices (alias: inv)(id, status, value, level) transactions(status, name, type, value) Task: Find salary from invoices where amount exceeds the total value from transactions for the same code. SQL:
SELECT salary FROM invoices AS inv WHERE amount > ( SELECT SUM(value) FROM transactions AS txn WHERE txn.code = inv.code );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00400
train
v1
Schema: categories (alias: catg)(level, id, value, code) transactions(date, salary, level, status) Task: Select id from categories where id exists in transactions for the same type. SQL:
SELECT id FROM categories AS catg WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.type = catg.type );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00401
train
v3
Schema: projects (alias: prj)(id, level, value, date) sales(value, amount, date, level) Task: Find amount from projects where salary exceeds the average salary from sales for the same level. SQL:
SELECT amount FROM projects AS prj WHERE salary > ( SELECT AVG(salary) FROM sales AS sale WHERE sale.level = prj.level );
{ "outer_table": "projects", "inner_table": "sales", "outer_alias": "prj", "inner_alias": "sale", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_00402
train
v1
Schema: requests (alias: ordr)(value, name, date, salary) schedules(status, id, value, code) Task: Retrieve id from requests whose id is found in schedules rows where id matches the outer record. SQL:
SELECT id FROM requests AS ordr WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.id = ordr.id );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_00403
train
v2
Schema: orders (alias: ord)(type, name, status, code) tasks(code, amount, salary, date) Task: Find salary from orders where a matching record exists in tasks with the same status. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = ord.status );
{ "outer_table": "orders", "inner_table": "tasks", "outer_alias": "ord", "inner_alias": "tsk", "proj_col": "salary", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00404
train
v3
Schema: categories (alias: catg)(name, value, code, level) requests(date, amount, type, status) Task: Retrieve value from categories with amount above the AVG(amount) of requests rows sharing the same status. SQL:
SELECT value FROM categories AS catg WHERE amount > ( SELECT AVG(amount) FROM requests AS ordr WHERE ordr.status = catg.status );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00405
train
v1
Schema: sales (alias: sale)(salary, type, code, level) schedules(salary, date, level, type) Task: Retrieve id from sales whose status is found in schedules rows where level matches the outer record. SQL:
SELECT id FROM sales AS sale WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.level = sale.level );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "id", "filter_col": "status", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00406
train
v1
Schema: requests (alias: ordr)(id, code, level, value) branches(type, id, amount, value) Task: Select code from requests where code exists in branches for the same status. SQL:
SELECT code FROM requests AS ordr WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.status = ordr.status );
{ "outer_table": "requests", "inner_table": "branches", "outer_alias": "ordr", "inner_alias": "brc", "proj_col": "code", "filter_col": "code", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_00407
train
v3
Schema: tasks (alias: tsk)(salary, amount, name, code) products(value, level, type, name) Task: Find amount from tasks where value exceeds the count of value from products for the same code. SQL:
SELECT amount FROM tasks AS tsk WHERE value > ( SELECT COUNT(value) FROM products AS prod WHERE prod.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "products", "outer_alias": "tsk", "inner_alias": "prod", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_00408
train
v1
Schema: accounts (alias: acct)(date, code, status, amount) branches(type, level, id, code) Task: Select code from accounts where type exists in branches for the same code. SQL:
SELECT code FROM accounts AS acct WHERE type IN ( SELECT type FROM branches AS brc WHERE brc.code = acct.code );
{ "outer_table": "accounts", "inner_table": "branches", "outer_alias": "acct", "inner_alias": "brc", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00409
train
v1
Schema: customers (alias: cust)(value, status, amount, date) transactions(name, level, amount, code) Task: Select salary from customers where type exists in transactions for the same status. SQL:
SELECT salary FROM customers AS cust WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.status = cust.status );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "salary", "filter_col": "type", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00410
train
v2
Schema: sales (alias: sale)(type, status, value, level) schedules(date, type, name, salary) Task: Retrieve amount from sales that have at least one corresponding entry in schedules sharing the same type. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = sale.type );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "amount", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00411
train
v2
Schema: accounts (alias: acct)(value, level, id, date) shipments(code, type, name, date) Task: Find code from accounts where a matching record exists in shipments with the same status. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = acct.status );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "code", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00412
train
v1
Schema: orders (alias: ord)(amount, date, salary, value) accounts(value, amount, name, date) Task: Find salary from orders where status appears in accounts entries with matching status. SQL:
SELECT salary FROM orders AS ord WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.status = ord.status );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00413
train
v3
Schema: items (alias: lne)(code, id, type, level) employees(type, level, status, name) Task: Find name from items where value exceeds the count of salary from employees for the same status. SQL:
SELECT name FROM items AS lne WHERE value > ( SELECT COUNT(salary) FROM employees AS emp WHERE emp.status = lne.status );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00414
train
v1
Schema: orders (alias: ord)(level, salary, code, value) customers(amount, name, salary, level) Task: Select value from orders where type exists in customers for the same level. SQL:
SELECT value FROM orders AS ord WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.level = ord.level );
{ "outer_table": "orders", "inner_table": "customers", "outer_alias": "ord", "inner_alias": "cust", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00415
train
v1
Schema: sales (alias: sale)(date, code, level, amount) products(id, status, salary, level) Task: Select value from sales where id exists in products for the same status. SQL:
SELECT value FROM sales AS sale WHERE id IN ( SELECT id FROM products AS prod WHERE prod.status = sale.status );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00416
train
v3
Schema: tasks (alias: tsk)(amount, date, salary, value) projects(amount, date, id, type) Task: Retrieve id from tasks with amount above the AVG(value) of projects rows sharing the same status. SQL:
SELECT id FROM tasks AS tsk WHERE amount > ( SELECT AVG(value) FROM projects AS prj WHERE prj.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "projects", "outer_alias": "tsk", "inner_alias": "prj", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_00417
train
v1
Schema: managers (alias: mgr)(name, type, value, status) employees(value, date, amount, code) Task: Retrieve amount from managers whose code is found in employees rows where level matches the outer record. SQL:
SELECT amount FROM managers AS mgr WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.level = mgr.level );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00418
train
v2
Schema: regions (alias: rgn)(salary, type, code, value) projects(date, name, amount, code) Task: Find amount from regions where a matching record exists in projects with the same status. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = rgn.status );
{ "outer_table": "regions", "inner_table": "projects", "outer_alias": "rgn", "inner_alias": "prj", "proj_col": "amount", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_00419
train
v3
Schema: departments (alias: dept)(name, amount, id, code) projects(name, type, date, salary) Task: Retrieve id from departments with amount above the COUNT(value) of projects rows sharing the same type. SQL:
SELECT id FROM departments AS dept WHERE amount > ( SELECT COUNT(value) FROM projects AS prj WHERE prj.type = dept.type );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00420
train
v1
Schema: items (alias: lne)(value, amount, status, date) categories(id, code, date, level) Task: Retrieve salary from items whose id is found in categories rows where code matches the outer record. SQL:
SELECT salary FROM items AS lne WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.code = lne.code );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00421
train
v1
Schema: items (alias: lne)(type, date, level, value) regions(level, type, date, name) Task: Retrieve code from items whose type is found in regions rows where code matches the outer record. SQL:
SELECT code FROM items AS lne WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.code = lne.code );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00422
train
v3
Schema: departments (alias: dept)(id, date, status, level) invoices(name, status, salary, id) Task: Retrieve amount from departments with value above the AVG(salary) of invoices rows sharing the same type. SQL:
SELECT amount FROM departments AS dept WHERE value > ( SELECT AVG(salary) FROM invoices AS inv WHERE inv.type = dept.type );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00423
train
v3
Schema: schedules (alias: schd)(status, name, id, salary) accounts(level, value, salary, type) Task: Retrieve value from schedules with value above the MIN(value) of accounts rows sharing the same status. SQL:
SELECT value FROM schedules AS schd WHERE value > ( SELECT MIN(value) FROM accounts AS acct WHERE acct.status = schd.status );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00424
train
v1
Schema: managers (alias: mgr)(name, value, id, status) staff(code, id, status, name) Task: Select amount from managers where id exists in staff for the same level. SQL:
SELECT amount FROM managers AS mgr WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.level = mgr.level );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00425
train
v2
Schema: requests (alias: ordr)(name, amount, id, salary) invoices(amount, level, date, name) Task: Retrieve amount from requests that have at least one corresponding entry in invoices sharing the same status. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = ordr.status );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "amount", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_00426
train
v2
Schema: branches (alias: brc)(amount, code, value, type) shipments(name, value, amount, id) Task: Find amount from branches where a matching record exists in shipments with the same status. SQL:
SELECT amount FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = brc.status );
{ "outer_table": "branches", "inner_table": "shipments", "outer_alias": "brc", "inner_alias": "shp", "proj_col": "amount", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_00427
train
v1
Schema: items (alias: lne)(value, name, type, date) transactions(name, value, status, id) Task: Select value from items where id exists in transactions for the same level. SQL:
SELECT value FROM items AS lne WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.level = lne.level );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00428
train
v3
Schema: schedules (alias: schd)(id, date, amount, level) requests(id, level, amount, name) Task: Find salary from schedules where value exceeds the maximum value from requests for the same status. SQL:
SELECT salary FROM schedules AS schd WHERE value > ( SELECT MAX(value) FROM requests AS ordr WHERE ordr.status = schd.status );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00429
train
v3
Schema: branches (alias: brc)(amount, value, name, type) tasks(amount, id, salary, value) Task: Retrieve salary from branches with salary above the AVG(value) of tasks rows sharing the same id. SQL:
SELECT salary FROM branches AS brc WHERE salary > ( SELECT AVG(value) FROM tasks AS tsk WHERE tsk.id = brc.id );
{ "outer_table": "branches", "inner_table": "tasks", "outer_alias": "brc", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_00430
train
v1
Schema: products (alias: prod)(name, status, amount, date) employees(salary, type, id, code) Task: Select salary from products where id exists in employees for the same code. SQL:
SELECT salary FROM products AS prod WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.code = prod.code );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00431
train
v1
Schema: requests (alias: ordr)(type, id, value, amount) shipments(value, status, salary, amount) Task: Retrieve code from requests whose id is found in shipments rows where type matches the outer record. SQL:
SELECT code FROM requests AS ordr WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.type = ordr.type );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "code", "filter_col": "id", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_00432
train
v3
Schema: invoices (alias: inv)(id, code, amount, salary) categories(status, amount, value, type) Task: Find value from invoices where salary exceeds the count of salary from categories for the same status. SQL:
SELECT value FROM invoices AS inv WHERE salary > ( SELECT COUNT(salary) FROM categories AS catg WHERE catg.status = inv.status );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00433
train
v1
Schema: categories (alias: catg)(id, salary, code, level) regions(salary, type, code, name) Task: Find code from categories where level appears in regions entries with matching status. SQL:
SELECT code FROM categories AS catg WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.status = catg.status );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00434
train
v2
Schema: sales (alias: sale)(value, status, level, code) projects(type, name, id, status) Task: Find code from sales where a matching record exists in projects with the same status. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = sale.status );
{ "outer_table": "sales", "inner_table": "projects", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "code", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00435
train
v1
Schema: transactions (alias: txn)(code, value, salary, level) shipments(value, salary, code, name) Task: Select value from transactions where code exists in shipments for the same type. SQL:
SELECT value FROM transactions AS txn WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.type = txn.type );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00436
train
v1
Schema: customers (alias: cust)(status, value, code, level) invoices(value, status, date, id) Task: Select value from customers where id exists in invoices for the same level. SQL:
SELECT value FROM customers AS cust WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.level = cust.level );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00437
train
v1
Schema: items (alias: lne)(status, name, type, salary) accounts(code, id, date, value) Task: Retrieve name from items whose id is found in accounts rows where id matches the outer record. SQL:
SELECT name FROM items AS lne WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.id = lne.id );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "name", "filter_col": "id", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00438
train
v3
Schema: items (alias: lne)(id, amount, status, type) regions(code, status, date, level) Task: Retrieve salary from items with value above the AVG(amount) of regions rows sharing the same code. SQL:
SELECT salary FROM items AS lne WHERE value > ( SELECT AVG(amount) FROM regions AS rgn WHERE rgn.code = lne.code );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00439
train
v2
Schema: departments (alias: dept)(level, amount, salary, date) employees(level, type, date, id) Task: Find amount from departments where a matching record exists in employees with the same code. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = dept.code );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "amount", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00440
train
v2
Schema: shipments (alias: shp)(value, name, id, status) items(type, date, name, salary) Task: Retrieve name from shipments that have at least one corresponding entry in items sharing the same type. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = shp.type );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "name", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00441
train
v3
Schema: shipments (alias: shp)(amount, status, salary, level) sales(value, code, status, date) Task: Retrieve id from shipments with value above the MAX(value) of sales rows sharing the same type. SQL:
SELECT id FROM shipments AS shp WHERE value > ( SELECT MAX(value) FROM sales AS sale WHERE sale.type = shp.type );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00442
train
v2
Schema: invoices (alias: inv)(type, name, id, amount) managers(code, value, level, type) Task: Find salary from invoices where a matching record exists in managers with the same status. SQL:
SELECT salary FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = inv.status );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "salary", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00443
train
v2
Schema: departments (alias: dept)(code, value, amount, level) employees(id, code, date, status) Task: Find code from departments where a matching record exists in employees with the same type. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = dept.type );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "code", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00444
train
v2
Schema: branches (alias: brc)(date, salary, level, id) regions(type, value, name, code) Task: Find id from branches where a matching record exists in regions with the same code. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = brc.code );
{ "outer_table": "branches", "inner_table": "regions", "outer_alias": "brc", "inner_alias": "rgn", "proj_col": "id", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_00445
train
v2
Schema: departments (alias: dept)(id, level, salary, amount) accounts(date, salary, status, level) Task: Retrieve salary from departments that have at least one corresponding entry in accounts sharing the same id. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = dept.id );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "salary", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00446
train
v1
Schema: orders (alias: ord)(status, amount, type, salary) transactions(level, name, id, salary) Task: Select amount from orders where type exists in transactions for the same id. SQL:
SELECT amount FROM orders AS ord WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.id = ord.id );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00447
train
v2
Schema: sales (alias: sale)(name, type, id, code) regions(amount, date, status, salary) Task: Retrieve code from sales that have at least one corresponding entry in regions sharing the same code. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = sale.code );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "code", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00448
train
v1
Schema: transactions (alias: txn)(date, type, salary, value) regions(id, date, status, value) Task: Find name from transactions where level appears in regions entries with matching code. SQL:
SELECT name FROM transactions AS txn WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.code = txn.code );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00449
train
v1
Schema: regions (alias: rgn)(value, name, level, date) transactions(salary, id, type, amount) Task: Retrieve amount from regions whose id is found in transactions rows where type matches the outer record. SQL:
SELECT amount FROM regions AS rgn WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.type = rgn.type );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_00450
train
v3
Schema: requests (alias: ordr)(date, amount, value, name) branches(level, value, status, id) Task: Find name from requests where value exceeds the maximum amount from branches for the same code. SQL:
SELECT name FROM requests AS ordr WHERE value > ( SELECT MAX(amount) FROM branches AS brc WHERE brc.code = ordr.code );
{ "outer_table": "requests", "inner_table": "branches", "outer_alias": "ordr", "inner_alias": "brc", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_00451
train
v2
Schema: schedules (alias: schd)(salary, date, level, status) invoices(id, status, name, code) Task: Find value from schedules where a matching record exists in invoices with the same status. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = schd.status );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "value", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00452
train
v1
Schema: schedules (alias: schd)(status, salary, id, name) categories(id, level, type, name) Task: Find id from schedules where status appears in categories entries with matching status. SQL:
SELECT id FROM schedules AS schd WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.status = schd.status );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00453
train
v3
Schema: products (alias: prod)(id, code, name, value) transactions(name, status, level, date) Task: Retrieve salary from products with value above the MAX(salary) of transactions rows sharing the same code. SQL:
SELECT salary FROM products AS prod WHERE value > ( SELECT MAX(salary) FROM transactions AS txn WHERE txn.code = prod.code );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00454
train
v1
Schema: customers (alias: cust)(status, value, date, code) shipments(id, salary, level, type) Task: Retrieve amount from customers whose level is found in shipments rows where type matches the outer record. SQL:
SELECT amount FROM customers AS cust WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.type = cust.type );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "amount", "filter_col": "level", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00455
train
v3
Schema: projects (alias: prj)(code, date, salary, id) tasks(type, name, level, code) Task: Find value from projects where salary exceeds the average salary from tasks for the same status. SQL:
SELECT value FROM projects AS prj WHERE salary > ( SELECT AVG(salary) FROM tasks AS tsk WHERE tsk.status = prj.status );
{ "outer_table": "projects", "inner_table": "tasks", "outer_alias": "prj", "inner_alias": "tsk", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_00456
train
v2
Schema: managers (alias: mgr)(level, type, code, date) tasks(date, type, id, name) Task: Find value from managers where a matching record exists in tasks with the same type. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.type = mgr.type );
{ "outer_table": "managers", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "tsk", "proj_col": "value", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00457
train
v1
Schema: departments (alias: dept)(status, amount, date, value) regions(name, amount, level, id) Task: Retrieve name from departments whose status is found in regions rows where code matches the outer record. SQL:
SELECT name FROM departments AS dept WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.code = dept.code );
{ "outer_table": "departments", "inner_table": "regions", "outer_alias": "dept", "inner_alias": "rgn", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00458
train
v2
Schema: staff (alias: empl)(value, code, name, salary) requests(status, id, date, salary) Task: Find salary from staff where a matching record exists in requests with the same code. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = empl.code );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "salary", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_00459
train
v3
Schema: employees (alias: emp)(type, value, level, amount) transactions(id, value, date, salary) Task: Retrieve amount from employees with amount above the MAX(value) of transactions rows sharing the same type. SQL:
SELECT amount FROM employees AS emp WHERE amount > ( SELECT MAX(value) FROM transactions AS txn WHERE txn.type = emp.type );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00460
train
v1
Schema: employees (alias: emp)(type, id, date, status) items(amount, status, salary, level) Task: Find salary from employees where type appears in items entries with matching level. SQL:
SELECT salary FROM employees AS emp WHERE type IN ( SELECT type FROM items AS lne WHERE lne.level = emp.level );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "salary", "filter_col": "type", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00461
train
v1
Schema: items (alias: lne)(type, status, level, salary) branches(type, code, date, value) Task: Find amount from items where id appears in branches entries with matching type. SQL:
SELECT amount FROM items AS lne WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.type = lne.type );
{ "outer_table": "items", "inner_table": "branches", "outer_alias": "lne", "inner_alias": "brc", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00462
train
v3
Schema: invoices (alias: inv)(value, type, salary, level) schedules(amount, status, code, salary) Task: Find id from invoices where salary exceeds the average salary from schedules for the same type. SQL:
SELECT id FROM invoices AS inv WHERE salary > ( SELECT AVG(salary) FROM schedules AS schd WHERE schd.type = inv.type );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00463
train
v2
Schema: items (alias: lne)(name, code, salary, level) regions(code, amount, type, level) Task: Find value from items where a matching record exists in regions with the same type. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = lne.type );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "value", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00464
train
v3
Schema: accounts (alias: acct)(type, name, id, status) invoices(date, status, level, type) Task: Retrieve code from accounts with salary above the AVG(value) of invoices rows sharing the same status. SQL:
SELECT code FROM accounts AS acct WHERE salary > ( SELECT AVG(value) FROM invoices AS inv WHERE inv.status = acct.status );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00465
train
v2
Schema: departments (alias: dept)(date, value, type, salary) staff(date, type, amount, status) Task: Retrieve code from departments that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = dept.status );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "code", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00466
train
v3
Schema: orders (alias: ord)(code, name, id, salary) products(status, level, type, value) Task: Retrieve code from orders with salary above the SUM(value) of products rows sharing the same code. SQL:
SELECT code FROM orders AS ord WHERE salary > ( SELECT SUM(value) FROM products AS prod WHERE prod.code = ord.code );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00467
train
v1
Schema: departments (alias: dept)(name, status, salary, level) schedules(salary, level, id, type) Task: Retrieve name from departments whose level is found in schedules rows where level matches the outer record. SQL:
SELECT name FROM departments AS dept WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.level = dept.level );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00468
train
v3
Schema: shipments (alias: shp)(status, code, date, level) products(code, amount, value, name) Task: Find code from shipments where amount exceeds the count of salary from products for the same code. SQL:
SELECT code FROM shipments AS shp WHERE amount > ( SELECT COUNT(salary) FROM products AS prod WHERE prod.code = shp.code );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00469
train
v2
Schema: customers (alias: cust)(salary, date, level, value) sales(level, type, date, name) Task: Retrieve code from customers that have at least one corresponding entry in sales sharing the same level. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = cust.level );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "code", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00470
train
v3
Schema: employees (alias: emp)(value, type, id, salary) departments(value, name, id, level) Task: Find id from employees where value exceeds the count of salary from departments for the same status. SQL:
SELECT id FROM employees AS emp WHERE value > ( SELECT COUNT(salary) FROM departments AS dept WHERE dept.status = emp.status );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00471
train
v3
Schema: schedules (alias: schd)(name, type, level, code) shipments(value, salary, date, id) Task: Find salary from schedules where salary exceeds the minimum salary from shipments for the same code. SQL:
SELECT salary FROM schedules AS schd WHERE salary > ( SELECT MIN(salary) FROM shipments AS shp WHERE shp.code = schd.code );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00472
train
v2
Schema: projects (alias: prj)(status, name, salary, type) departments(level, id, value, amount) Task: Retrieve name from projects that have at least one corresponding entry in departments sharing the same status. SQL:
SELECT name FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = prj.status );
{ "outer_table": "projects", "inner_table": "departments", "outer_alias": "prj", "inner_alias": "dept", "proj_col": "name", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_00473
train
v2
Schema: customers (alias: cust)(status, type, level, amount) categories(type, id, level, name) Task: Find code from customers where a matching record exists in categories with the same status. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = cust.status );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "code", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00474
train
v2
Schema: customers (alias: cust)(date, status, name, code) projects(status, value, amount, name) Task: Find name from customers where a matching record exists in projects with the same code. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.code = cust.code );
{ "outer_table": "customers", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "prj", "proj_col": "name", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00475
train
v2
Schema: employees (alias: emp)(salary, date, code, value) staff(type, amount, salary, value) Task: Retrieve code from employees that have at least one corresponding entry in staff sharing the same code. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = emp.code );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "code", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00476
train
v3
Schema: categories (alias: catg)(type, status, code, amount) transactions(name, id, status, level) Task: Retrieve id from categories with value above the MAX(salary) of transactions rows sharing the same id. SQL:
SELECT id FROM categories AS catg WHERE value > ( SELECT MAX(salary) FROM transactions AS txn WHERE txn.id = catg.id );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00477
train
v1
Schema: categories (alias: catg)(name, salary, type, id) transactions(code, amount, date, value) Task: Select code from categories where level exists in transactions for the same code. SQL:
SELECT code FROM categories AS catg WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.code = catg.code );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00478
train
v2
Schema: projects (alias: prj)(status, level, id, salary) schedules(id, name, type, value) Task: Find code from projects where a matching record exists in schedules with the same id. SQL:
SELECT code FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = prj.id );
{ "outer_table": "projects", "inner_table": "schedules", "outer_alias": "prj", "inner_alias": "schd", "proj_col": "code", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_00479
train
v3
Schema: items (alias: lne)(amount, id, status, value) projects(type, name, code, value) Task: Find code from items where salary exceeds the count of salary from projects for the same type. SQL:
SELECT code FROM items AS lne WHERE salary > ( SELECT COUNT(salary) FROM projects AS prj WHERE prj.type = lne.type );
{ "outer_table": "items", "inner_table": "projects", "outer_alias": "lne", "inner_alias": "prj", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00480
train
v3
Schema: shipments (alias: shp)(salary, date, code, value) branches(id, name, status, type) Task: Find salary from shipments where value exceeds the minimum amount from branches for the same type. SQL:
SELECT salary FROM shipments AS shp WHERE value > ( SELECT MIN(amount) FROM branches AS brc WHERE brc.type = shp.type );
{ "outer_table": "shipments", "inner_table": "branches", "outer_alias": "shp", "inner_alias": "brc", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00481
train
v2
Schema: schedules (alias: schd)(level, status, id, value) projects(amount, code, salary, type) Task: Retrieve value from schedules that have at least one corresponding entry in projects sharing the same status. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = schd.status );
{ "outer_table": "schedules", "inner_table": "projects", "outer_alias": "schd", "inner_alias": "prj", "proj_col": "value", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00482
train
v2
Schema: schedules (alias: schd)(name, level, value, status) managers(salary, level, status, amount) Task: Find salary from schedules where a matching record exists in managers with the same level. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = schd.level );
{ "outer_table": "schedules", "inner_table": "managers", "outer_alias": "schd", "inner_alias": "mgr", "proj_col": "salary", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00483
train
v3
Schema: categories (alias: catg)(date, code, salary, amount) accounts(type, salary, amount, level) Task: Retrieve value from categories with value above the AVG(value) of accounts rows sharing the same type. SQL:
SELECT value FROM categories AS catg WHERE value > ( SELECT AVG(value) FROM accounts AS acct WHERE acct.type = catg.type );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00484
train
v2
Schema: employees (alias: emp)(date, id, type, value) transactions(value, id, level, type) Task: Find value from employees where a matching record exists in transactions with the same status. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = emp.status );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "value", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00485
train
v2
Schema: shipments (alias: shp)(type, value, code, salary) managers(status, amount, salary, id) Task: Find value from shipments where a matching record exists in managers with the same id. SQL:
SELECT value FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = shp.id );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "value", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00486
train
v2
Schema: invoices (alias: inv)(type, id, code, date) departments(status, salary, type, id) Task: Find amount from invoices where a matching record exists in departments with the same level. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = inv.level );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "amount", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00487
train
v3
Schema: projects (alias: prj)(level, id, status, salary) accounts(level, amount, id, type) Task: Retrieve name from projects with value above the COUNT(amount) of accounts rows sharing the same level. SQL:
SELECT name FROM projects AS prj WHERE value > ( SELECT COUNT(amount) FROM accounts AS acct WHERE acct.level = prj.level );
{ "outer_table": "projects", "inner_table": "accounts", "outer_alias": "prj", "inner_alias": "acct", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_00488
train
v2
Schema: shipments (alias: shp)(date, amount, value, type) regions(id, level, code, amount) Task: Retrieve id from shipments that have at least one corresponding entry in regions sharing the same id. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = shp.id );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "id", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00489
train
v3
Schema: categories (alias: catg)(value, salary, name, amount) requests(amount, name, salary, code) Task: Retrieve salary from categories with salary above the AVG(amount) of requests rows sharing the same code. SQL:
SELECT salary FROM categories AS catg WHERE salary > ( SELECT AVG(amount) FROM requests AS ordr WHERE ordr.code = catg.code );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00490
train
v2
Schema: employees (alias: emp)(level, code, status, salary) staff(level, code, id, amount) Task: Find salary from employees where a matching record exists in staff with the same status. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = emp.status );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "salary", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00491
train
v3
Schema: departments (alias: dept)(salary, id, type, amount) requests(salary, code, type, level) Task: Retrieve salary from departments with value above the COUNT(amount) of requests rows sharing the same type. SQL:
SELECT salary FROM departments AS dept WHERE value > ( SELECT COUNT(amount) FROM requests AS ordr WHERE ordr.type = dept.type );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00492
train
v2
Schema: employees (alias: emp)(value, name, amount, code) transactions(salary, value, code, type) Task: Retrieve salary from employees that have at least one corresponding entry in transactions sharing the same level. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = emp.level );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "salary", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00493
train
v1
Schema: customers (alias: cust)(name, value, status, level) transactions(salary, amount, value, code) Task: Find name from customers where status appears in transactions entries with matching code. SQL:
SELECT name FROM customers AS cust WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.code = cust.code );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00494
train
v2
Schema: sales (alias: sale)(salary, id, status, value) tasks(date, status, type, code) Task: Find salary from sales where a matching record exists in tasks with the same id. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.id = sale.id );
{ "outer_table": "sales", "inner_table": "tasks", "outer_alias": "sale", "inner_alias": "tsk", "proj_col": "salary", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00495
train
v3
Schema: departments (alias: dept)(amount, level, salary, name) invoices(salary, code, level, id) Task: Find salary from departments where value exceeds the average salary from invoices for the same type. SQL:
SELECT salary FROM departments AS dept WHERE value > ( SELECT AVG(salary) FROM invoices AS inv WHERE inv.type = dept.type );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00496
train
v3
Schema: shipments (alias: shp)(status, name, salary, amount) regions(type, code, amount, value) Task: Find value from shipments where salary exceeds the count of value from regions for the same status. SQL:
SELECT value FROM shipments AS shp WHERE salary > ( SELECT COUNT(value) FROM regions AS rgn WHERE rgn.status = shp.status );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00497
train
v1
Schema: regions (alias: rgn)(code, amount, date, salary) departments(salary, level, value, amount) Task: Find salary from regions where level appears in departments entries with matching level. SQL:
SELECT salary FROM regions AS rgn WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.level = rgn.level );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "salary", "filter_col": "level", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_00498
train
v3
Schema: products (alias: prod)(name, code, level, amount) tasks(level, id, status, salary) Task: Retrieve value from products with value above the COUNT(amount) of tasks rows sharing the same level. SQL:
SELECT value FROM products AS prod WHERE value > ( SELECT COUNT(amount) FROM tasks AS tsk WHERE tsk.level = prod.level );
{ "outer_table": "products", "inner_table": "tasks", "outer_alias": "prod", "inner_alias": "tsk", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00499
train