variant
stringclasses
3 values
prompt
stringlengths
163
237
sql
stringlengths
103
143
metadata
unknown
id
stringlengths
21
21
split
stringclasses
1 value
token_group
stringclasses
2 values
v2
Schema: invoices (alias: inv)(name, value, status, level) managers(amount, name, salary, id) Task: Retrieve salary from invoices that have at least one corresponding entry in managers sharing the same id. SQL:
SELECT salary FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = inv.id );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "salary", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_11100
train
T1
v1
Schema: invoices (alias: inv)(date, code, id, value) customers(type, salary, name, date) Task: Select id from invoices where level exists in customers for the same code. SQL:
SELECT id FROM invoices AS inv WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.code = inv.code );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_11101
train
T1
v2
Schema: departments (alias: dept)(status, salary, id, type) invoices(code, amount, status, type) Task: Retrieve name from departments that have at least one corresponding entry in invoices sharing the same status. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = dept.status );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "name", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_11102
train
T1
v2
Schema: managers (alias: mgr)(amount, level, date, type) requests(amount, date, name, type) Task: Find salary from managers where a matching record exists in requests with the same type. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = mgr.type );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "salary", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_11103
train
T1
v3
Schema: schedules (alias: schd)(code, id, name, status) warehouses(name, level, id, status) Task: Retrieve salary from schedules with value above the SUM(salary) of warehouses rows sharing the same id. SQL:
SELECT salary FROM schedules AS schd WHERE value > ( SELECT SUM(salary) FROM warehouses AS whs WHERE whs.id = schd.id );
{ "outer_table": "schedules", "inner_table": "warehouses", "outer_alias": "schd", "inner_alias": "whs", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_11104
train
T2
v2
Schema: employees (alias: emp)(date, name, value, status) categories(id, name, type, level) Task: Find value from employees where a matching record exists in categories with the same code. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = emp.code );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "value", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_11105
train
T1
v1
Schema: accounts (alias: acct)(salary, id, level, date) products(code, status, amount, level) Task: Retrieve salary from accounts whose code is found in products rows where id matches the outer record. SQL:
SELECT salary FROM accounts AS acct WHERE code IN ( SELECT code FROM products AS prod WHERE prod.id = acct.id );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_11106
train
T1
v3
Schema: orders (alias: ord)(amount, salary, id, date) items(type, level, id, value) Task: Find value from orders where value exceeds the average salary from items for the same level. SQL:
SELECT value FROM orders AS ord WHERE value > ( SELECT SUM(salary) FROM items AS lne WHERE lne.level = ord.level );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_11107
train
T1
v3
Schema: sales (alias: sale)(code, level, amount, id) services(id, status, amount, value) Task: Retrieve code from sales with salary above the SUM(value) of services rows sharing the same code. SQL:
SELECT code FROM sales AS sale WHERE salary > ( SELECT SUM(value) FROM services AS srvc WHERE srvc.code = sale.code );
{ "outer_table": "sales", "inner_table": "services", "outer_alias": "sale", "inner_alias": "srvc", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_11108
train
T1
v1
Schema: customers (alias: cust)(value, status, amount, date) transactions(name, level, amount, code) Task: Select salary from customers where type exists in transactions for the same status. SQL:
SELECT salary FROM customers AS cust WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.status = cust.status );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "salary", "filter_col": "type", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_11109
train
T1
v1
Schema: accounts (alias: acct)(value, date, type, status) warehouses(date, id, type, code) Task: Find name from accounts where id appears in warehouses entries with matching id. SQL:
SELECT name FROM accounts AS acct WHERE id IN ( SELECT id FROM warehouses AS whs WHERE whs.id = acct.id );
{ "outer_table": "accounts", "inner_table": "warehouses", "outer_alias": "acct", "inner_alias": "whs", "proj_col": "name", "filter_col": "id", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_11110
train
T1
v1
Schema: products (alias: prod)(salary, amount, name, code) schedules(value, code, name, id) Task: Find value from products where level appears in schedules entries with matching level. SQL:
SELECT value FROM products AS prod WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.level = prod.level );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_11111
train
T1
v3
Schema: transactions (alias: txn)(value, name, date, code) schedules(type, amount, name, value) Task: Retrieve salary from transactions with value above the MIN(salary) of schedules rows sharing the same status. SQL:
SELECT salary FROM transactions AS txn WHERE value > ( SELECT MIN(salary) FROM schedules AS schd WHERE schd.status = txn.status );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_11112
train
T1
v3
Schema: departments (alias: dept)(salary, type, value, date) schedules(id, amount, value, status) Task: Find id from departments where value exceeds the average value from schedules for the same id. SQL:
SELECT id FROM departments AS dept WHERE value > ( SELECT MIN(value) FROM schedules AS schd WHERE schd.id = dept.id );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_11113
train
T1
v1
Schema: categories (alias: catg)(type, date, salary, amount) sales(date, type, level, amount) Task: Find salary from categories where code appears in sales entries with matching code. SQL:
SELECT salary FROM categories AS catg WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.code = catg.code );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_11114
train
T2
v1
Schema: staff (alias: empl)(date, code, salary, name) sales(name, date, status, value) Task: Select id from staff where id exists in sales for the same id. SQL:
SELECT id FROM staff AS empl WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.id = empl.id );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_11115
train
T2
v1
Schema: categories (alias: catg)(level, date, id, salary) orders(level, date, code, name) Task: Select amount from categories where id exists in orders for the same status. SQL:
SELECT amount FROM categories AS catg WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.status = catg.status );
{ "outer_table": "categories", "inner_table": "orders", "outer_alias": "catg", "inner_alias": "ord", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_11116
train
T2
v2
Schema: departments (alias: dept)(status, value, code, salary) transactions(level, code, salary, name) Task: Retrieve name from departments that have at least one corresponding entry in transactions sharing the same id. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = dept.id );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "name", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_11117
train
T1
v1
Schema: items (alias: lne)(date, id, type, amount) services(salary, id, value, level) Task: Select code from items where level exists in services for the same code. SQL:
SELECT code FROM items AS lne WHERE level IN ( SELECT level FROM services AS srvc WHERE srvc.code = lne.code );
{ "outer_table": "items", "inner_table": "services", "outer_alias": "lne", "inner_alias": "srvc", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_11118
train
T2
v3
Schema: products (alias: prod)(level, value, salary, code) customers(salary, name, id, type) Task: Find amount from products where amount exceeds the average amount from customers for the same type. SQL:
SELECT amount FROM products AS prod WHERE amount > ( SELECT MAX(amount) FROM customers AS cust WHERE cust.type = prod.type );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_11119
train
T1
v1
Schema: products (alias: prod)(type, date, status, level) warehouses(amount, level, value, name) Task: Select salary from products where level exists in warehouses for the same code. SQL:
SELECT salary FROM products AS prod WHERE level IN ( SELECT level FROM warehouses AS whs WHERE whs.code = prod.code );
{ "outer_table": "products", "inner_table": "warehouses", "outer_alias": "prod", "inner_alias": "whs", "proj_col": "salary", "filter_col": "level", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_11120
train
T1
v1
Schema: products (alias: prod)(level, name, date, type) invoices(code, status, name, date) Task: Select name from products where type exists in invoices for the same id. SQL:
SELECT name FROM products AS prod WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.id = prod.id );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "name", "filter_col": "type", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_11121
train
T1
v2
Schema: staff (alias: empl)(level, status, salary, amount) managers(name, status, level, amount) Task: Find amount from staff where a matching record exists in managers with the same type. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = empl.type );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "amount", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_11122
train
T2
v1
Schema: managers (alias: mgr)(name, date, amount, code) schedules(amount, id, type, name) Task: Select name from managers where id exists in schedules for the same status. SQL:
SELECT name FROM managers AS mgr WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.status = mgr.status );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "name", "filter_col": "id", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_11123
train
T1
v2
Schema: accounts (alias: acct)(type, status, value, code) orders(status, amount, name, value) Task: Retrieve name from accounts that have at least one corresponding entry in orders sharing the same type. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = acct.type );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "name", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_11124
train
T1
v1
Schema: products (alias: prod)(name, code, status, type) customers(value, level, id, date) Task: Find id from products where id appears in customers entries with matching code. SQL:
SELECT id FROM products AS prod WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.code = prod.code );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "id", "filter_col": "id", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_11125
train
T1
v1
Schema: managers (alias: mgr)(date, id, type, status) accounts(amount, code, level, type) Task: Find id from managers where id appears in accounts entries with matching id. SQL:
SELECT id FROM managers AS mgr WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.id = mgr.id );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_11126
train
T1
v1
Schema: customers (alias: cust)(status, value, salary, date) schedules(name, level, value, code) Task: Retrieve amount from customers whose type is found in schedules rows where status matches the outer record. SQL:
SELECT amount FROM customers AS cust WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.status = cust.status );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_11127
train
T1
v3
Schema: customers (alias: cust)(id, code, amount, type) managers(name, code, status, type) Task: Find id from customers where salary exceeds the average amount from managers for the same type. SQL:
SELECT id FROM customers AS cust WHERE salary > ( SELECT MIN(amount) FROM managers AS mgr WHERE mgr.type = cust.type );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_11128
train
T1
v2
Schema: accounts (alias: acct)(level, status, salary, id) orders(id, salary, code, status) Task: Retrieve id from accounts that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = acct.level );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "id", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_11129
train
T1
v2
Schema: departments (alias: dept)(value, status, name, amount) items(salary, id, type, name) Task: Find value from departments where a matching record exists in items with the same code. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = dept.code );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "value", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_11130
train
T1
v2
Schema: regions (alias: rgn)(salary, date, id, amount) categories(level, status, amount, id) Task: Retrieve id from regions that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = rgn.code );
{ "outer_table": "regions", "inner_table": "categories", "outer_alias": "rgn", "inner_alias": "catg", "proj_col": "id", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_11131
train
T2
v2
Schema: sales (alias: sale)(date, level, amount, id) invoices(name, value, salary, date) Task: Find name from sales where a matching record exists in invoices with the same level. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = sale.level );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "name", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_11132
train
T1
v1
Schema: sales (alias: sale)(name, type, date, code) managers(id, salary, date, name) Task: Select id from sales where level exists in managers for the same status. SQL:
SELECT id FROM sales AS sale WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.status = sale.status );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_11133
train
T1
v1
Schema: requests (alias: ordr)(date, code, type, salary) departments(id, amount, value, date) Task: Find salary from requests where type appears in departments entries with matching status. SQL:
SELECT salary FROM requests AS ordr WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.status = ordr.status );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "salary", "filter_col": "type", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_11134
train
T2
v2
Schema: warehouses (alias: whs)(status, type, code, id) categories(amount, value, level, name) Task: Retrieve amount from warehouses that have at least one corresponding entry in categories sharing the same type. SQL:
SELECT amount FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "categories", "outer_alias": "whs", "inner_alias": "catg", "proj_col": "amount", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_11135
train
T2
v2
Schema: sales (alias: sale)(salary, name, id, type) transactions(code, type, name, level) Task: Find name from sales where a matching record exists in transactions with the same id. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = sale.id );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "name", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_11136
train
T1
v2
Schema: staff (alias: empl)(code, id, date, type) budgets(name, amount, type, status) Task: Find salary from staff where a matching record exists in budgets with the same code. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.code = empl.code );
{ "outer_table": "staff", "inner_table": "budgets", "outer_alias": "empl", "inner_alias": "budg", "proj_col": "salary", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_11137
train
T2
v1
Schema: requests (alias: ordr)(status, type, id, amount) sales(status, salary, value, code) Task: Select code from requests where status exists in sales for the same level. SQL:
SELECT code FROM requests AS ordr WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.level = ordr.level );
{ "outer_table": "requests", "inner_table": "sales", "outer_alias": "ordr", "inner_alias": "sale", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_11138
train
T2
v3
Schema: regions (alias: rgn)(level, type, amount, status) employees(amount, status, value, name) Task: Retrieve amount from regions with amount above the SUM(value) of employees rows sharing the same id. SQL:
SELECT amount FROM regions AS rgn WHERE amount > ( SELECT SUM(value) FROM employees AS emp WHERE emp.id = rgn.id );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_11139
train
T2
v1
Schema: shipments (alias: shp)(type, level, date, code) items(code, name, value, salary) Task: Find salary from shipments where level appears in items entries with matching code. SQL:
SELECT salary FROM shipments AS shp WHERE level IN ( SELECT level FROM items AS lne WHERE lne.code = shp.code );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "salary", "filter_col": "level", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_11140
train
T2
v3
Schema: requests (alias: ordr)(date, id, level, amount) accounts(date, code, value, name) Task: Find code from requests where amount exceeds the average value from accounts for the same type. SQL:
SELECT code FROM requests AS ordr WHERE amount > ( SELECT SUM(value) FROM accounts AS acct WHERE acct.type = ordr.type );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_11141
train
T2
v1
Schema: schedules (alias: schd)(name, id, date, status) staff(level, name, date, code) Task: Find code from schedules where id appears in staff entries with matching status. SQL:
SELECT code FROM schedules AS schd WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.status = schd.status );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "code", "filter_col": "id", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_11142
train
T2
v2
Schema: accounts (alias: acct)(level, date, type, id) budgets(level, type, date, code) Task: Find amount from accounts where a matching record exists in budgets with the same id. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.id = acct.id );
{ "outer_table": "accounts", "inner_table": "budgets", "outer_alias": "acct", "inner_alias": "budg", "proj_col": "amount", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_11143
train
T1
v2
Schema: customers (alias: cust)(salary, amount, date, value) categories(date, value, type, level) Task: Retrieve value from customers that have at least one corresponding entry in categories sharing the same id. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = cust.id );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "value", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_11144
train
T1
v1
Schema: warehouses (alias: whs)(id, code, amount, type) employees(amount, id, status, date) Task: Select amount from warehouses where level exists in employees for the same code. SQL:
SELECT amount FROM warehouses AS whs WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "employees", "outer_alias": "whs", "inner_alias": "emp", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_11145
train
T2
v1
Schema: customers (alias: cust)(name, value, status, level) transactions(salary, amount, value, code) Task: Find name from customers where status appears in transactions entries with matching code. SQL:
SELECT name FROM customers AS cust WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.code = cust.code );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_11146
train
T1
v1
Schema: accounts (alias: acct)(amount, name, level, id) budgets(level, date, id, value) Task: Select value from accounts where status exists in budgets for the same level. SQL:
SELECT value FROM accounts AS acct WHERE status IN ( SELECT status FROM budgets AS budg WHERE budg.level = acct.level );
{ "outer_table": "accounts", "inner_table": "budgets", "outer_alias": "acct", "inner_alias": "budg", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_11147
train
T1
v2
Schema: transactions (alias: txn)(amount, date, salary, id) orders(id, salary, level, code) Task: Retrieve salary from transactions that have at least one corresponding entry in orders sharing the same id. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = txn.id );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "salary", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_11148
train
T1
v2
Schema: employees (alias: emp)(date, code, level, status) budgets(amount, code, level, id) Task: Retrieve amount from employees that have at least one corresponding entry in budgets sharing the same level. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.level = emp.level );
{ "outer_table": "employees", "inner_table": "budgets", "outer_alias": "emp", "inner_alias": "budg", "proj_col": "amount", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_11149
train
T1
v1
Schema: regions (alias: rgn)(salary, status, type, name) items(type, status, salary, id) Task: Select name from regions where level exists in items for the same status. SQL:
SELECT name FROM regions AS rgn WHERE level IN ( SELECT level FROM items AS lne WHERE lne.status = rgn.status );
{ "outer_table": "regions", "inner_table": "items", "outer_alias": "rgn", "inner_alias": "lne", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_11150
train
T2
v2
Schema: items (alias: lne)(type, status, date, name) requests(status, id, salary, amount) Task: Find amount from items where a matching record exists in requests with the same code. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = lne.code );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "amount", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_11151
train
T2
v2
Schema: budgets (alias: budg)(salary, value, code, status) customers(amount, status, level, date) Task: Find name from budgets where a matching record exists in customers with the same type. SQL:
SELECT name FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = budg.type );
{ "outer_table": "budgets", "inner_table": "customers", "outer_alias": "budg", "inner_alias": "cust", "proj_col": "name", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_11152
train
T2
v1
Schema: items (alias: lne)(value, id, status, salary) managers(type, salary, amount, id) Task: Select code from items where level exists in managers for the same level. SQL:
SELECT code FROM items AS lne WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.level = lne.level );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "code", "filter_col": "level", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_11153
train
T2
v2
Schema: customers (alias: cust)(id, date, name, level) orders(value, salary, status, amount) Task: Find code from customers where a matching record exists in orders with the same code. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = cust.code );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_11154
train
T1
v1
Schema: requests (alias: ordr)(status, salary, date, name) shipments(id, value, level, amount) Task: Find amount from requests where id appears in shipments entries with matching type. SQL:
SELECT amount FROM requests AS ordr WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.type = ordr.type );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_11155
train
T2
v1
Schema: services (alias: srvc)(value, date, level, code) warehouses(type, level, status, date) Task: Find value from services where status appears in warehouses entries with matching type. SQL:
SELECT value FROM services AS srvc WHERE status IN ( SELECT status FROM warehouses AS whs WHERE whs.type = srvc.type );
{ "outer_table": "services", "inner_table": "warehouses", "outer_alias": "srvc", "inner_alias": "whs", "proj_col": "value", "filter_col": "status", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_11156
train
T2
v1
Schema: services (alias: srvc)(salary, type, level, id) departments(name, level, value, salary) Task: Retrieve amount from services whose code is found in departments rows where type matches the outer record. SQL:
SELECT amount FROM services AS srvc WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.type = srvc.type );
{ "outer_table": "services", "inner_table": "departments", "outer_alias": "srvc", "inner_alias": "dept", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_11157
train
T2
v2
Schema: customers (alias: cust)(code, date, status, type) budgets(value, code, name, type) Task: Retrieve name from customers that have at least one corresponding entry in budgets sharing the same code. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.code = cust.code );
{ "outer_table": "customers", "inner_table": "budgets", "outer_alias": "cust", "inner_alias": "budg", "proj_col": "name", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_11158
train
T1
v2
Schema: transactions (alias: txn)(value, type, amount, id) budgets(id, level, name, date) Task: Find value from transactions where a matching record exists in budgets with the same type. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.type = txn.type );
{ "outer_table": "transactions", "inner_table": "budgets", "outer_alias": "txn", "inner_alias": "budg", "proj_col": "value", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_11159
train
T1
v1
Schema: products (alias: prod)(value, type, status, name) transactions(status, salary, date, value) Task: Retrieve name from products whose level is found in transactions rows where id matches the outer record. SQL:
SELECT name FROM products AS prod WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.id = prod.id );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "name", "filter_col": "level", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_11160
train
T1
v1
Schema: staff (alias: empl)(type, id, amount, value) accounts(date, salary, amount, code) Task: Retrieve name from staff whose status is found in accounts rows where id matches the outer record. SQL:
SELECT name FROM staff AS empl WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.id = empl.id );
{ "outer_table": "staff", "inner_table": "accounts", "outer_alias": "empl", "inner_alias": "acct", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_11161
train
T2
v1
Schema: employees (alias: emp)(value, salary, id, amount) customers(code, id, type, value) Task: Retrieve value from employees whose level is found in customers rows where code matches the outer record. SQL:
SELECT value FROM employees AS emp WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.code = emp.code );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_11162
train
T1
v1
Schema: requests (alias: ordr)(type, date, status, value) services(id, type, value, level) Task: Find salary from requests where code appears in services entries with matching id. SQL:
SELECT salary FROM requests AS ordr WHERE code IN ( SELECT code FROM services AS srvc WHERE srvc.id = ordr.id );
{ "outer_table": "requests", "inner_table": "services", "outer_alias": "ordr", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_11163
train
T2
v2
Schema: departments (alias: dept)(type, id, level, status) managers(code, amount, date, level) Task: Find salary from departments where a matching record exists in managers with the same type. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = dept.type );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "salary", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_11164
train
T1
v1
Schema: categories (alias: catg)(amount, salary, code, status) items(value, id, amount, name) Task: Select value from categories where type exists in items for the same code. SQL:
SELECT value FROM categories AS catg WHERE type IN ( SELECT type FROM items AS lne WHERE lne.code = catg.code );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_11165
train
T2
v2
Schema: departments (alias: dept)(name, level, value, salary) budgets(name, id, date, value) Task: Retrieve salary from departments that have at least one corresponding entry in budgets sharing the same code. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.code = dept.code );
{ "outer_table": "departments", "inner_table": "budgets", "outer_alias": "dept", "inner_alias": "budg", "proj_col": "salary", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_11166
train
T1
v1
Schema: sales (alias: sale)(amount, code, name, salary) employees(salary, date, value, code) Task: Retrieve value from sales whose level is found in employees rows where type matches the outer record. SQL:
SELECT value FROM sales AS sale WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.type = sale.type );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_11167
train
T1
v1
Schema: departments (alias: dept)(status, value, type, amount) requests(amount, salary, id, level) Task: Find id from departments where status appears in requests entries with matching level. SQL:
SELECT id FROM departments AS dept WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.level = dept.level );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "id", "filter_col": "status", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_11168
train
T1
v3
Schema: sales (alias: sale)(code, status, type, amount) customers(salary, value, date, name) Task: Find name from sales where value exceeds the average amount from customers for the same level. SQL:
SELECT name FROM sales AS sale WHERE value > ( SELECT MIN(amount) 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": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_11169
train
T1
v3
Schema: products (alias: prod)(name, value, amount, level) regions(code, name, status, id) Task: Retrieve name from products with value above the COUNT(value) of regions rows sharing the same level. SQL:
SELECT name FROM products AS prod WHERE value > ( SELECT COUNT(value) FROM regions AS rgn WHERE rgn.level = prod.level );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_11170
train
T1
v1
Schema: items (alias: lne)(date, code, name, amount) orders(amount, code, name, type) Task: Select code from items where code exists in orders for the same id. SQL:
SELECT code FROM items AS lne WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.id = lne.id );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_11171
train
T2
v3
Schema: orders (alias: ord)(status, id, value, salary) transactions(code, name, status, value) Task: Find id from orders where amount exceeds the average amount from transactions for the same status. SQL:
SELECT id FROM orders AS ord WHERE amount > ( SELECT COUNT(amount) FROM transactions AS txn WHERE txn.status = ord.status );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_11172
train
T1
v3
Schema: accounts (alias: acct)(date, name, salary, level) schedules(salary, date, id, code) Task: Retrieve name from accounts with amount above the MIN(amount) of schedules rows sharing the same level. SQL:
SELECT name FROM accounts AS acct WHERE amount > ( SELECT MIN(amount) FROM schedules AS schd WHERE schd.level = acct.level );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_11173
train
T1
v2
Schema: items (alias: lne)(name, type, amount, status) accounts(code, id, name, salary) Task: Find value from items where a matching record exists in accounts with the same type. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = lne.type );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "value", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_11174
train
T2
v3
Schema: employees (alias: emp)(type, amount, value, level) products(id, date, value, amount) Task: Retrieve amount from employees with amount above the MIN(amount) of products rows sharing the same status. SQL:
SELECT amount FROM employees AS emp WHERE amount > ( SELECT MIN(amount) FROM products AS prod WHERE prod.status = emp.status );
{ "outer_table": "employees", "inner_table": "products", "outer_alias": "emp", "inner_alias": "prod", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_11175
train
T1
v1
Schema: sales (alias: sale)(value, amount, date, code) employees(amount, type, code, value) Task: Select salary from sales where code exists in employees for the same code. SQL:
SELECT salary FROM sales AS sale WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.code = sale.code );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_11176
train
T1
v2
Schema: services (alias: srvc)(id, value, name, amount) shipments(value, type, salary, date) Task: Retrieve name from services that have at least one corresponding entry in shipments sharing the same code. SQL:
SELECT name FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = srvc.code );
{ "outer_table": "services", "inner_table": "shipments", "outer_alias": "srvc", "inner_alias": "shp", "proj_col": "name", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_11177
train
T2
v1
Schema: schedules (alias: schd)(type, date, name, amount) categories(id, status, code, value) Task: Retrieve id from schedules whose level is found in categories rows where id matches the outer record. SQL:
SELECT id FROM schedules AS schd WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.id = schd.id );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_11178
train
T2
v2
Schema: categories (alias: catg)(salary, value, name, level) products(salary, status, value, level) Task: Retrieve code from categories that have at least one corresponding entry in products sharing the same status. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = catg.status );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "code", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_11179
train
T2
v2
Schema: requests (alias: ordr)(date, status, code, level) categories(level, status, amount, name) Task: Retrieve value from requests that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = ordr.code );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "value", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_11180
train
T2
v3
Schema: regions (alias: rgn)(level, id, status, amount) schedules(date, level, type, salary) Task: Retrieve code from regions with value above the COUNT(salary) of schedules rows sharing the same code. SQL:
SELECT code FROM regions AS rgn WHERE value > ( SELECT COUNT(salary) FROM schedules AS schd WHERE schd.code = rgn.code );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_11181
train
T2
v2
Schema: customers (alias: cust)(name, status, code, amount) items(name, code, id, salary) Task: Find salary from customers where a matching record exists in items with the same code. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = cust.code );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "salary", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_11182
train
T1
v1
Schema: regions (alias: rgn)(name, status, value, salary) categories(value, date, type, code) Task: Select name from regions where id exists in categories for the same id. SQL:
SELECT name FROM regions AS rgn WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.id = rgn.id );
{ "outer_table": "regions", "inner_table": "categories", "outer_alias": "rgn", "inner_alias": "catg", "proj_col": "name", "filter_col": "id", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_11183
train
T2
v2
Schema: departments (alias: dept)(code, amount, type, level) warehouses(value, type, status, id) Task: Retrieve salary from departments that have at least one corresponding entry in warehouses sharing the same status. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.status = dept.status );
{ "outer_table": "departments", "inner_table": "warehouses", "outer_alias": "dept", "inner_alias": "whs", "proj_col": "salary", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_11184
train
T1
v2
Schema: transactions (alias: txn)(code, date, salary, type) orders(type, salary, status, level) Task: Find name from transactions where a matching record exists in orders with the same id. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = txn.id );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "name", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_11185
train
T1
v3
Schema: customers (alias: cust)(name, date, amount, type) schedules(date, code, amount, value) Task: Find name from customers where value exceeds the average value from schedules for the same type. SQL:
SELECT name FROM customers AS cust WHERE value > ( SELECT COUNT(value) FROM schedules AS schd WHERE schd.type = cust.type );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_11186
train
T1
v3
Schema: accounts (alias: acct)(level, type, salary, status) sales(salary, code, type, amount) Task: Retrieve salary from accounts with amount above the COUNT(value) of sales rows sharing the same code. SQL:
SELECT salary FROM accounts AS acct WHERE amount > ( SELECT COUNT(value) FROM sales AS sale WHERE sale.code = acct.code );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_11187
train
T1
v1
Schema: departments (alias: dept)(status, code, id, date) budgets(name, date, level, amount) Task: Select amount from departments where level exists in budgets for the same status. SQL:
SELECT amount FROM departments AS dept WHERE level IN ( SELECT level FROM budgets AS budg WHERE budg.status = dept.status );
{ "outer_table": "departments", "inner_table": "budgets", "outer_alias": "dept", "inner_alias": "budg", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_11188
train
T1
v1
Schema: categories (alias: catg)(level, name, date, amount) departments(amount, name, type, code) Task: Retrieve name from categories whose status is found in departments rows where level matches the outer record. SQL:
SELECT name FROM categories AS catg WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.level = catg.level );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_11189
train
T2
v3
Schema: warehouses (alias: whs)(id, name, date, value) services(value, level, date, id) Task: Find amount from warehouses where salary exceeds the average salary from services for the same type. SQL:
SELECT amount FROM warehouses AS whs WHERE salary > ( SELECT AVG(salary) FROM services AS srvc WHERE srvc.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "services", "outer_alias": "whs", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_11190
train
T2
v3
Schema: regions (alias: rgn)(type, code, salary, id) managers(code, date, level, amount) Task: Retrieve salary from regions with amount above the SUM(salary) of managers rows sharing the same code. SQL:
SELECT salary FROM regions AS rgn WHERE amount > ( SELECT SUM(salary) FROM managers AS mgr WHERE mgr.code = rgn.code );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_11191
train
T2
v1
Schema: items (alias: lne)(value, amount, status, date) budgets(salary, code, date, amount) Task: Select salary from items where level exists in budgets for the same id. SQL:
SELECT salary FROM items AS lne WHERE level IN ( SELECT level FROM budgets AS budg WHERE budg.id = lne.id );
{ "outer_table": "items", "inner_table": "budgets", "outer_alias": "lne", "inner_alias": "budg", "proj_col": "salary", "filter_col": "level", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_11192
train
T2
v3
Schema: staff (alias: empl)(salary, type, amount, status) accounts(date, amount, id, name) Task: Retrieve name from staff with value above the MIN(salary) of accounts rows sharing the same id. SQL:
SELECT name FROM staff AS empl WHERE value > ( SELECT MIN(salary) FROM accounts AS acct WHERE acct.id = empl.id );
{ "outer_table": "staff", "inner_table": "accounts", "outer_alias": "empl", "inner_alias": "acct", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_11193
train
T2
v3
Schema: categories (alias: catg)(name, amount, code, level) items(type, level, code, salary) Task: Find salary from categories where amount exceeds the average salary from items for the same status. SQL:
SELECT salary FROM categories AS catg WHERE amount > ( SELECT AVG(salary) FROM items AS lne WHERE lne.status = catg.status );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_11194
train
T2
v2
Schema: departments (alias: dept)(amount, date, level, status) employees(name, date, amount, level) Task: Find id from departments where a matching record exists in employees with the same id. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = dept.id );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "id", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_11195
train
T1
v3
Schema: budgets (alias: budg)(level, id, amount, type) employees(status, type, value, date) Task: Retrieve id from budgets with salary above the MIN(value) of employees rows sharing the same id. SQL:
SELECT id FROM budgets AS budg WHERE salary > ( SELECT MIN(value) FROM employees AS emp WHERE emp.id = budg.id );
{ "outer_table": "budgets", "inner_table": "employees", "outer_alias": "budg", "inner_alias": "emp", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_11196
train
T2
v1
Schema: staff (alias: empl)(date, code, amount, value) employees(date, status, code, amount) Task: Retrieve code from staff whose level is found in employees rows where level matches the outer record. SQL:
SELECT code FROM staff AS empl WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.level = empl.level );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "code", "filter_col": "level", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_11197
train
T2
v3
Schema: orders (alias: ord)(id, amount, date, type) warehouses(type, id, level, amount) Task: Retrieve amount from orders with amount above the SUM(value) of warehouses rows sharing the same type. SQL:
SELECT amount FROM orders AS ord WHERE amount > ( SELECT SUM(value) FROM warehouses AS whs WHERE whs.type = ord.type );
{ "outer_table": "orders", "inner_table": "warehouses", "outer_alias": "ord", "inner_alias": "whs", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_11198
train
T1
v3
Schema: warehouses (alias: whs)(type, status, code, name) items(date, id, type, status) Task: Retrieve amount from warehouses with value above the COUNT(salary) of items rows sharing the same level. SQL:
SELECT amount FROM warehouses AS whs WHERE value > ( SELECT COUNT(salary) FROM items AS lne WHERE lne.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "items", "outer_alias": "whs", "inner_alias": "lne", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_11199
train
T2