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: sales (alias: sale)(date, salary, id, level) regions(salary, code, type, id) Task: Retrieve amount from sales that have at least one corresponding entry in regions sharing the same type. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = sale.type );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "amount", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17700
train
v2
Schema: shipments (alias: shp)(amount, date, name, status) sales(level, amount, code, name) Task: Retrieve name from shipments that have at least one corresponding entry in sales sharing the same type. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = shp.type );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "name", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_17701
train
v1
Schema: staff (alias: empl)(code, status, amount, type) schedules(level, type, date, salary) Task: Find amount from staff where code appears in schedules entries with matching type. SQL:
SELECT amount FROM staff AS empl WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.type = empl.type );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_17702
train
v2
Schema: regions (alias: rgn)(amount, value, type, code) branches(status, type, amount, code) Task: Retrieve id from regions that have at least one corresponding entry in branches sharing the same code. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.code = rgn.code );
{ "outer_table": "regions", "inner_table": "branches", "outer_alias": "rgn", "inner_alias": "brc", "proj_col": "id", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_17703
train
v2
Schema: customers (alias: cust)(status, amount, code, type) projects(date, code, level, id) Task: Find name from customers where a matching record exists in projects with the same id. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.id = cust.id );
{ "outer_table": "customers", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "prj", "proj_col": "name", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17704
train
v1
Schema: requests (alias: ordr)(id, salary, code, name) transactions(amount, date, salary, name) Task: Select name from requests where id exists in transactions for the same code. SQL:
SELECT name FROM requests AS ordr WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.code = ordr.code );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_17705
train
v2
Schema: tasks (alias: tsk)(id, name, salary, amount) transactions(type, value, level, status) Task: Retrieve id from tasks that have at least one corresponding entry in transactions sharing the same type. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "transactions", "outer_alias": "tsk", "inner_alias": "txn", "proj_col": "id", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_17706
train
v1
Schema: accounts (alias: acct)(amount, level, name, id) staff(level, date, id, amount) Task: Find name from accounts where type appears in staff entries with matching type. SQL:
SELECT name FROM accounts AS acct WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.type = acct.type );
{ "outer_table": "accounts", "inner_table": "staff", "outer_alias": "acct", "inner_alias": "empl", "proj_col": "name", "filter_col": "type", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17707
train
v1
Schema: schedules (alias: schd)(level, value, id, salary) invoices(level, status, type, name) Task: Retrieve value from schedules whose code is found in invoices rows where type matches the outer record. SQL:
SELECT value FROM schedules AS schd WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.type = schd.type );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17708
train
v3
Schema: departments (alias: dept)(level, id, status, date) managers(name, salary, status, type) Task: Find value from departments where salary exceeds the total amount from managers for the same code. SQL:
SELECT value FROM departments AS dept WHERE salary > ( SELECT SUM(amount) FROM managers AS mgr WHERE mgr.code = dept.code );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17709
train
v1
Schema: staff (alias: empl)(id, status, value, level) items(level, date, type, code) Task: Find amount from staff where level appears in items entries with matching type. SQL:
SELECT amount FROM staff AS empl WHERE level IN ( SELECT level FROM items AS lne WHERE lne.type = empl.type );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "amount", "filter_col": "level", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_17710
train
v3
Schema: sales (alias: sale)(name, level, date, salary) orders(level, value, name, date) Task: Retrieve value from sales with salary above the AVG(salary) of orders rows sharing the same status. SQL:
SELECT value FROM sales AS sale WHERE salary > ( SELECT AVG(salary) FROM orders AS ord WHERE ord.status = sale.status );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17711
train
v1
Schema: staff (alias: empl)(name, id, level, date) invoices(code, id, level, value) Task: Retrieve name from staff whose code is found in invoices rows where code matches the outer record. SQL:
SELECT name FROM staff AS empl WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.code = empl.code );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_17712
train
v1
Schema: accounts (alias: acct)(name, date, amount, id) products(status, code, level, salary) Task: Select name from accounts where type exists in products for the same level. SQL:
SELECT name FROM accounts AS acct WHERE type IN ( SELECT type FROM products AS prod WHERE prod.level = acct.level );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17713
train
v2
Schema: regions (alias: rgn)(name, date, level, amount) tasks(value, status, salary, name) Task: Retrieve name from regions that have at least one corresponding entry in tasks sharing the same type. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.type = rgn.type );
{ "outer_table": "regions", "inner_table": "tasks", "outer_alias": "rgn", "inner_alias": "tsk", "proj_col": "name", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_17714
train
v1
Schema: projects (alias: prj)(amount, id, name, value) orders(level, status, value, date) Task: Select name from projects where type exists in orders for the same code. SQL:
SELECT name FROM projects AS prj WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.code = prj.code );
{ "outer_table": "projects", "inner_table": "orders", "outer_alias": "prj", "inner_alias": "ord", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_17715
train
v2
Schema: invoices (alias: inv)(code, status, value, name) shipments(status, date, id, name) Task: Retrieve amount from invoices that have at least one corresponding entry in shipments sharing the same code. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = inv.code );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "amount", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17716
train
v3
Schema: projects (alias: prj)(id, name, code, salary) invoices(code, status, level, salary) Task: Find name from projects where value exceeds the count of salary from invoices for the same id. SQL:
SELECT name FROM projects AS prj WHERE value > ( SELECT COUNT(salary) FROM invoices AS inv WHERE inv.id = prj.id );
{ "outer_table": "projects", "inner_table": "invoices", "outer_alias": "prj", "inner_alias": "inv", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_17717
train
v2
Schema: products (alias: prod)(name, value, code, type) categories(code, salary, level, date) Task: Find amount from products where a matching record exists in categories with the same code. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = prod.code );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "amount", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17718
train
v1
Schema: customers (alias: cust)(value, date, name, type) requests(type, id, amount, code) Task: Find name from customers where code appears in requests entries with matching code. SQL:
SELECT name FROM customers AS cust WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.code = cust.code );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17719
train
v2
Schema: products (alias: prod)(salary, name, level, date) accounts(id, date, name, salary) Task: Find name from products where a matching record exists in accounts with the same status. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = prod.status );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "name", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17720
train
v1
Schema: products (alias: prod)(type, id, name, date) tasks(value, status, level, id) Task: Find id from products where type appears in tasks entries with matching level. SQL:
SELECT id FROM products AS prod WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.level = prod.level );
{ "outer_table": "products", "inner_table": "tasks", "outer_alias": "prod", "inner_alias": "tsk", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17721
train
v3
Schema: regions (alias: rgn)(type, level, id, status) customers(type, status, name, code) Task: Find id from regions where value exceeds the total amount from customers for the same type. SQL:
SELECT id FROM regions AS rgn WHERE value > ( SELECT SUM(amount) FROM customers AS cust WHERE cust.type = rgn.type );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_17722
train
v2
Schema: orders (alias: ord)(status, id, level, type) sales(name, amount, code, id) Task: Retrieve value from orders that have at least one corresponding entry in sales sharing the same code. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = ord.code );
{ "outer_table": "orders", "inner_table": "sales", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "value", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17723
train
v2
Schema: branches (alias: brc)(amount, date, status, id) products(salary, level, type, amount) Task: Retrieve value from branches that have at least one corresponding entry in products sharing the same id. SQL:
SELECT value FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = brc.id );
{ "outer_table": "branches", "inner_table": "products", "outer_alias": "brc", "inner_alias": "prod", "proj_col": "value", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_17724
train
v1
Schema: invoices (alias: inv)(date, status, value, code) orders(id, amount, status, code) Task: Retrieve value from invoices whose status is found in orders rows where status matches the outer record. SQL:
SELECT value FROM invoices AS inv WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.status = inv.status );
{ "outer_table": "invoices", "inner_table": "orders", "outer_alias": "inv", "inner_alias": "ord", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17725
train
v3
Schema: categories (alias: catg)(salary, code, amount, level) schedules(value, type, name, salary) Task: Retrieve code from categories with amount above the SUM(value) of schedules rows sharing the same code. SQL:
SELECT code FROM categories AS catg WHERE amount > ( SELECT SUM(value) FROM schedules AS schd WHERE schd.code = catg.code );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17726
train
v2
Schema: schedules (alias: schd)(level, code, name, type) tasks(status, level, date, code) Task: Retrieve code from schedules that have at least one corresponding entry in tasks sharing the same type. SQL:
SELECT code FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.type = schd.type );
{ "outer_table": "schedules", "inner_table": "tasks", "outer_alias": "schd", "inner_alias": "tsk", "proj_col": "code", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17727
train
v3
Schema: shipments (alias: shp)(type, level, date, id) orders(value, code, level, type) Task: Retrieve value from shipments with amount above the SUM(value) of orders rows sharing the same status. SQL:
SELECT value FROM shipments AS shp WHERE amount > ( SELECT SUM(value) FROM orders AS ord WHERE ord.status = shp.status );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_17728
train
v2
Schema: managers (alias: mgr)(level, amount, code, name) tasks(name, salary, level, status) Task: Find id from managers where a matching record exists in tasks with the same code. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.code = mgr.code );
{ "outer_table": "managers", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "tsk", "proj_col": "id", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17729
train
v1
Schema: tasks (alias: tsk)(amount, date, id, name) items(name, code, date, salary) Task: Select value from tasks where id exists in items for the same status. SQL:
SELECT value FROM tasks AS tsk WHERE id IN ( SELECT id FROM items AS lne WHERE lne.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "items", "outer_alias": "tsk", "inner_alias": "lne", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_17730
train
v2
Schema: transactions (alias: txn)(code, amount, name, type) requests(name, level, salary, amount) Task: Retrieve value from transactions that have at least one corresponding entry in requests sharing the same level. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = txn.level );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "value", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17731
train
v1
Schema: products (alias: prod)(date, id, status, level) tasks(type, value, level, name) Task: Select amount from products where type exists in tasks for the same id. SQL:
SELECT amount FROM products AS prod WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.id = prod.id );
{ "outer_table": "products", "inner_table": "tasks", "outer_alias": "prod", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17732
train
v3
Schema: orders (alias: ord)(id, name, level, date) requests(type, name, code, status) Task: Retrieve salary from orders with amount above the AVG(salary) of requests rows sharing the same status. SQL:
SELECT salary FROM orders AS ord WHERE amount > ( SELECT AVG(salary) FROM requests AS ordr WHERE ordr.status = ord.status );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17733
train
v3
Schema: departments (alias: dept)(amount, code, salary, level) orders(value, amount, salary, type) Task: Find amount from departments where value exceeds the minimum amount from orders for the same status. SQL:
SELECT amount FROM departments AS dept WHERE value > ( SELECT MIN(amount) FROM orders AS ord WHERE ord.status = dept.status );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17734
train
v2
Schema: customers (alias: cust)(type, code, date, value) shipments(value, id, code, salary) Task: Retrieve id from customers that have at least one corresponding entry in shipments sharing the same level. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = cust.level );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "id", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17735
train
v2
Schema: requests (alias: ordr)(name, level, date, salary) schedules(type, level, value, status) Task: Find amount from requests where a matching record exists in schedules with the same type. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = ordr.type );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "amount", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_17736
train
v2
Schema: branches (alias: brc)(value, status, name, date) managers(level, id, code, salary) Task: Find code from branches where a matching record exists in managers with the same id. SQL:
SELECT code FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = brc.id );
{ "outer_table": "branches", "inner_table": "managers", "outer_alias": "brc", "inner_alias": "mgr", "proj_col": "code", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_17737
train
v1
Schema: departments (alias: dept)(name, id, value, type) projects(value, salary, code, level) Task: Find code from departments where type appears in projects entries with matching type. SQL:
SELECT code 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": "code", "filter_col": "type", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17738
train
v1
Schema: customers (alias: cust)(id, value, amount, level) regions(id, name, date, status) Task: Retrieve amount from customers whose level is found in regions rows where status matches the outer record. SQL:
SELECT amount FROM customers AS cust WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.status = cust.status );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17739
train
v2
Schema: tasks (alias: tsk)(salary, value, code, date) customers(salary, amount, type, code) Task: Find name from tasks where a matching record exists in customers with the same status. SQL:
SELECT name FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "customers", "outer_alias": "tsk", "inner_alias": "cust", "proj_col": "name", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_17740
train
v2
Schema: regions (alias: rgn)(code, name, amount, level) orders(salary, code, level, value) Task: Retrieve id from regions that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = rgn.code );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "id", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_17741
train
v2
Schema: employees (alias: emp)(status, code, name, amount) categories(code, amount, name, status) Task: Retrieve amount from employees that have at least one corresponding entry in categories sharing the same id. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = emp.id );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "amount", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17742
train
v2
Schema: regions (alias: rgn)(name, code, level, amount) schedules(value, type, status, amount) Task: Retrieve salary from regions that have at least one corresponding entry in schedules sharing the same type. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = rgn.type );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "salary", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_17743
train
v2
Schema: categories (alias: catg)(amount, value, code, id) transactions(type, level, code, salary) Task: Retrieve salary from categories that have at least one corresponding entry in transactions sharing the same status. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = catg.status );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "salary", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17744
train
v2
Schema: projects (alias: prj)(code, value, salary, date) tasks(salary, id, date, amount) Task: Find code from projects where a matching record exists in tasks with the same level. SQL:
SELECT code FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.level = prj.level );
{ "outer_table": "projects", "inner_table": "tasks", "outer_alias": "prj", "inner_alias": "tsk", "proj_col": "code", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_17745
train
v1
Schema: managers (alias: mgr)(id, amount, value, level) products(type, name, date, status) Task: Select salary from managers where type exists in products for the same type. SQL:
SELECT salary FROM managers AS mgr WHERE type IN ( SELECT type FROM products AS prod WHERE prod.type = mgr.type );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17746
train
v3
Schema: categories (alias: catg)(level, date, amount, salary) accounts(salary, date, id, type) Task: Find id from categories where value exceeds the minimum salary from accounts for the same type. SQL:
SELECT id FROM categories AS catg WHERE value > ( SELECT MIN(salary) FROM accounts AS acct WHERE acct.type = catg.type );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17747
train
v2
Schema: orders (alias: ord)(date, value, code, level) projects(date, type, code, value) Task: Find code from orders where a matching record exists in projects with the same level. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.level = ord.level );
{ "outer_table": "orders", "inner_table": "projects", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "code", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17748
train
v1
Schema: branches (alias: brc)(status, id, type, level) items(date, level, id, name) Task: Find code from branches where type appears in items entries with matching level. SQL:
SELECT code FROM branches AS brc WHERE type IN ( SELECT type FROM items AS lne WHERE lne.level = brc.level );
{ "outer_table": "branches", "inner_table": "items", "outer_alias": "brc", "inner_alias": "lne", "proj_col": "code", "filter_col": "type", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_17749
train
v3
Schema: regions (alias: rgn)(type, date, name, salary) managers(date, type, status, salary) Task: Find name from regions where value exceeds the maximum amount from managers for the same type. SQL:
SELECT name FROM regions AS rgn WHERE value > ( SELECT MAX(amount) FROM managers AS mgr WHERE mgr.type = rgn.type );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_17750
train
v2
Schema: tasks (alias: tsk)(status, code, id, salary) schedules(value, amount, level, status) Task: Find value from tasks where a matching record exists in schedules with the same level. SQL:
SELECT value FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "schedules", "outer_alias": "tsk", "inner_alias": "schd", "proj_col": "value", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_17751
train
v3
Schema: transactions (alias: txn)(level, code, type, value) invoices(status, salary, date, value) Task: Retrieve name from transactions with value above the MIN(salary) of invoices rows sharing the same id. SQL:
SELECT name FROM transactions AS txn WHERE value > ( SELECT MIN(salary) FROM invoices AS inv WHERE inv.id = txn.id );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17752
train
v2
Schema: orders (alias: ord)(name, value, code, level) managers(type, salary, status, value) Task: Find value from orders where a matching record exists in managers with the same type. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = ord.type );
{ "outer_table": "orders", "inner_table": "managers", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "value", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17753
train
v2
Schema: items (alias: lne)(level, date, value, amount) customers(status, level, amount, date) Task: Find id from items where a matching record exists in customers with the same level. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = lne.level );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "id", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_17754
train
v2
Schema: tasks (alias: tsk)(salary, status, code, name) products(name, amount, type, salary) Task: Retrieve name from tasks that have at least one corresponding entry in products sharing the same id. SQL:
SELECT name FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "products", "outer_alias": "tsk", "inner_alias": "prod", "proj_col": "name", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_17755
train
v3
Schema: branches (alias: brc)(amount, status, salary, id) shipments(status, date, value, salary) Task: Find salary from branches where amount exceeds the total salary from shipments for the same level. SQL:
SELECT salary FROM branches AS brc WHERE amount > ( SELECT SUM(salary) FROM shipments AS shp WHERE shp.level = brc.level );
{ "outer_table": "branches", "inner_table": "shipments", "outer_alias": "brc", "inner_alias": "shp", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_17756
train
v3
Schema: orders (alias: ord)(status, level, code, type) managers(name, type, level, value) Task: Retrieve salary from orders with amount above the SUM(salary) of managers rows sharing the same level. SQL:
SELECT salary FROM orders AS ord WHERE amount > ( SELECT SUM(salary) FROM managers AS mgr WHERE mgr.level = ord.level );
{ "outer_table": "orders", "inner_table": "managers", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17757
train
v3
Schema: transactions (alias: txn)(id, status, salary, type) employees(salary, amount, name, level) Task: Find code from transactions where amount exceeds the average salary from employees for the same status. SQL:
SELECT code FROM transactions AS txn WHERE amount > ( SELECT AVG(salary) FROM employees AS emp WHERE emp.status = txn.status );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17758
train
v2
Schema: branches (alias: brc)(code, name, value, status) regions(status, id, salary, value) Task: Retrieve code from branches that have at least one corresponding entry in regions sharing the same id. SQL:
SELECT code FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = brc.id );
{ "outer_table": "branches", "inner_table": "regions", "outer_alias": "brc", "inner_alias": "rgn", "proj_col": "code", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_17759
train
v1
Schema: products (alias: prod)(code, level, id, amount) employees(name, status, date, level) Task: Select name from products where level exists in employees for the same status. SQL:
SELECT name FROM products AS prod WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.status = prod.status );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17760
train
v2
Schema: accounts (alias: acct)(amount, value, code, name) projects(name, value, level, status) Task: Retrieve code from accounts that have at least one corresponding entry in projects sharing the same level. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.level = acct.level );
{ "outer_table": "accounts", "inner_table": "projects", "outer_alias": "acct", "inner_alias": "prj", "proj_col": "code", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17761
train
v3
Schema: sales (alias: sale)(name, code, level, salary) branches(status, date, type, amount) Task: Retrieve code from sales with value above the SUM(salary) of branches rows sharing the same level. SQL:
SELECT code FROM sales AS sale WHERE value > ( SELECT SUM(salary) FROM branches AS brc WHERE brc.level = sale.level );
{ "outer_table": "sales", "inner_table": "branches", "outer_alias": "sale", "inner_alias": "brc", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17762
train
v1
Schema: items (alias: lne)(date, type, id, name) tasks(value, type, amount, code) Task: Retrieve code from items whose level is found in tasks rows where status matches the outer record. SQL:
SELECT code FROM items AS lne WHERE level IN ( SELECT level FROM tasks AS tsk WHERE tsk.status = lne.status );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_17763
train
v1
Schema: managers (alias: mgr)(date, type, status, level) accounts(date, level, name, code) Task: Select value from managers where code exists in accounts for the same status. SQL:
SELECT value FROM managers AS mgr WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.status = mgr.status );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17764
train
v1
Schema: branches (alias: brc)(code, name, type, date) employees(date, code, name, amount) Task: Select code from branches where type exists in employees for the same id. SQL:
SELECT code FROM branches AS brc WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.id = brc.id );
{ "outer_table": "branches", "inner_table": "employees", "outer_alias": "brc", "inner_alias": "emp", "proj_col": "code", "filter_col": "type", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_17765
train
v1
Schema: transactions (alias: txn)(id, value, amount, type) branches(code, date, amount, salary) Task: Retrieve id from transactions whose type is found in branches rows where level matches the outer record. SQL:
SELECT id FROM transactions AS txn WHERE type IN ( SELECT type FROM branches AS brc WHERE brc.level = txn.level );
{ "outer_table": "transactions", "inner_table": "branches", "outer_alias": "txn", "inner_alias": "brc", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17766
train
v2
Schema: branches (alias: brc)(status, name, level, code) employees(id, amount, code, name) Task: Retrieve value from branches that have at least one corresponding entry in employees sharing the same level. SQL:
SELECT value FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = brc.level );
{ "outer_table": "branches", "inner_table": "employees", "outer_alias": "brc", "inner_alias": "emp", "proj_col": "value", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_17767
train
v3
Schema: invoices (alias: inv)(status, name, code, id) tasks(name, salary, id, status) Task: Find salary from invoices where amount exceeds the total salary from tasks for the same type. SQL:
SELECT salary FROM invoices AS inv WHERE amount > ( SELECT SUM(salary) FROM tasks AS tsk WHERE tsk.type = inv.type );
{ "outer_table": "invoices", "inner_table": "tasks", "outer_alias": "inv", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17768
train
v2
Schema: branches (alias: brc)(date, id, name, salary) departments(salary, type, value, level) Task: Find value from branches where a matching record exists in departments with the same code. SQL:
SELECT value FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = brc.code );
{ "outer_table": "branches", "inner_table": "departments", "outer_alias": "brc", "inner_alias": "dept", "proj_col": "value", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_17769
train
v3
Schema: items (alias: lne)(name, value, amount, code) categories(level, value, date, code) Task: Retrieve salary from items with amount above the MIN(salary) of categories rows sharing the same code. SQL:
SELECT salary FROM items AS lne WHERE amount > ( SELECT MIN(salary) FROM categories AS catg WHERE catg.code = lne.code );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_17770
train
v1
Schema: items (alias: lne)(salary, id, date, status) projects(level, amount, name, date) Task: Find id from items where type appears in projects entries with matching level. SQL:
SELECT id FROM items AS lne WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.level = lne.level );
{ "outer_table": "items", "inner_table": "projects", "outer_alias": "lne", "inner_alias": "prj", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_17771
train
v2
Schema: sales (alias: sale)(status, amount, name, date) items(name, value, date, code) Task: Retrieve salary from sales that have at least one corresponding entry in items sharing the same id. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.id = sale.id );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "salary", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17772
train
v3
Schema: regions (alias: rgn)(id, amount, salary, status) shipments(type, id, code, status) Task: Retrieve value from regions with amount above the SUM(value) of shipments rows sharing the same status. SQL:
SELECT value FROM regions AS rgn WHERE amount > ( SELECT SUM(value) FROM shipments AS shp WHERE shp.status = rgn.status );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_17773
train
v2
Schema: regions (alias: rgn)(date, code, id, name) schedules(amount, type, value, status) Task: Retrieve name from regions that have at least one corresponding entry in schedules sharing the same level. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = rgn.level );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "name", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_17774
train
v2
Schema: products (alias: prod)(code, amount, name, value) employees(type, status, salary, id) Task: Find salary from products where a matching record exists in employees with the same id. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = prod.id );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "salary", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17775
train
v3
Schema: categories (alias: catg)(code, salary, amount, status) managers(date, status, code, salary) Task: Retrieve name from categories with value above the SUM(amount) of managers rows sharing the same code. SQL:
SELECT name FROM categories AS catg WHERE value > ( SELECT SUM(amount) FROM managers AS mgr WHERE mgr.code = catg.code );
{ "outer_table": "categories", "inner_table": "managers", "outer_alias": "catg", "inner_alias": "mgr", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17776
train
v3
Schema: categories (alias: catg)(code, date, type, value) shipments(salary, code, id, date) Task: Retrieve salary from categories with value above the MAX(amount) of shipments rows sharing the same id. SQL:
SELECT salary FROM categories AS catg WHERE value > ( SELECT MAX(amount) FROM shipments AS shp WHERE shp.id = catg.id );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "catg", "inner_alias": "shp", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17777
train
v3
Schema: projects (alias: prj)(name, status, type, code) schedules(name, amount, id, salary) Task: Retrieve name from projects with value above the AVG(value) of schedules rows sharing the same code. SQL:
SELECT name FROM projects AS prj WHERE value > ( SELECT AVG(value) FROM schedules AS schd WHERE schd.code = prj.code );
{ "outer_table": "projects", "inner_table": "schedules", "outer_alias": "prj", "inner_alias": "schd", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_17778
train
v1
Schema: shipments (alias: shp)(name, value, salary, amount) requests(status, value, amount, code) Task: Find amount from shipments where level appears in requests entries with matching type. SQL:
SELECT amount FROM shipments AS shp WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.type = shp.type );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "level", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_17779
train
v2
Schema: accounts (alias: acct)(amount, date, level, type) branches(amount, type, salary, id) Task: Retrieve name from accounts that have at least one corresponding entry in branches sharing the same status. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.status = acct.status );
{ "outer_table": "accounts", "inner_table": "branches", "outer_alias": "acct", "inner_alias": "brc", "proj_col": "name", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17780
train
v2
Schema: invoices (alias: inv)(status, value, id, code) employees(salary, level, type, name) Task: Retrieve value from invoices that have at least one corresponding entry in employees sharing the same type. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = inv.type );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "value", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17781
train
v3
Schema: products (alias: prod)(level, date, value, salary) regions(status, level, id, date) Task: Find value from products where value exceeds the count of value from regions for the same type. SQL:
SELECT value FROM products AS prod WHERE value > ( SELECT COUNT(value) FROM regions AS rgn WHERE rgn.type = prod.type );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17782
train
v1
Schema: categories (alias: catg)(value, name, date, status) branches(salary, name, date, level) Task: Retrieve name from categories whose id is found in branches rows where status matches the outer record. SQL:
SELECT name FROM categories AS catg WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.status = catg.status );
{ "outer_table": "categories", "inner_table": "branches", "outer_alias": "catg", "inner_alias": "brc", "proj_col": "name", "filter_col": "id", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17783
train
v3
Schema: transactions (alias: txn)(level, date, value, id) orders(amount, code, type, level) Task: Retrieve salary from transactions with salary above the SUM(amount) of orders rows sharing the same code. SQL:
SELECT salary FROM transactions AS txn WHERE salary > ( SELECT SUM(amount) FROM orders AS ord WHERE ord.code = txn.code );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17784
train
v3
Schema: branches (alias: brc)(status, id, level, value) customers(type, level, name, amount) Task: Find id from branches where amount exceeds the total salary from customers for the same type. SQL:
SELECT id FROM branches AS brc WHERE amount > ( SELECT SUM(salary) FROM customers AS cust WHERE cust.type = brc.type );
{ "outer_table": "branches", "inner_table": "customers", "outer_alias": "brc", "inner_alias": "cust", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_17785
train
v2
Schema: managers (alias: mgr)(value, amount, level, code) categories(type, name, amount, status) Task: Retrieve amount from managers that have at least one corresponding entry in categories sharing the same level. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = mgr.level );
{ "outer_table": "managers", "inner_table": "categories", "outer_alias": "mgr", "inner_alias": "catg", "proj_col": "amount", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17786
train
v1
Schema: shipments (alias: shp)(name, id, salary, level) transactions(type, name, value, amount) Task: Retrieve amount from shipments whose level is found in transactions rows where type matches the outer record. SQL:
SELECT amount FROM shipments AS shp WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.type = shp.type );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "amount", "filter_col": "level", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_17787
train
v1
Schema: transactions (alias: txn)(date, value, name, code) branches(code, type, value, salary) Task: Select value from transactions where code exists in branches for the same code. SQL:
SELECT value FROM transactions AS txn WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.code = txn.code );
{ "outer_table": "transactions", "inner_table": "branches", "outer_alias": "txn", "inner_alias": "brc", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17788
train
v1
Schema: products (alias: prod)(name, status, salary, id) projects(id, type, salary, level) Task: Retrieve value from products whose level is found in projects rows where status matches the outer record. SQL:
SELECT value FROM products AS prod WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.status = prod.status );
{ "outer_table": "products", "inner_table": "projects", "outer_alias": "prod", "inner_alias": "prj", "proj_col": "value", "filter_col": "level", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17789
train
v1
Schema: categories (alias: catg)(amount, value, level, name) items(type, amount, value, date) Task: Retrieve name from categories whose code is found in items rows where status matches the outer record. SQL:
SELECT name FROM categories AS catg WHERE code IN ( SELECT code FROM items AS lne WHERE lne.status = catg.status );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17790
train
v1
Schema: requests (alias: ordr)(status, id, name, amount) customers(type, status, value, salary) Task: Retrieve value from requests whose code is found in customers rows where code matches the outer record. SQL:
SELECT value FROM requests AS ordr WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.code = ordr.code );
{ "outer_table": "requests", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_17791
train
v3
Schema: tasks (alias: tsk)(code, name, level, status) projects(name, salary, type, status) Task: Retrieve value from tasks with salary above the COUNT(value) of projects rows sharing the same status. SQL:
SELECT value FROM tasks AS tsk WHERE salary > ( SELECT COUNT(value) FROM projects AS prj WHERE prj.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "projects", "outer_alias": "tsk", "inner_alias": "prj", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_17792
train
v2
Schema: customers (alias: cust)(id, name, code, value) staff(type, level, value, id) Task: Find code from customers where a matching record exists in staff with the same code. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = cust.code );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17793
train
v2
Schema: staff (alias: empl)(value, amount, date, code) employees(id, value, date, code) Task: Find name from staff where a matching record exists in employees with the same id. SQL:
SELECT name FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = empl.id );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "name", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_17794
train
v2
Schema: invoices (alias: inv)(name, code, id, level) staff(code, date, name, salary) Task: Find name from invoices where a matching record exists in staff with the same code. SQL:
SELECT name FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = inv.code );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "name", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17795
train
v3
Schema: staff (alias: empl)(code, amount, name, salary) managers(salary, date, code, level) Task: Find salary from staff where salary exceeds the average amount from managers for the same status. SQL:
SELECT salary FROM staff AS empl WHERE salary > ( SELECT AVG(amount) FROM managers AS mgr WHERE mgr.status = empl.status );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_17796
train
v1
Schema: items (alias: lne)(code, level, date, salary) tasks(name, value, id, salary) Task: Select salary from items where level exists in tasks for the same level. SQL:
SELECT salary FROM items AS lne WHERE level IN ( SELECT level FROM tasks AS tsk WHERE tsk.level = lne.level );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "level", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_17797
train
v1
Schema: categories (alias: catg)(date, status, value, code) customers(type, level, salary, id) Task: Select id from categories where level exists in customers for the same status. SQL:
SELECT id FROM categories AS catg WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.status = catg.status );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_17798
train
v1
Schema: managers (alias: mgr)(level, id, type, status) departments(type, status, level, code) Task: Retrieve salary from managers whose id is found in departments rows where level matches the outer record. SQL:
SELECT salary FROM managers AS mgr WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.level = mgr.level );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "salary", "filter_col": "id", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_17799
train