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
v2
Schema: employees (alias: emp)(status, value, name, type) customers(amount, name, code, date) Task: Retrieve code from employees that have at least one corresponding entry in customers sharing the same type. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = emp.type );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "code", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09500
train
v1
Schema: accounts (alias: acct)(type, salary, name, amount) staff(amount, type, status, id) Task: Retrieve code from accounts whose status is found in staff rows where id matches the outer record. SQL:
SELECT code FROM accounts AS acct WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.id = acct.id );
{ "outer_table": "accounts", "inner_table": "staff", "outer_alias": "acct", "inner_alias": "empl", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09501
train
v1
Schema: products (alias: prod)(amount, value, id, salary) categories(level, id, name, type) Task: Select name from products where status exists in categories for the same status. SQL:
SELECT name FROM products AS prod WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.status = prod.status );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09502
train
v2
Schema: shipments (alias: shp)(code, level, value, type) staff(code, type, date, value) Task: Find salary from shipments where a matching record exists in staff with the same id. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = shp.id );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "salary", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_09503
train
v2
Schema: customers (alias: cust)(salary, value, status, level) managers(type, value, salary, amount) Task: Retrieve name from customers that have at least one corresponding entry in managers sharing the same type. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = cust.type );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "name", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09504
train
v3
Schema: tasks (alias: tsk)(amount, code, level, id) orders(status, level, date, code) Task: Find code from tasks where salary exceeds the minimum amount from orders for the same code. SQL:
SELECT code FROM tasks AS tsk WHERE salary > ( SELECT MIN(amount) FROM orders AS ord WHERE ord.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "orders", "outer_alias": "tsk", "inner_alias": "ord", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09505
train
v1
Schema: categories (alias: catg)(id, salary, level, code) requests(value, status, amount, id) Task: Find id from categories where type appears in requests entries with matching status. SQL:
SELECT id FROM categories AS catg WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.status = catg.status );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "id", "filter_col": "type", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09506
train
v3
Schema: staff (alias: empl)(salary, name, date, value) sales(code, value, level, salary) Task: Find amount from staff where salary exceeds the minimum amount from sales for the same level. SQL:
SELECT amount FROM staff AS empl WHERE salary > ( SELECT MIN(amount) FROM sales AS sale WHERE sale.level = empl.level );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_09507
train
v2
Schema: transactions (alias: txn)(level, code, id, value) products(salary, value, code, name) Task: Retrieve id from transactions that have at least one corresponding entry in products sharing the same id. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = txn.id );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "id", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09508
train
v3
Schema: accounts (alias: acct)(id, status, value, name) regions(name, amount, date, status) Task: Find value from accounts where salary exceeds the count of salary from regions for the same type. SQL:
SELECT value FROM accounts AS acct WHERE salary > ( SELECT COUNT(salary) FROM regions AS rgn WHERE rgn.type = acct.type );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09509
train
v3
Schema: employees (alias: emp)(id, date, type, salary) categories(amount, name, status, type) Task: Retrieve code from employees with amount above the AVG(amount) of categories rows sharing the same code. SQL:
SELECT code FROM employees AS emp WHERE amount > ( SELECT AVG(amount) FROM categories AS catg WHERE catg.code = emp.code );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09510
train
v1
Schema: projects (alias: prj)(value, name, salary, type) staff(level, salary, code, amount) Task: Retrieve value from projects whose status is found in staff rows where id matches the outer record. SQL:
SELECT value FROM projects AS prj WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.id = prj.id );
{ "outer_table": "projects", "inner_table": "staff", "outer_alias": "prj", "inner_alias": "empl", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_09511
train
v1
Schema: requests (alias: ordr)(status, date, code, name) invoices(status, type, level, amount) Task: Retrieve value from requests whose code is found in invoices rows where code matches the outer record. SQL:
SELECT value FROM requests AS ordr WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.code = ordr.code );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09512
train
v1
Schema: customers (alias: cust)(amount, value, level, name) invoices(id, level, value, salary) Task: Find name from customers where level appears in invoices entries with matching type. SQL:
SELECT name FROM customers AS cust WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.type = cust.type );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09513
train
v2
Schema: categories (alias: catg)(date, level, type, amount) transactions(date, code, value, name) Task: Find code from categories where a matching record exists in transactions with the same type. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = catg.type );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "code", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09514
train
v1
Schema: branches (alias: brc)(status, salary, code, id) invoices(id, salary, amount, level) Task: Find amount from branches where type appears in invoices entries with matching id. SQL:
SELECT amount FROM branches AS brc WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.id = brc.id );
{ "outer_table": "branches", "inner_table": "invoices", "outer_alias": "brc", "inner_alias": "inv", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_09515
train
v3
Schema: categories (alias: catg)(level, type, date, code) items(level, type, salary, date) Task: Find code from categories where amount exceeds the average value from items for the same level. SQL:
SELECT code FROM categories AS catg WHERE amount > ( SELECT AVG(value) FROM items AS lne WHERE lne.level = catg.level );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09516
train
v1
Schema: categories (alias: catg)(type, status, id, level) employees(date, type, id, amount) Task: Retrieve id from categories whose status is found in employees rows where code matches the outer record. SQL:
SELECT id FROM categories AS catg WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.code = catg.code );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09517
train
v1
Schema: customers (alias: cust)(value, amount, code, type) invoices(code, name, amount, date) Task: Find name from customers where status appears in invoices entries with matching level. SQL:
SELECT name FROM customers AS cust WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.level = cust.level );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09518
train
v2
Schema: requests (alias: ordr)(code, salary, level, id) customers(value, id, status, name) Task: Retrieve name from requests that have at least one corresponding entry in customers sharing the same status. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = ordr.status );
{ "outer_table": "requests", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "name", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09519
train
v2
Schema: categories (alias: catg)(id, name, amount, type) employees(code, id, amount, salary) Task: Find id from categories where a matching record exists in employees with the same code. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = catg.code );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "id", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09520
train
v2
Schema: employees (alias: emp)(amount, date, name, code) schedules(name, date, status, code) Task: Retrieve value from employees that have at least one corresponding entry in schedules sharing the same code. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = emp.code );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "value", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09521
train
v3
Schema: projects (alias: prj)(salary, code, name, id) items(level, salary, code, status) Task: Find code from projects where amount exceeds the average value from items for the same type. SQL:
SELECT code FROM projects AS prj WHERE amount > ( SELECT AVG(value) FROM items AS lne WHERE lne.type = prj.type );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "lne", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_09522
train
v3
Schema: departments (alias: dept)(status, amount, value, salary) items(level, value, status, id) Task: Find amount from departments where value exceeds the average salary from items for the same id. SQL:
SELECT amount FROM departments AS dept WHERE value > ( SELECT AVG(salary) FROM items AS lne WHERE lne.id = dept.id );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09523
train
v2
Schema: managers (alias: mgr)(name, amount, status, date) projects(date, code, type, name) Task: Retrieve salary from managers that have at least one corresponding entry in projects sharing the same type. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = mgr.type );
{ "outer_table": "managers", "inner_table": "projects", "outer_alias": "mgr", "inner_alias": "prj", "proj_col": "salary", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09524
train
v1
Schema: tasks (alias: tsk)(value, amount, id, salary) orders(salary, level, name, status) Task: Select value from tasks where type exists in orders for the same level. SQL:
SELECT value FROM tasks AS tsk WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "orders", "outer_alias": "tsk", "inner_alias": "ord", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09525
train
v1
Schema: sales (alias: sale)(name, amount, type, status) staff(amount, type, code, level) Task: Select amount from sales where level exists in staff for the same status. SQL:
SELECT amount FROM sales AS sale WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.status = sale.status );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09526
train
v3
Schema: accounts (alias: acct)(amount, code, salary, date) departments(salary, name, level, id) Task: Find id from accounts where amount exceeds the minimum amount from departments for the same type. SQL:
SELECT id FROM accounts AS acct WHERE amount > ( SELECT MIN(amount) FROM departments AS dept WHERE dept.type = acct.type );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09527
train
v1
Schema: transactions (alias: txn)(salary, date, level, amount) products(level, name, id, value) Task: Find name from transactions where status appears in products entries with matching level. SQL:
SELECT name FROM transactions AS txn WHERE status IN ( SELECT status FROM products AS prod WHERE prod.level = txn.level );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09528
train
v1
Schema: projects (alias: prj)(code, date, salary, name) staff(code, salary, name, value) Task: Retrieve salary from projects whose level is found in staff rows where code matches the outer record. SQL:
SELECT salary FROM projects AS prj WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.code = prj.code );
{ "outer_table": "projects", "inner_table": "staff", "outer_alias": "prj", "inner_alias": "empl", "proj_col": "salary", "filter_col": "level", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_09529
train
v1
Schema: regions (alias: rgn)(value, type, name, level) categories(id, type, salary, date) Task: Select value from regions where id exists in categories for the same id. SQL:
SELECT value FROM regions AS rgn WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.id = rgn.id );
{ "outer_table": "regions", "inner_table": "categories", "outer_alias": "rgn", "inner_alias": "catg", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_09530
train
v3
Schema: schedules (alias: schd)(level, date, type, salary) categories(code, status, name, amount) Task: Find value from schedules where value exceeds the average salary from categories for the same id. SQL:
SELECT value FROM schedules AS schd WHERE value > ( SELECT AVG(salary) FROM categories AS catg WHERE catg.id = schd.id );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09531
train
v2
Schema: accounts (alias: acct)(level, status, amount, name) invoices(status, value, name, amount) Task: Find value from accounts where a matching record exists in invoices with the same status. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = acct.status );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "value", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09532
train
v2
Schema: transactions (alias: txn)(value, level, code, date) items(type, code, name, id) Task: Find code from transactions where a matching record exists in items with the same id. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.id = txn.id );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "code", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09533
train
v1
Schema: branches (alias: brc)(value, status, id, date) items(code, amount, value, name) Task: Retrieve name from branches whose id is found in items rows where code matches the outer record. SQL:
SELECT name FROM branches AS brc WHERE id IN ( SELECT id FROM items AS lne WHERE lne.code = brc.code );
{ "outer_table": "branches", "inner_table": "items", "outer_alias": "brc", "inner_alias": "lne", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_09534
train
v1
Schema: departments (alias: dept)(type, salary, code, name) tasks(type, value, amount, name) Task: Select value from departments where status exists in tasks for the same code. SQL:
SELECT value FROM departments AS dept WHERE status IN ( SELECT status FROM tasks AS tsk WHERE tsk.code = dept.code );
{ "outer_table": "departments", "inner_table": "tasks", "outer_alias": "dept", "inner_alias": "tsk", "proj_col": "value", "filter_col": "status", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09535
train
v2
Schema: accounts (alias: acct)(value, type, date, salary) schedules(code, level, name, id) Task: Retrieve code from accounts that have at least one corresponding entry in schedules sharing the same status. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = acct.status );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "code", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09536
train
v2
Schema: departments (alias: dept)(status, date, code, amount) managers(level, salary, status, name) Task: Retrieve name from departments that have at least one corresponding entry in managers sharing the same code. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = dept.code );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "name", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09537
train
v1
Schema: departments (alias: dept)(status, date, id, amount) managers(salary, status, date, code) Task: Retrieve name from departments whose level is found in managers rows where status matches the outer record. SQL:
SELECT name FROM departments AS dept WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.status = dept.status );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09538
train
v1
Schema: schedules (alias: schd)(date, level, status, name) employees(amount, salary, value, code) Task: Retrieve value from schedules whose status is found in employees rows where type matches the outer record. SQL:
SELECT value FROM schedules AS schd WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.type = schd.type );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "value", "filter_col": "status", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09539
train
v2
Schema: orders (alias: ord)(amount, type, code, value) shipments(name, code, amount, status) Task: Retrieve id from orders that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT id FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = ord.status );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "id", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09540
train
v3
Schema: regions (alias: rgn)(id, name, date, level) projects(level, amount, status, date) Task: Find amount from regions where salary exceeds the total value from projects for the same id. SQL:
SELECT amount FROM regions AS rgn WHERE salary > ( SELECT SUM(value) FROM projects AS prj WHERE prj.id = rgn.id );
{ "outer_table": "regions", "inner_table": "projects", "outer_alias": "rgn", "inner_alias": "prj", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_09541
train
v3
Schema: accounts (alias: acct)(level, amount, id, status) managers(level, date, amount, name) Task: Find id from accounts where amount exceeds the average amount from managers for the same code. SQL:
SELECT id FROM accounts AS acct WHERE amount > ( SELECT AVG(amount) FROM managers AS mgr WHERE mgr.code = acct.code );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09542
train
v2
Schema: sales (alias: sale)(code, level, type, amount) shipments(value, id, status, amount) Task: Find amount from sales where a matching record exists in shipments with the same level. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = sale.level );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "amount", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09543
train
v3
Schema: customers (alias: cust)(salary, level, type, date) regions(date, value, name, code) Task: Find value from customers where value exceeds the count of salary from regions for the same status. SQL:
SELECT value FROM customers AS cust WHERE value > ( SELECT COUNT(salary) FROM regions AS rgn WHERE rgn.status = cust.status );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09544
train
v2
Schema: requests (alias: ordr)(status, id, code, amount) tasks(code, date, type, salary) Task: Retrieve value from requests that have at least one corresponding entry in tasks sharing the same level. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.level = ordr.level );
{ "outer_table": "requests", "inner_table": "tasks", "outer_alias": "ordr", "inner_alias": "tsk", "proj_col": "value", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09545
train
v1
Schema: customers (alias: cust)(id, status, code, salary) departments(amount, type, code, name) Task: Retrieve id from customers whose code is found in departments rows where code matches the outer record. SQL:
SELECT id FROM customers AS cust WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.code = cust.code );
{ "outer_table": "customers", "inner_table": "departments", "outer_alias": "cust", "inner_alias": "dept", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09546
train
v1
Schema: regions (alias: rgn)(id, amount, code, date) projects(amount, name, level, code) Task: Find code from regions where status appears in projects entries with matching type. SQL:
SELECT code FROM regions AS rgn WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.type = rgn.type );
{ "outer_table": "regions", "inner_table": "projects", "outer_alias": "rgn", "inner_alias": "prj", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_09547
train
v2
Schema: departments (alias: dept)(level, value, salary, type) tasks(date, id, salary, level) Task: Retrieve salary from departments that have at least one corresponding entry in tasks sharing the same type. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.type = dept.type );
{ "outer_table": "departments", "inner_table": "tasks", "outer_alias": "dept", "inner_alias": "tsk", "proj_col": "salary", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09548
train
v2
Schema: items (alias: lne)(date, name, level, status) shipments(salary, code, name, level) Task: Retrieve name from items that have at least one corresponding entry in shipments sharing the same level. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = lne.level );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "name", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09549
train
v1
Schema: regions (alias: rgn)(amount, type, code, id) staff(status, salary, date, value) Task: Select name from regions where code exists in staff for the same code. SQL:
SELECT name FROM regions AS rgn WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.code = rgn.code );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_09550
train
v1
Schema: transactions (alias: txn)(id, name, value, status) requests(id, type, value, code) Task: Retrieve salary from transactions whose status is found in requests rows where status matches the outer record. SQL:
SELECT salary FROM transactions AS txn WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.status = txn.status );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09551
train
v3
Schema: categories (alias: catg)(code, amount, status, value) products(level, id, value, date) Task: Retrieve amount from categories with salary above the MIN(value) of products rows sharing the same type. SQL:
SELECT amount FROM categories AS catg WHERE salary > ( SELECT MIN(value) FROM products AS prod WHERE prod.type = catg.type );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09552
train
v1
Schema: invoices (alias: inv)(name, value, type, level) schedules(id, code, date, value) Task: Find name from invoices where code appears in schedules entries with matching id. SQL:
SELECT name FROM invoices AS inv WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.id = inv.id );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09553
train
v2
Schema: invoices (alias: inv)(salary, id, code, status) regions(amount, salary, id, level) Task: Find id from invoices where a matching record exists in regions with the same type. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = inv.type );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "id", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09554
train
v1
Schema: requests (alias: ordr)(value, id, name, status) items(status, type, amount, id) Task: Find name from requests where status appears in items entries with matching type. SQL:
SELECT name FROM requests AS ordr WHERE status IN ( SELECT status FROM items AS lne WHERE lne.type = ordr.type );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_09555
train
v1
Schema: departments (alias: dept)(code, name, level, status) customers(id, level, salary, name) Task: Find code from departments where status appears in customers entries with matching status. SQL:
SELECT code FROM departments AS dept WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.status = dept.status );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "code", "filter_col": "status", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09556
train
v2
Schema: branches (alias: brc)(id, amount, status, name) employees(amount, name, status, value) Task: Retrieve name from branches that have at least one corresponding entry in employees sharing the same code. SQL:
SELECT name FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = brc.code );
{ "outer_table": "branches", "inner_table": "employees", "outer_alias": "brc", "inner_alias": "emp", "proj_col": "name", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_09557
train
v2
Schema: transactions (alias: txn)(code, type, value, amount) managers(type, name, salary, value) Task: Retrieve id from transactions that have at least one corresponding entry in managers sharing the same code. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = txn.code );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "id", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09558
train
v2
Schema: branches (alias: brc)(name, salary, value, type) accounts(date, status, id, amount) Task: Find id from branches where a matching record exists in accounts with the same type. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = brc.type );
{ "outer_table": "branches", "inner_table": "accounts", "outer_alias": "brc", "inner_alias": "acct", "proj_col": "id", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_09559
train
v3
Schema: departments (alias: dept)(type, name, amount, id) tasks(code, value, status, type) Task: Find amount from departments where amount exceeds the average salary from tasks for the same code. SQL:
SELECT amount FROM departments AS dept WHERE amount > ( SELECT AVG(salary) FROM tasks AS tsk WHERE tsk.code = dept.code );
{ "outer_table": "departments", "inner_table": "tasks", "outer_alias": "dept", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09560
train
v1
Schema: customers (alias: cust)(date, salary, value, code) departments(level, name, salary, date) Task: Retrieve value from customers whose level is found in departments rows where type matches the outer record. SQL:
SELECT value FROM customers AS cust WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.type = cust.type );
{ "outer_table": "customers", "inner_table": "departments", "outer_alias": "cust", "inner_alias": "dept", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09561
train
v2
Schema: regions (alias: rgn)(code, status, date, type) branches(name, amount, date, code) Task: Retrieve id from regions that have at least one corresponding entry in branches sharing the same id. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.id = rgn.id );
{ "outer_table": "regions", "inner_table": "branches", "outer_alias": "rgn", "inner_alias": "brc", "proj_col": "id", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_09562
train
v3
Schema: sales (alias: sale)(salary, amount, type, name) tasks(name, id, level, amount) Task: Find amount from sales where salary exceeds the total salary from tasks for the same code. SQL:
SELECT amount FROM sales AS sale WHERE salary > ( SELECT SUM(salary) FROM tasks AS tsk WHERE tsk.code = sale.code );
{ "outer_table": "sales", "inner_table": "tasks", "outer_alias": "sale", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09563
train
v3
Schema: accounts (alias: acct)(id, value, amount, name) branches(date, code, id, salary) Task: Retrieve value from accounts with value above the SUM(value) of branches rows sharing the same id. SQL:
SELECT value FROM accounts AS acct WHERE value > ( SELECT SUM(value) FROM branches AS brc WHERE brc.id = acct.id );
{ "outer_table": "accounts", "inner_table": "branches", "outer_alias": "acct", "inner_alias": "brc", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09564
train
v2
Schema: products (alias: prod)(code, status, id, type) sales(status, code, level, id) Task: Retrieve amount from products that have at least one corresponding entry in sales sharing the same status. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = prod.status );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "amount", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09565
train
v3
Schema: invoices (alias: inv)(salary, code, id, amount) accounts(amount, status, id, date) Task: Retrieve value from invoices with salary above the COUNT(amount) of accounts rows sharing the same level. SQL:
SELECT value FROM invoices AS inv WHERE salary > ( SELECT COUNT(amount) FROM accounts AS acct WHERE acct.level = inv.level );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09566
train
v1
Schema: orders (alias: ord)(amount, value, name, salary) invoices(level, date, amount, salary) Task: Retrieve value from orders whose level is found in invoices rows where level matches the outer record. SQL:
SELECT value FROM orders AS ord WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.level = ord.level );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09567
train
v3
Schema: regions (alias: rgn)(value, amount, status, type) orders(id, amount, status, name) Task: Retrieve salary from regions with salary above the SUM(salary) of orders rows sharing the same type. SQL:
SELECT salary FROM regions AS rgn WHERE salary > ( SELECT SUM(salary) FROM orders AS ord WHERE ord.type = rgn.type );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_09568
train
v2
Schema: customers (alias: cust)(status, date, code, name) projects(code, status, amount, salary) Task: Find name from customers where a matching record exists in projects with the same id. SQL:
SELECT name 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": "name", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09569
train
v1
Schema: categories (alias: catg)(amount, name, salary, value) departments(type, code, date, level) Task: Select id from categories where code exists in departments for the same status. SQL:
SELECT id FROM categories AS catg WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.status = catg.status );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09570
train
v3
Schema: sales (alias: sale)(value, date, type, name) transactions(level, salary, status, value) Task: Retrieve amount from sales with value above the SUM(value) of transactions rows sharing the same id. SQL:
SELECT amount FROM sales AS sale WHERE value > ( SELECT SUM(value) FROM transactions AS txn WHERE txn.id = sale.id );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09571
train
v1
Schema: projects (alias: prj)(type, amount, id, value) departments(type, name, value, salary) Task: Select amount from projects where id exists in departments for the same type. SQL:
SELECT amount FROM projects AS prj WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.type = prj.type );
{ "outer_table": "projects", "inner_table": "departments", "outer_alias": "prj", "inner_alias": "dept", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_09572
train
v1
Schema: products (alias: prod)(level, date, amount, value) projects(code, date, salary, type) Task: Select code from products where code exists in projects for the same type. SQL:
SELECT code FROM products AS prod WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.type = prod.type );
{ "outer_table": "products", "inner_table": "projects", "outer_alias": "prod", "inner_alias": "prj", "proj_col": "code", "filter_col": "code", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09573
train
v1
Schema: schedules (alias: schd)(name, id, type, value) projects(value, date, name, amount) Task: Select code from schedules where type exists in projects for the same id. SQL:
SELECT code FROM schedules AS schd WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.id = schd.id );
{ "outer_table": "schedules", "inner_table": "projects", "outer_alias": "schd", "inner_alias": "prj", "proj_col": "code", "filter_col": "type", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09574
train
v3
Schema: managers (alias: mgr)(date, salary, type, level) products(id, value, level, name) Task: Retrieve code from managers with value above the MIN(amount) of products rows sharing the same level. SQL:
SELECT code FROM managers AS mgr WHERE value > ( SELECT MIN(amount) FROM products AS prod WHERE prod.level = mgr.level );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09575
train
v1
Schema: sales (alias: sale)(date, salary, id, value) invoices(date, status, code, salary) Task: Select amount from sales where type exists in invoices for the same level. SQL:
SELECT amount FROM sales AS sale WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.level = sale.level );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09576
train
v1
Schema: branches (alias: brc)(level, code, amount, status) categories(salary, code, id, amount) Task: Find salary from branches where level appears in categories entries with matching type. SQL:
SELECT salary FROM branches AS brc WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.type = brc.type );
{ "outer_table": "branches", "inner_table": "categories", "outer_alias": "brc", "inner_alias": "catg", "proj_col": "salary", "filter_col": "level", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_09577
train
v3
Schema: sales (alias: sale)(salary, code, date, amount) customers(salary, status, level, date) Task: Retrieve name from sales with salary above the MIN(salary) of customers rows sharing the same code. SQL:
SELECT name FROM sales AS sale WHERE salary > ( SELECT MIN(salary) FROM customers AS cust WHERE cust.code = sale.code );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09578
train
v3
Schema: tasks (alias: tsk)(amount, code, type, id) departments(level, date, type, value) Task: Retrieve code from tasks with amount above the AVG(amount) of departments rows sharing the same type. SQL:
SELECT code FROM tasks AS tsk WHERE amount > ( SELECT AVG(amount) FROM departments AS dept WHERE dept.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "departments", "outer_alias": "tsk", "inner_alias": "dept", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_09579
train
v3
Schema: products (alias: prod)(id, date, type, level) managers(status, type, date, level) Task: Retrieve amount from products with salary above the SUM(value) of managers rows sharing the same level. SQL:
SELECT amount FROM products AS prod WHERE salary > ( SELECT SUM(value) FROM managers AS mgr WHERE mgr.level = prod.level );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09580
train
v3
Schema: branches (alias: brc)(amount, salary, status, type) items(amount, id, status, code) Task: Retrieve value from branches with salary above the AVG(value) of items rows sharing the same code. SQL:
SELECT value FROM branches AS brc WHERE salary > ( SELECT AVG(value) FROM items AS lne WHERE lne.code = brc.code );
{ "outer_table": "branches", "inner_table": "items", "outer_alias": "brc", "inner_alias": "lne", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_09581
train
v1
Schema: employees (alias: emp)(amount, value, salary, name) requests(status, amount, id, level) Task: Find code from employees where id appears in requests entries with matching level. SQL:
SELECT code FROM employees AS emp WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.level = emp.level );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "code", "filter_col": "id", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09582
train
v2
Schema: shipments (alias: shp)(code, type, salary, level) sales(name, level, amount, status) Task: Retrieve salary from shipments that have at least one corresponding entry in sales sharing the same level. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = shp.level );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "salary", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_09583
train
v1
Schema: products (alias: prod)(name, amount, salary, type) transactions(date, level, amount, id) Task: Find amount from products where status appears in transactions entries with matching type. SQL:
SELECT amount FROM products AS prod WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.type = prod.type );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "amount", "filter_col": "status", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09584
train
v2
Schema: departments (alias: dept)(value, salary, amount, level) branches(id, salary, status, name) Task: Find name from departments where a matching record exists in branches with the same id. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.id = dept.id );
{ "outer_table": "departments", "inner_table": "branches", "outer_alias": "dept", "inner_alias": "brc", "proj_col": "name", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09585
train
v1
Schema: transactions (alias: txn)(value, amount, name, status) accounts(code, status, level, type) Task: Retrieve amount from transactions whose id is found in accounts rows where type matches the outer record. SQL:
SELECT amount FROM transactions AS txn WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.type = txn.type );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09586
train
v3
Schema: employees (alias: emp)(date, amount, name, id) categories(amount, date, status, id) Task: Retrieve value from employees with salary above the MAX(value) of categories rows sharing the same code. SQL:
SELECT value FROM employees AS emp WHERE salary > ( SELECT MAX(value) FROM categories AS catg WHERE catg.code = emp.code );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09587
train
v2
Schema: schedules (alias: schd)(status, id, type, level) orders(amount, id, value, date) Task: Find code from schedules where a matching record exists in orders with the same id. SQL:
SELECT code FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = schd.id );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "code", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_09588
train
v1
Schema: customers (alias: cust)(id, type, value, code) accounts(level, status, code, amount) Task: Find amount from customers where id appears in accounts entries with matching status. SQL:
SELECT amount FROM customers AS cust WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.status = cust.status );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09589
train
v2
Schema: accounts (alias: acct)(code, status, amount, name) invoices(amount, salary, code, date) Task: Find code from accounts where a matching record exists in invoices with the same status. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = acct.status );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "code", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09590
train
v2
Schema: orders (alias: ord)(type, id, salary, code) projects(date, status, name, code) Task: Find name from orders where a matching record exists in projects with the same level. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.level = ord.level );
{ "outer_table": "orders", "inner_table": "projects", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "name", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09591
train
v2
Schema: customers (alias: cust)(amount, level, salary, id) shipments(status, id, code, level) Task: Retrieve name from customers that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = cust.id );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "name", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09592
train
v1
Schema: invoices (alias: inv)(value, level, code, salary) employees(amount, date, level, name) Task: Find code from invoices where code appears in employees entries with matching level. SQL:
SELECT code FROM invoices AS inv WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.level = inv.level );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "code", "filter_col": "code", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09593
train
v2
Schema: items (alias: lne)(value, type, amount, salary) orders(level, name, type, id) Task: Find salary from items where a matching record exists in orders with the same type. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = lne.type );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "salary", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_09594
train
v2
Schema: accounts (alias: acct)(type, level, salary, amount) requests(level, name, code, status) Task: Retrieve value from accounts that have at least one corresponding entry in requests sharing the same type. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = acct.type );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "value", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09595
train
v1
Schema: departments (alias: dept)(value, amount, level, salary) staff(code, amount, name, type) Task: Find value from departments where status appears in staff entries with matching code. SQL:
SELECT value FROM departments AS dept WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.code = dept.code );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "value", "filter_col": "status", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09596
train
v2
Schema: regions (alias: rgn)(status, level, date, code) schedules(id, status, date, name) Task: Retrieve id from regions that have at least one corresponding entry in schedules sharing the same level. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = rgn.level );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "id", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_09597
train
v1
Schema: orders (alias: ord)(id, date, amount, code) departments(name, code, type, id) Task: Select name from orders where id exists in departments for the same status. SQL:
SELECT name FROM orders AS ord WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.status = ord.status );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "name", "filter_col": "id", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09598
train
v2
Schema: orders (alias: ord)(status, value, date, level) staff(code, status, name, id) Task: Retrieve name from orders that have at least one corresponding entry in staff sharing the same code. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = ord.code );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "name", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_09599
train