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
v3
Schema: transactions (alias: txn)(amount, date, value, id) sales(name, status, date, id) Task: Retrieve id from transactions with salary above the MIN(value) of sales rows sharing the same code. SQL:
SELECT id FROM transactions AS txn WHERE salary > ( SELECT MIN(value) FROM sales AS sale WHERE sale.code = txn.code );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_09100
train
T1
v2
Schema: regions (alias: rgn)(type, code, amount, value) customers(amount, name, date, status) Task: Retrieve id from regions that have at least one corresponding entry in customers sharing the same level. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = rgn.level );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "id", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_09101
train
T2
v2
Schema: products (alias: prod)(id, salary, amount, date) schedules(date, code, level, salary) Task: Find id from products where a matching record exists in schedules with the same status. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = prod.status );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "id", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_09102
train
T1
v2
Schema: items (alias: lne)(status, amount, code, type) orders(code, salary, status, id) Task: Retrieve amount from items that have at least one corresponding entry in orders sharing the same status. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = lne.status );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "amount", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_09103
train
T2
v3
Schema: services (alias: srvc)(level, amount, salary, name) customers(name, code, type, status) Task: Retrieve name from services with value above the COUNT(amount) of customers rows sharing the same status. SQL:
SELECT name FROM services AS srvc WHERE value > ( SELECT COUNT(amount) FROM customers AS cust WHERE cust.status = srvc.status );
{ "outer_table": "services", "inner_table": "customers", "outer_alias": "srvc", "inner_alias": "cust", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_09104
train
T2
v3
Schema: customers (alias: cust)(salary, level, value, code) services(status, salary, code, id) Task: Retrieve value from customers with value above the MAX(value) of services rows sharing the same code. SQL:
SELECT value FROM customers AS cust WHERE value > ( SELECT MAX(value) FROM services AS srvc WHERE srvc.code = cust.code );
{ "outer_table": "customers", "inner_table": "services", "outer_alias": "cust", "inner_alias": "srvc", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_09105
train
T1
v3
Schema: sales (alias: sale)(date, value, level, amount) schedules(value, type, level, name) Task: Retrieve salary from sales with salary above the COUNT(value) of schedules rows sharing the same status. SQL:
SELECT salary FROM sales AS sale WHERE salary > ( SELECT COUNT(value) FROM schedules AS schd WHERE schd.status = sale.status );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_09106
train
T1
v3
Schema: budgets (alias: budg)(date, salary, amount, id) shipments(code, salary, name, id) Task: Find value from budgets where amount exceeds the average value from shipments for the same code. SQL:
SELECT value FROM budgets AS budg WHERE amount > ( SELECT AVG(value) FROM shipments AS shp WHERE shp.code = budg.code );
{ "outer_table": "budgets", "inner_table": "shipments", "outer_alias": "budg", "inner_alias": "shp", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_09107
train
T2
v2
Schema: categories (alias: catg)(name, status, id, type) staff(status, salary, amount, date) Task: Find salary from categories where a matching record exists in staff with the same level. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = catg.level );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "salary", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_09108
train
T2
v1
Schema: categories (alias: catg)(type, amount, salary, value) services(id, name, code, value) Task: Select amount from categories where id exists in services for the same level. SQL:
SELECT amount FROM categories AS catg WHERE id IN ( SELECT id FROM services AS srvc WHERE srvc.level = catg.level );
{ "outer_table": "categories", "inner_table": "services", "outer_alias": "catg", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_09109
train
T2
v2
Schema: warehouses (alias: whs)(value, level, id, amount) shipments(date, code, status, value) Task: Find id from warehouses where a matching record exists in shipments with the same type. SQL:
SELECT id FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "shipments", "outer_alias": "whs", "inner_alias": "shp", "proj_col": "id", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_09110
train
T2
v2
Schema: departments (alias: dept)(level, value, status, salary) accounts(value, status, name, salary) Task: Retrieve id from departments that have at least one corresponding entry in accounts sharing the same type. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = dept.type );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "id", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_09111
train
T1
v3
Schema: warehouses (alias: whs)(date, value, type, status) regions(code, amount, date, level) Task: Find name from warehouses where salary exceeds the average value from regions for the same type. SQL:
SELECT name FROM warehouses AS whs WHERE salary > ( SELECT COUNT(value) FROM regions AS rgn WHERE rgn.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "regions", "outer_alias": "whs", "inner_alias": "rgn", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_09112
train
T2
v2
Schema: orders (alias: ord)(value, salary, amount, date) schedules(amount, code, name, type) Task: Retrieve salary from orders that have at least one corresponding entry in schedules sharing the same code. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = ord.code );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "salary", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_09113
train
T1
v3
Schema: invoices (alias: inv)(salary, status, date, level) categories(salary, level, code, name) Task: Find amount from invoices where amount exceeds the average amount from categories for the same status. SQL:
SELECT amount FROM invoices AS inv WHERE amount > ( SELECT MIN(amount) FROM categories AS catg WHERE catg.status = inv.status );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_09114
train
T1
v2
Schema: requests (alias: ordr)(date, value, code, amount) schedules(id, amount, value, date) Task: Retrieve name from requests that have at least one corresponding entry in schedules sharing the same code. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = ordr.code );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "name", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_09115
train
T2
v2
Schema: items (alias: lne)(level, value, salary, date) customers(amount, type, date, value) Task: Find name from items where a matching record exists in customers with the same level. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = lne.level );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "name", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_09116
train
T2
v2
Schema: schedules (alias: schd)(id, salary, level, name) budgets(id, salary, value, name) Task: Find amount from schedules where a matching record exists in budgets with the same level. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.level = schd.level );
{ "outer_table": "schedules", "inner_table": "budgets", "outer_alias": "schd", "inner_alias": "budg", "proj_col": "amount", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_09117
train
T2
v1
Schema: accounts (alias: acct)(salary, date, id, code) orders(value, name, level, id) Task: Find salary from accounts where code appears in orders entries with matching type. SQL:
SELECT salary FROM accounts AS acct WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.type = acct.type );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_09118
train
T1
v2
Schema: departments (alias: dept)(id, name, value, amount) schedules(type, name, date, status) Task: Retrieve code from departments that have at least one corresponding entry in schedules sharing the same code. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = dept.code );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "code", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_09119
train
T1
v3
Schema: managers (alias: mgr)(date, amount, level, code) customers(name, type, status, salary) Task: Retrieve value from managers with amount above the MIN(value) of customers rows sharing the same id. SQL:
SELECT value FROM managers AS mgr WHERE amount > ( SELECT MIN(value) FROM customers AS cust WHERE cust.id = mgr.id );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_09120
train
T1
v2
Schema: orders (alias: ord)(level, value, type, id) staff(code, amount, salary, name) Task: Find value from orders where a matching record exists in staff with the same code. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = ord.code );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "value", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_09121
train
T1
v2
Schema: shipments (alias: shp)(date, name, status, level) staff(amount, level, date, name) Task: Find value from shipments where a matching record exists in staff with the same type. SQL:
SELECT value FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = shp.type );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "value", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_09122
train
T2
v2
Schema: orders (alias: ord)(date, salary, level, amount) services(name, level, salary, id) Task: Find value from orders where a matching record exists in services with the same id. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = ord.id );
{ "outer_table": "orders", "inner_table": "services", "outer_alias": "ord", "inner_alias": "srvc", "proj_col": "value", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_09123
train
T1
v1
Schema: staff (alias: empl)(id, code, type, level) items(date, value, id, status) Task: Select salary from staff where id exists in items for the same status. SQL:
SELECT salary FROM staff AS empl WHERE id IN ( SELECT id FROM items AS lne WHERE lne.status = empl.status );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_09124
train
T2
v2
Schema: customers (alias: cust)(level, code, salary, type) regions(salary, date, level, code) Task: Retrieve amount from customers that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = cust.level );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "amount", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_09125
train
T1
v1
Schema: transactions (alias: txn)(id, value, level, date) requests(type, date, status, id) Task: Retrieve amount from transactions whose id is found in requests rows where status matches the outer record. SQL:
SELECT amount FROM transactions AS txn WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.status = txn.status );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_09126
train
T1
v2
Schema: shipments (alias: shp)(id, code, type, status) accounts(status, salary, date, value) Task: Retrieve amount from shipments that have at least one corresponding entry in accounts sharing the same id. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = shp.id );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "amount", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_09127
train
T2
v2
Schema: budgets (alias: budg)(id, status, name, amount) customers(code, name, status, type) Task: Retrieve code from budgets that have at least one corresponding entry in customers sharing the same id. SQL:
SELECT code FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = budg.id );
{ "outer_table": "budgets", "inner_table": "customers", "outer_alias": "budg", "inner_alias": "cust", "proj_col": "code", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_09128
train
T2
v1
Schema: schedules (alias: schd)(id, type, date, status) categories(salary, amount, value, code) Task: Find value from schedules where id appears in categories entries with matching code. SQL:
SELECT value FROM schedules AS schd WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.code = schd.code );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_09129
train
T2
v2
Schema: employees (alias: emp)(amount, name, salary, id) accounts(value, code, name, id) Task: Retrieve id from employees that have at least one corresponding entry in accounts sharing the same status. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = emp.status );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "id", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_09130
train
T1
v1
Schema: services (alias: srvc)(status, date, amount, id) staff(code, level, id, status) Task: Find value from services where status appears in staff entries with matching level. SQL:
SELECT value FROM services AS srvc WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.level = srvc.level );
{ "outer_table": "services", "inner_table": "staff", "outer_alias": "srvc", "inner_alias": "empl", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_09131
train
T2
v3
Schema: accounts (alias: acct)(value, level, id, amount) services(type, status, salary, name) Task: Find name from accounts where amount exceeds the average amount from services for the same type. SQL:
SELECT name FROM accounts AS acct WHERE amount > ( SELECT COUNT(amount) FROM services AS srvc WHERE srvc.type = acct.type );
{ "outer_table": "accounts", "inner_table": "services", "outer_alias": "acct", "inner_alias": "srvc", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_09132
train
T1
v2
Schema: schedules (alias: schd)(name, date, level, code) products(type, amount, salary, date) Task: Find name from schedules where a matching record exists in products with the same type. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = schd.type );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "name", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_09133
train
T2
v2
Schema: schedules (alias: schd)(name, salary, value, level) shipments(salary, type, value, name) Task: Retrieve id from schedules that have at least one corresponding entry in shipments sharing the same type. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = schd.type );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "id", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_09134
train
T2
v2
Schema: sales (alias: sale)(amount, status, type, salary) regions(date, id, level, amount) Task: Find value from sales where a matching record exists in regions with the same code. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = sale.code );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "value", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_09135
train
T1
v2
Schema: transactions (alias: txn)(code, name, date, value) staff(amount, status, name, value) Task: Find value from transactions where a matching record exists in staff with the same level. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = txn.level );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "value", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_09136
train
T1
v2
Schema: categories (alias: catg)(code, level, amount, type) invoices(date, status, name, type) Task: Retrieve amount from categories that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = catg.id );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "amount", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_09137
train
T2
v3
Schema: transactions (alias: txn)(amount, salary, date, status) services(status, level, code, type) Task: Retrieve name from transactions with amount above the COUNT(value) of services rows sharing the same id. SQL:
SELECT name FROM transactions AS txn WHERE amount > ( SELECT COUNT(value) FROM services AS srvc WHERE srvc.id = txn.id );
{ "outer_table": "transactions", "inner_table": "services", "outer_alias": "txn", "inner_alias": "srvc", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_09138
train
T1
v1
Schema: warehouses (alias: whs)(level, name, value, type) orders(salary, id, amount, type) Task: Find amount from warehouses where type appears in orders entries with matching level. SQL:
SELECT amount FROM warehouses AS whs WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "orders", "outer_alias": "whs", "inner_alias": "ord", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_09139
train
T2
v3
Schema: items (alias: lne)(status, id, amount, value) transactions(id, status, salary, name) Task: Find salary from items where salary exceeds the average salary from transactions for the same status. SQL:
SELECT salary FROM items AS lne WHERE salary > ( SELECT MIN(salary) FROM transactions AS txn WHERE txn.status = lne.status );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_09140
train
T2
v1
Schema: requests (alias: ordr)(status, code, value, amount) accounts(type, code, id, level) Task: Find id from requests where type appears in accounts entries with matching level. SQL:
SELECT id FROM requests AS ordr WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.level = ordr.level );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_09141
train
T2
v3
Schema: services (alias: srvc)(name, amount, type, code) categories(code, value, date, status) Task: Retrieve salary from services with salary above the MAX(amount) of categories rows sharing the same id. SQL:
SELECT salary FROM services AS srvc WHERE salary > ( SELECT MAX(amount) FROM categories AS catg WHERE catg.id = srvc.id );
{ "outer_table": "services", "inner_table": "categories", "outer_alias": "srvc", "inner_alias": "catg", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_09142
train
T2
v1
Schema: regions (alias: rgn)(name, date, id, level) budgets(value, id, level, code) Task: Find id from regions where type appears in budgets entries with matching level. SQL:
SELECT id FROM regions AS rgn WHERE type IN ( SELECT type FROM budgets AS budg WHERE budg.level = rgn.level );
{ "outer_table": "regions", "inner_table": "budgets", "outer_alias": "rgn", "inner_alias": "budg", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_09143
train
T2
v3
Schema: warehouses (alias: whs)(level, value, name, date) customers(type, id, status, date) Task: Find salary from warehouses where amount exceeds the average value from customers for the same type. SQL:
SELECT salary FROM warehouses AS whs WHERE amount > ( SELECT MAX(value) FROM customers AS cust WHERE cust.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "customers", "outer_alias": "whs", "inner_alias": "cust", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_09144
train
T2
v1
Schema: products (alias: prod)(level, salary, amount, code) customers(status, level, type, code) Task: Select amount from products where id exists in customers for the same type. SQL:
SELECT amount FROM products AS prod WHERE id IN ( SELECT id 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": "id", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_09145
train
T1
v2
Schema: transactions (alias: txn)(status, name, amount, salary) categories(name, value, amount, salary) Task: Find id from transactions where a matching record exists in categories with the same status. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = txn.status );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "id", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_09146
train
T1
v2
Schema: services (alias: srvc)(type, value, amount, id) managers(salary, code, level, date) Task: Retrieve amount from services that have at least one corresponding entry in managers sharing the same code. SQL:
SELECT amount FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = srvc.code );
{ "outer_table": "services", "inner_table": "managers", "outer_alias": "srvc", "inner_alias": "mgr", "proj_col": "amount", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_09147
train
T2
v3
Schema: services (alias: srvc)(code, amount, value, name) shipments(status, amount, code, id) Task: Find value from services where amount exceeds the average amount from shipments for the same level. SQL:
SELECT value FROM services AS srvc WHERE amount > ( SELECT MAX(amount) FROM shipments AS shp WHERE shp.level = srvc.level );
{ "outer_table": "services", "inner_table": "shipments", "outer_alias": "srvc", "inner_alias": "shp", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_09148
train
T2
v2
Schema: departments (alias: dept)(id, status, value, type) invoices(value, salary, status, type) Task: Retrieve amount from departments that have at least one corresponding entry in invoices sharing the same status. SQL:
SELECT amount 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": "amount", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_09149
train
T1
v3
Schema: sales (alias: sale)(status, value, type, code) orders(code, name, value, status) Task: Retrieve id from sales with value above the MIN(amount) of orders rows sharing the same level. SQL:
SELECT id FROM sales AS sale WHERE value > ( SELECT MIN(amount) FROM orders AS ord WHERE ord.level = sale.level );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_09150
train
T1
v1
Schema: regions (alias: rgn)(salary, code, level, name) transactions(code, amount, date, type) Task: Find name from regions where type appears in transactions entries with matching code. SQL:
SELECT name FROM regions AS rgn WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.code = rgn.code );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_09151
train
T2
v1
Schema: services (alias: srvc)(salary, status, code, date) regions(salary, name, level, amount) Task: Retrieve salary from services whose level is found in regions rows where status matches the outer record. SQL:
SELECT salary FROM services AS srvc WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.status = srvc.status );
{ "outer_table": "services", "inner_table": "regions", "outer_alias": "srvc", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "level", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_09152
train
T2
v1
Schema: employees (alias: emp)(amount, value, salary, name) categories(status, amount, id, level) Task: Find code from employees where id appears in categories entries with matching level. SQL:
SELECT code FROM employees AS emp WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.level = emp.level );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "code", "filter_col": "id", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_09153
train
T1
v2
Schema: transactions (alias: txn)(status, date, amount, type) invoices(level, code, value, name) Task: Find name from transactions where a matching record exists in invoices with the same id. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = txn.id );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "name", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_09154
train
T1
v3
Schema: transactions (alias: txn)(date, status, amount, salary) products(id, code, type, value) Task: Retrieve code from transactions with amount above the MAX(value) of products rows sharing the same level. SQL:
SELECT code FROM transactions AS txn WHERE amount > ( SELECT MAX(value) FROM products AS prod WHERE prod.level = txn.level );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_09155
train
T1
v3
Schema: sales (alias: sale)(code, type, status, level) requests(type, level, id, name) Task: Find id from sales where salary exceeds the average salary from requests for the same type. SQL:
SELECT id FROM sales AS sale WHERE salary > ( SELECT MAX(salary) FROM requests AS ordr WHERE ordr.type = sale.type );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_09156
train
T1
v1
Schema: schedules (alias: schd)(salary, status, value, id) staff(code, salary, amount, status) Task: Find name from schedules where code appears in staff entries with matching status. SQL:
SELECT name FROM schedules AS schd WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.status = schd.status );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_09157
train
T2
v2
Schema: shipments (alias: shp)(level, name, id, code) items(salary, date, level, value) Task: Retrieve value from shipments that have at least one corresponding entry in items sharing the same status. SQL:
SELECT value FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = shp.status );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "value", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_09158
train
T2
v1
Schema: services (alias: srvc)(level, name, amount, code) products(type, status, code, amount) Task: Retrieve salary from services whose code is found in products rows where id matches the outer record. SQL:
SELECT salary FROM services AS srvc WHERE code IN ( SELECT code FROM products AS prod WHERE prod.id = srvc.id );
{ "outer_table": "services", "inner_table": "products", "outer_alias": "srvc", "inner_alias": "prod", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_09159
train
T2
v2
Schema: shipments (alias: shp)(status, type, level, code) invoices(status, name, value, level) Task: Retrieve id from shipments that have at least one corresponding entry in invoices sharing the same code. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = shp.code );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "id", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_09160
train
T2
v2
Schema: categories (alias: catg)(type, value, amount, date) regions(type, name, status, code) Task: Find amount from categories where a matching record exists in regions with the same status. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = catg.status );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "amount", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_09161
train
T2
v1
Schema: departments (alias: dept)(type, date, status, salary) accounts(amount, id, status, salary) Task: Retrieve code from departments whose status is found in accounts rows where code matches the outer record. SQL:
SELECT code FROM departments AS dept WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.code = dept.code );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "code", "filter_col": "status", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_09162
train
T1
v1
Schema: transactions (alias: txn)(date, id, name, type) managers(name, id, date, amount) Task: Retrieve value from transactions whose code is found in managers rows where level matches the outer record. SQL:
SELECT value FROM transactions AS txn WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.level = txn.level );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_09163
train
T1
v1
Schema: categories (alias: catg)(value, name, id, code) services(salary, level, type, name) Task: Retrieve code from categories whose code is found in services rows where id matches the outer record. SQL:
SELECT code FROM categories AS catg WHERE code IN ( SELECT code FROM services AS srvc WHERE srvc.id = catg.id );
{ "outer_table": "categories", "inner_table": "services", "outer_alias": "catg", "inner_alias": "srvc", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_09164
train
T2
v3
Schema: customers (alias: cust)(amount, code, level, status) warehouses(level, name, code, value) Task: Retrieve code from customers with value above the COUNT(salary) of warehouses rows sharing the same level. SQL:
SELECT code FROM customers AS cust WHERE value > ( SELECT COUNT(salary) FROM warehouses AS whs WHERE whs.level = cust.level );
{ "outer_table": "customers", "inner_table": "warehouses", "outer_alias": "cust", "inner_alias": "whs", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_09165
train
T1
v1
Schema: accounts (alias: acct)(salary, type, code, date) customers(amount, id, code, type) Task: Retrieve id from accounts whose status is found in customers rows where status matches the outer record. SQL:
SELECT id FROM accounts AS acct WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.status = acct.status );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_09166
train
T1
v2
Schema: transactions (alias: txn)(id, level, type, name) requests(salary, name, status, id) Task: Retrieve value from transactions that have at least one corresponding entry in requests sharing the same type. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = txn.type );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "value", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_09167
train
T1
v3
Schema: services (alias: srvc)(date, value, name, code) customers(code, name, value, type) Task: Find id from services where amount exceeds the average amount from customers for the same status. SQL:
SELECT id FROM services AS srvc WHERE amount > ( SELECT SUM(amount) FROM customers AS cust WHERE cust.status = srvc.status );
{ "outer_table": "services", "inner_table": "customers", "outer_alias": "srvc", "inner_alias": "cust", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_09168
train
T2
v1
Schema: products (alias: prod)(value, date, salary, amount) regions(id, name, code, date) Task: Find id from products where id appears in regions entries with matching status. SQL:
SELECT id FROM products AS prod WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.status = prod.status );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "id", "filter_col": "id", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_09169
train
T1
v1
Schema: services (alias: srvc)(name, id, level, status) transactions(salary, status, name, type) Task: Select name from services where status exists in transactions for the same code. SQL:
SELECT name FROM services AS srvc WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.code = srvc.code );
{ "outer_table": "services", "inner_table": "transactions", "outer_alias": "srvc", "inner_alias": "txn", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_09170
train
T2
v1
Schema: shipments (alias: shp)(date, level, salary, value) transactions(salary, id, amount, level) Task: Find value from shipments where level appears in transactions entries with matching status. SQL:
SELECT value FROM shipments AS shp WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.status = shp.status );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "value", "filter_col": "level", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_09171
train
T2
v1
Schema: requests (alias: ordr)(code, value, level, amount) customers(level, status, salary, value) Task: Find salary from requests where code appears in customers entries with matching code. SQL:
SELECT salary FROM requests AS ordr WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.code = ordr.code );
{ "outer_table": "requests", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_09172
train
T2
v3
Schema: sales (alias: sale)(id, code, amount, name) categories(salary, id, level, date) Task: Retrieve amount from sales with value above the MIN(value) of categories rows sharing the same type. SQL:
SELECT amount FROM sales AS sale WHERE value > ( SELECT MIN(value) FROM categories AS catg WHERE catg.type = sale.type );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_09173
train
T1
v1
Schema: customers (alias: cust)(name, amount, level, salary) requests(amount, id, level, salary) Task: Find salary from customers where code appears in requests entries with matching code. SQL:
SELECT salary FROM customers AS cust WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.code = cust.code );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_09174
train
T1
v2
Schema: items (alias: lne)(salary, date, id, code) categories(salary, level, amount, type) Task: Find salary from items where a matching record exists in categories with the same id. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = lne.id );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "salary", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_09175
train
T2
v1
Schema: budgets (alias: budg)(name, date, salary, amount) regions(id, name, status, date) Task: Retrieve code from budgets whose level is found in regions rows where level matches the outer record. SQL:
SELECT code FROM budgets AS budg WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.level = budg.level );
{ "outer_table": "budgets", "inner_table": "regions", "outer_alias": "budg", "inner_alias": "rgn", "proj_col": "code", "filter_col": "level", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_09176
train
T2
v2
Schema: departments (alias: dept)(value, status, type, id) customers(date, name, salary, code) Task: Find salary from departments where a matching record exists in customers with the same level. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = dept.level );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "salary", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_09177
train
T1
v3
Schema: employees (alias: emp)(amount, date, value, name) customers(salary, id, value, status) Task: Find name from employees where amount exceeds the average value from customers for the same type. SQL:
SELECT name FROM employees AS emp WHERE amount > ( SELECT AVG(value) FROM customers AS cust WHERE cust.type = emp.type );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_09178
train
T1
v3
Schema: accounts (alias: acct)(value, type, level, status) categories(id, value, name, level) Task: Retrieve code from accounts with salary above the MIN(salary) of categories rows sharing the same id. SQL:
SELECT code FROM accounts AS acct WHERE salary > ( SELECT MIN(salary) FROM categories AS catg WHERE catg.id = acct.id );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_09179
train
T1
v3
Schema: shipments (alias: shp)(code, value, status, type) budgets(amount, id, value, date) Task: Retrieve salary from shipments with amount above the SUM(salary) of budgets rows sharing the same level. SQL:
SELECT salary FROM shipments AS shp WHERE amount > ( SELECT SUM(salary) FROM budgets AS budg WHERE budg.level = shp.level );
{ "outer_table": "shipments", "inner_table": "budgets", "outer_alias": "shp", "inner_alias": "budg", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_09180
train
T2
v1
Schema: sales (alias: sale)(date, level, amount, name) employees(level, value, status, salary) Task: Retrieve salary from sales whose code is found in employees rows where status matches the outer record. SQL:
SELECT salary FROM sales AS sale WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.status = sale.status );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_09181
train
T1
v3
Schema: schedules (alias: schd)(amount, level, code, name) sales(status, id, value, salary) Task: Retrieve id from schedules with value above the COUNT(salary) of sales rows sharing the same type. SQL:
SELECT id FROM schedules AS schd WHERE value > ( SELECT COUNT(salary) FROM sales AS sale WHERE sale.type = schd.type );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_09182
train
T2
v2
Schema: customers (alias: cust)(date, value, level, salary) regions(name, salary, status, code) Task: Find value from customers where a matching record exists in regions with the same status. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = cust.status );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "value", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_09183
train
T1
v3
Schema: warehouses (alias: whs)(status, type, level, name) accounts(value, type, id, level) Task: Find id from warehouses where amount exceeds the average amount from accounts for the same type. SQL:
SELECT id FROM warehouses AS whs WHERE amount > ( SELECT MIN(amount) FROM accounts AS acct WHERE acct.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "accounts", "outer_alias": "whs", "inner_alias": "acct", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_09184
train
T2
v3
Schema: transactions (alias: txn)(level, amount, date, code) regions(amount, value, date, code) Task: Retrieve id from transactions with value above the SUM(salary) of regions rows sharing the same code. SQL:
SELECT id FROM transactions AS txn WHERE value > ( SELECT SUM(salary) FROM regions AS rgn WHERE rgn.code = txn.code );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_09185
train
T1
v2
Schema: invoices (alias: inv)(date, status, value, code) regions(id, amount, status, code) Task: Retrieve value from invoices that have at least one corresponding entry in regions sharing the same status. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = inv.status );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "value", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_09186
train
T1
v2
Schema: sales (alias: sale)(name, salary, id, code) managers(type, id, status, name) Task: Retrieve salary from sales that have at least one corresponding entry in managers sharing the same level. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = sale.level );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "salary", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_09187
train
T1
v3
Schema: items (alias: lne)(name, value, type, level) schedules(amount, level, date, name) Task: Find name from items where amount exceeds the average salary from schedules for the same type. SQL:
SELECT name FROM items AS lne WHERE amount > ( SELECT COUNT(salary) FROM schedules AS schd WHERE schd.type = lne.type );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_09188
train
T2
v1
Schema: transactions (alias: txn)(status, id, date, level) budgets(code, salary, value, name) Task: Find value from transactions where code appears in budgets entries with matching status. SQL:
SELECT value FROM transactions AS txn WHERE code IN ( SELECT code FROM budgets AS budg WHERE budg.status = txn.status );
{ "outer_table": "transactions", "inner_table": "budgets", "outer_alias": "txn", "inner_alias": "budg", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_09189
train
T1
v3
Schema: managers (alias: mgr)(code, type, value, salary) employees(type, amount, salary, status) Task: Find code from managers where value exceeds the average salary from employees for the same level. SQL:
SELECT code FROM managers AS mgr WHERE value > ( SELECT MAX(salary) FROM employees AS emp WHERE emp.level = mgr.level );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_09190
train
T1
v2
Schema: shipments (alias: shp)(salary, id, level, value) products(value, name, level, status) Task: Retrieve amount from shipments that have at least one corresponding entry in products sharing the same status. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = shp.status );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "amount", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_09191
train
T2
v1
Schema: sales (alias: sale)(value, id, level, name) shipments(value, salary, date, level) Task: Retrieve value from sales whose level is found in shipments rows where code matches the outer record. SQL:
SELECT value FROM sales AS sale WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.code = sale.code );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_09192
train
T1
v2
Schema: services (alias: srvc)(name, level, date, amount) employees(date, salary, type, status) Task: Find name from services where a matching record exists in employees with the same id. SQL:
SELECT name FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = srvc.id );
{ "outer_table": "services", "inner_table": "employees", "outer_alias": "srvc", "inner_alias": "emp", "proj_col": "name", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_09193
train
T2
v2
Schema: shipments (alias: shp)(salary, id, name, type) invoices(date, salary, value, status) Task: Retrieve id from shipments that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = shp.type );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "id", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_09194
train
T2
v2
Schema: customers (alias: cust)(salary, status, date, amount) departments(level, value, date, status) Task: Find amount from customers where a matching record exists in departments with the same code. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = cust.code );
{ "outer_table": "customers", "inner_table": "departments", "outer_alias": "cust", "inner_alias": "dept", "proj_col": "amount", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_09195
train
T1
v2
Schema: orders (alias: ord)(amount, value, id, level) managers(status, salary, value, id) Task: Retrieve amount from orders that have at least one corresponding entry in managers sharing the same status. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = ord.status );
{ "outer_table": "orders", "inner_table": "managers", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "amount", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_09196
train
T1
v1
Schema: accounts (alias: acct)(name, date, amount, id) products(status, code, level, salary) Task: Select name from accounts where type exists in products for the same level. SQL:
SELECT name FROM accounts AS acct WHERE type IN ( SELECT type FROM products AS prod WHERE prod.level = acct.level );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_09197
train
T1
v1
Schema: transactions (alias: txn)(name, level, salary, id) items(id, level, date, code) Task: Retrieve value from transactions whose level is found in items rows where level matches the outer record. SQL:
SELECT value FROM transactions AS txn WHERE level IN ( SELECT level FROM items AS lne WHERE lne.level = txn.level );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_09198
train
T1
v3
Schema: shipments (alias: shp)(level, id, status, value) invoices(value, date, type, level) Task: Retrieve amount from shipments with value above the MIN(salary) of invoices rows sharing the same type. SQL:
SELECT amount FROM shipments AS shp WHERE value > ( SELECT MIN(salary) FROM invoices AS inv WHERE inv.type = shp.type );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_09199
train
T2