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: staff (alias: empl)(salary, id, value, date) categories(date, type, name, salary) Task: Retrieve name from staff that have at least one corresponding entry in categories sharing the same type. SQL:
SELECT name FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = empl.type );
{ "outer_table": "staff", "inner_table": "categories", "outer_alias": "empl", "inner_alias": "catg", "proj_col": "name", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_03000
train
v3
Schema: tasks (alias: tsk)(name, salary, value, type) invoices(name, id, code, salary) Task: Retrieve amount from tasks with value above the MAX(value) of invoices rows sharing the same status. SQL:
SELECT amount FROM tasks AS tsk WHERE value > ( SELECT MAX(value) FROM invoices AS inv WHERE inv.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "invoices", "outer_alias": "tsk", "inner_alias": "inv", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03001
train
v2
Schema: departments (alias: dept)(value, status, salary, name) orders(value, type, id, status) Task: Find id from departments where a matching record exists in orders with the same code. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = dept.code );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "id", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03002
train
v1
Schema: departments (alias: dept)(salary, status, name, value) transactions(date, name, type, value) Task: Retrieve amount from departments whose id is found in transactions rows where level matches the outer record. SQL:
SELECT amount FROM departments AS dept WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.level = dept.level );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03003
train
v1
Schema: departments (alias: dept)(name, level, salary, id) staff(amount, status, value, level) Task: Retrieve name from departments whose status is found in staff rows where code matches the outer record. SQL:
SELECT name 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": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03004
train
v1
Schema: schedules (alias: schd)(level, date, code, status) branches(id, code, type, salary) Task: Find salary from schedules where id appears in branches entries with matching type. SQL:
SELECT salary FROM schedules AS schd WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.type = schd.type );
{ "outer_table": "schedules", "inner_table": "branches", "outer_alias": "schd", "inner_alias": "brc", "proj_col": "salary", "filter_col": "id", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03005
train
v2
Schema: items (alias: lne)(value, code, name, status) departments(code, id, salary, name) Task: Retrieve id from items that have at least one corresponding entry in departments sharing the same code. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = lne.code );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "id", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03006
train
v1
Schema: transactions (alias: txn)(date, value, status, type) projects(amount, name, value, id) Task: Retrieve salary from transactions whose status is found in projects rows where level matches the outer record. SQL:
SELECT salary FROM transactions AS txn WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.level = txn.level );
{ "outer_table": "transactions", "inner_table": "projects", "outer_alias": "txn", "inner_alias": "prj", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03007
train
v2
Schema: items (alias: lne)(id, code, salary, date) employees(level, date, name, status) Task: Retrieve code from items that have at least one corresponding entry in employees sharing the same code. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = lne.code );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "code", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03008
train
v3
Schema: items (alias: lne)(code, id, value, status) invoices(code, name, status, date) Task: Retrieve value from items with salary above the MIN(amount) of invoices rows sharing the same id. SQL:
SELECT value FROM items AS lne WHERE salary > ( SELECT MIN(amount) FROM invoices AS inv WHERE inv.id = lne.id );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03009
train
v2
Schema: branches (alias: brc)(id, level, name, value) schedules(code, status, value, name) Task: Find name from branches where a matching record exists in schedules with the same code. SQL:
SELECT name FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = brc.code );
{ "outer_table": "branches", "inner_table": "schedules", "outer_alias": "brc", "inner_alias": "schd", "proj_col": "name", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_03010
train
v2
Schema: managers (alias: mgr)(date, value, status, name) accounts(id, name, salary, level) Task: Find id from managers where a matching record exists in accounts with the same level. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = mgr.level );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "id", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03011
train
v2
Schema: tasks (alias: tsk)(id, code, amount, level) requests(value, name, type, level) Task: Retrieve salary from tasks that have at least one corresponding entry in requests sharing the same code. SQL:
SELECT salary FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "requests", "outer_alias": "tsk", "inner_alias": "ordr", "proj_col": "salary", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03012
train
v3
Schema: invoices (alias: inv)(amount, id, value, date) branches(value, salary, date, id) Task: Find id from invoices where salary exceeds the total amount from branches for the same type. SQL:
SELECT id FROM invoices AS inv WHERE salary > ( SELECT SUM(amount) FROM branches AS brc WHERE brc.type = inv.type );
{ "outer_table": "invoices", "inner_table": "branches", "outer_alias": "inv", "inner_alias": "brc", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03013
train
v1
Schema: shipments (alias: shp)(level, status, name, type) products(date, salary, value, status) Task: Select salary from shipments where code exists in products for the same id. SQL:
SELECT salary FROM shipments AS shp WHERE code IN ( SELECT code FROM products AS prod WHERE prod.id = shp.id );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_03014
train
v1
Schema: staff (alias: empl)(type, date, salary, amount) requests(value, id, salary, status) Task: Select code from staff where type exists in requests for the same status. SQL:
SELECT code FROM staff AS empl WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.status = empl.status );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_03015
train
v3
Schema: products (alias: prod)(date, type, name, value) regions(code, id, amount, salary) Task: Find salary from products where value exceeds the count of value from regions for the same type. SQL:
SELECT salary FROM products AS prod WHERE value > ( SELECT COUNT(value) FROM regions AS rgn WHERE rgn.type = prod.type );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03016
train
v3
Schema: orders (alias: ord)(type, value, status, date) invoices(date, status, code, id) Task: Retrieve salary from orders with salary above the AVG(value) of invoices rows sharing the same type. SQL:
SELECT salary FROM orders AS ord WHERE salary > ( SELECT AVG(value) FROM invoices AS inv WHERE inv.type = ord.type );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03017
train
v2
Schema: employees (alias: emp)(status, id, date, salary) items(date, level, code, salary) Task: Find salary from employees where a matching record exists in items with the same status. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = emp.status );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "salary", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03018
train
v2
Schema: projects (alias: prj)(salary, status, value, level) transactions(date, name, status, amount) Task: Find salary from projects where a matching record exists in transactions with the same type. SQL:
SELECT salary FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = prj.type );
{ "outer_table": "projects", "inner_table": "transactions", "outer_alias": "prj", "inner_alias": "txn", "proj_col": "salary", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_03019
train
v1
Schema: sales (alias: sale)(date, value, status, salary) projects(type, status, code, id) Task: Find code from sales where code appears in projects entries with matching type. SQL:
SELECT code FROM sales AS sale WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.type = sale.type );
{ "outer_table": "sales", "inner_table": "projects", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "code", "filter_col": "code", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03020
train
v3
Schema: orders (alias: ord)(salary, name, id, code) products(id, status, salary, level) Task: Find amount from orders where value exceeds the average salary from products for the same type. SQL:
SELECT amount FROM orders AS ord WHERE value > ( SELECT AVG(salary) FROM products AS prod WHERE prod.type = ord.type );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03021
train
v2
Schema: projects (alias: prj)(id, type, date, status) customers(code, amount, date, type) Task: Find id from projects where a matching record exists in customers with the same status. SQL:
SELECT id FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = prj.status );
{ "outer_table": "projects", "inner_table": "customers", "outer_alias": "prj", "inner_alias": "cust", "proj_col": "id", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_03022
train
v2
Schema: regions (alias: rgn)(value, salary, date, amount) transactions(value, amount, code, status) Task: Retrieve value from regions that have at least one corresponding entry in transactions sharing the same status. SQL:
SELECT value FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = rgn.status );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "value", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_03023
train
v2
Schema: transactions (alias: txn)(type, id, level, amount) managers(type, amount, level, value) Task: Retrieve salary from transactions that have at least one corresponding entry in managers sharing the same code. SQL:
SELECT salary 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": "salary", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03024
train
v1
Schema: categories (alias: catg)(value, code, id, date) staff(id, level, amount, status) Task: Retrieve amount from categories whose type is found in staff rows where status matches the outer record. SQL:
SELECT amount FROM categories AS catg WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.status = catg.status );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03025
train
v3
Schema: tasks (alias: tsk)(date, status, code, level) customers(id, amount, name, code) Task: Retrieve salary from tasks with amount above the SUM(amount) of customers rows sharing the same code. SQL:
SELECT salary FROM tasks AS tsk WHERE amount > ( SELECT SUM(amount) FROM customers AS cust WHERE cust.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "customers", "outer_alias": "tsk", "inner_alias": "cust", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03026
train
v3
Schema: requests (alias: ordr)(level, salary, type, status) transactions(code, type, name, value) Task: Find code from requests where salary exceeds the count of salary from transactions for the same id. SQL:
SELECT code FROM requests AS ordr WHERE salary > ( SELECT COUNT(salary) FROM transactions AS txn WHERE txn.id = ordr.id );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_03027
train
v1
Schema: requests (alias: ordr)(type, salary, status, amount) employees(salary, date, id, amount) Task: Find value from requests where code appears in employees entries with matching level. SQL:
SELECT value FROM requests AS ordr WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.level = ordr.level );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_03028
train
v2
Schema: transactions (alias: txn)(name, salary, amount, date) items(salary, code, amount, level) Task: Find id from transactions where a matching record exists in items with the same type. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = txn.type );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "id", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03029
train
v1
Schema: managers (alias: mgr)(amount, salary, id, name) tasks(code, id, status, type) Task: Find salary from managers where id appears in tasks entries with matching code. SQL:
SELECT salary FROM managers AS mgr WHERE id IN ( SELECT id FROM tasks AS tsk WHERE tsk.code = mgr.code );
{ "outer_table": "managers", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03030
train
v3
Schema: accounts (alias: acct)(type, code, level, name) branches(level, id, status, amount) Task: Retrieve value from accounts with amount above the SUM(salary) of branches rows sharing the same level. SQL:
SELECT value FROM accounts AS acct WHERE amount > ( SELECT SUM(salary) FROM branches AS brc WHERE brc.level = acct.level );
{ "outer_table": "accounts", "inner_table": "branches", "outer_alias": "acct", "inner_alias": "brc", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03031
train
v3
Schema: items (alias: lne)(value, date, type, status) departments(name, status, date, salary) Task: Find salary from items where amount exceeds the minimum value from departments for the same level. SQL:
SELECT salary FROM items AS lne WHERE amount > ( SELECT MIN(value) FROM departments AS dept WHERE dept.level = lne.level );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03032
train
v3
Schema: departments (alias: dept)(status, code, date, level) products(code, type, salary, level) Task: Retrieve amount from departments with value above the SUM(salary) of products rows sharing the same code. SQL:
SELECT amount FROM departments AS dept WHERE value > ( SELECT SUM(salary) FROM products AS prod WHERE prod.code = dept.code );
{ "outer_table": "departments", "inner_table": "products", "outer_alias": "dept", "inner_alias": "prod", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03033
train
v2
Schema: staff (alias: empl)(level, code, value, date) requests(salary, code, level, status) Task: Find value from staff where a matching record exists in requests with the same type. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = empl.type );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "value", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_03034
train
v2
Schema: categories (alias: catg)(type, value, amount, date) employees(name, salary, id, code) Task: Retrieve value from categories that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = catg.status );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "value", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03035
train
v3
Schema: customers (alias: cust)(name, amount, type, code) departments(level, date, name, status) Task: Find value from customers where salary exceeds the count of value from departments for the same type. SQL:
SELECT value FROM customers AS cust WHERE salary > ( SELECT COUNT(value) 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": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03036
train
v3
Schema: sales (alias: sale)(level, type, amount, salary) employees(date, code, salary, value) Task: Retrieve value from sales with amount above the MIN(amount) of employees rows sharing the same level. SQL:
SELECT value FROM sales AS sale WHERE amount > ( SELECT MIN(amount) FROM employees AS emp WHERE emp.level = sale.level );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03037
train
v2
Schema: managers (alias: mgr)(code, level, name, type) customers(salary, level, name, status) Task: Retrieve value from managers that have at least one corresponding entry in customers sharing the same type. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = mgr.type );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "value", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03038
train
v2
Schema: requests (alias: ordr)(status, type, value, level) tasks(salary, code, amount, id) Task: Find value from requests where a matching record exists in tasks with 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_03039
train
v2
Schema: projects (alias: prj)(date, amount, salary, id) customers(code, name, id, salary) Task: Find salary from projects where a matching record exists in customers with the same status. SQL:
SELECT salary FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = prj.status );
{ "outer_table": "projects", "inner_table": "customers", "outer_alias": "prj", "inner_alias": "cust", "proj_col": "salary", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_03040
train
v1
Schema: customers (alias: cust)(type, status, code, level) shipments(value, amount, type, date) Task: Find value from customers where level appears in shipments entries with matching id. SQL:
SELECT value FROM customers AS cust WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.id = cust.id );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "value", "filter_col": "level", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03041
train
v2
Schema: categories (alias: catg)(status, code, amount, name) employees(code, level, salary, amount) Task: Find salary from categories where a matching record exists in employees with the same id. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = catg.id );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "salary", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03042
train
v3
Schema: projects (alias: prj)(type, value, id, code) schedules(id, amount, salary, date) Task: Retrieve value from projects with salary above the AVG(amount) of schedules rows sharing the same type. SQL:
SELECT value FROM projects AS prj WHERE salary > ( SELECT AVG(amount) FROM schedules AS schd WHERE schd.type = prj.type );
{ "outer_table": "projects", "inner_table": "schedules", "outer_alias": "prj", "inner_alias": "schd", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_03043
train
v2
Schema: categories (alias: catg)(amount, salary, type, name) branches(date, id, amount, name) Task: Find name from categories where a matching record exists in branches with the same code. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.code = catg.code );
{ "outer_table": "categories", "inner_table": "branches", "outer_alias": "catg", "inner_alias": "brc", "proj_col": "name", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03044
train
v3
Schema: tasks (alias: tsk)(status, value, name, code) customers(date, value, salary, type) Task: Find value from tasks where salary exceeds the average salary from customers for the same level. SQL:
SELECT value FROM tasks AS tsk WHERE salary > ( SELECT AVG(salary) FROM customers AS cust WHERE cust.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "customers", "outer_alias": "tsk", "inner_alias": "cust", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03045
train
v3
Schema: orders (alias: ord)(salary, status, type, value) transactions(status, name, amount, date) Task: Find amount from orders where salary exceeds the total salary from transactions for the same id. SQL:
SELECT amount FROM orders AS ord WHERE salary > ( SELECT SUM(salary) 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": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03046
train
v2
Schema: departments (alias: dept)(status, value, name, code) tasks(value, code, date, level) Task: Retrieve id from departments that have at least one corresponding entry in tasks sharing the same status. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = dept.status );
{ "outer_table": "departments", "inner_table": "tasks", "outer_alias": "dept", "inner_alias": "tsk", "proj_col": "id", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03047
train
v3
Schema: projects (alias: prj)(type, amount, name, level) requests(name, status, value, date) Task: Retrieve id from projects with salary above the SUM(salary) of requests rows sharing the same code. SQL:
SELECT id FROM projects AS prj WHERE salary > ( SELECT SUM(salary) FROM requests AS ordr WHERE ordr.code = prj.code );
{ "outer_table": "projects", "inner_table": "requests", "outer_alias": "prj", "inner_alias": "ordr", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_03048
train
v1
Schema: products (alias: prod)(amount, status, type, code) items(date, salary, amount, value) Task: Retrieve code from products whose id is found in items rows where type matches the outer record. SQL:
SELECT code FROM products AS prod WHERE id IN ( SELECT id FROM items AS lne WHERE lne.type = prod.type );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "code", "filter_col": "id", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03049
train
v1
Schema: requests (alias: ordr)(id, type, value, amount) projects(date, amount, salary, type) Task: Select name from requests where level exists in projects for the same id. SQL:
SELECT name FROM requests AS ordr WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.id = ordr.id );
{ "outer_table": "requests", "inner_table": "projects", "outer_alias": "ordr", "inner_alias": "prj", "proj_col": "name", "filter_col": "level", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_03050
train
v1
Schema: customers (alias: cust)(salary, status, amount, name) orders(id, status, name, code) Task: Retrieve value from customers whose level is found in orders rows where level matches the outer record. SQL:
SELECT value FROM customers AS cust WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.level = cust.level );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03051
train
v2
Schema: managers (alias: mgr)(name, salary, code, amount) products(level, value, code, salary) Task: Find id from managers where a matching record exists in products with the same type. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = mgr.type );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "id", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03052
train
v2
Schema: tasks (alias: tsk)(name, salary, amount, value) projects(date, name, code, salary) Task: Find value from tasks where a matching record exists in projects with the same level. SQL:
SELECT value FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "projects", "outer_alias": "tsk", "inner_alias": "prj", "proj_col": "value", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03053
train
v1
Schema: regions (alias: rgn)(date, status, amount, value) staff(name, id, value, date) Task: Select code from regions where status exists in staff for the same level. SQL:
SELECT code FROM regions AS rgn WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.level = rgn.level );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_03054
train
v2
Schema: staff (alias: empl)(type, level, status, amount) employees(level, name, type, amount) Task: Retrieve code from staff that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = empl.status );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "code", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_03055
train
v3
Schema: transactions (alias: txn)(type, id, name, date) employees(type, salary, date, id) Task: Find amount from transactions where salary exceeds the count of value from employees for the same level. SQL:
SELECT amount FROM transactions AS txn WHERE salary > ( SELECT COUNT(value) FROM employees AS emp WHERE emp.level = txn.level );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03056
train
v3
Schema: departments (alias: dept)(date, code, level, name) schedules(salary, type, code, status) Task: Find value from departments where salary exceeds the maximum amount from schedules for the same type. SQL:
SELECT value FROM departments AS dept WHERE salary > ( SELECT MAX(amount) FROM schedules AS schd WHERE schd.type = dept.type );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03057
train
v2
Schema: categories (alias: catg)(type, name, amount, code) projects(id, salary, status, amount) Task: Retrieve value from categories that have at least one corresponding entry in projects sharing the same status. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = catg.status );
{ "outer_table": "categories", "inner_table": "projects", "outer_alias": "catg", "inner_alias": "prj", "proj_col": "value", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03058
train
v2
Schema: invoices (alias: inv)(code, id, status, value) items(id, name, salary, date) Task: Find id from invoices where a matching record exists in items with the same type. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = inv.type );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "id", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03059
train
v1
Schema: employees (alias: emp)(name, value, level, id) departments(code, type, salary, value) Task: Retrieve amount from employees whose code is found in departments rows where code matches the outer record. SQL:
SELECT amount FROM employees AS emp WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.code = emp.code );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03060
train
v2
Schema: invoices (alias: inv)(amount, code, level, value) accounts(type, status, value, amount) Task: Retrieve value from invoices that have at least one corresponding entry in accounts sharing the same level. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = inv.level );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "value", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03061
train
v2
Schema: requests (alias: ordr)(status, amount, code, salary) employees(value, date, id, type) Task: Find value from requests where a matching record exists in employees with the same status. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = ordr.status );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "value", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_03062
train
v3
Schema: categories (alias: catg)(date, name, code, value) employees(name, value, salary, level) Task: Retrieve value from categories with amount above the MAX(amount) of employees rows sharing the same status. SQL:
SELECT value FROM categories AS catg WHERE amount > ( SELECT MAX(amount) FROM employees AS emp WHERE emp.status = catg.status );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03063
train
v2
Schema: accounts (alias: acct)(id, amount, code, date) customers(code, level, salary, date) Task: Find salary from accounts where a matching record exists in customers with the same status. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = acct.status );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "salary", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03064
train
v2
Schema: customers (alias: cust)(value, salary, date, level) regions(date, id, name, code) Task: Find name from customers where a matching record exists in regions with the same level. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = cust.level );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "name", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03065
train
v2
Schema: orders (alias: ord)(id, code, value, status) projects(code, salary, id, amount) Task: Find name from orders where a matching record exists in projects with the same type. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = ord.type );
{ "outer_table": "orders", "inner_table": "projects", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "name", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03066
train
v1
Schema: customers (alias: cust)(type, code, salary, level) items(status, amount, id, type) Task: Select code from customers where status exists in items for the same type. SQL:
SELECT code FROM customers AS cust WHERE status IN ( SELECT status FROM items AS lne WHERE lne.type = cust.type );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03067
train
v2
Schema: employees (alias: emp)(status, id, amount, name) branches(value, status, date, amount) Task: Find code from employees where a matching record exists in branches with the same id. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.id = emp.id );
{ "outer_table": "employees", "inner_table": "branches", "outer_alias": "emp", "inner_alias": "brc", "proj_col": "code", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03068
train
v3
Schema: orders (alias: ord)(status, type, name, id) branches(level, type, id, name) Task: Retrieve value from orders with amount above the MIN(value) of branches rows sharing the same level. SQL:
SELECT value FROM orders AS ord WHERE amount > ( SELECT MIN(value) FROM branches AS brc WHERE brc.level = ord.level );
{ "outer_table": "orders", "inner_table": "branches", "outer_alias": "ord", "inner_alias": "brc", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03069
train
v2
Schema: projects (alias: prj)(status, amount, date, name) branches(value, status, type, level) Task: Find value from projects where a matching record exists in branches with the same level. SQL:
SELECT value FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.level = prj.level );
{ "outer_table": "projects", "inner_table": "branches", "outer_alias": "prj", "inner_alias": "brc", "proj_col": "value", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_03070
train
v3
Schema: schedules (alias: schd)(salary, level, code, value) departments(type, salary, name, amount) Task: Retrieve code from schedules with value above the MAX(value) of departments rows sharing the same status. SQL:
SELECT code FROM schedules AS schd WHERE value > ( SELECT MAX(value) FROM departments AS dept WHERE dept.status = schd.status );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "code", "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_03071
train
v2
Schema: branches (alias: brc)(type, salary, date, code) customers(level, amount, salary, value) Task: Retrieve id from branches that have at least one corresponding entry in customers sharing the same level. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = brc.level );
{ "outer_table": "branches", "inner_table": "customers", "outer_alias": "brc", "inner_alias": "cust", "proj_col": "id", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_03072
train
v1
Schema: orders (alias: ord)(id, salary, type, name) branches(name, id, salary, date) Task: Retrieve value from orders whose id is found in branches rows where type matches the outer record. SQL:
SELECT value FROM orders AS ord WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.type = ord.type );
{ "outer_table": "orders", "inner_table": "branches", "outer_alias": "ord", "inner_alias": "brc", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03073
train
v1
Schema: departments (alias: dept)(salary, amount, code, id) tasks(salary, type, level, code) Task: Find name from departments where status appears in tasks entries with matching id. SQL:
SELECT name FROM departments AS dept WHERE status IN ( SELECT status FROM tasks AS tsk WHERE tsk.id = dept.id );
{ "outer_table": "departments", "inner_table": "tasks", "outer_alias": "dept", "inner_alias": "tsk", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03074
train
v3
Schema: projects (alias: prj)(status, id, name, level) requests(status, name, id, date) Task: Find id from projects where salary exceeds the total value from requests for the same level. SQL:
SELECT id FROM projects AS prj WHERE salary > ( SELECT SUM(value) FROM requests AS ordr WHERE ordr.level = prj.level );
{ "outer_table": "projects", "inner_table": "requests", "outer_alias": "prj", "inner_alias": "ordr", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_03075
train
v3
Schema: categories (alias: catg)(code, salary, name, level) employees(type, amount, name, salary) Task: Find name from categories where value exceeds the maximum amount from employees for the same type. SQL:
SELECT name FROM categories AS catg WHERE value > ( SELECT MAX(amount) FROM employees AS emp WHERE emp.type = catg.type );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03076
train
v1
Schema: schedules (alias: schd)(type, id, salary, code) departments(level, value, code, type) Task: Select code from schedules where level exists in departments for the same code. SQL:
SELECT code FROM schedules AS schd WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.code = schd.code );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03077
train
v2
Schema: transactions (alias: txn)(name, date, level, value) customers(status, level, type, id) Task: Find value from transactions where a matching record exists in customers with the same level. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = txn.level );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "value", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03078
train
v3
Schema: orders (alias: ord)(code, level, status, amount) sales(status, code, date, value) Task: Find amount from orders where value exceeds the total amount from sales for the same type. SQL:
SELECT amount FROM orders AS ord WHERE value > ( SELECT SUM(amount) FROM sales AS sale WHERE sale.type = ord.type );
{ "outer_table": "orders", "inner_table": "sales", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03079
train
v3
Schema: tasks (alias: tsk)(type, name, value, id) schedules(level, code, date, salary) Task: Find value from tasks where salary exceeds the total value from schedules for the same code. SQL:
SELECT value FROM tasks AS tsk WHERE salary > ( SELECT SUM(value) FROM schedules AS schd WHERE schd.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "schedules", "outer_alias": "tsk", "inner_alias": "schd", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_03080
train
v1
Schema: shipments (alias: shp)(date, value, level, code) staff(code, level, amount, type) Task: Retrieve name from shipments whose status is found in staff rows where id matches the outer record. SQL:
SELECT name FROM shipments AS shp WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.id = shp.id );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_03081
train
v2
Schema: items (alias: lne)(value, date, id, code) tasks(amount, name, code, id) Task: Find id from items where a matching record exists in tasks with the same code. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.code = lne.code );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "id", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_03082
train
v2
Schema: categories (alias: catg)(type, name, status, id) employees(status, value, code, id) Task: Find name from categories where a matching record exists in employees with the same type. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = catg.type );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "name", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03083
train
v2
Schema: requests (alias: ordr)(date, value, name, id) staff(id, salary, amount, code) Task: Find salary from requests where a matching record exists in staff with the same code. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = ordr.code );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "salary", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_03084
train
v3
Schema: accounts (alias: acct)(date, level, salary, code) sales(date, status, type, id) Task: Retrieve salary from accounts with amount above the AVG(salary) of sales rows sharing the same type. SQL:
SELECT salary FROM accounts AS acct WHERE amount > ( SELECT AVG(salary) FROM sales AS sale WHERE sale.type = acct.type );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03085
train
v3
Schema: orders (alias: ord)(date, status, name, value) accounts(salary, name, type, date) Task: Find id from orders where value exceeds the maximum amount from accounts for the same code. SQL:
SELECT id FROM orders AS ord WHERE value > ( SELECT MAX(amount) FROM accounts AS acct WHERE acct.code = ord.code );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03086
train
v3
Schema: employees (alias: emp)(status, date, value, amount) categories(status, salary, type, code) Task: Find name from employees where value exceeds the average amount from categories for the same level. SQL:
SELECT name FROM employees AS emp WHERE value > ( SELECT AVG(amount) FROM categories AS catg WHERE catg.level = emp.level );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03087
train
v1
Schema: managers (alias: mgr)(status, amount, id, salary) orders(status, code, type, amount) Task: Find name from managers where id appears in orders entries with matching id. SQL:
SELECT name FROM managers AS mgr WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.id = mgr.id );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "name", "filter_col": "id", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03088
train
v1
Schema: customers (alias: cust)(date, name, status, code) projects(code, status, type, value) Task: Retrieve value from customers whose code is found in projects rows where code matches the outer record. SQL:
SELECT value FROM customers AS cust WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.code = cust.code );
{ "outer_table": "customers", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "prj", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03089
train
v3
Schema: branches (alias: brc)(status, code, date, id) orders(code, level, amount, status) Task: Find code from branches where value exceeds the average value from orders for the same code. SQL:
SELECT code FROM branches AS brc WHERE value > ( SELECT AVG(value) FROM orders AS ord WHERE ord.code = brc.code );
{ "outer_table": "branches", "inner_table": "orders", "outer_alias": "brc", "inner_alias": "ord", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_03090
train
v1
Schema: departments (alias: dept)(level, salary, amount, status) employees(name, value, date, type) Task: Select id from departments where id exists in employees for the same level. SQL:
SELECT id FROM departments AS dept WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.level = dept.level );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03091
train
v3
Schema: projects (alias: prj)(level, type, status, salary) tasks(level, value, id, amount) Task: Retrieve salary from projects with amount above the MAX(amount) of tasks rows sharing the same code. SQL:
SELECT salary FROM projects AS prj WHERE amount > ( SELECT MAX(amount) FROM tasks AS tsk WHERE tsk.code = prj.code );
{ "outer_table": "projects", "inner_table": "tasks", "outer_alias": "prj", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_03092
train
v2
Schema: schedules (alias: schd)(id, date, type, salary) accounts(value, level, salary, id) Task: Retrieve code from schedules that have at least one corresponding entry in accounts sharing the same type. SQL:
SELECT code FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = schd.type );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "code", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03093
train
v3
Schema: schedules (alias: schd)(value, salary, amount, date) shipments(id, type, level, name) Task: Find id from schedules where salary exceeds the minimum value from shipments for the same type. SQL:
SELECT id FROM schedules AS schd WHERE salary > ( SELECT MIN(value) FROM shipments AS shp WHERE shp.type = schd.type );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_03094
train
v1
Schema: branches (alias: brc)(date, type, name, value) managers(name, amount, id, level) Task: Retrieve code from branches whose type is found in managers rows where code matches the outer record. SQL:
SELECT code FROM branches AS brc WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.code = brc.code );
{ "outer_table": "branches", "inner_table": "managers", "outer_alias": "brc", "inner_alias": "mgr", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_03095
train
v3
Schema: orders (alias: ord)(code, type, name, level) transactions(level, code, id, status) Task: Find id from orders where salary exceeds the total salary from transactions for the same level. SQL:
SELECT id FROM orders AS ord WHERE salary > ( SELECT SUM(salary) FROM transactions AS txn WHERE txn.level = ord.level );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03096
train
v1
Schema: shipments (alias: shp)(level, date, value, amount) regions(level, id, value, type) Task: Find salary from shipments where status appears in regions entries with matching id. SQL:
SELECT salary FROM shipments AS shp WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.id = shp.id );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "status", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_03097
train
v1
Schema: branches (alias: brc)(type, level, date, value) departments(type, date, salary, code) Task: Find id from branches where code appears in departments entries with matching code. SQL:
SELECT id FROM branches AS brc WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.code = brc.code );
{ "outer_table": "branches", "inner_table": "departments", "outer_alias": "brc", "inner_alias": "dept", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_03098
train
v1
Schema: departments (alias: dept)(type, name, value, id) orders(code, level, status, date) Task: Find id from departments where status appears in orders entries with matching id. SQL:
SELECT id FROM departments AS dept WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.id = dept.id );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_03099
train