variant
stringclasses
3 values
prompt
stringlengths
160
237
sql
stringlengths
102
141
metadata
unknown
token_group
stringclasses
2 values
id
stringlengths
24
24
split
stringclasses
1 value
v3
Schema: products (alias: prod)(status, name, amount, value) schedules(value, level, date, salary) Task: Retrieve id from products with salary above the MIN(salary) of schedules rows sharing the same status. SQL:
SELECT id FROM products AS prod WHERE salary > ( SELECT MIN(salary) FROM schedules AS schd WHERE schd.status = prod.status );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16600
train
v2
Schema: categories (alias: catg)(code, salary, name, date) accounts(status, name, amount, type) Task: Retrieve amount from categories that have at least one corresponding entry in accounts sharing the same type. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = catg.type );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "amount", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_16601
train
v1
Schema: regions (alias: rgn)(amount, id, name, level) categories(name, id, date, status) Task: Select name from regions where code exists in categories for the same level. SQL:
SELECT name FROM regions AS rgn WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.level = rgn.level );
{ "outer_table": "regions", "inner_table": "categories", "outer_alias": "rgn", "inner_alias": "catg", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_16602
train
v3
Schema: branches (alias: brc)(id, status, name, type) shipments(code, type, name, level) Task: Retrieve code from branches with salary above the COUNT(value) of shipments rows sharing the same level. SQL:
SELECT code FROM branches AS brc WHERE salary > ( SELECT COUNT(value) FROM shipments AS shp WHERE shp.level = brc.level );
{ "outer_table": "branches", "inner_table": "shipments", "outer_alias": "brc", "inner_alias": "shp", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_16603
train
v3
Schema: managers (alias: mgr)(date, amount, level, status) products(salary, type, id, code) Task: Find value from managers where amount exceeds the count of amount from products for the same status. SQL:
SELECT value FROM managers AS mgr WHERE amount > ( SELECT COUNT(amount) FROM products AS prod WHERE prod.status = mgr.status );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16604
train
v2
Schema: items (alias: lne)(amount, name, code, type) orders(name, id, status, date) Task: Find value from items where a matching record exists in orders with the same id. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = lne.id );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "value", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_16605
train
v1
Schema: items (alias: lne)(code, amount, level, salary) sales(date, status, name, amount) Task: Find name from items where code appears in sales entries with matching code. SQL:
SELECT name FROM items AS lne WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.code = lne.code );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_16606
train
v3
Schema: tasks (alias: tsk)(id, date, value, code) customers(status, name, level, amount) Task: Find value from tasks where value exceeds the average salary from customers for the same code. SQL:
SELECT value FROM tasks AS tsk WHERE value > ( SELECT AVG(salary) 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": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_16607
train
v3
Schema: requests (alias: ordr)(id, value, salary, amount) projects(status, code, id, amount) Task: Retrieve id from requests with value above the SUM(salary) of projects rows sharing the same id. SQL:
SELECT id FROM requests AS ordr WHERE value > ( SELECT SUM(salary) FROM projects AS prj WHERE prj.id = ordr.id );
{ "outer_table": "requests", "inner_table": "projects", "outer_alias": "ordr", "inner_alias": "prj", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_16608
train
v3
Schema: accounts (alias: acct)(type, code, name, date) projects(salary, status, code, type) Task: Find value from accounts where amount exceeds the average value from projects for the same status. SQL:
SELECT value FROM accounts AS acct WHERE amount > ( SELECT AVG(value) FROM projects AS prj WHERE prj.status = acct.status );
{ "outer_table": "accounts", "inner_table": "projects", "outer_alias": "acct", "inner_alias": "prj", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16609
train
v3
Schema: managers (alias: mgr)(date, amount, code, level) employees(value, type, salary, amount) Task: Retrieve value from managers with salary above the MAX(value) of employees rows sharing the same code. SQL:
SELECT value FROM managers AS mgr WHERE salary > ( SELECT MAX(value) FROM employees AS emp WHERE emp.code = mgr.code );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16610
train
v2
Schema: staff (alias: empl)(type, name, id, salary) departments(status, salary, id, value) Task: Find amount from staff where a matching record exists in departments with the same status. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = empl.status );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "amount", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_16611
train
v3
Schema: customers (alias: cust)(id, salary, amount, status) employees(id, type, date, amount) Task: Find code from customers where amount exceeds the count of amount from employees for the same level. SQL:
SELECT code FROM customers AS cust WHERE amount > ( SELECT COUNT(amount) FROM employees AS emp WHERE emp.level = cust.level );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16612
train
v1
Schema: branches (alias: brc)(date, name, salary, value) staff(name, value, level, salary) Task: Find id from branches where type appears in staff entries with matching id. SQL:
SELECT id FROM branches AS brc WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.id = brc.id );
{ "outer_table": "branches", "inner_table": "staff", "outer_alias": "brc", "inner_alias": "empl", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_16613
train
v2
Schema: regions (alias: rgn)(salary, date, name, amount) invoices(level, type, id, code) Task: Retrieve id from regions that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = rgn.id );
{ "outer_table": "regions", "inner_table": "invoices", "outer_alias": "rgn", "inner_alias": "inv", "proj_col": "id", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_16614
train
v2
Schema: customers (alias: cust)(value, date, code, id) orders(value, salary, date, amount) Task: Find id from customers where a matching record exists in orders with the same level. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = cust.level );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "id", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16615
train
v2
Schema: managers (alias: mgr)(id, salary, level, type) sales(name, code, value, date) Task: Retrieve amount from managers that have at least one corresponding entry in sales sharing the same id. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = mgr.id );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "amount", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16616
train
v1
Schema: transactions (alias: txn)(id, amount, type, value) regions(code, value, name, level) Task: Retrieve name from transactions whose code is found in regions rows where status matches the outer record. SQL:
SELECT name FROM transactions AS txn WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.status = txn.status );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16617
train
v2
Schema: sales (alias: sale)(level, type, status, amount) shipments(name, level, salary, date) Task: Find name from sales where a matching record exists in shipments with the same level. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = sale.level );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "name", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16618
train
v1
Schema: departments (alias: dept)(date, id, value, salary) branches(level, value, code, name) Task: Retrieve amount from departments whose type is found in branches rows where code matches the outer record. SQL:
SELECT amount FROM departments AS dept WHERE type IN ( SELECT type FROM branches AS brc WHERE brc.code = dept.code );
{ "outer_table": "departments", "inner_table": "branches", "outer_alias": "dept", "inner_alias": "brc", "proj_col": "amount", "filter_col": "type", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16619
train
v1
Schema: departments (alias: dept)(amount, date, salary, type) invoices(name, salary, date, level) Task: Select id from departments where level exists in invoices for the same code. SQL:
SELECT id FROM departments AS dept WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.code = dept.code );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16620
train
v1
Schema: employees (alias: emp)(level, id, date, salary) schedules(id, level, value, name) Task: Find value from employees where status appears in schedules entries with matching level. SQL:
SELECT value FROM employees AS emp WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.level = emp.level );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16621
train
v1
Schema: items (alias: lne)(id, salary, name, status) departments(name, level, status, id) Task: Find amount from items where id appears in departments entries with matching id. SQL:
SELECT amount FROM items AS lne WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.id = lne.id );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "amount", "filter_col": "id", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_16622
train
v2
Schema: projects (alias: prj)(value, code, type, date) shipments(level, name, type, id) Task: Find id from projects where a matching record exists in shipments with the same id. SQL:
SELECT id FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = prj.id );
{ "outer_table": "projects", "inner_table": "shipments", "outer_alias": "prj", "inner_alias": "shp", "proj_col": "id", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_16623
train
v2
Schema: staff (alias: empl)(salary, status, code, id) items(type, id, salary, code) Task: Find value from staff where a matching record exists in items with the same status. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = empl.status );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "value", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_16624
train
v3
Schema: customers (alias: cust)(code, salary, type, status) managers(value, id, code, name) Task: Find id from customers where amount exceeds the minimum value from managers for the same id. SQL:
SELECT id FROM customers AS cust WHERE amount > ( SELECT MIN(value) FROM managers AS mgr WHERE mgr.id = cust.id );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16625
train
v3
Schema: employees (alias: emp)(level, name, id, amount) schedules(type, id, code, value) Task: Find amount from employees where salary exceeds the maximum salary from schedules for the same type. SQL:
SELECT amount FROM employees AS emp WHERE salary > ( SELECT MAX(salary) FROM schedules AS schd WHERE schd.type = emp.type );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16626
train
v2
Schema: items (alias: lne)(value, salary, code, status) tasks(status, name, id, code) Task: Find name from items where a matching record exists in tasks with the same level. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.level = lne.level );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "name", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_16627
train
v3
Schema: projects (alias: prj)(date, status, code, salary) accounts(amount, date, level, code) Task: Retrieve value from projects with amount above the MIN(value) of accounts rows sharing the same id. SQL:
SELECT value FROM projects AS prj WHERE amount > ( SELECT MIN(value) FROM accounts AS acct WHERE acct.id = prj.id );
{ "outer_table": "projects", "inner_table": "accounts", "outer_alias": "prj", "inner_alias": "acct", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_16628
train
v2
Schema: customers (alias: cust)(code, date, status, type) categories(value, code, name, type) Task: Retrieve name from customers that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = cust.code );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "name", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16629
train
v1
Schema: customers (alias: cust)(code, value, level, id) departments(id, type, amount, status) Task: Find name from customers where status appears in departments entries with matching id. SQL:
SELECT name FROM customers AS cust WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.id = cust.id );
{ "outer_table": "customers", "inner_table": "departments", "outer_alias": "cust", "inner_alias": "dept", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16630
train
v2
Schema: schedules (alias: schd)(name, level, value, id) customers(status, amount, name, value) Task: Find code from schedules where a matching record exists in customers with the same code. SQL:
SELECT code FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = schd.code );
{ "outer_table": "schedules", "inner_table": "customers", "outer_alias": "schd", "inner_alias": "cust", "proj_col": "code", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_16631
train
v3
Schema: departments (alias: dept)(type, status, salary, level) staff(name, status, id, type) Task: Find value from departments where value exceeds the minimum value from staff for the same code. SQL:
SELECT value FROM departments AS dept WHERE value > ( SELECT MIN(value) FROM staff AS empl WHERE empl.code = dept.code );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16632
train
v3
Schema: staff (alias: empl)(salary, type, status, name) employees(name, code, salary, id) Task: Retrieve name from staff with value above the MIN(salary) of employees rows sharing the same status. SQL:
SELECT name FROM staff AS empl WHERE value > ( SELECT MIN(salary) FROM employees AS emp WHERE emp.status = empl.status );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_16633
train
v2
Schema: projects (alias: prj)(date, salary, type, name) tasks(type, code, value, name) Task: Find salary from projects where a matching record exists in tasks with the same status. SQL:
SELECT salary FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = prj.status );
{ "outer_table": "projects", "inner_table": "tasks", "outer_alias": "prj", "inner_alias": "tsk", "proj_col": "salary", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_16634
train
v1
Schema: branches (alias: brc)(code, status, amount, name) regions(code, amount, name, salary) Task: Retrieve code from branches whose status is found in regions rows where id matches the outer record. SQL:
SELECT code FROM branches AS brc WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.id = brc.id );
{ "outer_table": "branches", "inner_table": "regions", "outer_alias": "brc", "inner_alias": "rgn", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_16635
train
v2
Schema: products (alias: prod)(date, code, type, status) schedules(date, status, id, code) Task: Retrieve salary from products that have at least one corresponding entry in schedules sharing the same id. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = prod.id );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "salary", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16636
train
v3
Schema: products (alias: prod)(date, amount, value, type) customers(date, level, value, salary) Task: Retrieve name from products with value above the MIN(amount) of customers rows sharing the same code. SQL:
SELECT name FROM products AS prod WHERE value > ( SELECT MIN(amount) FROM customers AS cust WHERE cust.code = prod.code );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16637
train
v1
Schema: accounts (alias: acct)(code, status, value, id) items(value, date, level, name) Task: Retrieve amount from accounts whose level is found in items rows where id matches the outer record. SQL:
SELECT amount FROM accounts AS acct WHERE level IN ( SELECT level FROM items AS lne WHERE lne.id = acct.id );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16638
train
v2
Schema: products (alias: prod)(id, status, name, level) accounts(name, date, amount, level) Task: Retrieve value from products that have at least one corresponding entry in accounts sharing the same code. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = prod.code );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "value", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16639
train
v2
Schema: categories (alias: catg)(code, status, name, date) requests(type, date, amount, value) Task: Retrieve name from categories that have at least one corresponding entry in requests sharing the same id. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = catg.id );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "name", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_16640
train
v2
Schema: categories (alias: catg)(id, date, value, level) projects(salary, type, value, level) Task: Find value from categories where a matching record exists in projects with the same type. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = catg.type );
{ "outer_table": "categories", "inner_table": "projects", "outer_alias": "catg", "inner_alias": "prj", "proj_col": "value", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_16641
train
v3
Schema: employees (alias: emp)(salary, level, code, value) departments(code, value, salary, id) Task: Retrieve id from employees with value above the AVG(amount) of departments rows sharing the same level. SQL:
SELECT id FROM employees AS emp WHERE value > ( SELECT AVG(amount) FROM departments AS dept WHERE dept.level = emp.level );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "id", "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_16642
train
v3
Schema: managers (alias: mgr)(amount, id, type, salary) orders(code, id, level, salary) Task: Retrieve code from managers with salary above the SUM(salary) of orders rows sharing the same code. SQL:
SELECT code FROM managers AS mgr WHERE salary > ( SELECT SUM(salary) FROM orders AS ord WHERE ord.code = mgr.code );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16643
train
v2
Schema: invoices (alias: inv)(type, code, status, salary) departments(date, value, level, amount) Task: Find id from invoices where a matching record exists in departments with the same type. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = inv.type );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "id", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16644
train
v1
Schema: tasks (alias: tsk)(value, date, salary, type) invoices(code, salary, amount, level) Task: Find value from tasks where type appears in invoices entries with matching id. SQL:
SELECT value FROM tasks AS tsk WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "invoices", "outer_alias": "tsk", "inner_alias": "inv", "proj_col": "value", "filter_col": "type", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_16645
train
v1
Schema: transactions (alias: txn)(salary, id, value, name) projects(value, date, status, type) Task: Retrieve salary from transactions whose code is found in projects rows where id matches the outer record. SQL:
SELECT salary FROM transactions AS txn WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.id = txn.id );
{ "outer_table": "transactions", "inner_table": "projects", "outer_alias": "txn", "inner_alias": "prj", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16646
train
v3
Schema: tasks (alias: tsk)(salary, name, code, value) managers(amount, date, status, salary) Task: Find salary from tasks where value exceeds the total value from managers for the same status. SQL:
SELECT salary FROM tasks AS tsk WHERE value > ( SELECT SUM(value) FROM managers AS mgr WHERE mgr.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "managers", "outer_alias": "tsk", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_16647
train
v2
Schema: staff (alias: empl)(status, value, amount, type) shipments(id, amount, date, type) Task: Find name from staff where a matching record exists in shipments with the same type. SQL:
SELECT name FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = empl.type );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "name", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_16648
train
v3
Schema: projects (alias: prj)(salary, id, level, value) accounts(name, value, status, amount) Task: Retrieve salary from projects with salary above the SUM(value) of accounts rows sharing the same level. SQL:
SELECT salary FROM projects AS prj WHERE salary > ( SELECT SUM(value) FROM accounts AS acct WHERE acct.level = prj.level );
{ "outer_table": "projects", "inner_table": "accounts", "outer_alias": "prj", "inner_alias": "acct", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_16649
train
v1
Schema: managers (alias: mgr)(status, id, value, date) customers(amount, type, salary, level) Task: Select id from managers where type exists in customers for the same status. SQL:
SELECT id FROM managers AS mgr WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.status = mgr.status );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "id", "filter_col": "type", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16650
train
v1
Schema: requests (alias: ordr)(value, amount, type, status) sales(level, name, date, code) Task: Find amount from requests where id appears in sales entries with matching level. SQL:
SELECT amount FROM requests AS ordr WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.level = ordr.level );
{ "outer_table": "requests", "inner_table": "sales", "outer_alias": "ordr", "inner_alias": "sale", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_16651
train
v3
Schema: branches (alias: brc)(level, amount, code, type) managers(value, salary, code, level) Task: Find id from branches where value exceeds the maximum value from managers for the same level. SQL:
SELECT id FROM branches AS brc WHERE value > ( SELECT MAX(value) FROM managers AS mgr WHERE mgr.level = brc.level );
{ "outer_table": "branches", "inner_table": "managers", "outer_alias": "brc", "inner_alias": "mgr", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_16652
train
v2
Schema: requests (alias: ordr)(code, status, date, type) orders(salary, value, status, level) Task: Retrieve id from requests that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = ordr.level );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "id", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_16653
train
v1
Schema: departments (alias: dept)(amount, code, date, value) projects(id, salary, name, type) Task: Retrieve name from departments whose type is found in projects rows where type matches the outer record. SQL:
SELECT name FROM departments AS dept WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.type = dept.type );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "name", "filter_col": "type", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16654
train
v1
Schema: shipments (alias: shp)(salary, level, code, type) categories(name, id, salary, level) Task: Select value from shipments where type exists in categories for the same level. SQL:
SELECT value FROM shipments AS shp WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.level = shp.level );
{ "outer_table": "shipments", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "catg", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_16655
train
v3
Schema: branches (alias: brc)(salary, id, value, amount) staff(status, id, amount, salary) Task: Find salary from branches where amount exceeds the average amount from staff for the same code. SQL:
SELECT salary FROM branches AS brc WHERE amount > ( SELECT AVG(amount) FROM staff AS empl WHERE empl.code = brc.code );
{ "outer_table": "branches", "inner_table": "staff", "outer_alias": "brc", "inner_alias": "empl", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_16656
train
v2
Schema: tasks (alias: tsk)(name, level, type, value) managers(amount, level, status, id) Task: Find id from tasks where a matching record exists in managers with the same type. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "managers", "outer_alias": "tsk", "inner_alias": "mgr", "proj_col": "id", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_16657
train
v3
Schema: branches (alias: brc)(type, date, value, status) schedules(salary, level, id, type) Task: Find amount from branches where value exceeds the maximum value from schedules for the same type. SQL:
SELECT amount FROM branches AS brc WHERE value > ( SELECT MAX(value) FROM schedules AS schd WHERE schd.type = brc.type );
{ "outer_table": "branches", "inner_table": "schedules", "outer_alias": "brc", "inner_alias": "schd", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_16658
train
v3
Schema: orders (alias: ord)(date, level, status, type) products(salary, level, value, name) Task: Find amount from orders where value exceeds the total amount from products for the same level. SQL:
SELECT amount FROM orders AS ord WHERE value > ( SELECT SUM(amount) FROM products AS prod WHERE prod.level = ord.level );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16659
train
v3
Schema: managers (alias: mgr)(level, salary, name, status) regions(level, name, id, date) Task: Retrieve code from managers with value above the AVG(salary) of regions rows sharing the same code. SQL:
SELECT code FROM managers AS mgr WHERE value > ( SELECT AVG(salary) FROM regions AS rgn WHERE rgn.code = mgr.code );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16660
train
v3
Schema: transactions (alias: txn)(code, type, amount, value) categories(value, salary, id, name) Task: Find id from transactions where value exceeds the maximum amount from categories for the same code. SQL:
SELECT id FROM transactions AS txn WHERE value > ( SELECT MAX(amount) FROM categories AS catg WHERE catg.code = txn.code );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16661
train
v1
Schema: projects (alias: prj)(level, id, status, amount) employees(level, name, status, id) Task: Find id from projects where type appears in employees entries with matching code. SQL:
SELECT id FROM projects AS prj WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.code = prj.code );
{ "outer_table": "projects", "inner_table": "employees", "outer_alias": "prj", "inner_alias": "emp", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_16662
train
v1
Schema: tasks (alias: tsk)(amount, name, id, value) employees(level, id, value, type) Task: Retrieve amount from tasks whose type is found in employees rows where level matches the outer record. SQL:
SELECT amount FROM tasks AS tsk WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "employees", "outer_alias": "tsk", "inner_alias": "emp", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_16663
train
v2
Schema: managers (alias: mgr)(code, value, date, type) branches(name, status, id, salary) Task: Find amount from managers where a matching record exists in branches with the same id. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.id = mgr.id );
{ "outer_table": "managers", "inner_table": "branches", "outer_alias": "mgr", "inner_alias": "brc", "proj_col": "amount", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16664
train
v2
Schema: requests (alias: ordr)(date, value, code, name) tasks(value, code, name, date) Task: Retrieve name from requests that have at least one corresponding entry in tasks sharing the same id. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.id = ordr.id );
{ "outer_table": "requests", "inner_table": "tasks", "outer_alias": "ordr", "inner_alias": "tsk", "proj_col": "name", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_16665
train
v3
Schema: employees (alias: emp)(id, salary, date, code) tasks(date, level, id, name) Task: Find code from employees where amount exceeds the total salary from tasks for the same status. SQL:
SELECT code FROM employees AS emp WHERE amount > ( SELECT SUM(salary) FROM tasks AS tsk WHERE tsk.status = emp.status );
{ "outer_table": "employees", "inner_table": "tasks", "outer_alias": "emp", "inner_alias": "tsk", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16666
train
v3
Schema: branches (alias: brc)(value, type, id, amount) invoices(salary, id, code, level) Task: Retrieve code from branches with value above the SUM(value) of invoices rows sharing the same status. SQL:
SELECT code FROM branches AS brc WHERE value > ( SELECT SUM(value) FROM invoices AS inv WHERE inv.status = brc.status );
{ "outer_table": "branches", "inner_table": "invoices", "outer_alias": "brc", "inner_alias": "inv", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_16667
train
v1
Schema: products (alias: prod)(status, level, id, amount) orders(name, amount, id, salary) Task: Retrieve id from products whose type is found in orders rows where id matches the outer record. SQL:
SELECT id FROM products AS prod WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.id = prod.id );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16668
train
v1
Schema: shipments (alias: shp)(code, date, status, value) products(status, name, salary, type) Task: Find id from shipments where level appears in products entries with matching level. SQL:
SELECT id FROM shipments AS shp WHERE level IN ( SELECT level FROM products AS prod WHERE prod.level = shp.level );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_16669
train
v3
Schema: staff (alias: empl)(level, value, status, id) managers(salary, id, level, date) Task: Retrieve salary from staff with salary above the MIN(salary) of managers rows sharing the same id. SQL:
SELECT salary FROM staff AS empl WHERE salary > ( SELECT MIN(salary) FROM managers AS mgr WHERE mgr.id = empl.id );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_16670
train
v2
Schema: items (alias: lne)(value, amount, code, name) managers(level, status, salary, code) Task: Retrieve salary from items that have at least one corresponding entry in managers sharing the same type. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = lne.type );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "salary", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_16671
train
v3
Schema: regions (alias: rgn)(id, name, code, date) tasks(amount, value, date, level) Task: Find value from regions where amount exceeds the maximum amount from tasks for the same id. SQL:
SELECT value FROM regions AS rgn WHERE amount > ( SELECT MAX(amount) FROM tasks AS tsk WHERE tsk.id = rgn.id );
{ "outer_table": "regions", "inner_table": "tasks", "outer_alias": "rgn", "inner_alias": "tsk", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_16672
train
v1
Schema: staff (alias: empl)(type, date, name, level) managers(value, id, status, name) Task: Retrieve code from staff whose code is found in managers rows where id matches the outer record. SQL:
SELECT code FROM staff AS empl WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.id = empl.id );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_16673
train
v2
Schema: departments (alias: dept)(salary, name, status, id) items(value, code, type, level) Task: Retrieve code from departments that have at least one corresponding entry in items sharing the same code. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = dept.code );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "code", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16674
train
v2
Schema: departments (alias: dept)(salary, id, level, type) orders(level, id, value, amount) Task: Retrieve name from departments that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = dept.level );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "name", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16675
train
v3
Schema: accounts (alias: acct)(salary, status, type, amount) products(date, salary, level, code) Task: Find value from accounts where amount exceeds the average value from products for the same level. SQL:
SELECT value FROM accounts AS acct WHERE amount > ( SELECT AVG(value) FROM products AS prod WHERE prod.level = acct.level );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16676
train
v2
Schema: categories (alias: catg)(name, type, id, amount) shipments(date, salary, id, status) Task: Find value from categories where a matching record exists in shipments with the same status. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = catg.status );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "catg", "inner_alias": "shp", "proj_col": "value", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_16677
train
v2
Schema: employees (alias: emp)(code, value, name, type) managers(code, date, id, salary) Task: Retrieve name from employees that have at least one corresponding entry in managers sharing the same code. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = emp.code );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "name", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16678
train
v2
Schema: managers (alias: mgr)(status, name, id, value) sales(id, amount, status, name) Task: Find value from managers where a matching record exists in sales with the same level. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = mgr.level );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "value", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16679
train
v3
Schema: projects (alias: prj)(id, salary, level, value) invoices(code, type, amount, value) Task: Retrieve amount from projects with amount above the COUNT(amount) of invoices rows sharing the same id. SQL:
SELECT amount FROM projects AS prj WHERE amount > ( SELECT COUNT(amount) FROM invoices AS inv WHERE inv.id = prj.id );
{ "outer_table": "projects", "inner_table": "invoices", "outer_alias": "prj", "inner_alias": "inv", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_16680
train
v1
Schema: branches (alias: brc)(value, code, level, salary) projects(code, type, id, value) Task: Find salary from branches where level appears in projects entries with matching code. SQL:
SELECT salary FROM branches AS brc WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.code = brc.code );
{ "outer_table": "branches", "inner_table": "projects", "outer_alias": "brc", "inner_alias": "prj", "proj_col": "salary", "filter_col": "level", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_16681
train
v2
Schema: items (alias: lne)(id, code, level, amount) sales(type, name, value, level) Task: Retrieve amount from items that have at least one corresponding entry in sales sharing the same status. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = lne.status );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "amount", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_16682
train
v2
Schema: invoices (alias: inv)(status, type, name, salary) customers(value, id, type, date) Task: Find value from invoices where a matching record exists in customers with the same id. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = inv.id );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "value", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16683
train
v3
Schema: products (alias: prod)(status, value, salary, name) regions(type, value, level, id) Task: Find value from products where value exceeds the maximum value from regions for the same code. SQL:
SELECT value FROM products AS prod WHERE value > ( SELECT MAX(value) FROM regions AS rgn WHERE rgn.code = prod.code );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16684
train
v1
Schema: regions (alias: rgn)(type, name, level, amount) orders(status, id, date, salary) Task: Retrieve amount from regions whose level is found in orders rows where id matches the outer record. SQL:
SELECT amount FROM regions AS rgn WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.id = rgn.id );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_16685
train
v2
Schema: accounts (alias: acct)(date, code, salary, level) departments(level, amount, id, salary) Task: Find id from accounts where a matching record exists in departments with the same type. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = acct.type );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "id", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16686
train
v3
Schema: managers (alias: mgr)(id, salary, name, date) orders(date, level, amount, value) Task: Retrieve value from managers with amount above the AVG(salary) of orders rows sharing the same id. SQL:
SELECT value FROM managers AS mgr WHERE amount > ( SELECT AVG(salary) FROM orders AS ord WHERE ord.id = mgr.id );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16687
train
v3
Schema: transactions (alias: txn)(date, code, type, salary) requests(status, amount, name, level) Task: Retrieve amount from transactions with amount above the AVG(salary) of requests rows sharing the same code. SQL:
SELECT amount FROM transactions AS txn WHERE amount > ( SELECT AVG(salary) FROM requests AS ordr WHERE ordr.code = txn.code );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16688
train
v3
Schema: categories (alias: catg)(amount, type, name, level) accounts(date, id, salary, level) Task: Retrieve salary from categories with value above the AVG(value) of accounts rows sharing the same level. SQL:
SELECT salary FROM categories AS catg WHERE value > ( SELECT AVG(value) FROM accounts AS acct WHERE acct.level = catg.level );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_16689
train
v1
Schema: invoices (alias: inv)(level, code, date, value) sales(id, salary, date, value) Task: Find amount from invoices where id appears in sales entries with matching code. SQL:
SELECT amount FROM invoices AS inv WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.code = inv.code );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16690
train
v1
Schema: projects (alias: prj)(id, code, value, type) items(salary, status, date, code) Task: Retrieve amount from projects whose type is found in items rows where id matches the outer record. SQL:
SELECT amount FROM projects AS prj WHERE type IN ( SELECT type FROM items AS lne WHERE lne.id = prj.id );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "lne", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_16691
train
v1
Schema: categories (alias: catg)(level, value, id, code) sales(id, salary, name, amount) Task: Retrieve value from categories whose type is found in sales rows where status matches the outer record. SQL:
SELECT value FROM categories AS catg WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.status = catg.status );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_16692
train
v3
Schema: items (alias: lne)(date, status, code, name) employees(type, code, value, name) Task: Find salary from items where amount exceeds the count of salary from employees for the same code. SQL:
SELECT salary FROM items AS lne WHERE amount > ( SELECT COUNT(salary) FROM employees AS emp WHERE emp.code = lne.code );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_16693
train
v2
Schema: requests (alias: ordr)(amount, level, code, status) accounts(amount, type, level, salary) Task: Find name from requests where a matching record exists in accounts with the same type. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = ordr.type );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "name", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_16694
train
v1
Schema: staff (alias: empl)(salary, name, amount, value) branches(salary, amount, name, date) Task: Retrieve name from staff whose status is found in branches rows where status matches the outer record. SQL:
SELECT name FROM staff AS empl WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.status = empl.status );
{ "outer_table": "staff", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_16695
train
v2
Schema: transactions (alias: txn)(date, name, salary, level) branches(amount, id, salary, status) Task: Find id from transactions where a matching record exists in branches with the same type. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = txn.type );
{ "outer_table": "transactions", "inner_table": "branches", "outer_alias": "txn", "inner_alias": "brc", "proj_col": "id", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16696
train
v3
Schema: regions (alias: rgn)(salary, status, id, name) branches(status, type, level, salary) Task: Retrieve id from regions with value above the MAX(salary) of branches rows sharing the same id. SQL:
SELECT id FROM regions AS rgn WHERE value > ( SELECT MAX(salary) FROM branches AS brc WHERE brc.id = rgn.id );
{ "outer_table": "regions", "inner_table": "branches", "outer_alias": "rgn", "inner_alias": "brc", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_16697
train
v3
Schema: shipments (alias: shp)(type, amount, level, id) customers(name, type, date, value) Task: Find id from shipments where amount exceeds the average value from customers for the same id. SQL:
SELECT id FROM shipments AS shp WHERE amount > ( SELECT AVG(value) FROM customers AS cust WHERE cust.id = shp.id );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_16698
train
v1
Schema: products (alias: prod)(code, name, value, level) staff(code, value, id, name) Task: Find salary from products where status appears in staff entries with matching status. SQL:
SELECT salary FROM products AS prod WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.status = prod.status );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_16699
train