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: items (alias: lne)(type, code, id, value) invoices(date, level, code, id) Task: Retrieve id from items that have at least one corresponding entry in invoices sharing the same code. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = lne.code );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "id", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_19100
train
v2
Schema: projects (alias: prj)(amount, salary, status, value) sales(salary, name, level, code) Task: Retrieve value from projects that have at least one corresponding entry in sales sharing the same id. SQL:
SELECT value FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = prj.id );
{ "outer_table": "projects", "inner_table": "sales", "outer_alias": "prj", "inner_alias": "sale", "proj_col": "value", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_19101
train
v3
Schema: accounts (alias: acct)(salary, value, date, level) requests(id, date, status, type) Task: Find id from accounts where amount exceeds the total salary from requests for the same id. SQL:
SELECT id FROM accounts AS acct WHERE amount > ( SELECT SUM(salary) FROM requests AS ordr WHERE ordr.id = acct.id );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19102
train
v2
Schema: schedules (alias: schd)(type, date, level, name) items(amount, date, code, status) Task: Find id from schedules where a matching record exists in items with the same status. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = schd.status );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "id", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_19103
train
v1
Schema: shipments (alias: shp)(salary, status, date, code) managers(date, amount, type, salary) Task: Find code from shipments where id appears in managers entries with matching id. SQL:
SELECT code FROM shipments AS shp WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.id = shp.id );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "code", "filter_col": "id", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_19104
train
v2
Schema: accounts (alias: acct)(status, salary, date, name) departments(type, status, level, id) Task: Retrieve name from accounts that have at least one corresponding entry in departments sharing the same id. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = acct.id );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "name", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19105
train
v3
Schema: orders (alias: ord)(level, type, value, status) customers(name, value, type, amount) Task: Find value from orders where value exceeds the count of amount from customers for the same code. SQL:
SELECT value FROM orders AS ord WHERE value > ( SELECT COUNT(amount) FROM customers AS cust WHERE cust.code = ord.code );
{ "outer_table": "orders", "inner_table": "customers", "outer_alias": "ord", "inner_alias": "cust", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19106
train
v1
Schema: sales (alias: sale)(amount, value, name, id) customers(amount, value, id, code) Task: Select name from sales where level exists in customers for the same status. SQL:
SELECT name FROM sales AS sale WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.status = sale.status );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19107
train
v3
Schema: orders (alias: ord)(status, code, amount, value) shipments(salary, date, level, type) Task: Find code from orders where salary exceeds the total value from shipments for the same level. SQL:
SELECT code FROM orders AS ord WHERE salary > ( SELECT SUM(value) FROM shipments AS shp WHERE shp.level = ord.level );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19108
train
v2
Schema: staff (alias: empl)(id, date, type, level) requests(name, date, id, amount) Task: Find id from staff where a matching record exists in requests with the same code. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = empl.code );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "id", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_19109
train
v2
Schema: items (alias: lne)(status, code, name, value) products(code, salary, level, status) Task: Find name from items where a matching record exists in products with the same level. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = lne.level );
{ "outer_table": "items", "inner_table": "products", "outer_alias": "lne", "inner_alias": "prod", "proj_col": "name", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_19110
train
v1
Schema: categories (alias: catg)(value, salary, id, amount) transactions(name, type, id, date) Task: Retrieve name from categories whose status is found in transactions rows where id matches the outer record. SQL:
SELECT name FROM categories AS catg WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.id = catg.id );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_19111
train
v1
Schema: departments (alias: dept)(name, type, level, amount) orders(level, amount, id, salary) Task: Retrieve amount from departments whose level is found in orders rows where code matches the outer record. SQL:
SELECT amount FROM departments AS dept WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.code = dept.code );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19112
train
v3
Schema: tasks (alias: tsk)(value, name, date, id) departments(name, id, amount, type) Task: Retrieve code from tasks with salary above the COUNT(value) of departments rows sharing the same id. SQL:
SELECT code FROM tasks AS tsk WHERE salary > ( SELECT COUNT(value) FROM departments AS dept WHERE dept.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "departments", "outer_alias": "tsk", "inner_alias": "dept", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_19113
train
v2
Schema: shipments (alias: shp)(status, id, value, amount) transactions(type, salary, amount, level) Task: Find value from shipments where a matching record exists in transactions with the same code. SQL:
SELECT value FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = shp.code );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "value", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_19114
train
v1
Schema: departments (alias: dept)(value, amount, salary, level) transactions(level, salary, status, name) Task: Find code from departments where status appears in transactions entries with matching id. SQL:
SELECT code FROM departments AS dept WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.id = dept.id );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19115
train
v1
Schema: transactions (alias: txn)(code, status, value, salary) requests(date, level, status, amount) Task: Retrieve salary from transactions whose id is found in requests rows where level matches the outer record. SQL:
SELECT salary FROM transactions AS txn WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.level = txn.level );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "id", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19116
train
v1
Schema: sales (alias: sale)(name, salary, status, date) projects(level, code, amount, value) Task: Find id from sales where id appears in projects entries with matching type. SQL:
SELECT id FROM sales AS sale WHERE id IN ( SELECT id FROM projects AS prj WHERE prj.type = sale.type );
{ "outer_table": "sales", "inner_table": "projects", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19117
train
v3
Schema: items (alias: lne)(code, name, id, date) products(date, salary, name, level) Task: Retrieve code from items with value above the AVG(salary) of products rows sharing the same level. SQL:
SELECT code FROM items AS lne WHERE value > ( SELECT AVG(salary) FROM products AS prod WHERE prod.level = lne.level );
{ "outer_table": "items", "inner_table": "products", "outer_alias": "lne", "inner_alias": "prod", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_19118
train
v3
Schema: tasks (alias: tsk)(amount, salary, id, level) employees(value, name, date, salary) Task: Retrieve id from tasks with amount above the SUM(value) of employees rows sharing the same status. SQL:
SELECT id FROM tasks AS tsk WHERE amount > ( SELECT SUM(value) FROM employees AS emp WHERE emp.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "employees", "outer_alias": "tsk", "inner_alias": "emp", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_19119
train
v1
Schema: invoices (alias: inv)(status, value, id, salary) regions(level, salary, amount, type) Task: Retrieve value from invoices whose code is found in regions rows where code matches the outer record. SQL:
SELECT value FROM invoices AS inv WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.code = inv.code );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19120
train
v3
Schema: departments (alias: dept)(salary, level, code, id) schedules(level, code, name, id) Task: Retrieve amount from departments with salary above the MAX(amount) of schedules rows sharing the same id. SQL:
SELECT amount FROM departments AS dept WHERE salary > ( SELECT MAX(amount) FROM schedules AS schd WHERE schd.id = dept.id );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19121
train
v3
Schema: invoices (alias: inv)(amount, id, type, date) orders(date, amount, status, type) Task: Retrieve code from invoices with salary above the MAX(salary) of orders rows sharing the same status. SQL:
SELECT code FROM invoices AS inv WHERE salary > ( SELECT MAX(salary) FROM orders AS ord WHERE ord.status = inv.status );
{ "outer_table": "invoices", "inner_table": "orders", "outer_alias": "inv", "inner_alias": "ord", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19122
train
v1
Schema: branches (alias: brc)(code, level, salary, date) shipments(amount, id, date, name) Task: Retrieve salary from branches whose status is found in shipments rows where code matches the outer record. SQL:
SELECT salary FROM branches AS brc WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.code = brc.code );
{ "outer_table": "branches", "inner_table": "shipments", "outer_alias": "brc", "inner_alias": "shp", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_19123
train
v2
Schema: departments (alias: dept)(salary, name, type, value) sales(amount, value, status, salary) Task: Find id from departments where a matching record exists in sales with the same status. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = dept.status );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "id", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19124
train
v1
Schema: shipments (alias: shp)(value, level, salary, code) invoices(type, id, name, amount) Task: Find id from shipments where id appears in invoices entries with matching type. SQL:
SELECT id FROM shipments AS shp WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.type = shp.type );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_19125
train
v1
Schema: sales (alias: sale)(value, date, amount, code) items(date, salary, code, value) Task: Select amount from sales where status exists in items for the same id. SQL:
SELECT amount FROM sales AS sale WHERE status IN ( SELECT status FROM items AS lne WHERE lne.id = sale.id );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19126
train
v3
Schema: regions (alias: rgn)(salary, level, amount, name) orders(level, salary, amount, code) Task: Find salary from regions where value exceeds the maximum salary from orders for the same level. SQL:
SELECT salary FROM regions AS rgn WHERE value > ( SELECT MAX(salary) FROM orders AS ord WHERE ord.level = rgn.level );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_19127
train
v3
Schema: staff (alias: empl)(date, amount, status, value) customers(level, value, type, status) Task: Retrieve value from staff with salary above the SUM(amount) of customers rows sharing the same code. SQL:
SELECT value FROM staff AS empl WHERE salary > ( SELECT SUM(amount) FROM customers AS cust WHERE cust.code = empl.code );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_19128
train
v2
Schema: products (alias: prod)(level, salary, status, type) regions(value, salary, amount, status) Task: Find amount from products where a matching record exists in regions with the same status. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = prod.status );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "amount", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19129
train
v2
Schema: accounts (alias: acct)(level, date, name, code) shipments(date, amount, name, status) Task: Retrieve id from accounts that have at least one corresponding entry in shipments sharing the same type. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = acct.type );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "id", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19130
train
v1
Schema: schedules (alias: schd)(level, value, name, status) employees(level, type, salary, amount) Task: Select code from schedules where id exists in employees for the same type. SQL:
SELECT code FROM schedules AS schd WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.type = schd.type );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "code", "filter_col": "id", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_19131
train
v3
Schema: products (alias: prod)(status, type, code, id) employees(status, amount, salary, level) Task: Retrieve amount from products with salary above the MIN(value) of employees rows sharing the same status. SQL:
SELECT amount FROM products AS prod WHERE salary > ( SELECT MIN(value) FROM employees AS emp WHERE emp.status = prod.status );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19132
train
v2
Schema: transactions (alias: txn)(id, amount, type, status) customers(level, amount, value, type) Task: Retrieve name from transactions that have at least one corresponding entry in customers sharing the same id. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = txn.id );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "name", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19133
train
v1
Schema: sales (alias: sale)(id, status, salary, date) branches(date, level, salary, status) Task: Retrieve salary from sales whose status is found in branches rows where id matches the outer record. SQL:
SELECT salary FROM sales AS sale WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.id = sale.id );
{ "outer_table": "sales", "inner_table": "branches", "outer_alias": "sale", "inner_alias": "brc", "proj_col": "salary", "filter_col": "status", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19134
train
v1
Schema: departments (alias: dept)(id, name, salary, value) items(level, status, name, value) Task: Find salary from departments where type appears in items entries with matching id. SQL:
SELECT salary FROM departments AS dept WHERE type IN ( SELECT type FROM items AS lne WHERE lne.id = dept.id );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "salary", "filter_col": "type", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19135
train
v1
Schema: regions (alias: rgn)(name, code, value, status) accounts(amount, status, id, salary) Task: Retrieve code from regions whose id is found in accounts rows where code matches the outer record. SQL:
SELECT code FROM regions AS rgn WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.code = rgn.code );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "rgn", "inner_alias": "acct", "proj_col": "code", "filter_col": "id", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_19136
train
v2
Schema: regions (alias: rgn)(level, type, name, id) sales(level, date, value, type) Task: Find code from regions where a matching record exists in sales with the same level. SQL:
SELECT code FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = rgn.level );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "code", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_19137
train
v2
Schema: products (alias: prod)(id, code, date, name) shipments(name, status, code, amount) Task: Find value from products where a matching record exists in shipments with the same status. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = prod.status );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "value", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19138
train
v2
Schema: regions (alias: rgn)(type, date, salary, amount) transactions(level, salary, name, date) Task: Find id from regions where a matching record exists in transactions with the same level. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = rgn.level );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "id", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_19139
train
v2
Schema: staff (alias: empl)(status, code, amount, salary) shipments(status, name, date, level) Task: Retrieve amount from staff that have at least one corresponding entry in shipments sharing the same level. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = empl.level );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "amount", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_19140
train
v2
Schema: sales (alias: sale)(status, code, date, type) shipments(amount, type, level, code) Task: Retrieve id from sales that have at least one corresponding entry in shipments sharing the same type. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = sale.type );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "id", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19141
train
v3
Schema: regions (alias: rgn)(id, type, code, amount) requests(date, value, level, salary) Task: Retrieve value from regions with amount above the COUNT(value) of requests rows sharing the same type. SQL:
SELECT value FROM regions AS rgn WHERE amount > ( SELECT COUNT(value) FROM requests AS ordr WHERE ordr.type = rgn.type );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_19142
train
v2
Schema: managers (alias: mgr)(value, level, type, code) schedules(name, id, value, status) Task: Retrieve id from managers that have at least one corresponding entry in schedules sharing the same level. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = mgr.level );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "id", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19143
train
v3
Schema: departments (alias: dept)(level, name, code, status) tasks(date, code, salary, id) Task: Find id from departments where value exceeds the average amount from tasks for the same code. SQL:
SELECT id FROM departments AS dept WHERE value > ( SELECT AVG(amount) FROM tasks AS tsk WHERE tsk.code = dept.code );
{ "outer_table": "departments", "inner_table": "tasks", "outer_alias": "dept", "inner_alias": "tsk", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19144
train
v3
Schema: transactions (alias: txn)(id, status, code, type) regions(level, code, type, name) Task: Find value from transactions where salary exceeds the average salary from regions for the same status. SQL:
SELECT value FROM transactions AS txn WHERE salary > ( SELECT AVG(salary) FROM regions AS rgn WHERE rgn.status = txn.status );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19145
train
v3
Schema: sales (alias: sale)(id, amount, status, type) products(id, type, name, date) Task: Find salary from sales where salary exceeds the minimum value from products for the same level. SQL:
SELECT salary FROM sales AS sale WHERE salary > ( SELECT MIN(value) FROM products AS prod WHERE prod.level = sale.level );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19146
train
v3
Schema: departments (alias: dept)(value, name, code, salary) managers(status, date, name, value) Task: Retrieve salary from departments with value above the MAX(salary) of managers rows sharing the same code. SQL:
SELECT salary FROM departments AS dept WHERE value > ( SELECT MAX(salary) FROM managers AS mgr WHERE mgr.code = dept.code );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19147
train
v2
Schema: invoices (alias: inv)(date, code, id, name) tasks(salary, name, type, status) Task: Find amount from invoices where a matching record exists in tasks with the same status. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = inv.status );
{ "outer_table": "invoices", "inner_table": "tasks", "outer_alias": "inv", "inner_alias": "tsk", "proj_col": "amount", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19148
train
v2
Schema: transactions (alias: txn)(value, code, type, amount) managers(salary, amount, level, name) Task: Find name from transactions where a matching record exists in managers with the same status. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = txn.status );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "name", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19149
train
v2
Schema: customers (alias: cust)(status, amount, level, name) projects(value, id, name, amount) Task: Retrieve code from customers that have at least one corresponding entry in projects sharing the same code. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.code = cust.code );
{ "outer_table": "customers", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "prj", "proj_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19150
train
v3
Schema: shipments (alias: shp)(code, status, level, name) customers(amount, value, name, type) Task: Retrieve id from shipments with salary above the SUM(value) of customers rows sharing the same type. SQL:
SELECT id FROM shipments AS shp WHERE salary > ( SELECT SUM(value) FROM customers AS cust WHERE cust.type = shp.type );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_19151
train
v2
Schema: regions (alias: rgn)(status, code, amount, type) shipments(name, type, id, value) Task: Find code from regions where a matching record exists in shipments with the same status. SQL:
SELECT code FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = rgn.status );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "code", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_19152
train
v1
Schema: tasks (alias: tsk)(date, amount, status, value) branches(code, date, amount, status) Task: Find name from tasks where code appears in branches entries with matching id. SQL:
SELECT name FROM tasks AS tsk WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "branches", "outer_alias": "tsk", "inner_alias": "brc", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_19153
train
v3
Schema: schedules (alias: schd)(type, date, id, value) items(amount, salary, value, name) Task: Retrieve id from schedules with value above the MIN(salary) of items rows sharing the same id. SQL:
SELECT id FROM schedules AS schd WHERE value > ( SELECT MIN(salary) FROM items AS lne WHERE lne.id = schd.id );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_19154
train
v3
Schema: transactions (alias: txn)(status, date, amount, level) categories(status, value, level, type) Task: Find salary from transactions where value exceeds the average amount from categories for the same status. SQL:
SELECT salary FROM transactions AS txn WHERE value > ( SELECT AVG(amount) FROM categories AS catg WHERE catg.status = txn.status );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19155
train
v3
Schema: regions (alias: rgn)(status, amount, id, code) products(type, date, status, code) Task: Retrieve id from regions with amount above the AVG(value) of products rows sharing the same type. SQL:
SELECT id FROM regions AS rgn WHERE amount > ( SELECT AVG(value) FROM products AS prod WHERE prod.type = rgn.type );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_19156
train
v1
Schema: orders (alias: ord)(amount, status, level, code) accounts(name, salary, level, value) Task: Select salary from orders where code exists in accounts for the same type. SQL:
SELECT salary FROM orders AS ord WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.type = ord.type );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19157
train
v1
Schema: schedules (alias: schd)(code, type, name, status) transactions(code, name, date, id) Task: Select value from schedules where id exists in transactions for the same id. SQL:
SELECT value FROM schedules AS schd WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.id = schd.id );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_19158
train
v3
Schema: staff (alias: empl)(date, status, salary, type) departments(date, type, amount, status) Task: Find name from staff where salary exceeds the maximum amount from departments for the same status. SQL:
SELECT name FROM staff AS empl WHERE salary > ( SELECT MAX(amount) FROM departments AS dept WHERE dept.status = empl.status );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_19159
train
v2
Schema: invoices (alias: inv)(level, salary, value, amount) sales(id, type, date, salary) Task: Retrieve salary from invoices that have at least one corresponding entry in sales sharing the same type. SQL:
SELECT salary FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = inv.type );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "salary", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19160
train
v1
Schema: sales (alias: sale)(name, level, value, type) customers(status, type, salary, level) Task: Find name from sales where status appears in customers entries with matching level. SQL:
SELECT name FROM sales AS sale WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.level = sale.level );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19161
train
v3
Schema: branches (alias: brc)(id, date, salary, code) tasks(id, type, status, value) Task: Find salary from branches where amount exceeds the average value from tasks for the same status. SQL:
SELECT salary FROM branches AS brc WHERE amount > ( SELECT AVG(value) FROM tasks AS tsk WHERE tsk.status = brc.status );
{ "outer_table": "branches", "inner_table": "tasks", "outer_alias": "brc", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_19162
train
v1
Schema: regions (alias: rgn)(salary, date, id, amount) invoices(type, amount, date, name) Task: Select name from regions where type exists in invoices for the same status. SQL:
SELECT name FROM regions AS rgn WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.status = rgn.status );
{ "outer_table": "regions", "inner_table": "invoices", "outer_alias": "rgn", "inner_alias": "inv", "proj_col": "name", "filter_col": "type", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_19163
train
v1
Schema: managers (alias: mgr)(code, salary, type, level) categories(name, date, value, amount) Task: Select amount from managers where type exists in categories for the same id. SQL:
SELECT amount FROM managers AS mgr WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.id = mgr.id );
{ "outer_table": "managers", "inner_table": "categories", "outer_alias": "mgr", "inner_alias": "catg", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19164
train
v3
Schema: regions (alias: rgn)(value, amount, date, level) orders(type, status, date, level) Task: Find value from regions where salary exceeds the minimum salary from orders for the same code. SQL:
SELECT value FROM regions AS rgn WHERE salary > ( SELECT MIN(salary) FROM orders AS ord WHERE ord.code = rgn.code );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_19165
train
v1
Schema: managers (alias: mgr)(amount, salary, date, status) categories(date, status, value, amount) Task: Select value from managers where level exists in categories for the same level. SQL:
SELECT value FROM managers AS mgr WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.level = mgr.level );
{ "outer_table": "managers", "inner_table": "categories", "outer_alias": "mgr", "inner_alias": "catg", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19166
train
v2
Schema: managers (alias: mgr)(code, status, id, name) transactions(amount, level, value, status) Task: Find value from managers where a matching record exists in transactions with the same level. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = mgr.level );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "value", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19167
train
v2
Schema: branches (alias: brc)(date, status, level, value) customers(value, name, type, id) Task: Find salary from branches where a matching record exists in customers with the same level. SQL:
SELECT salary FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = brc.level );
{ "outer_table": "branches", "inner_table": "customers", "outer_alias": "brc", "inner_alias": "cust", "proj_col": "salary", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_19168
train
v2
Schema: departments (alias: dept)(value, name, type, code) categories(level, salary, type, amount) Task: Find value from departments where a matching record exists in categories with the same id. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = dept.id );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "value", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19169
train
v1
Schema: products (alias: prod)(salary, name, level, id) departments(name, id, salary, date) Task: Find salary from products where status appears in departments entries with matching id. SQL:
SELECT salary FROM products AS prod WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.id = prod.id );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "salary", "filter_col": "status", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19170
train
v2
Schema: sales (alias: sale)(code, date, amount, salary) schedules(code, date, type, name) Task: Find salary from sales where a matching record exists in schedules with the same status. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = sale.status );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "salary", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19171
train
v2
Schema: branches (alias: brc)(amount, code, type, name) orders(status, type, level, name) Task: Find id from branches where a matching record exists in orders with the same status. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = brc.status );
{ "outer_table": "branches", "inner_table": "orders", "outer_alias": "brc", "inner_alias": "ord", "proj_col": "id", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_19172
train
v2
Schema: projects (alias: prj)(salary, name, date, type) staff(code, status, salary, value) Task: Find id from projects where a matching record exists in staff with the same code. SQL:
SELECT id FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = prj.code );
{ "outer_table": "projects", "inner_table": "staff", "outer_alias": "prj", "inner_alias": "empl", "proj_col": "id", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_19173
train
v2
Schema: products (alias: prod)(date, type, salary, code) sales(amount, value, id, salary) Task: Find code from products where a matching record exists in sales with the same code. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = prod.code );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "code", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19174
train
v1
Schema: employees (alias: emp)(name, level, salary, id) branches(amount, type, value, date) Task: Find id from employees where id appears in branches entries with matching status. SQL:
SELECT id FROM employees AS emp WHERE id IN ( SELECT id FROM branches AS brc WHERE brc.status = emp.status );
{ "outer_table": "employees", "inner_table": "branches", "outer_alias": "emp", "inner_alias": "brc", "proj_col": "id", "filter_col": "id", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19175
train
v2
Schema: sales (alias: sale)(salary, code, name, type) accounts(level, type, id, salary) Task: Find id from sales where a matching record exists in accounts with the same type. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = sale.type );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "id", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19176
train
v1
Schema: staff (alias: empl)(salary, date, level, type) shipments(id, value, status, salary) Task: Retrieve salary from staff whose type is found in shipments rows where code matches the outer record. SQL:
SELECT salary FROM staff AS empl WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.code = empl.code );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "salary", "filter_col": "type", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_19177
train
v2
Schema: departments (alias: dept)(id, level, value, amount) branches(value, amount, date, status) Task: Find id from departments where a matching record exists in branches with the same type. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = dept.type );
{ "outer_table": "departments", "inner_table": "branches", "outer_alias": "dept", "inner_alias": "brc", "proj_col": "id", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19178
train
v1
Schema: projects (alias: prj)(code, date, name, value) transactions(salary, type, value, date) Task: Find name from projects where id appears in transactions entries with matching status. SQL:
SELECT name FROM projects AS prj WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.status = prj.status );
{ "outer_table": "projects", "inner_table": "transactions", "outer_alias": "prj", "inner_alias": "txn", "proj_col": "name", "filter_col": "id", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_19179
train
v2
Schema: schedules (alias: schd)(salary, date, amount, name) regions(id, status, code, level) Task: Retrieve value from schedules that have at least one corresponding entry in regions sharing the same type. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = schd.type );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "value", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_19180
train
v3
Schema: customers (alias: cust)(code, amount, value, level) sales(name, salary, status, code) Task: Find value from customers where salary exceeds the minimum value from sales for the same code. SQL:
SELECT value FROM customers AS cust WHERE salary > ( SELECT MIN(value) FROM sales AS sale WHERE sale.code = cust.code );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19181
train
v1
Schema: shipments (alias: shp)(code, salary, date, amount) schedules(date, id, status, type) Task: Retrieve value from shipments whose level is found in schedules rows where code matches the outer record. SQL:
SELECT value FROM shipments AS shp WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.code = shp.code );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_19182
train
v3
Schema: employees (alias: emp)(status, amount, salary, date) projects(status, type, value, id) Task: Retrieve salary from employees with amount above the COUNT(value) of projects rows sharing the same id. SQL:
SELECT salary FROM employees AS emp WHERE amount > ( SELECT COUNT(value) FROM projects AS prj WHERE prj.id = emp.id );
{ "outer_table": "employees", "inner_table": "projects", "outer_alias": "emp", "inner_alias": "prj", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19183
train
v1
Schema: categories (alias: catg)(status, code, salary, date) requests(amount, id, salary, type) Task: Retrieve code from categories whose status is found in requests rows where level matches the outer record. SQL:
SELECT code FROM categories AS catg WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.level = catg.level );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_19184
train
v3
Schema: departments (alias: dept)(type, status, name, value) schedules(salary, amount, value, level) Task: Retrieve salary from departments with value above the AVG(value) of schedules rows sharing the same code. SQL:
SELECT salary FROM departments AS dept WHERE value > ( SELECT AVG(value) FROM schedules AS schd WHERE schd.code = dept.code );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19185
train
v2
Schema: departments (alias: dept)(amount, status, code, salary) transactions(salary, name, level, amount) Task: Retrieve salary from departments that have at least one corresponding entry in transactions sharing the same status. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = dept.status );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "salary", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19186
train
v1
Schema: managers (alias: mgr)(salary, level, value, date) projects(name, code, amount, salary) Task: Find amount from managers where code appears in projects entries with matching id. SQL:
SELECT amount FROM managers AS mgr WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.id = mgr.id );
{ "outer_table": "managers", "inner_table": "projects", "outer_alias": "mgr", "inner_alias": "prj", "proj_col": "amount", "filter_col": "code", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19187
train
v1
Schema: invoices (alias: inv)(salary, name, id, value) branches(amount, type, level, name) Task: Select amount from invoices where code exists in branches for the same id. SQL:
SELECT amount FROM invoices AS inv WHERE code IN ( SELECT code FROM branches AS brc WHERE brc.id = inv.id );
{ "outer_table": "invoices", "inner_table": "branches", "outer_alias": "inv", "inner_alias": "brc", "proj_col": "amount", "filter_col": "code", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19188
train
v1
Schema: invoices (alias: inv)(value, amount, date, status) items(amount, date, name, id) Task: Select name from invoices where status exists in items for the same code. SQL:
SELECT name FROM invoices AS inv WHERE status IN ( SELECT status FROM items AS lne WHERE lne.code = inv.code );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19189
train
v2
Schema: projects (alias: prj)(salary, value, code, id) customers(code, status, level, salary) Task: Retrieve name from projects that have at least one corresponding entry in customers sharing the same type. SQL:
SELECT name FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = prj.type );
{ "outer_table": "projects", "inner_table": "customers", "outer_alias": "prj", "inner_alias": "cust", "proj_col": "name", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_19190
train
v3
Schema: transactions (alias: txn)(code, id, name, status) accounts(status, name, code, amount) Task: Retrieve salary from transactions with value above the COUNT(salary) of accounts rows sharing the same id. SQL:
SELECT salary FROM transactions AS txn WHERE value > ( SELECT COUNT(salary) FROM accounts AS acct WHERE acct.id = txn.id );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19191
train
v2
Schema: schedules (alias: schd)(date, id, type, name) requests(date, value, type, status) Task: Find salary from schedules where a matching record exists in requests with the same status. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = schd.status );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "salary", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_19192
train
v2
Schema: managers (alias: mgr)(code, id, amount, level) orders(type, code, name, level) Task: Retrieve id from managers that have at least one corresponding entry in orders sharing the same id. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = mgr.id );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "id", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19193
train
v3
Schema: orders (alias: ord)(status, type, amount, value) regions(name, amount, code, value) Task: Retrieve salary from orders with salary above the MIN(amount) of regions rows sharing the same status. SQL:
SELECT salary FROM orders AS ord WHERE salary > ( SELECT MIN(amount) FROM regions AS rgn WHERE rgn.status = ord.status );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19194
train
v2
Schema: departments (alias: dept)(code, id, status, level) shipments(date, level, amount, type) Task: Find salary from departments where a matching record exists in shipments with the same id. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = dept.id );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "salary", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19195
train
v2
Schema: accounts (alias: acct)(code, level, name, id) requests(level, name, type, code) Task: Retrieve id from accounts that have at least one corresponding entry in requests sharing the same id. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = acct.id );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "id", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19196
train
v2
Schema: sales (alias: sale)(name, type, date, salary) departments(type, salary, date, status) Task: Find salary from sales where a matching record exists in departments with the same code. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = sale.code );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "salary", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19197
train
v3
Schema: employees (alias: emp)(code, level, name, date) customers(amount, value, level, id) Task: Retrieve id from employees with value above the MAX(amount) of customers rows sharing the same id. SQL:
SELECT id FROM employees AS emp WHERE value > ( SELECT MAX(amount) FROM customers AS cust WHERE cust.id = emp.id );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19198
train
v3
Schema: managers (alias: mgr)(type, value, date, code) invoices(status, level, id, name) Task: Find code from managers where value exceeds the average amount from invoices for the same type. SQL:
SELECT code FROM managers AS mgr WHERE value > ( SELECT AVG(amount) FROM invoices AS inv WHERE inv.type = mgr.type );
{ "outer_table": "managers", "inner_table": "invoices", "outer_alias": "mgr", "inner_alias": "inv", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_19199
train