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: invoices (alias: inv)(code, name, type, status) shipments(date, name, amount, status) Task: Find code from invoices where salary exceeds the average amount from shipments for the same type. SQL:
SELECT code FROM invoices AS inv WHERE salary > ( SELECT COUNT(amount) FROM shipments AS shp WHERE shp.type = inv.type );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_02200
train
T1
v3
Schema: employees (alias: emp)(value, code, id, date) items(status, id, type, value) Task: Retrieve name from employees with salary above the MAX(amount) of items rows sharing the same type. SQL:
SELECT name FROM employees AS emp WHERE salary > ( SELECT MAX(amount) FROM items AS lne WHERE lne.type = emp.type );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_02201
train
T1
v3
Schema: categories (alias: catg)(value, level, date, status) budgets(value, code, id, date) Task: Find code from categories where salary exceeds the average salary from budgets for the same type. SQL:
SELECT code FROM categories AS catg WHERE salary > ( SELECT AVG(salary) FROM budgets AS budg WHERE budg.type = catg.type );
{ "outer_table": "categories", "inner_table": "budgets", "outer_alias": "catg", "inner_alias": "budg", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_02202
train
T2
v3
Schema: warehouses (alias: whs)(id, code, type, value) requests(name, type, salary, amount) Task: Find amount from warehouses where amount exceeds the average value from requests for the same level. SQL:
SELECT amount FROM warehouses AS whs WHERE amount > ( SELECT SUM(value) FROM requests AS ordr WHERE ordr.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "requests", "outer_alias": "whs", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_02203
train
T2
v1
Schema: customers (alias: cust)(amount, salary, level, id) products(date, type, id, code) Task: Find value from customers where type appears in products entries with matching level. SQL:
SELECT value FROM customers AS cust WHERE type IN ( SELECT type FROM products AS prod WHERE prod.level = cust.level );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_02204
train
T1
v1
Schema: transactions (alias: txn)(name, status, id, type) employees(name, id, code, date) Task: Retrieve salary from transactions whose type is found in employees rows where level matches the outer record. SQL:
SELECT salary FROM transactions AS txn WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.level = txn.level );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "salary", "filter_col": "type", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_02205
train
T1
v2
Schema: employees (alias: emp)(status, code, name, level) services(amount, code, id, name) Task: Retrieve name from employees that have at least one corresponding entry in services sharing the same id. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = emp.id );
{ "outer_table": "employees", "inner_table": "services", "outer_alias": "emp", "inner_alias": "srvc", "proj_col": "name", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_02206
train
T1
v1
Schema: services (alias: srvc)(name, amount, value, date) warehouses(date, level, amount, id) Task: Find name from services where type appears in warehouses entries with matching id. SQL:
SELECT name FROM services AS srvc WHERE type IN ( SELECT type FROM warehouses AS whs WHERE whs.id = srvc.id );
{ "outer_table": "services", "inner_table": "warehouses", "outer_alias": "srvc", "inner_alias": "whs", "proj_col": "name", "filter_col": "type", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_02207
train
T2
v2
Schema: services (alias: srvc)(name, type, status, amount) warehouses(status, id, name, type) Task: Find id from services where a matching record exists in warehouses with the same code. SQL:
SELECT id FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.code = srvc.code );
{ "outer_table": "services", "inner_table": "warehouses", "outer_alias": "srvc", "inner_alias": "whs", "proj_col": "id", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_02208
train
T2
v1
Schema: categories (alias: catg)(status, code, level, amount) budgets(id, code, value, date) Task: Select name from categories where status exists in budgets for the same level. SQL:
SELECT name FROM categories AS catg WHERE status IN ( SELECT status FROM budgets AS budg WHERE budg.level = catg.level );
{ "outer_table": "categories", "inner_table": "budgets", "outer_alias": "catg", "inner_alias": "budg", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_02209
train
T2
v2
Schema: customers (alias: cust)(id, status, salary, date) budgets(level, value, name, id) Task: Find name from customers where a matching record exists in budgets with the same level. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.level = cust.level );
{ "outer_table": "customers", "inner_table": "budgets", "outer_alias": "cust", "inner_alias": "budg", "proj_col": "name", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_02210
train
T1
v2
Schema: managers (alias: mgr)(value, id, name, status) regions(amount, value, status, type) Task: Find code from managers where a matching record exists in regions with the same status. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = mgr.status );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "code", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_02211
train
T1
v3
Schema: items (alias: lne)(code, id, salary, status) accounts(code, status, type, date) Task: Retrieve value from items with value above the SUM(salary) of accounts rows sharing the same status. SQL:
SELECT value FROM items AS lne WHERE value > ( SELECT SUM(salary) FROM accounts AS acct WHERE acct.status = lne.status );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_02212
train
T2
v1
Schema: customers (alias: cust)(code, salary, type, id) warehouses(type, value, amount, status) Task: Find name from customers where status appears in warehouses entries with matching code. SQL:
SELECT name FROM customers AS cust WHERE status IN ( SELECT status FROM warehouses AS whs WHERE whs.code = cust.code );
{ "outer_table": "customers", "inner_table": "warehouses", "outer_alias": "cust", "inner_alias": "whs", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_02213
train
T1
v2
Schema: budgets (alias: budg)(name, code, salary, type) invoices(level, value, date, type) Task: Find amount from budgets where a matching record exists in invoices with the same id. SQL:
SELECT amount FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = budg.id );
{ "outer_table": "budgets", "inner_table": "invoices", "outer_alias": "budg", "inner_alias": "inv", "proj_col": "amount", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_02214
train
T2
v3
Schema: invoices (alias: inv)(name, date, level, amount) accounts(id, level, type, code) Task: Find id from invoices where salary exceeds the average amount from accounts for the same status. SQL:
SELECT id FROM invoices AS inv WHERE salary > ( SELECT COUNT(amount) FROM accounts AS acct WHERE acct.status = inv.status );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_02215
train
T1
v3
Schema: products (alias: prod)(code, status, value, level) requests(code, status, name, value) Task: Find amount from products where value exceeds the average amount from requests for the same status. SQL:
SELECT amount FROM products AS prod WHERE value > ( SELECT AVG(amount) FROM requests AS ordr WHERE ordr.status = prod.status );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_02216
train
T1
v1
Schema: categories (alias: catg)(amount, type, salary, code) schedules(date, code, name, value) Task: Retrieve value from categories whose status is found in schedules rows where level matches the outer record. SQL:
SELECT value FROM categories AS catg WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.level = catg.level );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_02217
train
T2
v2
Schema: employees (alias: emp)(code, id, value, salary) budgets(code, level, name, salary) Task: Find value from employees where a matching record exists in budgets with the same id. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.id = emp.id );
{ "outer_table": "employees", "inner_table": "budgets", "outer_alias": "emp", "inner_alias": "budg", "proj_col": "value", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_02218
train
T1
v3
Schema: shipments (alias: shp)(type, id, value, salary) services(salary, code, status, id) Task: Find value from shipments where amount exceeds the average salary from services for the same status. SQL:
SELECT value FROM shipments AS shp WHERE amount > ( SELECT MIN(salary) FROM services AS srvc WHERE srvc.status = shp.status );
{ "outer_table": "shipments", "inner_table": "services", "outer_alias": "shp", "inner_alias": "srvc", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_02219
train
T2
v1
Schema: services (alias: srvc)(code, salary, date, amount) schedules(date, id, status, type) Task: Retrieve value from services whose level is found in schedules rows where code matches the outer record. SQL:
SELECT value FROM services AS srvc WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.code = srvc.code );
{ "outer_table": "services", "inner_table": "schedules", "outer_alias": "srvc", "inner_alias": "schd", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_02220
train
T2
v3
Schema: accounts (alias: acct)(code, id, date, salary) budgets(salary, code, date, id) Task: Retrieve value from accounts with salary above the AVG(value) of budgets rows sharing the same id. SQL:
SELECT value FROM accounts AS acct WHERE salary > ( SELECT AVG(value) FROM budgets AS budg WHERE budg.id = acct.id );
{ "outer_table": "accounts", "inner_table": "budgets", "outer_alias": "acct", "inner_alias": "budg", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_02221
train
T1
v2
Schema: shipments (alias: shp)(type, value, amount, date) products(salary, status, value, date) Task: Retrieve amount from shipments that have at least one corresponding entry in products sharing the same code. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = shp.code );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "amount", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_02222
train
T2
v1
Schema: employees (alias: emp)(amount, date, status, salary) categories(type, status, name, salary) Task: Find code from employees where code appears in categories entries with matching level. SQL:
SELECT code FROM employees AS emp WHERE code IN ( SELECT code 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": "code", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_02223
train
T1
v3
Schema: orders (alias: ord)(name, type, code, date) categories(value, date, name, id) Task: Find id from orders where amount exceeds the average value from categories for the same type. SQL:
SELECT id FROM orders AS ord WHERE amount > ( SELECT MIN(value) FROM categories AS catg WHERE catg.type = ord.type );
{ "outer_table": "orders", "inner_table": "categories", "outer_alias": "ord", "inner_alias": "catg", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_02224
train
T1
v2
Schema: departments (alias: dept)(date, value, salary, name) services(date, code, name, id) Task: Retrieve value from departments that have at least one corresponding entry in services sharing the same level. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.level = dept.level );
{ "outer_table": "departments", "inner_table": "services", "outer_alias": "dept", "inner_alias": "srvc", "proj_col": "value", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_02225
train
T1
v3
Schema: items (alias: lne)(name, amount, date, status) managers(name, id, type, level) Task: Retrieve code from items with value above the AVG(amount) of managers rows sharing the same type. SQL:
SELECT code FROM items AS lne WHERE value > ( SELECT AVG(amount) FROM managers AS mgr WHERE mgr.type = lne.type );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_02226
train
T2
v2
Schema: requests (alias: ordr)(status, amount, type, name) invoices(name, salary, amount, date) Task: Find id from requests where a matching record exists in invoices with the same status. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = ordr.status );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "id", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_02227
train
T2
v3
Schema: managers (alias: mgr)(status, code, id, date) regions(level, date, type, value) Task: Retrieve salary from managers with value above the COUNT(amount) of regions rows sharing the same code. SQL:
SELECT salary FROM managers AS mgr WHERE value > ( SELECT COUNT(amount) FROM regions AS rgn WHERE rgn.code = mgr.code );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_02228
train
T1
v1
Schema: products (alias: prod)(id, type, amount, date) budgets(date, value, code, name) Task: Retrieve value from products whose status is found in budgets rows where id matches the outer record. SQL:
SELECT value FROM products AS prod WHERE status IN ( SELECT status FROM budgets AS budg WHERE budg.id = prod.id );
{ "outer_table": "products", "inner_table": "budgets", "outer_alias": "prod", "inner_alias": "budg", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_02229
train
T1
v3
Schema: managers (alias: mgr)(status, id, type, level) sales(type, code, amount, salary) Task: Retrieve name from managers with salary above the MAX(salary) of sales rows sharing the same id. SQL:
SELECT name FROM managers AS mgr WHERE salary > ( SELECT MAX(salary) FROM sales AS sale WHERE sale.id = mgr.id );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_02230
train
T1
v3
Schema: budgets (alias: budg)(level, id, code, value) services(value, amount, level, date) Task: Find code from budgets where value exceeds the average amount from services for the same code. SQL:
SELECT code FROM budgets AS budg WHERE value > ( SELECT SUM(amount) FROM services AS srvc WHERE srvc.code = budg.code );
{ "outer_table": "budgets", "inner_table": "services", "outer_alias": "budg", "inner_alias": "srvc", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_02231
train
T2
v3
Schema: products (alias: prod)(code, amount, value, status) schedules(level, value, name, amount) Task: Find id from products where amount exceeds the average amount from schedules for the same status. SQL:
SELECT id FROM products AS prod WHERE amount > ( SELECT MIN(amount) FROM schedules AS schd WHERE schd.status = prod.status );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_02232
train
T1
v2
Schema: items (alias: lne)(salary, status, code, id) requests(value, status, salary, code) Task: Find code from items where a matching record exists in requests with the same status. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = lne.status );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "code", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_02233
train
T2
v1
Schema: services (alias: srvc)(type, level, amount, id) shipments(type, date, value, name) Task: Retrieve amount from services whose type is found in shipments rows where status matches the outer record. SQL:
SELECT amount FROM services AS srvc WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.status = srvc.status );
{ "outer_table": "services", "inner_table": "shipments", "outer_alias": "srvc", "inner_alias": "shp", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_02234
train
T2
v1
Schema: sales (alias: sale)(date, id, status, salary) employees(status, code, level, name) Task: Retrieve name from sales whose type is found in employees rows where type matches the outer record. SQL:
SELECT name FROM sales AS sale WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.type = sale.type );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "name", "filter_col": "type", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_02235
train
T1
v2
Schema: regions (alias: rgn)(level, type, id, date) requests(amount, date, code, level) Task: Find value from regions where a matching record exists in requests with the same level. SQL:
SELECT value FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = rgn.level );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "value", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_02236
train
T2
v3
Schema: transactions (alias: txn)(salary, status, type, date) departments(name, id, value, status) Task: Find name from transactions where amount exceeds the average salary from departments for the same status. SQL:
SELECT name FROM transactions AS txn WHERE amount > ( SELECT AVG(salary) FROM departments AS dept WHERE dept.status = txn.status );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_02237
train
T1
v2
Schema: customers (alias: cust)(amount, level, value, status) invoices(name, date, status, type) Task: Retrieve value from customers that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = cust.id );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "value", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_02238
train
T1
v2
Schema: regions (alias: rgn)(salary, value, status, amount) sales(name, date, level, value) Task: Retrieve salary from regions that have at least one corresponding entry in sales sharing the same id. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = rgn.id );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "salary", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_02239
train
T2
v3
Schema: orders (alias: ord)(id, name, value, code) managers(name, code, value, status) Task: Find value from orders where salary exceeds the average amount from managers for the same level. SQL:
SELECT value FROM orders AS ord WHERE salary > ( SELECT AVG(amount) FROM managers AS mgr WHERE mgr.level = ord.level );
{ "outer_table": "orders", "inner_table": "managers", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_02240
train
T1
v2
Schema: sales (alias: sale)(id, amount, code, type) orders(id, name, type, value) Task: Find code from sales where a matching record exists in orders with the same level. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = sale.level );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "code", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_02241
train
T1
v2
Schema: accounts (alias: acct)(value, name, date, code) departments(status, type, salary, amount) Task: Find id from accounts where a matching record exists in departments with the same status. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = acct.status );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "id", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_02242
train
T1
v1
Schema: regions (alias: rgn)(code, id, amount, type) products(level, value, name, salary) Task: Find value from regions where code appears in products entries with matching level. SQL:
SELECT value FROM regions AS rgn WHERE code IN ( SELECT code FROM products AS prod WHERE prod.level = rgn.level );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_02243
train
T2
v2
Schema: accounts (alias: acct)(amount, status, id, value) services(date, level, type, status) Task: Find salary from accounts where a matching record exists in services with the same id. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = acct.id );
{ "outer_table": "accounts", "inner_table": "services", "outer_alias": "acct", "inner_alias": "srvc", "proj_col": "salary", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_02244
train
T1
v1
Schema: schedules (alias: schd)(name, date, type, value) staff(date, salary, amount, id) Task: Select code from schedules where id exists in staff for the same level. SQL:
SELECT code FROM schedules AS schd WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.level = schd.level );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "code", "filter_col": "id", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_02245
train
T2
v1
Schema: accounts (alias: acct)(name, level, status, code) customers(value, salary, status, code) Task: Find salary from accounts where level appears in customers entries with matching level. SQL:
SELECT salary FROM accounts AS acct WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.level = acct.level );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "salary", "filter_col": "level", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_02246
train
T1
v1
Schema: shipments (alias: shp)(amount, level, value, type) items(value, name, date, type) Task: Retrieve name from shipments whose code is found in items rows where code matches the outer record. SQL:
SELECT name FROM shipments AS shp WHERE code IN ( SELECT code FROM items AS lne WHERE lne.code = shp.code );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_02247
train
T2
v3
Schema: products (alias: prod)(status, value, type, salary) categories(date, code, value, salary) Task: Find salary from products where value exceeds the average value from categories for the same id. SQL:
SELECT salary FROM products AS prod WHERE value > ( SELECT MIN(value) FROM categories AS catg WHERE catg.id = prod.id );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_02248
train
T1
v1
Schema: schedules (alias: schd)(date, salary, amount, status) items(code, name, level, value) Task: Find name from schedules where code appears in items entries with matching type. SQL:
SELECT name FROM schedules AS schd WHERE code IN ( SELECT code FROM items AS lne WHERE lne.type = schd.type );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "name", "filter_col": "code", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_02249
train
T2
v3
Schema: schedules (alias: schd)(level, status, id, amount) services(code, status, value, amount) Task: Retrieve code from schedules with amount above the MAX(salary) of services rows sharing the same level. SQL:
SELECT code FROM schedules AS schd WHERE amount > ( SELECT MAX(salary) FROM services AS srvc WHERE srvc.level = schd.level );
{ "outer_table": "schedules", "inner_table": "services", "outer_alias": "schd", "inner_alias": "srvc", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_02250
train
T2
v1
Schema: transactions (alias: txn)(name, value, level, salary) customers(amount, value, date, type) Task: Select salary from transactions where status exists in customers for the same level. SQL:
SELECT salary FROM transactions AS txn WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.level = txn.level );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_02251
train
T1
v2
Schema: staff (alias: empl)(name, salary, level, value) regions(type, date, level, status) Task: Find code from staff where a matching record exists in regions with the same type. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = empl.type );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "code", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_02252
train
T2
v3
Schema: orders (alias: ord)(name, type, salary, id) requests(salary, code, type, amount) Task: Retrieve value from orders with salary above the SUM(salary) of requests rows sharing the same status. SQL:
SELECT value FROM orders AS ord WHERE salary > ( SELECT SUM(salary) FROM requests AS ordr WHERE ordr.status = ord.status );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_02253
train
T1
v3
Schema: employees (alias: emp)(status, amount, id, salary) customers(name, code, value, id) Task: Retrieve amount from employees with amount above the MAX(amount) of customers rows sharing the same id. SQL:
SELECT amount FROM employees AS emp WHERE amount > ( SELECT MAX(amount) FROM customers AS cust WHERE cust.id = emp.id );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_02254
train
T1
v1
Schema: accounts (alias: acct)(amount, code, name, value) items(code, type, date, status) Task: Find code from accounts where status appears in items entries with matching id. SQL:
SELECT code FROM accounts AS acct WHERE status IN ( SELECT status FROM items AS lne WHERE lne.id = acct.id );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_02255
train
T1
v1
Schema: categories (alias: catg)(status, amount, level, value) orders(status, code, type, level) Task: Retrieve code from categories whose id is found in orders rows where status matches the outer record. SQL:
SELECT code 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": "code", "filter_col": "id", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_02256
train
T2
v1
Schema: accounts (alias: acct)(id, date, code, type) departments(value, level, name, status) Task: Retrieve amount from accounts whose status is found in departments rows where code matches the outer record. SQL:
SELECT amount FROM accounts AS acct WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.code = acct.code );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "amount", "filter_col": "status", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_02257
train
T1
v1
Schema: budgets (alias: budg)(salary, status, code, type) requests(level, id, code, name) Task: Find code from budgets where level appears in requests entries with matching level. SQL:
SELECT code FROM budgets AS budg WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.level = budg.level );
{ "outer_table": "budgets", "inner_table": "requests", "outer_alias": "budg", "inner_alias": "ordr", "proj_col": "code", "filter_col": "level", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_02258
train
T2
v2
Schema: regions (alias: rgn)(status, value, name, type) shipments(value, code, amount, type) Task: Retrieve id from regions that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = rgn.status );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "id", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_02259
train
T2
v2
Schema: items (alias: lne)(level, date, value, code) customers(name, amount, code, level) Task: Retrieve id from items that have at least one corresponding entry in customers sharing the same id. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = lne.id );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "id", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_02260
train
T2
v3
Schema: items (alias: lne)(salary, date, id, name) employees(status, code, amount, id) Task: Retrieve amount from items with value above the SUM(amount) of employees rows sharing the same id. SQL:
SELECT amount FROM items AS lne WHERE value > ( SELECT SUM(amount) FROM employees AS emp WHERE emp.id = lne.id );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_02261
train
T2
v2
Schema: employees (alias: emp)(value, id, amount, level) orders(id, value, code, salary) Task: Retrieve id from employees that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = emp.code );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "id", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_02262
train
T1
v1
Schema: categories (alias: catg)(status, salary, name, amount) warehouses(id, name, code, value) Task: Retrieve id from categories whose status is found in warehouses rows where type matches the outer record. SQL:
SELECT id FROM categories AS catg WHERE status IN ( SELECT status FROM warehouses AS whs WHERE whs.type = catg.type );
{ "outer_table": "categories", "inner_table": "warehouses", "outer_alias": "catg", "inner_alias": "whs", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_02263
train
T2
v3
Schema: sales (alias: sale)(id, status, type, level) departments(date, id, salary, code) Task: Retrieve salary from sales with amount above the SUM(amount) of departments rows sharing the same status. SQL:
SELECT salary FROM sales AS sale WHERE amount > ( SELECT SUM(amount) FROM departments AS dept WHERE dept.status = sale.status );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_02264
train
T1
v3
Schema: accounts (alias: acct)(value, salary, status, type) regions(type, salary, amount, status) Task: Find amount from accounts where amount exceeds the average value from regions for the same code. SQL:
SELECT amount FROM accounts AS acct WHERE amount > ( SELECT AVG(value) FROM regions AS rgn WHERE rgn.code = acct.code );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_02265
train
T1
v3
Schema: regions (alias: rgn)(id, salary, status, level) employees(amount, type, id, status) Task: Retrieve value from regions with value above the MIN(value) of employees rows sharing the same code. SQL:
SELECT value FROM regions AS rgn WHERE value > ( SELECT MIN(value) FROM employees AS emp WHERE emp.code = rgn.code );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_02266
train
T2
v2
Schema: staff (alias: empl)(salary, status, id, date) schedules(id, date, salary, code) Task: Find code from staff where a matching record exists in schedules with the same status. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = empl.status );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "code", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_02267
train
T2
v3
Schema: departments (alias: dept)(salary, amount, code, status) schedules(date, amount, value, name) Task: Retrieve salary from departments with salary above the AVG(salary) of schedules rows sharing the same code. SQL:
SELECT salary FROM departments AS dept WHERE salary > ( SELECT AVG(salary) FROM schedules AS schd WHERE schd.code = dept.code );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_02268
train
T1
v1
Schema: transactions (alias: txn)(status, code, name, type) invoices(name, code, status, salary) Task: Retrieve amount from transactions whose id is found in invoices rows where type matches the outer record. SQL:
SELECT amount FROM transactions AS txn WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.type = txn.type );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_02269
train
T1
v3
Schema: schedules (alias: schd)(code, id, salary, type) sales(type, name, status, level) Task: Find code from schedules where salary exceeds the average value from sales for the same status. SQL:
SELECT code FROM schedules AS schd WHERE salary > ( SELECT MIN(value) FROM sales AS sale WHERE sale.status = schd.status );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_02270
train
T2
v1
Schema: orders (alias: ord)(salary, value, name, id) items(value, amount, salary, type) Task: Select value from orders where status exists in items for the same status. SQL:
SELECT value FROM orders AS ord WHERE status IN ( SELECT status FROM items AS lne WHERE lne.status = ord.status );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_02271
train
T1
v2
Schema: items (alias: lne)(code, level, amount, status) schedules(date, status, name, value) Task: Find value from items where a matching record exists in schedules with the same level. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = lne.level );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "value", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_02272
train
T2
v2
Schema: customers (alias: cust)(name, salary, level, code) warehouses(level, status, salary, name) Task: Retrieve value from customers that have at least one corresponding entry in warehouses sharing the same type. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.type = cust.type );
{ "outer_table": "customers", "inner_table": "warehouses", "outer_alias": "cust", "inner_alias": "whs", "proj_col": "value", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_02273
train
T1
v3
Schema: requests (alias: ordr)(status, level, type, name) categories(type, level, date, id) Task: Find value from requests where salary exceeds the average value from categories for the same status. SQL:
SELECT value FROM requests AS ordr WHERE salary > ( SELECT AVG(value) FROM categories AS catg WHERE catg.status = ordr.status );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_02274
train
T2
v1
Schema: categories (alias: catg)(id, code, name, date) requests(status, level, type, code) Task: Select value from categories where type exists in requests for the same type. SQL:
SELECT value FROM categories AS catg WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.type = catg.type );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "value", "filter_col": "type", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_02275
train
T2
v1
Schema: warehouses (alias: whs)(value, status, salary, id) schedules(date, type, code, value) Task: Find id from warehouses where type appears in schedules entries with matching code. SQL:
SELECT id FROM warehouses AS whs WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "schedules", "outer_alias": "whs", "inner_alias": "schd", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_02276
train
T2
v1
Schema: schedules (alias: schd)(type, date, salary, status) invoices(salary, amount, name, code) Task: Find amount from schedules where code appears in invoices entries with matching level. SQL:
SELECT amount FROM schedules AS schd WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.level = schd.level );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_02277
train
T2
v2
Schema: schedules (alias: schd)(code, value, date, name) accounts(id, value, name, amount) Task: Find value from schedules where a matching record exists in accounts with the same status. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = schd.status );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "value", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_02278
train
T2
v2
Schema: staff (alias: empl)(level, amount, date, value) accounts(status, code, id, value) Task: Find value from staff where a matching record exists in accounts with the same id. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = empl.id );
{ "outer_table": "staff", "inner_table": "accounts", "outer_alias": "empl", "inner_alias": "acct", "proj_col": "value", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_02279
train
T2
v1
Schema: transactions (alias: txn)(name, status, amount, value) items(date, id, code, amount) Task: Find code from transactions where type appears in items entries with matching status. SQL:
SELECT code FROM transactions AS txn WHERE type IN ( SELECT type FROM items AS lne WHERE lne.status = txn.status );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_02280
train
T1
v1
Schema: orders (alias: ord)(name, type, amount, value) regions(name, type, code, value) Task: Retrieve code from orders whose status is found in regions rows where type matches the outer record. SQL:
SELECT code FROM orders AS ord WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.type = ord.type );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_02281
train
T1
v1
Schema: products (alias: prod)(date, amount, status, code) schedules(id, salary, status, date) Task: Find value from products where type appears in schedules entries with matching status. SQL:
SELECT value FROM products AS prod WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.status = prod.status );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_02282
train
T1
v2
Schema: products (alias: prod)(value, code, date, type) budgets(level, value, code, type) Task: Find name from products where a matching record exists in budgets with the same level. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.level = prod.level );
{ "outer_table": "products", "inner_table": "budgets", "outer_alias": "prod", "inner_alias": "budg", "proj_col": "name", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_02283
train
T1
v3
Schema: sales (alias: sale)(date, salary, code, amount) products(id, date, amount, salary) Task: Find code from sales where amount exceeds the average amount from products for the same type. SQL:
SELECT code FROM sales AS sale WHERE amount > ( SELECT MIN(amount) FROM products AS prod WHERE prod.type = sale.type );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_02284
train
T1
v3
Schema: employees (alias: emp)(salary, type, status, date) schedules(code, date, level, amount) Task: Find name from employees where value exceeds the average value from schedules for the same type. SQL:
SELECT name FROM employees AS emp WHERE value > ( SELECT MAX(value) FROM schedules AS schd WHERE schd.type = emp.type );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_02285
train
T1
v3
Schema: invoices (alias: inv)(code, type, date, name) shipments(level, id, amount, value) Task: Retrieve code from invoices with value above the SUM(salary) of shipments rows sharing the same type. SQL:
SELECT code FROM invoices AS inv WHERE value > ( SELECT SUM(salary) FROM shipments AS shp WHERE shp.type = inv.type );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_02286
train
T1
v1
Schema: invoices (alias: inv)(value, code, status, name) shipments(type, name, amount, date) Task: Select value from invoices where id exists in shipments for the same level. SQL:
SELECT value FROM invoices AS inv WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.level = inv.level );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_02287
train
T1
v3
Schema: regions (alias: rgn)(date, status, value, id) requests(type, status, salary, value) Task: Retrieve amount from regions with value above the MAX(salary) of requests rows sharing the same type. SQL:
SELECT amount FROM regions AS rgn WHERE value > ( SELECT MAX(salary) FROM requests AS ordr WHERE ordr.type = rgn.type );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_02288
train
T2
v1
Schema: orders (alias: ord)(type, level, code, value) employees(code, amount, value, id) Task: Select value from orders where id exists in employees for the same id. SQL:
SELECT value FROM orders AS ord WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.id = ord.id );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_02289
train
T1
v3
Schema: employees (alias: emp)(status, name, amount, type) managers(value, id, date, code) Task: Retrieve code from employees with amount above the SUM(amount) of managers rows sharing the same status. SQL:
SELECT code FROM employees AS emp WHERE amount > ( SELECT SUM(amount) FROM managers AS mgr WHERE mgr.status = emp.status );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_02290
train
T1
v2
Schema: accounts (alias: acct)(status, type, salary, amount) sales(code, type, name, value) Task: Retrieve amount from accounts that have at least one corresponding entry in sales sharing the same code. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = acct.code );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "amount", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_02291
train
T1
v3
Schema: invoices (alias: inv)(level, type, id, amount) services(status, id, salary, amount) Task: Retrieve value from invoices with amount above the COUNT(salary) of services rows sharing the same id. SQL:
SELECT value FROM invoices AS inv WHERE amount > ( SELECT COUNT(salary) FROM services AS srvc WHERE srvc.id = inv.id );
{ "outer_table": "invoices", "inner_table": "services", "outer_alias": "inv", "inner_alias": "srvc", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_02292
train
T1
v3
Schema: customers (alias: cust)(code, salary, value, id) services(type, status, level, amount) Task: Retrieve amount from customers with value above the AVG(amount) of services rows sharing the same type. SQL:
SELECT amount FROM customers AS cust WHERE value > ( SELECT AVG(amount) FROM services AS srvc WHERE srvc.type = cust.type );
{ "outer_table": "customers", "inner_table": "services", "outer_alias": "cust", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_02293
train
T1
v1
Schema: products (alias: prod)(salary, amount, id, date) accounts(status, date, name, code) Task: Retrieve name from products whose type is found in accounts rows where code matches the outer record. SQL:
SELECT name FROM products AS prod WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.code = prod.code );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_02294
train
T1
v2
Schema: staff (alias: empl)(status, amount, name, code) customers(id, code, date, type) Task: Retrieve salary from staff that have at least one corresponding entry in customers sharing the same status. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = empl.status );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "salary", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_02295
train
T2
v1
Schema: employees (alias: emp)(salary, status, id, date) sales(date, value, type, salary) Task: Find value from employees where status appears in sales entries with matching type. SQL:
SELECT value FROM employees AS emp WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.type = emp.type );
{ "outer_table": "employees", "inner_table": "sales", "outer_alias": "emp", "inner_alias": "sale", "proj_col": "value", "filter_col": "status", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_02296
train
T1
v1
Schema: orders (alias: ord)(id, level, type, value) budgets(status, amount, type, level) Task: Find amount from orders where level appears in budgets entries with matching code. SQL:
SELECT amount FROM orders AS ord WHERE level IN ( SELECT level FROM budgets AS budg WHERE budg.code = ord.code );
{ "outer_table": "orders", "inner_table": "budgets", "outer_alias": "ord", "inner_alias": "budg", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_02297
train
T1
v1
Schema: budgets (alias: budg)(amount, name, date, type) invoices(salary, date, amount, code) Task: Find id from budgets where level appears in invoices entries with matching status. SQL:
SELECT id FROM budgets AS budg WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.status = budg.status );
{ "outer_table": "budgets", "inner_table": "invoices", "outer_alias": "budg", "inner_alias": "inv", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_02298
train
T2
v3
Schema: warehouses (alias: whs)(salary, id, status, level) categories(code, salary, id, date) Task: Retrieve name from warehouses with value above the AVG(salary) of categories rows sharing the same type. SQL:
SELECT name FROM warehouses AS whs WHERE value > ( SELECT AVG(salary) FROM categories AS catg WHERE catg.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "categories", "outer_alias": "whs", "inner_alias": "catg", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_02299
train
T2