variant
stringclasses
3 values
prompt
stringlengths
160
237
sql
stringlengths
102
141
metadata
unknown
token_group
stringclasses
2 values
id
stringlengths
24
24
split
stringclasses
1 value
v3
Schema: branches (alias: brc)(type, status, id, salary) tasks(value, level, date, amount) Task: Find id from branches where salary exceeds the count of value from tasks for the same code. SQL:
SELECT id FROM branches AS brc WHERE salary > ( SELECT COUNT(value) FROM tasks AS tsk WHERE tsk.code = brc.code );
{ "outer_table": "branches", "inner_table": "tasks", "outer_alias": "brc", "inner_alias": "tsk", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_17000
train
v2
Schema: invoices (alias: inv)(id, date, level, value) regions(date, type, code, status) Task: Retrieve value from invoices that have at least one corresponding entry in regions sharing the same status. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = inv.status );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "value", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17001
train
v3
Schema: requests (alias: ordr)(name, amount, level, type) regions(id, code, status, salary) Task: Retrieve name from requests with value above the SUM(value) of regions rows sharing the same level. SQL:
SELECT name FROM requests AS ordr WHERE value > ( SELECT SUM(value) FROM regions AS rgn WHERE rgn.level = ordr.level );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_17002
train
v2
Schema: projects (alias: prj)(amount, salary, status, date) departments(amount, code, salary, value) Task: Retrieve name from projects that have at least one corresponding entry in departments sharing the same status. SQL:
SELECT name FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = prj.status );
{ "outer_table": "projects", "inner_table": "departments", "outer_alias": "prj", "inner_alias": "dept", "proj_col": "name", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_17003
train
v3
Schema: products (alias: prod)(type, name, code, amount) items(salary, name, amount, id) Task: Find code from products where value exceeds the minimum value from items for the same id. SQL:
SELECT code FROM products AS prod WHERE value > ( SELECT MIN(value) FROM items AS lne WHERE lne.id = prod.id );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17004
train
v3
Schema: shipments (alias: shp)(status, id, date, type) regions(type, status, id, name) Task: Retrieve value from shipments with value above the MIN(value) of regions rows sharing the same code. SQL:
SELECT value FROM shipments AS shp WHERE value > ( SELECT MIN(value) FROM regions AS rgn WHERE rgn.code = shp.code );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_17005
train
v2
Schema: sales (alias: sale)(value, salary, date, level) items(value, amount, level, code) Task: Retrieve value from sales that have at least one corresponding entry in items sharing the same code. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = sale.code );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "value", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17006
train
v1
Schema: tasks (alias: tsk)(value, id, code, level) accounts(code, name, level, value) Task: Find value from tasks where code appears in accounts entries with matching status. SQL:
SELECT value FROM tasks AS tsk WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "accounts", "outer_alias": "tsk", "inner_alias": "acct", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_17007
train
v1
Schema: projects (alias: prj)(type, value, code, status) invoices(code, salary, status, type) Task: Retrieve amount from projects whose status is found in invoices rows where code matches the outer record. SQL:
SELECT amount FROM projects AS prj WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.code = prj.code );
{ "outer_table": "projects", "inner_table": "invoices", "outer_alias": "prj", "inner_alias": "inv", "proj_col": "amount", "filter_col": "status", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_17008
train
v2
Schema: departments (alias: dept)(type, name, id, date) schedules(level, date, type, id) Task: Find code from departments where a matching record exists in schedules with the same level. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = dept.level );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "code", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17009
train
v3
Schema: schedules (alias: schd)(name, level, date, value) items(salary, amount, status, type) Task: Retrieve amount from schedules with value above the COUNT(amount) of items rows sharing the same code. SQL:
SELECT amount FROM schedules AS schd WHERE value > ( SELECT COUNT(amount) FROM items AS lne WHERE lne.code = schd.code );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17010
train
v1
Schema: tasks (alias: tsk)(name, amount, id, date) transactions(value, name, status, type) Task: Retrieve name from tasks whose code is found in transactions rows where status matches the outer record. SQL:
SELECT name FROM tasks AS tsk WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "transactions", "outer_alias": "tsk", "inner_alias": "txn", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_17011
train
v1
Schema: accounts (alias: acct)(value, name, amount, type) orders(value, amount, name, status) Task: Select id from accounts where code exists in orders for the same code. SQL:
SELECT id FROM accounts AS acct WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.code = acct.code );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17012
train
v3
Schema: tasks (alias: tsk)(id, code, salary, status) departments(name, id, type, status) Task: Find code from tasks where value exceeds the count of salary from departments for the same id. SQL:
SELECT code FROM tasks AS tsk WHERE value > ( SELECT COUNT(salary) FROM departments AS dept WHERE dept.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "departments", "outer_alias": "tsk", "inner_alias": "dept", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_17013
train
v3
Schema: tasks (alias: tsk)(salary, value, level, date) managers(date, amount, code, name) Task: Retrieve amount from tasks with value above the AVG(value) of managers rows sharing the same status. SQL:
SELECT amount FROM tasks AS tsk WHERE value > ( SELECT AVG(value) FROM managers AS mgr WHERE mgr.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "managers", "outer_alias": "tsk", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_17014
train
v3
Schema: departments (alias: dept)(status, code, type, id) transactions(type, level, salary, name) Task: Find amount from departments where salary exceeds the minimum amount from transactions for the same level. SQL:
SELECT amount FROM departments AS dept WHERE salary > ( SELECT MIN(amount) 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": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17015
train
v3
Schema: sales (alias: sale)(level, id, amount, salary) shipments(amount, name, value, status) Task: Find value from sales where value exceeds the count of salary from shipments for the same type. SQL:
SELECT value FROM sales AS sale WHERE value > ( SELECT COUNT(salary) FROM shipments AS shp WHERE shp.type = sale.type );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17016
train
v1
Schema: categories (alias: catg)(value, salary, code, amount) schedules(code, level, name, salary) Task: Retrieve code from categories whose status is found in schedules rows where level matches the outer record. SQL:
SELECT code FROM categories AS catg WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.level = catg.level );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17017
train
v3
Schema: orders (alias: ord)(name, status, level, id) branches(type, level, amount, value) Task: Find value from orders where amount exceeds the total value from branches for the same level. SQL:
SELECT value FROM orders AS ord WHERE amount > ( SELECT SUM(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": "SUM", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17018
train
v3
Schema: invoices (alias: inv)(code, amount, date, type) products(name, type, level, salary) Task: Retrieve code from invoices with amount above the COUNT(value) of products rows sharing the same type. SQL:
SELECT code FROM invoices AS inv WHERE amount > ( SELECT COUNT(value) FROM products AS prod WHERE prod.type = inv.type );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17019
train
v3
Schema: schedules (alias: schd)(id, status, amount, date) staff(status, value, name, id) Task: Retrieve salary from schedules with salary above the SUM(amount) of staff rows sharing the same type. SQL:
SELECT salary FROM schedules AS schd WHERE salary > ( SELECT SUM(amount) FROM staff AS empl WHERE empl.type = schd.type );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17020
train
v3
Schema: departments (alias: dept)(level, status, salary, code) accounts(code, name, amount, level) Task: Find name from departments where amount exceeds the average salary from accounts for the same level. SQL:
SELECT name FROM departments AS dept WHERE amount > ( SELECT AVG(salary) FROM accounts AS acct WHERE acct.level = dept.level );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17021
train
v3
Schema: projects (alias: prj)(amount, value, type, name) branches(date, value, salary, status) Task: Retrieve salary from projects with salary above the MAX(amount) of branches rows sharing the same level. SQL:
SELECT salary FROM projects AS prj WHERE salary > ( SELECT MAX(amount) FROM branches AS brc WHERE brc.level = prj.level );
{ "outer_table": "projects", "inner_table": "branches", "outer_alias": "prj", "inner_alias": "brc", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_17022
train
v3
Schema: items (alias: lne)(date, amount, name, code) managers(id, name, value, amount) Task: Find amount from items where salary exceeds the total value from managers for the same type. SQL:
SELECT amount FROM items AS lne WHERE salary > ( SELECT SUM(value) FROM managers AS mgr WHERE mgr.type = lne.type );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_17023
train
v2
Schema: invoices (alias: inv)(amount, type, date, code) orders(status, code, date, id) Task: Retrieve id from invoices that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = inv.code );
{ "outer_table": "invoices", "inner_table": "orders", "outer_alias": "inv", "inner_alias": "ord", "proj_col": "id", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17024
train
v2
Schema: accounts (alias: acct)(status, type, code, name) invoices(type, date, value, salary) Task: Find salary from accounts where a matching record exists in invoices with the same type. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = acct.type );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "salary", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17025
train
v2
Schema: invoices (alias: inv)(salary, id, status, date) shipments(name, value, date, id) Task: Find salary from invoices where a matching record exists in shipments with the same status. SQL:
SELECT salary FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = inv.status );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "salary", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17026
train
v1
Schema: staff (alias: empl)(salary, name, date, level) customers(value, type, date, name) Task: Retrieve id from staff whose level is found in customers rows where type matches the outer record. SQL:
SELECT id FROM staff AS empl WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.type = empl.type );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_17027
train
v1
Schema: invoices (alias: inv)(level, code, name, date) shipments(name, salary, id, status) Task: Select amount from invoices where level exists in shipments for the same level. SQL:
SELECT amount FROM invoices AS inv WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.level = inv.level );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "amount", "filter_col": "level", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17028
train
v2
Schema: managers (alias: mgr)(status, type, amount, code) products(type, level, salary, name) Task: Retrieve salary from managers that have at least one corresponding entry in products sharing the same level. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = mgr.level );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "salary", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17029
train
v1
Schema: transactions (alias: txn)(id, amount, date, salary) shipments(id, name, amount, date) Task: Retrieve salary from transactions whose id is found in shipments rows where status matches the outer record. SQL:
SELECT salary FROM transactions AS txn WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.status = txn.status );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17030
train
v1
Schema: departments (alias: dept)(status, value, type, amount) staff(amount, salary, id, level) Task: Find id from departments where status appears in staff entries with matching level. SQL:
SELECT id FROM departments AS dept WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.level = dept.level );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "id", "filter_col": "status", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17031
train
v1
Schema: accounts (alias: acct)(salary, level, status, amount) invoices(amount, value, level, name) Task: Retrieve salary from accounts whose id is found in invoices rows where id matches the outer record. SQL:
SELECT salary FROM accounts AS acct WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.id = acct.id );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17032
train
v2
Schema: employees (alias: emp)(type, date, name, code) tasks(amount, value, level, status) Task: Find value from employees where a matching record exists in tasks with the same level. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.level = emp.level );
{ "outer_table": "employees", "inner_table": "tasks", "outer_alias": "emp", "inner_alias": "tsk", "proj_col": "value", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17033
train
v3
Schema: shipments (alias: shp)(salary, id, value, status) customers(value, id, type, code) Task: Find name from shipments where amount exceeds the total salary from customers for the same level. SQL:
SELECT name FROM shipments AS shp WHERE amount > ( SELECT SUM(salary) FROM customers AS cust WHERE cust.level = shp.level );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_17034
train
v1
Schema: invoices (alias: inv)(date, type, level, code) managers(value, type, salary, status) Task: Retrieve code from invoices whose status is found in managers rows where id matches the outer record. SQL:
SELECT code FROM invoices AS inv WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.id = inv.id );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17035
train
v3
Schema: managers (alias: mgr)(type, status, amount, date) orders(date, type, status, code) Task: Retrieve amount from managers with amount above the SUM(value) of orders rows sharing the same status. SQL:
SELECT amount FROM managers AS mgr WHERE amount > ( SELECT SUM(value) FROM orders AS ord WHERE ord.status = mgr.status );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17036
train
v2
Schema: customers (alias: cust)(date, level, status, type) accounts(status, name, level, type) Task: Retrieve salary from customers that have at least one corresponding entry in accounts sharing the same level. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = cust.level );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "salary", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17037
train
v2
Schema: sales (alias: sale)(amount, status, type, salary) regions(date, id, level, amount) Task: Find value from sales where a matching record exists in regions with the same code. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = sale.code );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "value", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17038
train
v1
Schema: products (alias: prod)(amount, id, code, salary) accounts(level, salary, id, type) Task: Select salary from products where status exists in accounts for the same code. SQL:
SELECT salary FROM products AS prod WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.code = prod.code );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17039
train
v3
Schema: branches (alias: brc)(type, value, code, salary) departments(salary, code, id, date) Task: Find name from branches where salary exceeds the total value from departments for the same status. SQL:
SELECT name FROM branches AS brc WHERE salary > ( SELECT SUM(value) FROM departments AS dept WHERE dept.status = brc.status );
{ "outer_table": "branches", "inner_table": "departments", "outer_alias": "brc", "inner_alias": "dept", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_17040
train
v3
Schema: staff (alias: empl)(value, amount, level, type) regions(date, code, value, amount) Task: Retrieve salary from staff with salary above the COUNT(salary) of regions rows sharing the same code. SQL:
SELECT salary FROM staff AS empl WHERE salary > ( SELECT COUNT(salary) FROM regions AS rgn WHERE rgn.code = empl.code );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_17041
train
v2
Schema: accounts (alias: acct)(status, id, value, salary) managers(id, type, salary, code) Task: Find value from accounts where a matching record exists in managers with the same status. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = acct.status );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "value", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17042
train
v3
Schema: departments (alias: dept)(date, amount, value, name) branches(status, name, salary, type) Task: Find value from departments where amount exceeds the total amount from branches for the same status. SQL:
SELECT value FROM departments AS dept WHERE amount > ( SELECT SUM(amount) FROM branches AS brc WHERE brc.status = dept.status );
{ "outer_table": "departments", "inner_table": "branches", "outer_alias": "dept", "inner_alias": "brc", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17043
train
v3
Schema: regions (alias: rgn)(level, amount, code, salary) departments(id, code, amount, name) Task: Find amount from regions where salary exceeds the minimum salary from departments for the same id. SQL:
SELECT amount FROM regions AS rgn WHERE salary > ( SELECT MIN(salary) FROM departments AS dept WHERE dept.id = rgn.id );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_17044
train
v2
Schema: projects (alias: prj)(amount, type, status, code) categories(value, type, date, level) Task: Retrieve code from projects that have at least one corresponding entry in categories sharing the same id. SQL:
SELECT code FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = prj.id );
{ "outer_table": "projects", "inner_table": "categories", "outer_alias": "prj", "inner_alias": "catg", "proj_col": "code", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_17045
train
v3
Schema: staff (alias: empl)(type, value, status, salary) sales(date, salary, status, amount) Task: Find salary from staff where value exceeds the maximum salary from sales for the same type. SQL:
SELECT salary FROM staff AS empl WHERE value > ( SELECT MAX(salary) FROM sales AS sale WHERE sale.type = empl.type );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_17046
train
v1
Schema: tasks (alias: tsk)(id, code, salary, name) orders(date, name, status, type) Task: Find amount from tasks where id appears in orders entries with matching id. SQL:
SELECT amount FROM tasks AS tsk WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "orders", "outer_alias": "tsk", "inner_alias": "ord", "proj_col": "amount", "filter_col": "id", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_17047
train
v3
Schema: employees (alias: emp)(value, amount, status, name) tasks(id, code, date, name) Task: Retrieve id from employees with amount above the COUNT(amount) of tasks rows sharing the same level. SQL:
SELECT id FROM employees AS emp WHERE amount > ( SELECT COUNT(amount) FROM tasks AS tsk WHERE tsk.level = emp.level );
{ "outer_table": "employees", "inner_table": "tasks", "outer_alias": "emp", "inner_alias": "tsk", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17048
train
v1
Schema: employees (alias: emp)(value, name, date, id) projects(type, id, date, value) Task: Retrieve name from employees whose id is found in projects rows where level matches the outer record. SQL:
SELECT name FROM employees AS emp WHERE id IN ( SELECT id FROM projects AS prj WHERE prj.level = emp.level );
{ "outer_table": "employees", "inner_table": "projects", "outer_alias": "emp", "inner_alias": "prj", "proj_col": "name", "filter_col": "id", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17049
train
v2
Schema: departments (alias: dept)(code, value, amount, name) sales(name, level, status, salary) Task: Retrieve code from departments that have at least one corresponding entry in sales sharing the same status. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = dept.status );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "code", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17050
train
v2
Schema: orders (alias: ord)(id, value, code, salary) departments(level, salary, id, date) Task: Retrieve id from orders that have at least one corresponding entry in departments sharing the same id. SQL:
SELECT id FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = ord.id );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "id", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17051
train
v2
Schema: items (alias: lne)(status, code, name, amount) schedules(value, type, amount, code) Task: Retrieve name from items that have at least one corresponding entry in schedules sharing the same level. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = lne.level );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "name", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_17052
train
v1
Schema: customers (alias: cust)(type, name, salary, id) transactions(salary, value, code, type) Task: Find id from customers where level appears in transactions entries with matching id. SQL:
SELECT id FROM customers AS cust WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.id = cust.id );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17053
train
v1
Schema: orders (alias: ord)(level, name, date, status) employees(type, id, code, name) Task: Find amount from orders where id appears in employees entries with matching level. SQL:
SELECT amount FROM orders AS ord WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.level = ord.level );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17054
train
v3
Schema: branches (alias: brc)(id, amount, level, date) employees(date, id, value, level) Task: Find code from branches where salary exceeds the count of salary from employees for the same type. SQL:
SELECT code FROM branches AS brc WHERE salary > ( SELECT COUNT(salary) FROM employees AS emp WHERE emp.type = brc.type );
{ "outer_table": "branches", "inner_table": "employees", "outer_alias": "brc", "inner_alias": "emp", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_17055
train
v2
Schema: orders (alias: ord)(salary, status, date, value) regions(status, name, code, value) Task: Find code from orders where a matching record exists in regions with the same type. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = ord.type );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "code", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17056
train
v3
Schema: transactions (alias: txn)(type, level, amount, status) regions(level, value, status, type) Task: Find code from transactions where value exceeds the count of salary from regions for the same status. SQL:
SELECT code FROM transactions AS txn WHERE value > ( SELECT COUNT(salary) FROM regions AS rgn WHERE rgn.status = txn.status );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17057
train
v3
Schema: regions (alias: rgn)(status, type, code, level) employees(value, code, status, salary) Task: Find code from regions where salary exceeds the average value from employees for the same level. SQL:
SELECT code FROM regions AS rgn WHERE salary > ( SELECT AVG(value) FROM employees AS emp WHERE emp.level = rgn.level );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_17058
train
v3
Schema: regions (alias: rgn)(amount, code, status, level) requests(value, level, code, amount) Task: Retrieve id from regions with amount above the MAX(value) of requests rows sharing the same status. SQL:
SELECT id FROM regions AS rgn WHERE amount > ( SELECT MAX(value) FROM requests AS ordr WHERE ordr.status = rgn.status );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_17059
train
v1
Schema: staff (alias: empl)(code, name, salary, type) employees(date, level, name, salary) Task: Retrieve code from staff whose status is found in employees rows where code matches the outer record. SQL:
SELECT code FROM staff AS empl WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.code = empl.code );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "code", "filter_col": "status", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_17060
train
v1
Schema: items (alias: lne)(date, code, salary, status) branches(amount, code, level, value) Task: Select name from items where level exists in branches for the same type. SQL:
SELECT name FROM items AS lne WHERE level IN ( SELECT level FROM branches AS brc WHERE brc.type = lne.type );
{ "outer_table": "items", "inner_table": "branches", "outer_alias": "lne", "inner_alias": "brc", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_17061
train
v3
Schema: regions (alias: rgn)(name, salary, amount, type) managers(type, date, level, id) Task: Find name from regions where amount exceeds the maximum amount from managers for the same level. SQL:
SELECT name FROM regions AS rgn WHERE amount > ( SELECT MAX(amount) FROM managers AS mgr WHERE mgr.level = rgn.level );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_17062
train
v2
Schema: projects (alias: prj)(salary, code, type, value) branches(value, level, salary, status) Task: Retrieve value from projects that have at least one corresponding entry in branches sharing the same status. SQL:
SELECT value FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.status = prj.status );
{ "outer_table": "projects", "inner_table": "branches", "outer_alias": "prj", "inner_alias": "brc", "proj_col": "value", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_17063
train
v2
Schema: orders (alias: ord)(id, value, code, name) accounts(salary, date, name, id) Task: Find id from orders where a matching record exists in accounts with the same code. SQL:
SELECT id FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = ord.code );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "id", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17064
train
v1
Schema: customers (alias: cust)(name, amount, level, salary) staff(amount, id, level, salary) Task: Find salary from customers where code appears in staff entries with matching code. SQL:
SELECT salary FROM customers AS cust WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.code = cust.code );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17065
train
v3
Schema: items (alias: lne)(name, level, salary, value) regions(code, level, date, value) Task: Find code from items where salary exceeds the minimum value from regions for the same type. SQL:
SELECT code FROM items AS lne WHERE salary > ( SELECT MIN(value) FROM regions AS rgn WHERE rgn.type = lne.type );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_17066
train
v3
Schema: sales (alias: sale)(salary, level, status, amount) projects(salary, type, value, name) Task: Find code from sales where value exceeds the maximum salary from projects for the same level. SQL:
SELECT code FROM sales AS sale WHERE value > ( SELECT MAX(salary) FROM projects AS prj WHERE prj.level = sale.level );
{ "outer_table": "sales", "inner_table": "projects", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17067
train
v1
Schema: invoices (alias: inv)(code, level, amount, type) managers(level, amount, status, value) Task: Select amount from invoices where code exists in managers for the same level. SQL:
SELECT amount FROM invoices AS inv WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.level = inv.level );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17068
train
v1
Schema: requests (alias: ordr)(status, id, code, salary) accounts(code, type, id, name) Task: Retrieve name from requests whose status is found in accounts rows where level matches the outer record. SQL:
SELECT name FROM requests AS ordr WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.level = ordr.level );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_17069
train
v2
Schema: transactions (alias: txn)(status, type, id, value) schedules(name, value, salary, id) Task: Find value from transactions where a matching record exists in schedules with the same type. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = txn.type );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "value", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17070
train
v1
Schema: transactions (alias: txn)(level, code, salary, name) departments(name, type, amount, salary) Task: Retrieve amount from transactions whose id is found in departments rows where type matches the outer record. SQL:
SELECT amount FROM transactions AS txn WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.type = txn.type );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17071
train
v1
Schema: transactions (alias: txn)(code, value, name, status) tasks(value, type, date, level) Task: Select value from transactions where id exists in tasks for the same code. SQL:
SELECT value FROM transactions AS txn WHERE id IN ( SELECT id FROM tasks AS tsk WHERE tsk.code = txn.code );
{ "outer_table": "transactions", "inner_table": "tasks", "outer_alias": "txn", "inner_alias": "tsk", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17072
train
v1
Schema: schedules (alias: schd)(id, date, type, amount) managers(amount, name, salary, value) Task: Retrieve salary from schedules whose status is found in managers rows where code matches the outer record. SQL:
SELECT salary FROM schedules AS schd WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.code = schd.code );
{ "outer_table": "schedules", "inner_table": "managers", "outer_alias": "schd", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17073
train
v2
Schema: projects (alias: prj)(salary, id, code, date) tasks(level, id, status, date) Task: Retrieve id from projects that have at least one corresponding entry in tasks sharing the same id. SQL:
SELECT id FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.id = prj.id );
{ "outer_table": "projects", "inner_table": "tasks", "outer_alias": "prj", "inner_alias": "tsk", "proj_col": "id", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_17074
train
v1
Schema: schedules (alias: schd)(level, value, id, name) departments(code, name, amount, value) Task: Find value from schedules where level appears in departments entries with matching type. SQL:
SELECT value FROM schedules AS schd WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.type = schd.type );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17075
train
v2
Schema: transactions (alias: txn)(date, status, type, code) sales(salary, name, value, date) Task: Find value from transactions where a matching record exists in sales with the same code. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = txn.code );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "value", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17076
train
v2
Schema: departments (alias: dept)(salary, code, status, name) branches(name, level, amount, code) Task: Retrieve salary from departments that have at least one corresponding entry in branches sharing the same level. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.level = dept.level );
{ "outer_table": "departments", "inner_table": "branches", "outer_alias": "dept", "inner_alias": "brc", "proj_col": "salary", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17077
train
v1
Schema: employees (alias: emp)(salary, status, id, date) sales(date, value, type, salary) Task: Find value from employees where status appears in sales entries with matching type. SQL:
SELECT value FROM employees AS emp WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.type = emp.type );
{ "outer_table": "employees", "inner_table": "sales", "outer_alias": "emp", "inner_alias": "sale", "proj_col": "value", "filter_col": "status", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17078
train
v3
Schema: accounts (alias: acct)(salary, level, code, value) regions(code, salary, date, status) Task: Retrieve value from accounts with salary above the COUNT(salary) of regions rows sharing 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_17079
train
v2
Schema: items (alias: lne)(value, salary, type, date) shipments(date, salary, level, code) Task: Retrieve value from items that have at least one corresponding entry in shipments sharing the same code. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = lne.code );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "value", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_17080
train
v3
Schema: employees (alias: emp)(status, salary, level, type) invoices(id, level, salary, code) Task: Find amount from employees where amount exceeds the maximum salary from invoices for the same level. SQL:
SELECT amount FROM employees AS emp WHERE amount > ( SELECT MAX(salary) FROM invoices AS inv WHERE inv.level = emp.level );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17081
train
v2
Schema: tasks (alias: tsk)(amount, salary, name, value) products(value, salary, name, code) Task: Retrieve amount from tasks that have at least one corresponding entry in products sharing the same id. SQL:
SELECT amount FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "products", "outer_alias": "tsk", "inner_alias": "prod", "proj_col": "amount", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_17082
train
v3
Schema: staff (alias: empl)(code, date, status, salary) regions(level, salary, status, id) Task: Retrieve value from staff with amount above the MAX(value) of regions rows sharing the same status. SQL:
SELECT value FROM staff AS empl WHERE amount > ( SELECT MAX(value) FROM regions AS rgn WHERE rgn.status = empl.status );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_17083
train
v3
Schema: invoices (alias: inv)(level, salary, status, amount) tasks(status, level, type, id) Task: Find id from invoices where amount exceeds the total salary from tasks for the same status. SQL:
SELECT id FROM invoices AS inv WHERE amount > ( SELECT SUM(salary) FROM tasks AS tsk WHERE tsk.status = inv.status );
{ "outer_table": "invoices", "inner_table": "tasks", "outer_alias": "inv", "inner_alias": "tsk", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17084
train
v2
Schema: staff (alias: empl)(salary, level, status, code) accounts(status, date, level, code) Task: Find value from staff where a matching record exists in accounts with the same status. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = empl.status );
{ "outer_table": "staff", "inner_table": "accounts", "outer_alias": "empl", "inner_alias": "acct", "proj_col": "value", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_17085
train
v1
Schema: projects (alias: prj)(name, amount, level, id) items(name, type, date, id) Task: Retrieve code from projects whose level is found in items rows where status matches the outer record. SQL:
SELECT code FROM projects AS prj WHERE level IN ( SELECT level FROM items AS lne WHERE lne.status = prj.status );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "lne", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_17086
train
v2
Schema: categories (alias: catg)(status, date, value, level) accounts(date, status, id, level) Task: Retrieve code from categories that have at least one corresponding entry in accounts sharing the same level. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = catg.level );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "code", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17087
train
v2
Schema: orders (alias: ord)(salary, level, code, date) tasks(id, code, amount, type) Task: Find code from orders where a matching record exists in tasks with the same level. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.level = ord.level );
{ "outer_table": "orders", "inner_table": "tasks", "outer_alias": "ord", "inner_alias": "tsk", "proj_col": "code", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17088
train
v2
Schema: staff (alias: empl)(type, date, value, amount) branches(salary, code, level, type) Task: Find name from staff where a matching record exists in branches with the same id. SQL:
SELECT name FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.id = empl.id );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "name", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_17089
train
v3
Schema: invoices (alias: inv)(value, level, date, name) products(name, level, status, amount) Task: Retrieve id from invoices with value above the COUNT(salary) of products rows sharing the same id. SQL:
SELECT id FROM invoices AS inv WHERE value > ( SELECT COUNT(salary) FROM products AS prod WHERE prod.id = inv.id );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17090
train
v1
Schema: staff (alias: empl)(amount, name, type, salary) customers(type, value, code, salary) Task: Find name from staff where type appears in customers entries with matching code. SQL:
SELECT name FROM staff AS empl WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.code = empl.code );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_17091
train
v2
Schema: categories (alias: catg)(level, code, value, salary) projects(value, name, id, amount) Task: Retrieve salary from categories that have at least one corresponding entry in projects sharing the same type. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = catg.type );
{ "outer_table": "categories", "inner_table": "projects", "outer_alias": "catg", "inner_alias": "prj", "proj_col": "salary", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17092
train
v1
Schema: managers (alias: mgr)(amount, code, date, id) staff(id, type, name, status) Task: Select amount from managers where status exists in staff for the same level. SQL:
SELECT amount FROM managers AS mgr WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.level = mgr.level );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17093
train
v3
Schema: requests (alias: ordr)(amount, type, code, id) tasks(code, value, amount, status) Task: Retrieve id from requests with amount above the SUM(amount) of tasks rows sharing the same status. SQL:
SELECT id FROM requests AS ordr WHERE amount > ( SELECT SUM(amount) FROM tasks AS tsk WHERE tsk.status = ordr.status );
{ "outer_table": "requests", "inner_table": "tasks", "outer_alias": "ordr", "inner_alias": "tsk", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_17094
train
v1
Schema: departments (alias: dept)(salary, status, code, level) staff(date, amount, id, name) Task: Retrieve salary from departments whose code is found in staff rows where code matches the outer record. SQL:
SELECT salary FROM departments AS dept WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.code = dept.code );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17095
train
v3
Schema: managers (alias: mgr)(name, code, salary, amount) accounts(date, level, id, amount) Task: Find id from managers where amount exceeds the maximum amount from accounts for the same code. SQL:
SELECT id FROM managers AS mgr WHERE amount > ( SELECT MAX(amount) FROM accounts AS acct WHERE acct.code = mgr.code );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17096
train
v2
Schema: shipments (alias: shp)(id, status, value, salary) regions(amount, value, level, salary) Task: Retrieve salary from shipments that have at least one corresponding entry in regions sharing the same status. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = shp.status );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "salary", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_17097
train
v3
Schema: categories (alias: catg)(type, value, status, code) products(code, id, date, level) Task: Retrieve salary from categories with value above the MAX(amount) of products rows sharing the same status. SQL:
SELECT salary FROM categories AS catg WHERE value > ( SELECT MAX(amount) FROM products AS prod WHERE prod.status = catg.status );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17098
train
v2
Schema: schedules (alias: schd)(level, date, type, name) shipments(status, code, amount, salary) Task: Retrieve amount from schedules that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = schd.id );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "amount", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17099
train