variant
stringclasses
3 values
prompt
stringlengths
160
237
sql
stringlengths
102
141
metadata
unknown
token_group
stringclasses
2 values
id
stringlengths
24
24
split
stringclasses
1 value
v2
Schema: invoices (alias: inv)(level, amount, salary, code) managers(name, code, id, date) Task: Retrieve salary from invoices that have at least one corresponding entry in managers sharing the same code. SQL:
SELECT salary FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = inv.code );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "salary", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15800
train
v2
Schema: employees (alias: emp)(date, code, amount, type) branches(name, value, type, level) Task: Find salary from employees where a matching record exists in branches with the same type. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = emp.type );
{ "outer_table": "employees", "inner_table": "branches", "outer_alias": "emp", "inner_alias": "brc", "proj_col": "salary", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15801
train
v2
Schema: accounts (alias: acct)(salary, status, value, type) schedules(level, status, amount, code) Task: Retrieve amount from accounts that have at least one corresponding entry in schedules sharing the same type. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = acct.type );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "amount", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15802
train
v1
Schema: schedules (alias: schd)(type, level, code, id) categories(code, name, date, salary) Task: Select salary from schedules where id exists in categories for the same type. SQL:
SELECT salary FROM schedules AS schd WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.type = schd.type );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "salary", "filter_col": "id", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15803
train
v3
Schema: schedules (alias: schd)(amount, salary, id, value) accounts(value, date, salary, level) Task: Retrieve name from schedules with amount above the COUNT(value) of accounts rows sharing the same code. SQL:
SELECT name FROM schedules AS schd WHERE amount > ( SELECT COUNT(value) FROM accounts AS acct WHERE acct.code = schd.code );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15804
train
v1
Schema: sales (alias: sale)(amount, level, name, value) customers(amount, type, value, status) Task: Find id from sales where level appears in customers entries with matching level. SQL:
SELECT id FROM sales AS sale WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.level = sale.level );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15805
train
v2
Schema: accounts (alias: acct)(code, level, value, salary) categories(level, value, name, date) Task: Find name from accounts where a matching record exists in categories with the same type. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = acct.type );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "name", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15806
train
v3
Schema: schedules (alias: schd)(status, level, code, salary) projects(name, salary, status, date) Task: Retrieve amount from schedules with value above the SUM(amount) of projects rows sharing the same code. SQL:
SELECT amount FROM schedules AS schd WHERE value > ( SELECT SUM(amount) FROM projects AS prj WHERE prj.code = schd.code );
{ "outer_table": "schedules", "inner_table": "projects", "outer_alias": "schd", "inner_alias": "prj", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15807
train
v3
Schema: items (alias: lne)(code, id, type, value) regions(value, amount, code, name) Task: Retrieve value from items with salary above the AVG(amount) of regions rows sharing the same status. SQL:
SELECT value FROM items AS lne WHERE salary > ( SELECT AVG(amount) FROM regions AS rgn WHERE rgn.status = lne.status );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15808
train
v1
Schema: projects (alias: prj)(type, id, level, date) tasks(status, type, code, salary) Task: Select code from projects where level exists in tasks for the same status. SQL:
SELECT code FROM projects AS prj WHERE level IN ( SELECT level FROM tasks AS tsk WHERE tsk.status = prj.status );
{ "outer_table": "projects", "inner_table": "tasks", "outer_alias": "prj", "inner_alias": "tsk", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_15809
train
v1
Schema: managers (alias: mgr)(status, level, code, value) departments(date, amount, type, id) Task: Find value from managers where id appears in departments entries with matching level. SQL:
SELECT value FROM managers AS mgr WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.level = mgr.level );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15810
train
v1
Schema: requests (alias: ordr)(amount, code, type, date) invoices(amount, value, level, code) Task: Select id from requests where id exists in invoices for the same level. SQL:
SELECT id FROM requests AS ordr WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.level = ordr.level );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_15811
train
v2
Schema: sales (alias: sale)(status, value, amount, id) employees(name, id, level, code) Task: Retrieve salary from sales that have at least one corresponding entry in employees sharing the same id. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = sale.id );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "salary", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15812
train
v2
Schema: transactions (alias: txn)(id, value, code, date) tasks(salary, code, type, value) Task: Retrieve value from transactions that have at least one corresponding entry in tasks sharing the same level. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.level = txn.level );
{ "outer_table": "transactions", "inner_table": "tasks", "outer_alias": "txn", "inner_alias": "tsk", "proj_col": "value", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15813
train
v2
Schema: sales (alias: sale)(salary, status, level, name) schedules(amount, code, name, value) Task: Find amount from sales where a matching record exists in schedules with the same status. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = sale.status );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "amount", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15814
train
v3
Schema: sales (alias: sale)(date, id, amount, value) schedules(status, salary, date, value) Task: Retrieve id from sales with salary above the SUM(salary) of schedules rows sharing the same id. SQL:
SELECT id FROM sales AS sale WHERE salary > ( SELECT SUM(salary) FROM schedules AS schd WHERE schd.id = sale.id );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15815
train
v1
Schema: requests (alias: ordr)(name, level, type, code) tasks(name, value, id, amount) Task: Retrieve id from requests whose id is found in tasks rows where id matches the outer record. SQL:
SELECT id FROM requests AS ordr WHERE id IN ( SELECT id FROM tasks AS tsk WHERE tsk.id = ordr.id );
{ "outer_table": "requests", "inner_table": "tasks", "outer_alias": "ordr", "inner_alias": "tsk", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_15816
train
v1
Schema: customers (alias: cust)(value, salary, code, status) projects(name, status, level, date) Task: Find id from customers where status appears in projects entries with matching id. SQL:
SELECT id FROM customers AS cust WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.id = cust.id );
{ "outer_table": "customers", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "prj", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15817
train
v3
Schema: branches (alias: brc)(salary, name, status, level) tasks(level, status, amount, name) Task: Retrieve value from branches with amount above the MIN(amount) of tasks rows sharing the same code. SQL:
SELECT value FROM branches AS brc WHERE amount > ( SELECT MIN(amount) FROM tasks AS tsk WHERE tsk.code = brc.code );
{ "outer_table": "branches", "inner_table": "tasks", "outer_alias": "brc", "inner_alias": "tsk", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_15818
train
v1
Schema: regions (alias: rgn)(salary, date, level, status) requests(value, name, salary, amount) Task: Select value from regions where level exists in requests for the same id. SQL:
SELECT value FROM regions AS rgn WHERE level IN ( SELECT level 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": "level", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_15819
train
v2
Schema: employees (alias: emp)(date, type, id, level) requests(salary, status, type, amount) Task: Retrieve code from employees that have at least one corresponding entry in requests sharing the same type. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = emp.type );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "code", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15820
train
v2
Schema: schedules (alias: schd)(name, level, code, type) employees(type, date, value, salary) Task: Retrieve salary from schedules that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = schd.status );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "salary", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15821
train
v3
Schema: requests (alias: ordr)(name, id, date, type) categories(value, status, salary, amount) Task: Find value from requests where salary exceeds the count of amount from categories for the same type. SQL:
SELECT value FROM requests AS ordr WHERE salary > ( SELECT COUNT(amount) FROM categories AS catg WHERE catg.type = ordr.type );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_15822
train
v1
Schema: customers (alias: cust)(salary, value, type, amount) departments(value, id, status, amount) Task: Find id from customers where status appears in departments entries with matching code. SQL:
SELECT id FROM customers AS cust WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.code = cust.code );
{ "outer_table": "customers", "inner_table": "departments", "outer_alias": "cust", "inner_alias": "dept", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15823
train
v1
Schema: shipments (alias: shp)(level, value, id, amount) items(type, date, amount, salary) Task: Find id from shipments where level appears in items entries with matching status. SQL:
SELECT id FROM shipments AS shp WHERE level IN ( SELECT level FROM items AS lne WHERE lne.status = shp.status );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15824
train
v1
Schema: categories (alias: catg)(type, code, value, status) requests(salary, status, name, date) Task: Find code from categories where level appears in requests entries with matching level. SQL:
SELECT code FROM categories AS catg WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.level = catg.level );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "code", "filter_col": "level", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15825
train
v3
Schema: items (alias: lne)(name, salary, level, value) tasks(code, amount, status, value) Task: Retrieve salary from items with amount above the COUNT(value) of tasks rows sharing the same code. SQL:
SELECT salary FROM items AS lne WHERE amount > ( SELECT COUNT(value) FROM tasks AS tsk WHERE tsk.code = lne.code );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15826
train
v2
Schema: products (alias: prod)(name, date, value, salary) sales(status, name, value, type) Task: Find code from products where a matching record exists in sales with the same level. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = prod.level );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "code", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15827
train
v1
Schema: shipments (alias: shp)(type, name, code, salary) staff(date, value, salary, amount) Task: Retrieve salary from shipments whose type is found in staff rows where type matches the outer record. SQL:
SELECT salary FROM shipments AS shp WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.type = shp.type );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15828
train
v1
Schema: orders (alias: ord)(id, status, code, date) managers(level, amount, value, code) Task: Select id from orders where level exists in managers for the same code. SQL:
SELECT id FROM orders AS ord WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.code = ord.code );
{ "outer_table": "orders", "inner_table": "managers", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15829
train
v1
Schema: shipments (alias: shp)(type, status, date, code) categories(amount, salary, level, date) Task: Select name from shipments where code exists in categories for the same code. SQL:
SELECT name FROM shipments AS shp WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.code = shp.code );
{ "outer_table": "shipments", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "catg", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15830
train
v3
Schema: transactions (alias: txn)(type, code, id, date) orders(code, name, status, date) Task: Find id from transactions where salary exceeds the total value from orders for the same level. SQL:
SELECT id FROM transactions AS txn WHERE salary > ( SELECT SUM(value) FROM orders AS ord WHERE ord.level = txn.level );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15831
train
v3
Schema: shipments (alias: shp)(type, name, amount, level) regions(level, code, status, salary) Task: Find name from shipments where amount exceeds the maximum salary from regions for the same level. SQL:
SELECT name FROM shipments AS shp WHERE amount > ( SELECT MAX(salary) FROM regions AS rgn WHERE rgn.level = shp.level );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15832
train
v1
Schema: projects (alias: prj)(status, amount, level, salary) categories(code, value, salary, id) Task: Retrieve id from projects whose id is found in categories rows where id matches the outer record. SQL:
SELECT id FROM projects AS prj WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.id = prj.id );
{ "outer_table": "projects", "inner_table": "categories", "outer_alias": "prj", "inner_alias": "catg", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_15833
train
v3
Schema: staff (alias: empl)(amount, level, id, name) tasks(salary, name, type, date) Task: Retrieve code from staff with amount above the MIN(value) of tasks rows sharing the same level. SQL:
SELECT code FROM staff AS empl WHERE amount > ( SELECT MIN(value) FROM tasks AS tsk WHERE tsk.level = empl.level );
{ "outer_table": "staff", "inner_table": "tasks", "outer_alias": "empl", "inner_alias": "tsk", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_15834
train
v1
Schema: customers (alias: cust)(amount, code, value, type) staff(status, level, id, date) Task: Select value from customers where type exists in staff for the same type. SQL:
SELECT value FROM customers AS cust WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.type = cust.type );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "value", "filter_col": "type", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15835
train
v2
Schema: requests (alias: ordr)(status, amount, type, code) customers(type, value, name, level) Task: Retrieve id from requests that have at least one corresponding entry in customers sharing the same level. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = ordr.level );
{ "outer_table": "requests", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "id", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_15836
train
v2
Schema: items (alias: lne)(name, status, value, salary) invoices(type, status, amount, id) Task: Find code from items where a matching record exists in invoices with the same level. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = lne.level );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "code", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15837
train
v2
Schema: shipments (alias: shp)(type, id, amount, status) departments(amount, value, date, level) Task: Retrieve amount from shipments that have at least one corresponding entry in departments sharing the same code. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = shp.code );
{ "outer_table": "shipments", "inner_table": "departments", "outer_alias": "shp", "inner_alias": "dept", "proj_col": "amount", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15838
train
v3
Schema: sales (alias: sale)(level, value, name, id) projects(amount, name, salary, level) Task: Retrieve code from sales with salary above the MAX(salary) of projects rows sharing the same code. SQL:
SELECT code FROM sales AS sale WHERE salary > ( SELECT MAX(salary) FROM projects AS prj WHERE prj.code = sale.code );
{ "outer_table": "sales", "inner_table": "projects", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15839
train
v3
Schema: managers (alias: mgr)(salary, type, level, status) transactions(id, salary, amount, status) Task: Find amount from managers where value exceeds the count of amount from transactions for the same type. SQL:
SELECT amount FROM managers AS mgr WHERE value > ( SELECT COUNT(amount) FROM transactions AS txn WHERE txn.type = mgr.type );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15840
train
v1
Schema: requests (alias: ordr)(code, type, date, id) orders(name, value, id, level) Task: Retrieve salary from requests whose status is found in orders rows where status matches the outer record. SQL:
SELECT salary FROM requests AS ordr WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.status = ordr.status );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_15841
train
v1
Schema: items (alias: lne)(amount, id, date, level) managers(code, value, amount, id) Task: Select value from items where level exists in managers for the same code. SQL:
SELECT value FROM items AS lne WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.code = lne.code );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15842
train
v3
Schema: employees (alias: emp)(type, id, code, level) regions(value, name, date, code) Task: Retrieve salary from employees with value above the AVG(amount) of regions rows sharing the same level. SQL:
SELECT salary FROM employees AS emp WHERE value > ( SELECT AVG(amount) FROM regions AS rgn WHERE rgn.level = emp.level );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15843
train
v2
Schema: regions (alias: rgn)(type, name, level, id) customers(name, status, salary, type) Task: Find code from regions where a matching record exists in customers with the same level. SQL:
SELECT code FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = rgn.level );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "code", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_15844
train
v2
Schema: staff (alias: empl)(code, date, amount, level) projects(salary, value, amount, code) Task: Retrieve code from staff that have at least one corresponding entry in projects sharing the same code. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.code = empl.code );
{ "outer_table": "staff", "inner_table": "projects", "outer_alias": "empl", "inner_alias": "prj", "proj_col": "code", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_15845
train
v2
Schema: items (alias: lne)(amount, id, date, type) regions(date, name, amount, value) Task: Find id from items where a matching record exists in regions with the same status. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = lne.status );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "id", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15846
train
v3
Schema: items (alias: lne)(value, amount, date, level) customers(date, id, name, level) Task: Find amount from items where amount exceeds the count of value from customers for the same status. SQL:
SELECT amount FROM items AS lne WHERE amount > ( SELECT COUNT(value) FROM customers AS cust WHERE cust.status = lne.status );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15847
train
v3
Schema: shipments (alias: shp)(value, date, salary, level) managers(code, level, name, amount) Task: Find id from shipments where salary exceeds the minimum salary from managers for the same code. SQL:
SELECT id FROM shipments AS shp WHERE salary > ( SELECT MIN(salary) FROM managers AS mgr WHERE mgr.code = shp.code );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15848
train
v2
Schema: orders (alias: ord)(value, type, amount, date) accounts(status, type, level, amount) Task: Retrieve amount from orders that have at least one corresponding entry in accounts sharing the same status. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = ord.status );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "amount", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15849
train
v1
Schema: categories (alias: catg)(value, status, code, type) orders(date, id, code, status) Task: Find name from categories where type appears in orders entries with matching code. SQL:
SELECT name FROM categories AS catg WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.code = catg.code );
{ "outer_table": "categories", "inner_table": "orders", "outer_alias": "catg", "inner_alias": "ord", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15850
train
v1
Schema: branches (alias: brc)(code, amount, status, date) accounts(type, code, id, value) Task: Select salary from branches where id exists in accounts for the same id. SQL:
SELECT salary FROM branches AS brc WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.id = brc.id );
{ "outer_table": "branches", "inner_table": "accounts", "outer_alias": "brc", "inner_alias": "acct", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_15851
train
v1
Schema: orders (alias: ord)(value, salary, name, date) requests(status, value, id, salary) Task: Select name from orders where id exists in requests for the same code. SQL:
SELECT name FROM orders AS ord WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.code = ord.code );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15852
train
v3
Schema: invoices (alias: inv)(date, name, amount, code) products(date, name, value, salary) Task: Find id from invoices where amount exceeds the minimum value from products for the same type. SQL:
SELECT id FROM invoices AS inv WHERE amount > ( SELECT MIN(value) FROM products AS prod WHERE prod.type = inv.type );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15853
train
v3
Schema: transactions (alias: txn)(amount, code, status, date) employees(status, type, value, code) Task: Retrieve value from transactions with value above the SUM(salary) of employees rows sharing the same type. SQL:
SELECT value FROM transactions AS txn WHERE value > ( SELECT SUM(salary) FROM employees AS emp WHERE emp.type = txn.type );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15854
train
v3
Schema: managers (alias: mgr)(name, value, salary, type) transactions(name, type, status, level) Task: Retrieve id from managers with salary above the COUNT(salary) of transactions rows sharing the same code. SQL:
SELECT id FROM managers AS mgr WHERE salary > ( SELECT COUNT(salary) FROM transactions AS txn WHERE txn.code = mgr.code );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15855
train
v3
Schema: sales (alias: sale)(amount, date, id, salary) items(date, name, id, level) Task: Retrieve amount from sales with salary above the AVG(amount) of items rows sharing the same type. SQL:
SELECT amount FROM sales AS sale WHERE salary > ( SELECT AVG(amount) FROM items AS lne WHERE lne.type = sale.type );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15856
train
v1
Schema: items (alias: lne)(level, code, salary, id) invoices(amount, code, name, status) Task: Select id from items where id exists in invoices for the same level. SQL:
SELECT id FROM items AS lne WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.level = lne.level );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15857
train
v1
Schema: customers (alias: cust)(code, level, name, salary) departments(value, date, name, status) Task: Select value from customers where level exists in departments for the same level. SQL:
SELECT value FROM customers AS cust WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.level = cust.level );
{ "outer_table": "customers", "inner_table": "departments", "outer_alias": "cust", "inner_alias": "dept", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15858
train
v1
Schema: sales (alias: sale)(amount, id, status, salary) schedules(value, date, salary, amount) Task: Retrieve id from sales whose level is found in schedules rows where level matches the outer record. SQL:
SELECT id FROM sales AS sale WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.level = sale.level );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15859
train
v1
Schema: accounts (alias: acct)(value, status, name, amount) departments(type, date, name, id) Task: Select salary from accounts where status exists in departments for the same id. SQL:
SELECT salary FROM accounts AS acct WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.id = acct.id );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "salary", "filter_col": "status", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15860
train
v2
Schema: shipments (alias: shp)(amount, value, level, code) products(name, value, type, status) Task: Retrieve name from shipments that have at least one corresponding entry in products sharing the same code. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = shp.code );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "name", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15861
train
v3
Schema: employees (alias: emp)(value, id, name, type) customers(value, code, name, type) Task: Retrieve code from employees with value above the MIN(amount) of customers rows sharing the same code. SQL:
SELECT code FROM employees AS emp WHERE value > ( SELECT MIN(amount) FROM customers AS cust WHERE cust.code = emp.code );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15862
train
v3
Schema: orders (alias: ord)(type, salary, level, date) invoices(value, status, code, level) Task: Retrieve amount from orders with amount above the MAX(amount) of invoices rows sharing the same level. SQL:
SELECT amount FROM orders AS ord WHERE amount > ( SELECT MAX(amount) FROM invoices AS inv WHERE inv.level = ord.level );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15863
train
v1
Schema: items (alias: lne)(level, type, status, name) categories(date, type, value, status) Task: Find salary from items where id appears in categories entries with matching type. SQL:
SELECT salary FROM items AS lne WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.type = lne.type );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "salary", "filter_col": "id", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15864
train
v3
Schema: items (alias: lne)(value, amount, date, level) branches(amount, level, code, status) Task: Find amount from items where value exceeds the total amount from branches for the same level. SQL:
SELECT amount FROM items AS lne WHERE value > ( SELECT SUM(amount) FROM branches AS brc WHERE brc.level = lne.level );
{ "outer_table": "items", "inner_table": "branches", "outer_alias": "lne", "inner_alias": "brc", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15865
train
v1
Schema: staff (alias: empl)(amount, value, code, id) branches(date, name, level, amount) Task: Find value from staff where status appears in branches entries with matching code. SQL:
SELECT value FROM staff AS empl WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.code = empl.code );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "value", "filter_col": "status", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_15866
train
v3
Schema: requests (alias: ordr)(level, code, salary, name) projects(level, date, amount, value) Task: Retrieve name from requests with salary above the MAX(amount) of projects rows sharing the same code. SQL:
SELECT name FROM requests AS ordr WHERE salary > ( SELECT MAX(amount) FROM projects AS prj WHERE prj.code = ordr.code );
{ "outer_table": "requests", "inner_table": "projects", "outer_alias": "ordr", "inner_alias": "prj", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_15867
train
v3
Schema: managers (alias: mgr)(date, level, name, amount) transactions(level, amount, salary, value) Task: Find amount from managers where value exceeds the minimum amount from transactions for the same level. SQL:
SELECT amount FROM managers AS mgr WHERE value > ( SELECT MIN(amount) FROM transactions AS txn WHERE txn.level = mgr.level );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15868
train
v1
Schema: shipments (alias: shp)(type, salary, amount, date) items(amount, value, name, code) Task: Retrieve name from shipments whose status is found in items rows where code matches the outer record. SQL:
SELECT name FROM shipments AS shp WHERE status IN ( SELECT status FROM items AS lne WHERE lne.code = shp.code );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15869
train
v2
Schema: products (alias: prod)(id, value, code, level) staff(status, level, value, code) Task: Retrieve amount from products that have at least one corresponding entry in staff sharing the same id. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = prod.id );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "amount", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15870
train
v2
Schema: employees (alias: emp)(name, salary, value, level) managers(amount, code, type, salary) Task: Find name from employees where a matching record exists in managers with the same id. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = emp.id );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "name", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15871
train
v1
Schema: managers (alias: mgr)(id, type, code, date) staff(code, amount, salary, id) Task: Find code from managers where code appears in staff entries with matching status. SQL:
SELECT code FROM managers AS mgr WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.status = mgr.status );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "code", "filter_col": "code", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15872
train
v2
Schema: orders (alias: ord)(status, salary, name, value) tasks(value, id, salary, level) Task: Retrieve amount from orders that have at least one corresponding entry in tasks sharing the same level. SQL:
SELECT amount 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": "amount", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15873
train
v2
Schema: customers (alias: cust)(salary, name, id, level) projects(id, name, amount, value) Task: Find code from customers where a matching record exists in projects with the same code. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.code = cust.code );
{ "outer_table": "customers", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "prj", "proj_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15874
train
v1
Schema: shipments (alias: shp)(salary, level, type, name) managers(id, status, name, code) Task: Find name from shipments where id appears in managers entries with matching level. SQL:
SELECT name FROM shipments AS shp WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.level = shp.level );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "name", "filter_col": "id", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15875
train
v2
Schema: accounts (alias: acct)(status, type, name, id) requests(value, salary, id, status) Task: Find value from accounts where a matching record exists in requests with the same code. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = acct.code );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "value", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15876
train
v2
Schema: sales (alias: sale)(value, amount, salary, type) staff(code, type, name, amount) Task: Find salary from sales where a matching record exists in staff with the same code. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = sale.code );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "salary", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15877
train
v2
Schema: staff (alias: empl)(name, salary, code, value) regions(name, code, id, date) Task: Retrieve id from staff that have at least one corresponding entry in regions sharing the same code. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = empl.code );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "id", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_15878
train
v3
Schema: products (alias: prod)(id, salary, date, value) managers(salary, date, type, name) Task: Find code from products where value exceeds the total salary from managers for the same code. SQL:
SELECT code FROM products AS prod WHERE value > ( SELECT SUM(salary) FROM managers AS mgr WHERE mgr.code = prod.code );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15879
train
v1
Schema: accounts (alias: acct)(name, amount, status, value) shipments(id, date, amount, code) Task: Retrieve amount from accounts whose level is found in shipments rows where status matches the outer record. SQL:
SELECT amount FROM accounts AS acct WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.status = acct.status );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15880
train
v2
Schema: items (alias: lne)(status, level, id, salary) requests(level, value, code, salary) Task: Find amount from items where a matching record exists in requests with the same level. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = lne.level );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "amount", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15881
train
v1
Schema: sales (alias: sale)(level, amount, type, id) transactions(amount, status, date, salary) Task: Retrieve id from sales whose status is found in transactions rows where type matches the outer record. SQL:
SELECT id FROM sales AS sale WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.type = sale.type );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15882
train
v1
Schema: shipments (alias: shp)(salary, value, status, name) projects(salary, code, value, type) Task: Find salary from shipments where level appears in projects entries with matching id. SQL:
SELECT salary FROM shipments AS shp WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.id = shp.id );
{ "outer_table": "shipments", "inner_table": "projects", "outer_alias": "shp", "inner_alias": "prj", "proj_col": "salary", "filter_col": "level", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15883
train
v1
Schema: customers (alias: cust)(amount, salary, level, id) products(date, type, id, code) Task: Find value from customers where type appears in products entries with matching level. SQL:
SELECT value FROM customers AS cust WHERE type IN ( SELECT type FROM products AS prod WHERE prod.level = cust.level );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15884
train
v1
Schema: regions (alias: rgn)(amount, type, code, level) sales(type, date, amount, id) Task: Retrieve code from regions whose status is found in sales rows where level matches the outer record. SQL:
SELECT code FROM regions AS rgn WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.level = rgn.level );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_15885
train
v2
Schema: items (alias: lne)(level, id, code, type) sales(level, id, value, name) Task: Retrieve name from items that have at least one corresponding entry in sales sharing the same level. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = lne.level );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "name", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15886
train
v2
Schema: customers (alias: cust)(salary, value, type, id) sales(code, amount, level, type) Task: Find code from customers where a matching record exists in sales with the same type. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = cust.type );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "code", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15887
train
v1
Schema: employees (alias: emp)(value, salary, level, code) invoices(code, level, type, status) Task: Select value from employees where id exists in invoices for the same level. SQL:
SELECT value FROM employees AS emp WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.level = emp.level );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15888
train
v3
Schema: schedules (alias: schd)(date, level, type, value) departments(value, type, date, amount) Task: Find name from schedules where amount exceeds the count of salary from departments for the same id. SQL:
SELECT name FROM schedules AS schd WHERE amount > ( SELECT COUNT(salary) FROM departments AS dept WHERE dept.id = schd.id );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_15889
train
v1
Schema: sales (alias: sale)(date, level, code, salary) categories(amount, code, level, date) Task: Select value from sales where id exists in categories for the same level. SQL:
SELECT value FROM sales AS sale WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.level = sale.level );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15890
train
v3
Schema: items (alias: lne)(code, date, type, amount) regions(code, salary, level, name) Task: Retrieve value from items with salary above the AVG(salary) of regions rows sharing the same level. SQL:
SELECT value FROM items AS lne WHERE salary > ( SELECT AVG(salary) FROM regions AS rgn WHERE rgn.level = lne.level );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15891
train
v3
Schema: tasks (alias: tsk)(level, name, type, value) transactions(value, code, level, status) Task: Retrieve value from tasks with salary above the AVG(amount) of transactions rows sharing the same code. SQL:
SELECT value FROM tasks AS tsk WHERE salary > ( SELECT AVG(amount) FROM transactions AS txn WHERE txn.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "transactions", "outer_alias": "tsk", "inner_alias": "txn", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15892
train
v1
Schema: orders (alias: ord)(date, status, code, name) shipments(value, date, name, code) Task: Select salary from orders where status exists in shipments for the same type. SQL:
SELECT salary FROM orders AS ord WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.type = ord.type );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15893
train
v3
Schema: accounts (alias: acct)(id, level, date, amount) schedules(name, value, id, type) Task: Find amount from accounts where salary exceeds the minimum value from schedules for the same code. SQL:
SELECT amount FROM accounts AS acct WHERE salary > ( SELECT MIN(value) FROM schedules AS schd WHERE schd.code = acct.code );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15894
train
v2
Schema: items (alias: lne)(code, level, name, salary) employees(id, value, name, status) Task: Retrieve salary from items that have at least one corresponding entry in employees sharing the same code. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = lne.code );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "salary", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_15895
train
v1
Schema: staff (alias: empl)(level, name, amount, code) managers(name, status, type, salary) Task: Retrieve code from staff whose type is found in managers rows where type matches the outer record. SQL:
SELECT code FROM staff AS empl WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.type = empl.type );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "code", "filter_col": "type", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_15896
train
v3
Schema: tasks (alias: tsk)(code, name, id, type) staff(salary, type, level, date) Task: Retrieve salary from tasks with amount above the AVG(amount) of staff rows sharing the same id. SQL:
SELECT salary FROM tasks AS tsk WHERE amount > ( SELECT AVG(amount) FROM staff AS empl WHERE empl.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "staff", "outer_alias": "tsk", "inner_alias": "empl", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_15897
train
v3
Schema: shipments (alias: shp)(level, salary, status, type) employees(level, status, name, id) Task: Find salary from shipments where salary exceeds the minimum amount from employees for the same type. SQL:
SELECT salary FROM shipments AS shp WHERE salary > ( SELECT MIN(amount) FROM employees AS emp WHERE emp.type = shp.type );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_15898
train
v1
Schema: departments (alias: dept)(amount, salary, level, date) requests(amount, id, type, status) Task: Find id from departments where status appears in requests entries with matching id. SQL:
SELECT id FROM departments AS dept WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.id = dept.id );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_15899
train