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: transactions (alias: txn)(amount, date, value, name) invoices(status, amount, code, name) Task: Find code from transactions where a matching record exists in invoices with the same id. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = txn.id );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "code", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04900
train
v3
Schema: projects (alias: prj)(date, salary, id, code) products(name, type, salary, date) Task: Find value from projects where salary exceeds the maximum salary from products for the same status. SQL:
SELECT value FROM projects AS prj WHERE salary > ( SELECT MAX(salary) FROM products AS prod WHERE prod.status = prj.status );
{ "outer_table": "projects", "inner_table": "products", "outer_alias": "prj", "inner_alias": "prod", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04901
train
v3
Schema: sales (alias: sale)(amount, name, level, code) shipments(level, date, id, amount) Task: Retrieve value from sales with amount above the MAX(salary) of shipments rows sharing the same code. SQL:
SELECT value FROM sales AS sale WHERE amount > ( SELECT MAX(salary) FROM shipments AS shp WHERE shp.code = sale.code );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04902
train
v1
Schema: staff (alias: empl)(code, type, status, amount) requests(date, status, salary, amount) Task: Select value from staff where status exists in requests for the same status. SQL:
SELECT value FROM staff AS empl WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.status = empl.status );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04903
train
v1
Schema: regions (alias: rgn)(amount, name, id, salary) shipments(amount, name, value, status) Task: Find amount from regions where code appears in shipments entries with matching code. SQL:
SELECT amount FROM regions AS rgn WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.code = rgn.code );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04904
train
v2
Schema: requests (alias: ordr)(code, status, type, name) invoices(name, value, amount, status) Task: Retrieve salary from requests that have at least one corresponding entry in invoices sharing the same code. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = ordr.code );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "salary", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04905
train
v3
Schema: orders (alias: ord)(name, salary, id, code) categories(status, date, level, amount) Task: Retrieve amount from orders with value above the COUNT(amount) of categories rows sharing the same code. SQL:
SELECT amount FROM orders AS ord WHERE value > ( SELECT COUNT(amount) FROM categories AS catg WHERE catg.code = ord.code );
{ "outer_table": "orders", "inner_table": "categories", "outer_alias": "ord", "inner_alias": "catg", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04906
train
v2
Schema: employees (alias: emp)(level, name, value, id) items(amount, salary, level, code) Task: Find amount from employees where a matching record exists in items with the same status. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = emp.status );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "amount", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04907
train
v2
Schema: sales (alias: sale)(value, status, salary, type) tasks(date, value, name, salary) Task: Retrieve amount from sales that have at least one corresponding entry in tasks sharing the same type. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.type = sale.type );
{ "outer_table": "sales", "inner_table": "tasks", "outer_alias": "sale", "inner_alias": "tsk", "proj_col": "amount", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04908
train
v2
Schema: customers (alias: cust)(name, salary, level, code) branches(level, status, salary, name) Task: Retrieve value from customers that have at least one corresponding entry in branches sharing the same type. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = cust.type );
{ "outer_table": "customers", "inner_table": "branches", "outer_alias": "cust", "inner_alias": "brc", "proj_col": "value", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04909
train
v3
Schema: products (alias: prod)(amount, type, value, code) departments(type, id, level, code) Task: Retrieve value from products with salary above the SUM(amount) of departments rows sharing the same code. SQL:
SELECT value FROM products AS prod WHERE salary > ( SELECT SUM(amount) FROM departments AS dept WHERE dept.code = prod.code );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04910
train
v2
Schema: accounts (alias: acct)(id, code, date, type) requests(date, value, salary, status) Task: Retrieve name from accounts that have at least one corresponding entry in requests sharing the same status. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = acct.status );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "name", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04911
train
v3
Schema: accounts (alias: acct)(type, level, id, salary) schedules(status, amount, id, salary) Task: Retrieve name from accounts with amount above the COUNT(amount) of schedules rows sharing the same id. SQL:
SELECT name FROM accounts AS acct WHERE amount > ( SELECT COUNT(amount) FROM schedules AS schd WHERE schd.id = acct.id );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04912
train
v3
Schema: sales (alias: sale)(salary, value, status, amount) accounts(type, amount, value, name) Task: Retrieve amount from sales with salary above the AVG(value) of accounts rows sharing the same id. SQL:
SELECT amount FROM sales AS sale WHERE salary > ( SELECT AVG(value) FROM accounts AS acct WHERE acct.id = sale.id );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04913
train
v3
Schema: staff (alias: empl)(status, value, level, id) employees(name, amount, type, value) Task: Retrieve id from staff with salary above the AVG(amount) of employees rows sharing the same level. SQL:
SELECT id FROM staff AS empl WHERE salary > ( SELECT AVG(amount) FROM employees AS emp WHERE emp.level = empl.level );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04914
train
v1
Schema: accounts (alias: acct)(level, value, salary, amount) orders(value, amount, status, name) Task: Find salary from accounts where code appears in orders entries with matching id. SQL:
SELECT salary FROM accounts AS acct WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.id = acct.id );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04915
train
v2
Schema: departments (alias: dept)(type, date, level, id) tasks(salary, amount, status, value) Task: Retrieve code from departments that have at least one corresponding entry in tasks sharing the same level. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.level = dept.level );
{ "outer_table": "departments", "inner_table": "tasks", "outer_alias": "dept", "inner_alias": "tsk", "proj_col": "code", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04916
train
v2
Schema: products (alias: prod)(date, status, type, code) accounts(amount, level, id, salary) Task: Retrieve code from products that have at least one corresponding entry in accounts sharing the same type. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = prod.type );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "code", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04917
train
v3
Schema: categories (alias: catg)(name, status, date, amount) products(code, salary, name, value) Task: Find code from categories where salary exceeds the minimum salary from products for the same status. SQL:
SELECT code FROM categories AS catg WHERE salary > ( SELECT MIN(salary) FROM products AS prod WHERE prod.status = catg.status );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04918
train
v2
Schema: products (alias: prod)(code, date, id, value) staff(id, value, status, name) Task: Retrieve amount from products that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = prod.status );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "amount", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04919
train
v1
Schema: staff (alias: empl)(salary, level, type, code) branches(value, status, name, id) Task: Select code from staff where level exists in branches for the same status. SQL:
SELECT code FROM staff AS empl WHERE level IN ( SELECT level FROM branches AS brc WHERE brc.status = empl.status );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04920
train
v2
Schema: branches (alias: brc)(status, code, id, date) departments(code, id, type, name) Task: Retrieve value from branches that have at least one corresponding entry in departments sharing the same type. SQL:
SELECT value FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = brc.type );
{ "outer_table": "branches", "inner_table": "departments", "outer_alias": "brc", "inner_alias": "dept", "proj_col": "value", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04921
train
v3
Schema: items (alias: lne)(level, name, id, status) projects(name, date, type, id) Task: Retrieve salary from items with salary above the MIN(amount) of projects rows sharing the same status. SQL:
SELECT salary FROM items AS lne WHERE salary > ( SELECT MIN(amount) FROM projects AS prj WHERE prj.status = lne.status );
{ "outer_table": "items", "inner_table": "projects", "outer_alias": "lne", "inner_alias": "prj", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04922
train
v1
Schema: products (alias: prod)(code, date, level, name) accounts(value, date, salary, type) Task: Find name from products where type appears in accounts entries with matching level. SQL:
SELECT name FROM products AS prod WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.level = prod.level );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04923
train
v1
Schema: employees (alias: emp)(status, amount, code, salary) tasks(level, amount, status, code) Task: Retrieve amount from employees whose code is found in tasks rows where id matches the outer record. SQL:
SELECT amount FROM employees AS emp WHERE code IN ( SELECT code FROM tasks AS tsk WHERE tsk.id = emp.id );
{ "outer_table": "employees", "inner_table": "tasks", "outer_alias": "emp", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "code", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04924
train
v1
Schema: invoices (alias: inv)(salary, name, date, level) managers(level, id, salary, date) Task: Select salary from invoices where type exists in managers for the same type. SQL:
SELECT salary FROM invoices AS inv WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.type = inv.type );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04925
train
v3
Schema: employees (alias: emp)(date, value, id, code) items(amount, value, date, code) Task: Retrieve salary from employees with salary above the AVG(amount) of items rows sharing the same level. SQL:
SELECT salary FROM employees AS emp WHERE salary > ( SELECT AVG(amount) FROM items AS lne WHERE lne.level = emp.level );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04926
train
v3
Schema: schedules (alias: schd)(date, id, level, name) products(status, name, code, type) Task: Find name from schedules where amount exceeds the count of salary from products for the same level. SQL:
SELECT name FROM schedules AS schd WHERE amount > ( SELECT COUNT(salary) FROM products AS prod WHERE prod.level = schd.level );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04927
train
v1
Schema: products (alias: prod)(code, date, salary, level) managers(code, id, name, salary) Task: Retrieve id from products whose type is found in managers rows where level matches the outer record. SQL:
SELECT id FROM products AS prod WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.level = prod.level );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04928
train
v3
Schema: products (alias: prod)(id, code, date, value) branches(code, level, date, amount) Task: Find salary from products where salary exceeds the count of value from branches for the same code. SQL:
SELECT salary FROM products AS prod WHERE salary > ( SELECT COUNT(value) FROM branches AS brc WHERE brc.code = prod.code );
{ "outer_table": "products", "inner_table": "branches", "outer_alias": "prod", "inner_alias": "brc", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04929
train
v3
Schema: requests (alias: ordr)(salary, id, status, value) categories(type, status, level, id) Task: Retrieve value from requests with salary above the MAX(amount) of categories rows sharing the same id. SQL:
SELECT value FROM requests AS ordr WHERE salary > ( SELECT MAX(amount) FROM categories AS catg WHERE catg.id = ordr.id );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04930
train
v1
Schema: sales (alias: sale)(id, salary, status, type) products(level, type, salary, id) Task: Retrieve amount from sales whose code is found in products rows where type matches the outer record. SQL:
SELECT amount FROM sales AS sale WHERE code IN ( SELECT code FROM products AS prod WHERE prod.type = sale.type );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04931
train
v3
Schema: schedules (alias: schd)(date, value, amount, salary) tasks(value, type, level, date) Task: Retrieve code from schedules with value above the MAX(salary) of tasks rows sharing the same level. SQL:
SELECT code FROM schedules AS schd WHERE value > ( SELECT MAX(salary) FROM tasks AS tsk WHERE tsk.level = schd.level );
{ "outer_table": "schedules", "inner_table": "tasks", "outer_alias": "schd", "inner_alias": "tsk", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04932
train
v1
Schema: schedules (alias: schd)(date, code, level, status) categories(date, status, salary, value) Task: Select name from schedules where level exists in categories for the same status. SQL:
SELECT name FROM schedules AS schd WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.status = schd.status );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04933
train
v3
Schema: managers (alias: mgr)(salary, value, code, level) shipments(date, amount, value, code) Task: Find code from managers where amount exceeds the maximum amount from shipments for the same level. SQL:
SELECT code FROM managers AS mgr WHERE amount > ( SELECT MAX(amount) FROM shipments AS shp WHERE shp.level = mgr.level );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04934
train
v2
Schema: categories (alias: catg)(salary, code, type, name) staff(salary, type, name, code) Task: Retrieve value from categories that have at least one corresponding entry in staff sharing the same code. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = catg.code );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "value", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04935
train
v2
Schema: requests (alias: ordr)(level, value, code, name) products(code, status, date, salary) Task: Retrieve name from requests that have at least one corresponding entry in products sharing the same status. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = ordr.status );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "name", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04936
train
v2
Schema: requests (alias: ordr)(id, code, level, value) managers(amount, code, value, id) Task: Find amount from requests where a matching record exists in managers with the same level. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = ordr.level );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "amount", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04937
train
v2
Schema: staff (alias: empl)(date, id, salary, type) projects(salary, name, date, value) Task: Retrieve id from staff that have at least one corresponding entry in projects sharing the same status. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = empl.status );
{ "outer_table": "staff", "inner_table": "projects", "outer_alias": "empl", "inner_alias": "prj", "proj_col": "id", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04938
train
v3
Schema: shipments (alias: shp)(level, date, status, amount) orders(code, amount, level, id) Task: Find salary from shipments where value exceeds the maximum value from orders for the same id. SQL:
SELECT salary FROM shipments AS shp WHERE value > ( SELECT MAX(value) FROM orders AS ord WHERE ord.id = shp.id );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04939
train
v3
Schema: employees (alias: emp)(amount, id, name, date) managers(id, level, name, type) Task: Retrieve salary from employees with amount above the AVG(value) of managers rows sharing the same id. SQL:
SELECT salary FROM employees AS emp WHERE amount > ( SELECT AVG(value) FROM managers AS mgr WHERE mgr.id = emp.id );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04940
train
v1
Schema: tasks (alias: tsk)(date, amount, type, id) customers(type, status, date, salary) Task: Select value from tasks where id exists in customers for the same code. SQL:
SELECT value FROM tasks AS tsk WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "customers", "outer_alias": "tsk", "inner_alias": "cust", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04941
train
v2
Schema: staff (alias: empl)(salary, type, status, level) regions(level, id, code, type) Task: Retrieve code from staff that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = empl.level );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "code", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04942
train
v3
Schema: accounts (alias: acct)(id, type, level, salary) branches(value, type, status, level) Task: Retrieve salary from accounts with amount above the AVG(value) of branches rows sharing the same code. SQL:
SELECT salary FROM accounts AS acct WHERE amount > ( SELECT AVG(value) FROM branches AS brc WHERE brc.code = acct.code );
{ "outer_table": "accounts", "inner_table": "branches", "outer_alias": "acct", "inner_alias": "brc", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04943
train
v3
Schema: departments (alias: dept)(id, date, name, salary) staff(name, type, amount, value) Task: Find code from departments where amount exceeds the count of salary from staff for the same level. SQL:
SELECT code FROM departments AS dept WHERE amount > ( SELECT COUNT(salary) FROM staff AS empl WHERE empl.level = dept.level );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04944
train
v3
Schema: products (alias: prod)(status, level, type, date) departments(value, name, code, amount) Task: Retrieve code from products with salary above the SUM(amount) of departments rows sharing the same level. SQL:
SELECT code FROM products AS prod WHERE salary > ( SELECT SUM(amount) FROM departments AS dept WHERE dept.level = prod.level );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04945
train
v3
Schema: branches (alias: brc)(salary, code, status, name) accounts(level, value, date, code) Task: Find salary from branches where salary exceeds the minimum amount from accounts for the same type. SQL:
SELECT salary FROM branches AS brc WHERE salary > ( SELECT MIN(amount) FROM accounts AS acct WHERE acct.type = brc.type );
{ "outer_table": "branches", "inner_table": "accounts", "outer_alias": "brc", "inner_alias": "acct", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04946
train
v1
Schema: sales (alias: sale)(name, type, date, code) managers(id, salary, date, name) Task: Select id from sales where level exists in managers for the same status. SQL:
SELECT id FROM sales AS sale WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.status = sale.status );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04947
train
v2
Schema: managers (alias: mgr)(id, amount, name, level) items(code, salary, level, value) Task: Find code from managers where a matching record exists in items with the same level. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.level = mgr.level );
{ "outer_table": "managers", "inner_table": "items", "outer_alias": "mgr", "inner_alias": "lne", "proj_col": "code", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04948
train
v2
Schema: departments (alias: dept)(name, amount, type, salary) categories(type, level, status, value) Task: Find code from departments where a matching record exists in categories with the same type. SQL:
SELECT code 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": "code", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04949
train
v1
Schema: managers (alias: mgr)(value, date, level, status) projects(amount, id, type, value) Task: Retrieve name from managers whose status is found in projects rows where id matches the outer record. SQL:
SELECT name FROM managers AS mgr WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.id = mgr.id );
{ "outer_table": "managers", "inner_table": "projects", "outer_alias": "mgr", "inner_alias": "prj", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04950
train
v2
Schema: managers (alias: mgr)(id, name, value, level) schedules(name, id, level, amount) Task: Retrieve code from managers that have at least one corresponding entry in schedules sharing the same status. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = mgr.status );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "code", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04951
train
v2
Schema: products (alias: prod)(salary, code, date, id) accounts(value, id, level, type) Task: Retrieve salary from products that have at least one corresponding entry in accounts sharing the same id. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = prod.id );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "salary", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04952
train
v3
Schema: branches (alias: brc)(status, date, value, code) categories(level, code, type, status) Task: Find salary from branches where amount exceeds the total value from categories for the same type. SQL:
SELECT salary FROM branches AS brc WHERE amount > ( SELECT SUM(value) FROM categories AS catg WHERE catg.type = brc.type );
{ "outer_table": "branches", "inner_table": "categories", "outer_alias": "brc", "inner_alias": "catg", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04953
train
v2
Schema: projects (alias: prj)(name, status, date, amount) branches(name, status, level, value) Task: Find name from projects where a matching record exists in branches with 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_04954
train
v2
Schema: regions (alias: rgn)(value, status, id, code) tasks(date, code, name, status) Task: Retrieve salary from regions that have at least one corresponding entry in tasks sharing the same code. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.code = rgn.code );
{ "outer_table": "regions", "inner_table": "tasks", "outer_alias": "rgn", "inner_alias": "tsk", "proj_col": "salary", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04955
train
v1
Schema: projects (alias: prj)(code, id, date, name) shipments(type, salary, date, name) Task: Select name from projects where type exists in shipments for the same type. SQL:
SELECT name FROM projects AS prj WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.type = prj.type );
{ "outer_table": "projects", "inner_table": "shipments", "outer_alias": "prj", "inner_alias": "shp", "proj_col": "name", "filter_col": "type", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04956
train
v3
Schema: departments (alias: dept)(salary, name, value, status) sales(name, value, id, amount) Task: Find name from departments where value exceeds the count of amount from sales for the same level. SQL:
SELECT name FROM departments AS dept WHERE value > ( SELECT COUNT(amount) FROM sales AS sale WHERE sale.level = dept.level );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04957
train
v1
Schema: requests (alias: ordr)(code, level, date, name) branches(amount, id, value, status) Task: Find code from requests where status appears in branches entries with matching level. SQL:
SELECT code FROM requests AS ordr WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.level = ordr.level );
{ "outer_table": "requests", "inner_table": "branches", "outer_alias": "ordr", "inner_alias": "brc", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04958
train
v2
Schema: products (alias: prod)(type, salary, id, name) departments(level, value, amount, name) Task: Find name from products where a matching record exists in departments with the same code. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = prod.code );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "name", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04959
train
v2
Schema: categories (alias: catg)(date, amount, type, salary) sales(name, value, level, id) Task: Retrieve value from categories that have at least one corresponding entry in sales sharing the same code. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = catg.code );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "value", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04960
train
v1
Schema: accounts (alias: acct)(code, amount, value, salary) tasks(amount, salary, date, status) Task: Find salary from accounts where level appears in tasks entries with matching level. SQL:
SELECT salary FROM accounts AS acct WHERE level IN ( SELECT level FROM tasks AS tsk WHERE tsk.level = acct.level );
{ "outer_table": "accounts", "inner_table": "tasks", "outer_alias": "acct", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "level", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04961
train
v1
Schema: customers (alias: cust)(date, type, id, salary) projects(status, salary, name, level) Task: Select id from customers where id exists in projects for the same type. SQL:
SELECT id FROM customers AS cust WHERE id IN ( SELECT id FROM projects AS prj WHERE prj.type = cust.type );
{ "outer_table": "customers", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "prj", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04962
train
v2
Schema: items (alias: lne)(level, date, name, id) regions(type, amount, level, status) Task: Find value from items where a matching record exists in regions with the same code. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = lne.code );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "value", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04963
train
v3
Schema: staff (alias: empl)(value, date, code, id) categories(date, type, code, level) Task: Retrieve code from staff with amount above the COUNT(value) of categories rows sharing the same code. SQL:
SELECT code FROM staff AS empl WHERE amount > ( SELECT COUNT(value) FROM categories AS catg WHERE catg.code = empl.code );
{ "outer_table": "staff", "inner_table": "categories", "outer_alias": "empl", "inner_alias": "catg", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04964
train
v1
Schema: transactions (alias: txn)(name, amount, id, type) managers(value, amount, level, name) Task: Select id from transactions where code exists in managers for the same id. SQL:
SELECT id FROM transactions AS txn WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.id = txn.id );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "id", "filter_col": "code", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04965
train
v2
Schema: sales (alias: sale)(value, status, id, level) products(amount, id, type, status) Task: Retrieve code from sales that have at least one corresponding entry in products sharing the same status. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = sale.status );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "code", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04966
train
v1
Schema: invoices (alias: inv)(name, salary, level, code) projects(value, status, code, type) Task: Retrieve code from invoices whose level is found in projects rows where type matches the outer record. SQL:
SELECT code FROM invoices AS inv WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.type = inv.type );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "inv", "inner_alias": "prj", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04967
train
v2
Schema: invoices (alias: inv)(value, salary, id, status) regions(name, level, date, salary) Task: Find amount from invoices where a matching record exists in regions with the same status. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = inv.status );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "amount", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04968
train
v1
Schema: schedules (alias: schd)(salary, status, amount, name) employees(amount, code, type, salary) Task: Retrieve salary from schedules whose type is found in employees rows where level matches the outer record. SQL:
SELECT salary FROM schedules AS schd WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.level = schd.level );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "salary", "filter_col": "type", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04969
train
v2
Schema: accounts (alias: acct)(date, amount, level, name) shipments(type, level, code, id) Task: Find code from accounts where a matching record exists in shipments with the same level. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = acct.level );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "code", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04970
train
v1
Schema: branches (alias: brc)(value, salary, level, status) regions(type, amount, name, salary) Task: Retrieve id from branches whose level is found in regions rows where code matches the outer record. SQL:
SELECT id FROM branches AS brc WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.code = brc.code );
{ "outer_table": "branches", "inner_table": "regions", "outer_alias": "brc", "inner_alias": "rgn", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04971
train
v3
Schema: invoices (alias: inv)(level, date, id, type) sales(value, name, status, code) Task: Find value from invoices where amount exceeds the count of amount from sales for the same level. SQL:
SELECT value FROM invoices AS inv WHERE amount > ( SELECT COUNT(amount) FROM sales AS sale WHERE sale.level = inv.level );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04972
train
v3
Schema: regions (alias: rgn)(status, date, salary, level) accounts(amount, status, name, date) Task: Retrieve name from regions with amount above the MIN(value) of accounts rows sharing the same id. SQL:
SELECT name FROM regions AS rgn WHERE amount > ( SELECT MIN(value) FROM accounts AS acct WHERE acct.id = rgn.id );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "rgn", "inner_alias": "acct", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04973
train
v2
Schema: shipments (alias: shp)(salary, amount, id, code) managers(level, amount, id, status) Task: Find amount from shipments where a matching record exists in managers with the same id. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = shp.id );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "amount", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04974
train
v2
Schema: projects (alias: prj)(amount, id, status, salary) orders(code, amount, date, id) Task: Retrieve value from projects that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT value FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = prj.level );
{ "outer_table": "projects", "inner_table": "orders", "outer_alias": "prj", "inner_alias": "ord", "proj_col": "value", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04975
train
v1
Schema: shipments (alias: shp)(salary, status, type, value) schedules(level, code, id, status) Task: Find id from shipments where id appears in schedules entries with matching type. SQL:
SELECT id FROM shipments AS shp WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.type = shp.type );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04976
train
v1
Schema: accounts (alias: acct)(level, date, id, salary) items(amount, code, status, level) Task: Find salary from accounts where type appears in items entries with matching level. SQL:
SELECT salary FROM accounts AS acct WHERE type IN ( SELECT type FROM items AS lne WHERE lne.level = acct.level );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "salary", "filter_col": "type", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04977
train
v1
Schema: schedules (alias: schd)(salary, id, code, name) categories(name, value, type, salary) Task: Retrieve value from schedules whose status is found in categories rows where id matches the outer record. SQL:
SELECT value FROM schedules AS schd WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.id = schd.id );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04978
train
v2
Schema: shipments (alias: shp)(code, name, date, type) sales(value, amount, date, code) Task: Retrieve amount from shipments that have at least one corresponding entry in sales sharing the same code. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = shp.code );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "amount", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04979
train
v1
Schema: customers (alias: cust)(id, level, salary, type) items(status, level, date, value) Task: Find salary from customers where level appears in items entries with matching type. SQL:
SELECT salary FROM customers AS cust WHERE level IN ( SELECT level FROM items AS lne WHERE lne.type = cust.type );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "salary", "filter_col": "level", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04980
train
v2
Schema: staff (alias: empl)(level, date, type, value) managers(type, code, name, date) Task: Find amount from staff where a matching record exists in managers with the same level. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = empl.level );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "amount", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04981
train
v1
Schema: shipments (alias: shp)(type, id, salary, date) customers(name, level, type, amount) Task: Retrieve id from shipments whose id is found in customers rows where code matches the outer record. SQL:
SELECT id FROM shipments AS shp WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.code = shp.code );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "id", "filter_col": "id", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04982
train
v2
Schema: transactions (alias: txn)(date, salary, status, name) invoices(date, type, level, value) Task: Retrieve value from transactions that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = txn.type );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "value", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04983
train
v3
Schema: accounts (alias: acct)(value, id, code, salary) schedules(value, salary, amount, id) Task: Find code from accounts where amount exceeds the minimum salary from schedules for the same type. SQL:
SELECT code FROM accounts AS acct WHERE amount > ( SELECT MIN(salary) FROM schedules AS schd WHERE schd.type = acct.type );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04984
train
v2
Schema: schedules (alias: schd)(amount, value, type, status) categories(value, level, status, date) Task: Retrieve id from schedules that have at least one corresponding entry in categories sharing the same type. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = schd.type );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "id", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04985
train
v1
Schema: invoices (alias: inv)(amount, value, type, name) regions(status, amount, type, code) Task: Retrieve id from invoices whose type is found in regions rows where code matches the outer record. SQL:
SELECT id FROM invoices AS inv WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.code = inv.code );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04986
train
v1
Schema: sales (alias: sale)(value, amount, id, type) transactions(date, name, status, type) Task: Find amount from sales where status appears in transactions entries with matching status. SQL:
SELECT amount FROM sales AS sale WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.status = sale.status );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04987
train
v2
Schema: requests (alias: ordr)(salary, value, code, status) transactions(salary, code, date, id) Task: Find id from requests where a matching record exists in transactions with the same level. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = ordr.level );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "id", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04988
train
v1
Schema: transactions (alias: txn)(date, value, id, level) departments(type, date, id, code) Task: Find value from transactions where id appears in departments entries with matching status. SQL:
SELECT value FROM transactions AS txn WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.status = txn.status );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04989
train
v2
Schema: projects (alias: prj)(date, status, name, salary) staff(status, type, salary, amount) Task: Find amount from projects where a matching record exists in staff with the same level. SQL:
SELECT amount FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = prj.level );
{ "outer_table": "projects", "inner_table": "staff", "outer_alias": "prj", "inner_alias": "empl", "proj_col": "amount", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04990
train
v1
Schema: invoices (alias: inv)(amount, value, date, name) transactions(status, salary, name, amount) Task: Select value from invoices where level exists in transactions for the same code. SQL:
SELECT value FROM invoices AS inv WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.code = inv.code );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04991
train
v3
Schema: categories (alias: catg)(value, amount, code, id) regions(name, date, code, value) Task: Retrieve salary from categories with value above the SUM(value) of regions rows sharing the same type. SQL:
SELECT salary FROM categories AS catg WHERE value > ( SELECT SUM(value) FROM regions AS rgn WHERE rgn.type = catg.type );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04992
train
v3
Schema: invoices (alias: inv)(salary, date, level, amount) employees(value, salary, status, type) Task: Retrieve value from invoices with amount above the MIN(value) of employees rows sharing the same id. SQL:
SELECT value FROM invoices AS inv WHERE amount > ( SELECT MIN(value) FROM employees AS emp WHERE emp.id = inv.id );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04993
train
v1
Schema: tasks (alias: tsk)(amount, type, date, salary) orders(status, type, amount, value) Task: Retrieve salary from tasks whose code is found in orders rows where status matches the outer record. SQL:
SELECT salary FROM tasks AS tsk WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "orders", "outer_alias": "tsk", "inner_alias": "ord", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04994
train
v2
Schema: staff (alias: empl)(name, date, level, status) products(id, date, value, name) Task: Find value from staff where a matching record exists in products with the same code. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = empl.code );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "value", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04995
train
v2
Schema: requests (alias: ordr)(name, amount, salary, id) staff(code, name, salary, id) Task: Retrieve id from requests that have at least one corresponding entry in staff sharing the same level. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = ordr.level );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "id", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04996
train
v2
Schema: departments (alias: dept)(amount, level, salary, date) accounts(salary, value, name, code) Task: Find amount from departments where a matching record exists in accounts with the same id. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = dept.id );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "amount", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04997
train
v2
Schema: branches (alias: brc)(amount, name, level, status) products(date, value, salary, type) Task: Retrieve id from branches that have at least one corresponding entry in products sharing the same type. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = brc.type );
{ "outer_table": "branches", "inner_table": "products", "outer_alias": "brc", "inner_alias": "prod", "proj_col": "id", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04998
train
v3
Schema: staff (alias: empl)(type, code, id, value) invoices(level, salary, code, name) Task: Retrieve salary from staff with value above the MIN(amount) of invoices rows sharing the same code. SQL:
SELECT salary FROM staff AS empl WHERE value > ( SELECT MIN(amount) FROM invoices AS inv WHERE inv.code = empl.code );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04999
train