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
v1
Schema: staff (alias: empl)(date, amount, status, type) sales(status, date, level, type) Task: Select code from staff where id exists in sales for the same type. SQL:
SELECT code FROM staff AS empl WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.type = empl.type );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "code", "filter_col": "id", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04000
train
v1
Schema: sales (alias: sale)(value, name, id, salary) items(date, type, value, amount) Task: Find id from sales where status appears in items entries with matching type. SQL:
SELECT id FROM sales AS sale WHERE status IN ( SELECT status FROM items AS lne WHERE lne.type = sale.type );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04001
train
v3
Schema: shipments (alias: shp)(type, status, value, name) categories(id, code, date, amount) Task: Retrieve amount from shipments with value above the COUNT(salary) of categories rows sharing the same code. SQL:
SELECT amount FROM shipments AS shp WHERE value > ( SELECT COUNT(salary) FROM categories AS catg WHERE catg.code = shp.code );
{ "outer_table": "shipments", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "catg", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04002
train
v2
Schema: products (alias: prod)(code, amount, type, name) managers(level, code, value, id) Task: Find salary from products where a matching record exists in managers with the same level. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = prod.level );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "salary", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04003
train
v1
Schema: employees (alias: emp)(amount, id, name, type) regions(value, date, amount, status) Task: Find amount from employees where level appears in regions entries with matching level. SQL:
SELECT amount FROM employees AS emp WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.level = emp.level );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "level", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04004
train
v2
Schema: orders (alias: ord)(level, code, name, amount) requests(salary, amount, date, status) Task: Find code from orders where a matching record exists in requests with the same status. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = ord.status );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "code", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04005
train
v1
Schema: shipments (alias: shp)(status, id, level, amount) products(amount, status, date, name) Task: Retrieve id from shipments whose status is found in products rows where status matches the outer record. SQL:
SELECT id FROM shipments AS shp WHERE status IN ( SELECT status FROM products AS prod WHERE prod.status = shp.status );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04006
train
v2
Schema: schedules (alias: schd)(amount, salary, id, status) tasks(id, value, code, level) Task: Find amount from schedules where a matching record exists in tasks with the same status. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = schd.status );
{ "outer_table": "schedules", "inner_table": "tasks", "outer_alias": "schd", "inner_alias": "tsk", "proj_col": "amount", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04007
train
v3
Schema: schedules (alias: schd)(name, code, amount, value) sales(level, name, status, type) Task: Find name from schedules where salary exceeds the total amount from sales for the same id. SQL:
SELECT name FROM schedules AS schd WHERE salary > ( SELECT SUM(amount) FROM sales AS sale WHERE sale.id = schd.id );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04008
train
v3
Schema: shipments (alias: shp)(type, date, id, name) requests(id, level, salary, status) Task: Retrieve salary from shipments with amount above the SUM(salary) of requests rows sharing the same type. SQL:
SELECT salary FROM shipments AS shp WHERE amount > ( SELECT SUM(salary) FROM requests AS ordr WHERE ordr.type = shp.type );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04009
train
v1
Schema: shipments (alias: shp)(name, status, amount, code) managers(type, name, status, date) Task: Find salary from shipments where level appears in managers entries with matching level. SQL:
SELECT salary FROM shipments AS shp WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.level = shp.level );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "level", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04010
train
v2
Schema: customers (alias: cust)(id, type, salary, code) projects(amount, level, id, value) Task: Retrieve salary from customers that have at least one corresponding entry in projects sharing the same type. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = cust.type );
{ "outer_table": "customers", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "prj", "proj_col": "salary", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04011
train
v3
Schema: categories (alias: catg)(date, value, level, code) invoices(name, level, code, date) Task: Retrieve salary from categories with amount above the MAX(amount) of invoices rows sharing the same status. SQL:
SELECT salary FROM categories AS catg WHERE amount > ( SELECT MAX(amount) FROM invoices AS inv WHERE inv.status = catg.status );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "salary", "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_04012
train
v2
Schema: shipments (alias: shp)(name, status, salary, type) sales(code, level, amount, date) Task: Find value from shipments where a matching record exists in sales with the same status. SQL:
SELECT value FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = shp.status );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "value", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04013
train
v1
Schema: transactions (alias: txn)(date, salary, id, code) branches(salary, level, amount, name) Task: Find id from transactions where level appears in branches entries with matching id. SQL:
SELECT id FROM transactions AS txn WHERE level IN ( SELECT level FROM branches AS brc WHERE brc.id = txn.id );
{ "outer_table": "transactions", "inner_table": "branches", "outer_alias": "txn", "inner_alias": "brc", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04014
train
v2
Schema: orders (alias: ord)(name, status, id, type) staff(code, level, type, status) Task: Retrieve id from orders that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT id FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = ord.type );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "id", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04015
train
v1
Schema: staff (alias: empl)(level, code, name, type) invoices(id, code, type, name) Task: Retrieve name from staff whose status is found in invoices rows where id matches the outer record. SQL:
SELECT name FROM staff AS empl WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.id = empl.id );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04016
train
v1
Schema: products (alias: prod)(id, value, salary, date) branches(salary, type, date, status) Task: Find id from products where id appears in branches entries with matching type. SQL:
SELECT id FROM products AS prod WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.type = prod.type );
{ "outer_table": "products", "inner_table": "branches", "outer_alias": "prod", "inner_alias": "brc", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04017
train
v1
Schema: items (alias: lne)(name, date, level, value) managers(value, id, salary, name) Task: Retrieve name from items whose status is found in managers rows where type matches the outer record. SQL:
SELECT name FROM items AS lne WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.type = lne.type );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04018
train
v3
Schema: orders (alias: ord)(type, amount, date, name) items(id, date, type, code) Task: Find code from orders where value exceeds the count of value from items for the same code. SQL:
SELECT code FROM orders AS ord WHERE value > ( SELECT COUNT(value) FROM items AS lne WHERE lne.code = ord.code );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04019
train
v1
Schema: products (alias: prod)(value, name, code, status) orders(type, level, id, value) Task: Retrieve amount from products whose status is found in orders rows where type matches the outer record. SQL:
SELECT amount FROM products AS prod WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.type = prod.type );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "amount", "filter_col": "status", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04020
train
v3
Schema: tasks (alias: tsk)(status, name, id, value) regions(status, salary, amount, level) Task: Retrieve salary from tasks with value above the MAX(salary) of regions rows sharing the same code. SQL:
SELECT salary FROM tasks AS tsk WHERE value > ( SELECT MAX(salary) FROM regions AS rgn WHERE rgn.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "regions", "outer_alias": "tsk", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04021
train
v3
Schema: tasks (alias: tsk)(level, salary, status, type) sales(type, amount, salary, name) Task: Retrieve id from tasks with amount above the AVG(value) of sales rows sharing the same status. SQL:
SELECT id FROM tasks AS tsk WHERE amount > ( SELECT AVG(value) FROM sales AS sale WHERE sale.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "sales", "outer_alias": "tsk", "inner_alias": "sale", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04022
train
v3
Schema: schedules (alias: schd)(name, date, value, salary) projects(salary, code, value, level) Task: Find salary from schedules where amount exceeds the maximum salary from projects for the same code. SQL:
SELECT salary FROM schedules AS schd WHERE amount > ( SELECT MAX(salary) FROM projects AS prj WHERE prj.code = schd.code );
{ "outer_table": "schedules", "inner_table": "projects", "outer_alias": "schd", "inner_alias": "prj", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04023
train
v2
Schema: requests (alias: ordr)(amount, value, code, level) shipments(id, amount, type, salary) Task: Retrieve amount from requests that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = ordr.status );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "amount", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04024
train
v1
Schema: requests (alias: ordr)(value, salary, type, level) departments(date, value, status, salary) Task: Find amount from requests where code appears in departments entries with matching level. SQL:
SELECT amount FROM requests AS ordr WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.level = ordr.level );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04025
train
v1
Schema: schedules (alias: schd)(id, amount, status, name) invoices(id, status, value, level) Task: Find id from schedules where status appears in invoices entries with matching id. SQL:
SELECT id FROM schedules AS schd WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.id = schd.id );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04026
train
v3
Schema: customers (alias: cust)(id, value, code, level) sales(id, amount, status, salary) Task: Find value from customers where amount exceeds the maximum amount from sales for the same id. SQL:
SELECT value FROM customers AS cust WHERE amount > ( SELECT MAX(amount) FROM sales AS sale WHERE sale.id = cust.id );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04027
train
v1
Schema: employees (alias: emp)(value, salary, id, amount) customers(code, id, type, value) Task: Retrieve value from employees whose level is found in customers rows where code matches the outer record. SQL:
SELECT value FROM employees AS emp WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.code = emp.code );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04028
train
v3
Schema: projects (alias: prj)(type, value, id, code) branches(name, value, salary, level) Task: Retrieve amount from projects with amount above the MIN(salary) of branches rows sharing the same code. SQL:
SELECT amount FROM projects AS prj WHERE amount > ( SELECT MIN(salary) FROM branches AS brc WHERE brc.code = prj.code );
{ "outer_table": "projects", "inner_table": "branches", "outer_alias": "prj", "inner_alias": "brc", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04029
train
v3
Schema: regions (alias: rgn)(amount, name, level, value) managers(level, value, salary, date) Task: Find amount from regions where amount exceeds the count of salary from managers for the same level. SQL:
SELECT amount FROM regions AS rgn WHERE amount > ( SELECT COUNT(salary) FROM managers AS mgr WHERE mgr.level = rgn.level );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04030
train
v2
Schema: projects (alias: prj)(salary, type, amount, status) tasks(date, code, salary, level) Task: Find amount from projects where a matching record exists in tasks with the same code. SQL:
SELECT amount FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.code = prj.code );
{ "outer_table": "projects", "inner_table": "tasks", "outer_alias": "prj", "inner_alias": "tsk", "proj_col": "amount", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04031
train
v3
Schema: customers (alias: cust)(name, amount, salary, date) requests(type, level, status, amount) Task: Retrieve code from customers with value above the COUNT(amount) of requests rows sharing the same level. SQL:
SELECT code FROM customers AS cust WHERE value > ( SELECT COUNT(amount) FROM requests AS ordr WHERE ordr.level = cust.level );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04032
train
v1
Schema: managers (alias: mgr)(date, amount, type, id) sales(level, name, status, salary) Task: Find id from managers where id appears in sales entries with matching code. SQL:
SELECT id FROM managers AS mgr WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.code = mgr.code );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "id", "filter_col": "id", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04033
train
v2
Schema: products (alias: prod)(code, value, status, type) categories(level, name, value, salary) Task: Find id from products where a matching record exists in categories with the same level. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = prod.level );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "id", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04034
train
v2
Schema: items (alias: lne)(date, code, salary, level) projects(type, id, name, date) Task: Find name from items where a matching record exists in projects with the same level. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.level = lne.level );
{ "outer_table": "items", "inner_table": "projects", "outer_alias": "lne", "inner_alias": "prj", "proj_col": "name", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04035
train
v3
Schema: managers (alias: mgr)(id, date, name, code) items(salary, id, name, amount) Task: Find name from managers where salary exceeds the total value from items for the same code. SQL:
SELECT name FROM managers AS mgr WHERE salary > ( SELECT SUM(value) FROM items AS lne WHERE lne.code = mgr.code );
{ "outer_table": "managers", "inner_table": "items", "outer_alias": "mgr", "inner_alias": "lne", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04036
train
v1
Schema: categories (alias: catg)(level, code, name, value) accounts(id, amount, type, code) Task: Find id from categories where level appears in accounts entries with matching id. SQL:
SELECT id FROM categories AS catg WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.id = catg.id );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04037
train
v2
Schema: tasks (alias: tsk)(level, type, status, salary) managers(name, date, type, amount) Task: Retrieve salary from tasks that have at least one corresponding entry in managers sharing the same code. SQL:
SELECT salary FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "managers", "outer_alias": "tsk", "inner_alias": "mgr", "proj_col": "salary", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04038
train
v1
Schema: schedules (alias: schd)(date, type, name, salary) staff(amount, level, code, name) Task: Select salary from schedules where code exists in staff for the same type. SQL:
SELECT salary FROM schedules AS schd WHERE code IN ( SELECT code 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": "code", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04039
train
v1
Schema: sales (alias: sale)(type, salary, code, status) accounts(amount, code, type, date) Task: Retrieve value from sales whose type is found in accounts rows where status matches the outer record. SQL:
SELECT value FROM sales AS sale WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.status = sale.status );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04040
train
v3
Schema: branches (alias: brc)(status, salary, name, id) schedules(value, salary, code, date) Task: Find id from branches where amount exceeds the count of amount from schedules for the same code. SQL:
SELECT id FROM branches AS brc WHERE amount > ( SELECT COUNT(amount) FROM schedules AS schd WHERE schd.code = brc.code );
{ "outer_table": "branches", "inner_table": "schedules", "outer_alias": "brc", "inner_alias": "schd", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04041
train
v3
Schema: invoices (alias: inv)(code, name, status, salary) transactions(status, name, salary, value) Task: Retrieve value from invoices with salary above the COUNT(value) of transactions rows sharing the same id. SQL:
SELECT value FROM invoices AS inv WHERE salary > ( SELECT COUNT(value) FROM transactions AS txn WHERE txn.id = inv.id );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04042
train
v3
Schema: shipments (alias: shp)(amount, status, level, code) transactions(salary, amount, code, date) Task: Retrieve amount from shipments with salary above the AVG(value) of transactions rows sharing the same level. SQL:
SELECT amount FROM shipments AS shp WHERE salary > ( SELECT AVG(value) FROM transactions AS txn WHERE txn.level = shp.level );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04043
train
v2
Schema: invoices (alias: inv)(id, salary, date, amount) products(value, salary, code, amount) Task: Find value from invoices where a matching record exists in products with the same type. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = inv.type );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "value", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04044
train
v1
Schema: invoices (alias: inv)(name, type, amount, level) projects(value, amount, name, salary) Task: Retrieve salary from invoices whose status is found in projects rows where type matches the outer record. SQL:
SELECT salary FROM invoices AS inv WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.type = inv.type );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "inv", "inner_alias": "prj", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04045
train
v3
Schema: requests (alias: ordr)(amount, date, salary, status) accounts(salary, status, code, level) Task: Retrieve amount from requests with amount above the SUM(amount) of accounts rows sharing the same type. SQL:
SELECT amount FROM requests AS ordr WHERE amount > ( SELECT SUM(amount) FROM accounts AS acct WHERE acct.type = ordr.type );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04046
train
v1
Schema: staff (alias: empl)(amount, type, salary, status) schedules(amount, value, name, level) Task: Retrieve value from staff whose level is found in schedules rows where id matches the outer record. SQL:
SELECT value FROM staff AS empl WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.id = empl.id );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "value", "filter_col": "level", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04047
train
v2
Schema: staff (alias: empl)(amount, salary, id, status) invoices(code, status, type, date) Task: Find salary from staff where a matching record exists in invoices with the same id. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = empl.id );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "salary", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04048
train
v1
Schema: regions (alias: rgn)(type, code, name, amount) requests(code, type, name, status) Task: Retrieve id from regions whose code is found in requests rows where status matches the outer record. SQL:
SELECT id FROM regions AS rgn WHERE code IN ( SELECT code 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": "code", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04049
train
v2
Schema: employees (alias: emp)(status, id, name, code) orders(status, date, type, amount) Task: Find code from employees where a matching record exists in orders with the same id. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = emp.id );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "code", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04050
train
v1
Schema: regions (alias: rgn)(code, id, amount, type) products(level, value, name, salary) Task: Find value from regions where code appears in products entries with matching level. SQL:
SELECT value FROM regions AS rgn WHERE code IN ( SELECT code FROM products AS prod WHERE prod.level = rgn.level );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04051
train
v2
Schema: employees (alias: emp)(status, code, name, id) sales(name, amount, value, salary) Task: Find id from employees where a matching record exists in sales with the same type. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = emp.type );
{ "outer_table": "employees", "inner_table": "sales", "outer_alias": "emp", "inner_alias": "sale", "proj_col": "id", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04052
train
v2
Schema: employees (alias: emp)(value, code, level, salary) products(id, value, name, type) Task: Find code from employees where a matching record exists in products with the same code. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = emp.code );
{ "outer_table": "employees", "inner_table": "products", "outer_alias": "emp", "inner_alias": "prod", "proj_col": "code", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04053
train
v3
Schema: projects (alias: prj)(id, code, salary, name) requests(id, type, code, level) Task: Retrieve amount from projects with amount above the COUNT(value) of requests rows sharing the same type. SQL:
SELECT amount FROM projects AS prj WHERE amount > ( SELECT COUNT(value) FROM requests AS ordr WHERE ordr.type = prj.type );
{ "outer_table": "projects", "inner_table": "requests", "outer_alias": "prj", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04054
train
v2
Schema: employees (alias: emp)(date, amount, level, status) departments(salary, date, level, name) Task: Find code from employees where a matching record exists in departments with the same status. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = emp.status );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "code", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04055
train
v3
Schema: customers (alias: cust)(type, value, date, status) transactions(value, amount, id, status) Task: Retrieve id from customers with amount above the COUNT(amount) of transactions rows sharing the same level. SQL:
SELECT id FROM customers AS cust WHERE amount > ( SELECT COUNT(amount) FROM transactions AS txn WHERE txn.level = cust.level );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04056
train
v3
Schema: requests (alias: ordr)(date, salary, name, amount) categories(code, status, amount, level) Task: Retrieve name from requests with value above the SUM(value) of categories rows sharing the same id. SQL:
SELECT name FROM requests AS ordr WHERE value > ( SELECT SUM(value) FROM categories AS catg WHERE catg.id = ordr.id );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04057
train
v2
Schema: products (alias: prod)(salary, level, amount, value) branches(date, type, value, level) Task: Find id from products where a matching record exists in branches with the same type. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = prod.type );
{ "outer_table": "products", "inner_table": "branches", "outer_alias": "prod", "inner_alias": "brc", "proj_col": "id", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04058
train
v1
Schema: managers (alias: mgr)(name, amount, value, type) tasks(type, id, level, name) Task: Select salary from managers where type exists in tasks for the same level. SQL:
SELECT salary FROM managers AS mgr WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.level = mgr.level );
{ "outer_table": "managers", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "type", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04059
train
v1
Schema: transactions (alias: txn)(type, date, name, status) branches(value, amount, id, name) Task: Select id from transactions where status exists in branches for the same id. SQL:
SELECT id FROM transactions AS txn WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.id = txn.id );
{ "outer_table": "transactions", "inner_table": "branches", "outer_alias": "txn", "inner_alias": "brc", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04060
train
v2
Schema: categories (alias: catg)(value, date, name, id) departments(name, status, level, amount) Task: Find amount from categories where a matching record exists in departments with the same status. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = catg.status );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "amount", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04061
train
v1
Schema: managers (alias: mgr)(amount, id, level, status) orders(type, id, code, salary) Task: Find value from managers where code appears in orders entries with matching type. SQL:
SELECT value FROM managers AS mgr WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.type = mgr.type );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04062
train
v2
Schema: customers (alias: cust)(salary, amount, id, code) schedules(salary, id, name, value) Task: Retrieve code from customers that have at least one corresponding entry in schedules sharing the same code. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = cust.code );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04063
train
v1
Schema: departments (alias: dept)(level, value, id, name) categories(id, name, code, value) Task: Retrieve id from departments whose id is found in categories rows where id matches the outer record. SQL:
SELECT id FROM departments AS dept WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.id = dept.id );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04064
train
v2
Schema: projects (alias: prj)(amount, name, code, level) branches(name, date, type, id) Task: Retrieve name from projects that have at least one corresponding entry in branches sharing the same type. SQL:
SELECT name FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = prj.type );
{ "outer_table": "projects", "inner_table": "branches", "outer_alias": "prj", "inner_alias": "brc", "proj_col": "name", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04065
train
v3
Schema: staff (alias: empl)(amount, type, value, code) departments(name, salary, type, amount) Task: Retrieve id from staff with salary above the SUM(amount) of departments rows sharing the same id. SQL:
SELECT id FROM staff AS empl WHERE salary > ( SELECT SUM(amount) FROM departments AS dept WHERE dept.id = empl.id );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04066
train
v2
Schema: schedules (alias: schd)(type, code, salary, value) branches(value, salary, amount, level) Task: Retrieve name from schedules that have at least one corresponding entry in branches sharing the same id. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.id = schd.id );
{ "outer_table": "schedules", "inner_table": "branches", "outer_alias": "schd", "inner_alias": "brc", "proj_col": "name", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04067
train
v2
Schema: sales (alias: sale)(code, id, date, salary) orders(type, id, name, amount) Task: Retrieve amount from sales that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = sale.code );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "amount", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04068
train
v3
Schema: regions (alias: rgn)(amount, id, date, status) employees(value, status, date, id) Task: Retrieve amount from regions with salary above the SUM(salary) of employees rows sharing the same status. SQL:
SELECT amount FROM regions AS rgn WHERE salary > ( SELECT SUM(salary) FROM employees AS emp WHERE emp.status = rgn.status );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04069
train
v3
Schema: invoices (alias: inv)(value, level, salary, type) branches(status, type, id, code) Task: Retrieve value from invoices with salary above the MAX(value) of branches rows sharing the same id. SQL:
SELECT value FROM invoices AS inv WHERE salary > ( SELECT MAX(value) FROM branches AS brc WHERE brc.id = inv.id );
{ "outer_table": "invoices", "inner_table": "branches", "outer_alias": "inv", "inner_alias": "brc", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04070
train
v1
Schema: staff (alias: empl)(level, amount, status, salary) managers(amount, code, value, id) Task: Find code from staff where level appears in managers entries with matching id. SQL:
SELECT code FROM staff AS empl WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.id = empl.id );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "code", "filter_col": "level", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04071
train
v1
Schema: items (alias: lne)(date, level, type, value) transactions(id, value, type, code) Task: Select salary from items where code exists in transactions for the same type. SQL:
SELECT salary FROM items AS lne WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.type = lne.type );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04072
train
v3
Schema: branches (alias: brc)(amount, value, date, level) orders(name, amount, id, code) Task: Retrieve amount from branches with amount above the MAX(amount) of orders rows sharing the same type. SQL:
SELECT amount FROM branches AS brc WHERE amount > ( SELECT MAX(amount) FROM orders AS ord WHERE ord.type = brc.type );
{ "outer_table": "branches", "inner_table": "orders", "outer_alias": "brc", "inner_alias": "ord", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04073
train
v1
Schema: invoices (alias: inv)(amount, code, status, id) departments(value, id, level, type) Task: Retrieve name from invoices whose code is found in departments rows where code matches the outer record. SQL:
SELECT name FROM invoices AS inv WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.code = inv.code );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04074
train
v3
Schema: regions (alias: rgn)(type, name, date, salary) requests(level, value, salary, id) Task: Retrieve value from regions with value above the AVG(amount) of requests rows sharing the same id. SQL:
SELECT value FROM regions AS rgn WHERE value > ( SELECT AVG(amount) FROM requests AS ordr WHERE ordr.id = rgn.id );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04075
train
v2
Schema: departments (alias: dept)(name, level, amount, type) categories(value, amount, salary, type) Task: Find amount from departments where a matching record exists in categories with the same type. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = dept.type );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "amount", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04076
train
v1
Schema: transactions (alias: txn)(salary, date, amount, status) tasks(salary, code, amount, value) Task: Select salary from transactions where type exists in tasks for the same id. SQL:
SELECT salary FROM transactions AS txn WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.id = txn.id );
{ "outer_table": "transactions", "inner_table": "tasks", "outer_alias": "txn", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "type", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04077
train
v1
Schema: items (alias: lne)(amount, id, date, level) branches(level, type, code, date) Task: Find code from items where status appears in branches entries with matching level. SQL:
SELECT code FROM items AS lne WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.level = lne.level );
{ "outer_table": "items", "inner_table": "branches", "outer_alias": "lne", "inner_alias": "brc", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04078
train
v1
Schema: categories (alias: catg)(amount, value, salary, type) staff(type, id, level, status) Task: Find id from categories where code appears in staff entries with matching id. SQL:
SELECT id FROM categories AS catg WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.id = catg.id );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "id", "filter_col": "code", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04079
train
v2
Schema: requests (alias: ordr)(level, date, type, amount) employees(type, name, salary, value) Task: Retrieve value from requests that have at least one corresponding entry in employees sharing 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_04080
train
v1
Schema: shipments (alias: shp)(value, amount, status, name) transactions(type, name, status, code) Task: Retrieve value from shipments whose id is found in transactions rows where id matches the outer record. SQL:
SELECT value FROM shipments AS shp WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.id = shp.id );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04081
train
v2
Schema: tasks (alias: tsk)(salary, date, code, type) staff(code, name, type, status) Task: Find id from tasks where a matching record exists in staff with the same type. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "staff", "outer_alias": "tsk", "inner_alias": "empl", "proj_col": "id", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04082
train
v3
Schema: projects (alias: prj)(amount, code, level, status) regions(amount, name, status, salary) Task: Retrieve amount from projects with salary above the AVG(salary) of regions rows sharing the same type. SQL:
SELECT amount FROM projects AS prj WHERE salary > ( SELECT AVG(salary) FROM regions AS rgn WHERE rgn.type = prj.type );
{ "outer_table": "projects", "inner_table": "regions", "outer_alias": "prj", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04083
train
v3
Schema: invoices (alias: inv)(code, amount, level, name) branches(amount, status, type, value) Task: Find name from invoices where salary exceeds the total amount from branches for the same id. SQL:
SELECT name FROM invoices AS inv WHERE salary > ( SELECT SUM(amount) FROM branches AS brc WHERE brc.id = inv.id );
{ "outer_table": "invoices", "inner_table": "branches", "outer_alias": "inv", "inner_alias": "brc", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04084
train
v3
Schema: tasks (alias: tsk)(salary, name, level, id) sales(date, value, type, level) Task: Retrieve id from tasks with salary above the COUNT(amount) of sales rows sharing the same code. SQL:
SELECT id FROM tasks AS tsk WHERE salary > ( SELECT COUNT(amount) FROM sales AS sale WHERE sale.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "sales", "outer_alias": "tsk", "inner_alias": "sale", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04085
train
v1
Schema: customers (alias: cust)(value, code, id, date) transactions(name, status, date, level) Task: Select salary from customers where level exists in transactions for the same level. SQL:
SELECT salary FROM customers AS cust WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.level = cust.level );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "salary", "filter_col": "level", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04086
train
v3
Schema: transactions (alias: txn)(value, level, amount, date) categories(value, date, name, level) Task: Find value from transactions where amount exceeds the average value from categories for the same level. SQL:
SELECT value FROM transactions AS txn WHERE amount > ( SELECT AVG(value) FROM categories AS catg WHERE catg.level = txn.level );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04087
train
v2
Schema: transactions (alias: txn)(name, id, level, code) accounts(code, value, status, id) Task: Retrieve value from transactions that have at least one corresponding entry in accounts sharing the same status. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = txn.status );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "value", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04088
train
v3
Schema: managers (alias: mgr)(level, code, salary, name) employees(amount, status, code, date) Task: Retrieve salary from managers with value above the AVG(amount) of employees rows sharing the same type. SQL:
SELECT salary FROM managers AS mgr WHERE value > ( SELECT AVG(amount) FROM employees AS emp WHERE emp.type = mgr.type );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04089
train
v1
Schema: employees (alias: emp)(code, value, date, type) transactions(amount, date, status, id) Task: Retrieve name from employees whose type is found in transactions rows where code matches the outer record. SQL:
SELECT name FROM employees AS emp WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.code = emp.code );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04090
train
v3
Schema: accounts (alias: acct)(value, type, status, id) customers(name, salary, type, status) Task: Find salary from accounts where salary exceeds the minimum amount from customers for the same type. SQL:
SELECT salary FROM accounts AS acct WHERE salary > ( SELECT MIN(amount) FROM customers AS cust WHERE cust.type = acct.type );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04091
train
v2
Schema: departments (alias: dept)(value, name, date, salary) employees(name, amount, status, salary) Task: Find id from departments where a matching record exists in employees with the same status. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = dept.status );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "id", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04092
train
v3
Schema: tasks (alias: tsk)(code, name, salary, date) requests(date, level, id, code) Task: Find code from tasks where amount exceeds the minimum amount from requests for the same id. SQL:
SELECT code FROM tasks AS tsk WHERE amount > ( SELECT MIN(amount) FROM requests AS ordr WHERE ordr.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "requests", "outer_alias": "tsk", "inner_alias": "ordr", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04093
train
v1
Schema: shipments (alias: shp)(type, level, amount, id) tasks(type, date, value, name) Task: Retrieve amount from shipments whose type is found in tasks rows where status matches the outer record. SQL:
SELECT amount FROM shipments AS shp WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.status = shp.status );
{ "outer_table": "shipments", "inner_table": "tasks", "outer_alias": "shp", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04094
train
v3
Schema: orders (alias: ord)(salary, id, level, type) categories(value, amount, type, salary) Task: Find name from orders where amount exceeds the minimum amount from categories for the same level. SQL:
SELECT name FROM orders AS ord WHERE amount > ( SELECT MIN(amount) FROM categories AS catg WHERE catg.level = ord.level );
{ "outer_table": "orders", "inner_table": "categories", "outer_alias": "ord", "inner_alias": "catg", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04095
train
v3
Schema: tasks (alias: tsk)(level, date, code, id) schedules(date, type, id, value) Task: Find amount from tasks where value exceeds the average amount from schedules for the same status. SQL:
SELECT amount FROM tasks AS tsk WHERE value > ( SELECT AVG(amount) FROM schedules AS schd WHERE schd.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "schedules", "outer_alias": "tsk", "inner_alias": "schd", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04096
train
v2
Schema: transactions (alias: txn)(value, type, code, status) requests(code, salary, type, status) Task: Find salary from transactions where a matching record exists in requests with the same id. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = txn.id );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "salary", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04097
train
v1
Schema: items (alias: lne)(date, level, amount, status) sales(id, type, amount, date) Task: Find id from items where code appears in sales entries with matching level. SQL:
SELECT id FROM items AS lne WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.level = lne.level );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "id", "filter_col": "code", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04098
train
v2
Schema: employees (alias: emp)(level, date, name, type) shipments(code, amount, level, date) Task: Find name from employees where a matching record exists in shipments with the same level. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = emp.level );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "name", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04099
train