variant
stringclasses
3 values
prompt
stringlengths
163
237
sql
stringlengths
103
143
metadata
unknown
id
stringlengths
21
21
split
stringclasses
1 value
token_group
stringclasses
2 values
v2
Schema: items (alias: lne)(name, id, level, salary) staff(salary, level, name, status) Task: Retrieve amount from items that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = lne.type );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "amount", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_08400
train
T2
v1
Schema: budgets (alias: budg)(amount, name, id, date) invoices(name, salary, type, status) Task: Select code from budgets where status exists in invoices for the same status. SQL:
SELECT code FROM budgets AS budg WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.status = budg.status );
{ "outer_table": "budgets", "inner_table": "invoices", "outer_alias": "budg", "inner_alias": "inv", "proj_col": "code", "filter_col": "status", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_08401
train
T2
v3
Schema: managers (alias: mgr)(level, date, name, value) items(salary, status, code, id) Task: Retrieve name from managers with value above the AVG(amount) of items rows sharing the same type. SQL:
SELECT name FROM managers AS mgr WHERE value > ( SELECT AVG(amount) FROM items AS lne WHERE lne.type = mgr.type );
{ "outer_table": "managers", "inner_table": "items", "outer_alias": "mgr", "inner_alias": "lne", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_08402
train
T1
v2
Schema: budgets (alias: budg)(name, type, amount, date) items(code, date, type, id) Task: Find name from budgets where a matching record exists in items with the same id. SQL:
SELECT name FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.id = budg.id );
{ "outer_table": "budgets", "inner_table": "items", "outer_alias": "budg", "inner_alias": "lne", "proj_col": "name", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_08403
train
T2
v3
Schema: employees (alias: emp)(status, id, level, amount) invoices(amount, code, type, name) Task: Find id from employees where salary exceeds the average salary from invoices for the same status. SQL:
SELECT id FROM employees AS emp WHERE salary > ( SELECT MAX(salary) FROM invoices AS inv WHERE inv.status = emp.status );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_08404
train
T1
v3
Schema: sales (alias: sale)(amount, code, date, type) departments(id, level, status, name) Task: Retrieve name from sales with value above the COUNT(salary) of departments rows sharing the same status. SQL:
SELECT name FROM sales AS sale WHERE value > ( SELECT COUNT(salary) FROM departments AS dept WHERE dept.status = sale.status );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_08405
train
T1
v3
Schema: accounts (alias: acct)(amount, value, id, level) products(date, value, name, level) Task: Retrieve id from accounts with salary above the COUNT(value) of products rows sharing the same status. SQL:
SELECT id FROM accounts AS acct WHERE salary > ( SELECT COUNT(value) FROM products AS prod WHERE prod.status = acct.status );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_08406
train
T1
v2
Schema: customers (alias: cust)(date, name, salary, status) managers(status, level, value, type) Task: Find value from customers where a matching record exists in managers with the same type. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = cust.type );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "value", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_08407
train
T1
v2
Schema: schedules (alias: schd)(status, salary, level, id) transactions(id, status, date, amount) Task: Retrieve value from schedules that have at least one corresponding entry in transactions sharing the same level. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = schd.level );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "value", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_08408
train
T2
v3
Schema: orders (alias: ord)(status, value, level, type) accounts(value, amount, name, id) Task: Retrieve code from orders with amount above the SUM(value) of accounts rows sharing the same level. SQL:
SELECT code FROM orders AS ord WHERE amount > ( SELECT SUM(value) FROM accounts AS acct WHERE acct.level = ord.level );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_08409
train
T1
v3
Schema: services (alias: srvc)(code, level, id, salary) requests(amount, date, value, code) Task: Retrieve id from services with salary above the AVG(value) of requests rows sharing the same status. SQL:
SELECT id FROM services AS srvc WHERE salary > ( SELECT AVG(value) FROM requests AS ordr WHERE ordr.status = srvc.status );
{ "outer_table": "services", "inner_table": "requests", "outer_alias": "srvc", "inner_alias": "ordr", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_08410
train
T2
v1
Schema: staff (alias: empl)(level, id, salary, value) invoices(level, date, status, code) Task: Retrieve salary from staff whose id is found in invoices rows where status matches the outer record. SQL:
SELECT salary FROM staff AS empl WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.status = empl.status );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_08411
train
T2
v3
Schema: products (alias: prod)(id, name, amount, date) departments(salary, status, id, date) Task: Retrieve value from products with value above the MAX(salary) of departments rows sharing the same level. SQL:
SELECT value FROM products AS prod WHERE value > ( SELECT MAX(salary) FROM departments AS dept WHERE dept.level = prod.level );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_08412
train
T1
v3
Schema: services (alias: srvc)(id, type, value, status) sales(code, status, date, salary) Task: Retrieve id from services with salary above the COUNT(value) of sales rows sharing the same type. SQL:
SELECT id FROM services AS srvc WHERE salary > ( SELECT COUNT(value) FROM sales AS sale WHERE sale.type = srvc.type );
{ "outer_table": "services", "inner_table": "sales", "outer_alias": "srvc", "inner_alias": "sale", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_08413
train
T2
v1
Schema: departments (alias: dept)(status, date, id, name) categories(code, type, id, name) Task: Select code from departments where level exists in categories for the same level. SQL:
SELECT code FROM departments AS dept WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.level = dept.level );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "code", "filter_col": "level", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_08414
train
T1
v2
Schema: customers (alias: cust)(id, status, level, salary) transactions(value, name, level, date) Task: Retrieve amount from customers that have at least one corresponding entry in transactions sharing the same id. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = cust.id );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "amount", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_08415
train
T1
v3
Schema: customers (alias: cust)(status, code, id, date) requests(level, value, code, status) Task: Find amount from customers where salary exceeds the average amount from requests for the same id. SQL:
SELECT amount FROM customers AS cust WHERE salary > ( SELECT SUM(amount) FROM requests AS ordr WHERE ordr.id = cust.id );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_08416
train
T1
v3
Schema: transactions (alias: txn)(name, value, salary, level) invoices(code, date, level, status) Task: Retrieve name from transactions with value above the SUM(amount) of invoices rows sharing the same id. SQL:
SELECT name FROM transactions AS txn WHERE value > ( SELECT SUM(amount) FROM invoices AS inv WHERE inv.id = txn.id );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_08417
train
T1
v3
Schema: services (alias: srvc)(name, date, level, code) staff(type, status, id, value) Task: Retrieve amount from services with value above the MIN(amount) of staff rows sharing the same id. SQL:
SELECT amount FROM services AS srvc WHERE value > ( SELECT MIN(amount) FROM staff AS empl WHERE empl.id = srvc.id );
{ "outer_table": "services", "inner_table": "staff", "outer_alias": "srvc", "inner_alias": "empl", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_08418
train
T2
v2
Schema: customers (alias: cust)(salary, code, level, amount) services(salary, status, amount, name) Task: Retrieve amount from customers that have at least one corresponding entry in services sharing the same type. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.type = cust.type );
{ "outer_table": "customers", "inner_table": "services", "outer_alias": "cust", "inner_alias": "srvc", "proj_col": "amount", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_08419
train
T1
v3
Schema: sales (alias: sale)(id, salary, date, value) invoices(name, type, id, salary) Task: Find value from sales where value exceeds the average value from invoices for the same code. SQL:
SELECT value FROM sales AS sale WHERE value > ( SELECT SUM(value) FROM invoices AS inv WHERE inv.code = sale.code );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_08420
train
T1
v3
Schema: regions (alias: rgn)(name, value, amount, status) shipments(level, salary, type, value) Task: Find id from regions where amount exceeds the average amount from shipments for the same level. SQL:
SELECT id FROM regions AS rgn WHERE amount > ( SELECT COUNT(amount) FROM shipments AS shp WHERE shp.level = rgn.level );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_08421
train
T2
v2
Schema: invoices (alias: inv)(salary, level, amount, code) products(id, date, amount, name) Task: Find code from invoices where a matching record exists in products with the same type. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = inv.type );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_08422
train
T1
v3
Schema: departments (alias: dept)(id, status, code, date) managers(name, salary, id, type) Task: Find value from departments where salary exceeds the average salary from managers for the same type. SQL:
SELECT value FROM departments AS dept WHERE salary > ( SELECT AVG(salary) FROM managers AS mgr WHERE mgr.type = dept.type );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_08423
train
T1
v3
Schema: services (alias: srvc)(type, salary, code, name) shipments(type, code, level, id) Task: Retrieve salary from services with salary above the COUNT(salary) of shipments rows sharing the same id. SQL:
SELECT salary FROM services AS srvc WHERE salary > ( SELECT COUNT(salary) FROM shipments AS shp WHERE shp.id = srvc.id );
{ "outer_table": "services", "inner_table": "shipments", "outer_alias": "srvc", "inner_alias": "shp", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_08424
train
T2
v3
Schema: budgets (alias: budg)(salary, status, code, name) categories(name, date, status, code) Task: Retrieve code from budgets with amount above the AVG(salary) of categories rows sharing the same type. SQL:
SELECT code FROM budgets AS budg WHERE amount > ( SELECT AVG(salary) FROM categories AS catg WHERE catg.type = budg.type );
{ "outer_table": "budgets", "inner_table": "categories", "outer_alias": "budg", "inner_alias": "catg", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_08425
train
T2
v3
Schema: budgets (alias: budg)(level, status, salary, value) customers(level, value, code, salary) Task: Retrieve code from budgets with value above the SUM(value) of customers rows sharing the same code. SQL:
SELECT code FROM budgets AS budg WHERE value > ( SELECT SUM(value) FROM customers AS cust WHERE cust.code = budg.code );
{ "outer_table": "budgets", "inner_table": "customers", "outer_alias": "budg", "inner_alias": "cust", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_08426
train
T2
v3
Schema: employees (alias: emp)(type, amount, status, name) customers(name, salary, value, id) Task: Find salary from employees where salary exceeds the average amount from customers for the same status. SQL:
SELECT salary FROM employees AS emp WHERE salary > ( SELECT MAX(amount) FROM customers AS cust WHERE cust.status = emp.status );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_08427
train
T1
v3
Schema: orders (alias: ord)(status, code, id, name) staff(code, date, type, name) Task: Retrieve code from orders with value above the SUM(salary) of staff rows sharing the same type. SQL:
SELECT code FROM orders AS ord WHERE value > ( SELECT SUM(salary) FROM staff AS empl WHERE empl.type = ord.type );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_08428
train
T1
v2
Schema: departments (alias: dept)(code, id, type, level) staff(name, id, amount, code) Task: Retrieve value from departments that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = dept.status );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "value", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_08429
train
T1
v2
Schema: requests (alias: ordr)(salary, amount, code, id) employees(date, salary, amount, value) Task: Find name from requests where a matching record exists in employees with the same status. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = ordr.status );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "name", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_08430
train
T2
v2
Schema: requests (alias: ordr)(name, code, type, salary) staff(status, level, amount, name) Task: Find amount from requests where a matching record exists in staff with the same type. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = ordr.type );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "amount", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_08431
train
T2
v3
Schema: items (alias: lne)(id, amount, date, level) sales(code, date, id, salary) Task: Find name from items where amount exceeds the average value from sales for the same type. SQL:
SELECT name FROM items AS lne WHERE amount > ( SELECT SUM(value) FROM sales AS sale WHERE sale.type = lne.type );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_08432
train
T2
v2
Schema: sales (alias: sale)(date, code, status, type) employees(name, level, id, salary) Task: Retrieve amount from sales that have at least one corresponding entry in employees sharing the same type. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = sale.type );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "amount", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_08433
train
T1
v1
Schema: items (alias: lne)(salary, code, status, name) departments(salary, amount, name, level) Task: Find name from items where id appears in departments entries with matching id. SQL:
SELECT name FROM items AS lne WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.id = lne.id );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "name", "filter_col": "id", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_08434
train
T2
v1
Schema: items (alias: lne)(level, salary, name, date) accounts(salary, id, name, type) Task: Find id from items where status appears in accounts entries with matching status. SQL:
SELECT id FROM items AS lne WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.status = lne.status );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_08435
train
T2
v3
Schema: sales (alias: sale)(name, level, code, type) categories(level, status, value, type) Task: Retrieve code from sales with amount above the AVG(amount) of categories rows sharing the same type. SQL:
SELECT code FROM sales AS sale WHERE amount > ( SELECT AVG(amount) FROM categories AS catg WHERE catg.type = sale.type );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_08436
train
T1
v3
Schema: services (alias: srvc)(date, value, level, name) budgets(type, status, name, amount) Task: Find amount from services where value exceeds the average value from budgets for the same type. SQL:
SELECT amount FROM services AS srvc WHERE value > ( SELECT MAX(value) FROM budgets AS budg WHERE budg.type = srvc.type );
{ "outer_table": "services", "inner_table": "budgets", "outer_alias": "srvc", "inner_alias": "budg", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_08437
train
T2
v3
Schema: services (alias: srvc)(date, salary, value, amount) accounts(id, code, status, name) Task: Retrieve amount from services with amount above the MAX(value) of accounts rows sharing the same id. SQL:
SELECT amount FROM services AS srvc WHERE amount > ( SELECT MAX(value) FROM accounts AS acct WHERE acct.id = srvc.id );
{ "outer_table": "services", "inner_table": "accounts", "outer_alias": "srvc", "inner_alias": "acct", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_08438
train
T2
v3
Schema: schedules (alias: schd)(code, status, id, salary) requests(name, id, code, level) Task: Retrieve salary from schedules with amount above the AVG(salary) of requests rows sharing the same id. SQL:
SELECT salary FROM schedules AS schd WHERE amount > ( SELECT AVG(salary) FROM requests AS ordr WHERE ordr.id = schd.id );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_08439
train
T2
v1
Schema: categories (alias: catg)(status, id, name, value) services(salary, value, type, code) Task: Find id from categories where code appears in services entries with matching id. SQL:
SELECT id 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": "id", "filter_col": "code", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_08440
train
T2
v3
Schema: requests (alias: ordr)(value, date, id, status) schedules(type, amount, value, date) Task: Retrieve code from requests with amount above the SUM(salary) of schedules rows sharing the same status. SQL:
SELECT code FROM requests AS ordr WHERE amount > ( SELECT SUM(salary) FROM schedules AS schd WHERE schd.status = ordr.status );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_08441
train
T2
v2
Schema: staff (alias: empl)(amount, status, code, value) customers(type, value, date, name) Task: Retrieve name from staff that have at least one corresponding entry in customers sharing the same id. SQL:
SELECT name FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = empl.id );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "name", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_08442
train
T2
v3
Schema: schedules (alias: schd)(type, name, level, amount) items(name, code, value, date) Task: Find value from schedules where value exceeds the average value from items for the same level. SQL:
SELECT value FROM schedules AS schd WHERE value > ( SELECT COUNT(value) FROM items AS lne WHERE lne.level = schd.level );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_08443
train
T2
v3
Schema: budgets (alias: budg)(amount, name, salary, type) employees(level, salary, status, type) Task: Retrieve amount from budgets with salary above the MIN(salary) of employees rows sharing the same id. SQL:
SELECT amount FROM budgets AS budg WHERE salary > ( SELECT MIN(salary) FROM employees AS emp WHERE emp.id = budg.id );
{ "outer_table": "budgets", "inner_table": "employees", "outer_alias": "budg", "inner_alias": "emp", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_08444
train
T2
v2
Schema: transactions (alias: txn)(level, code, id, salary) sales(name, type, value, status) Task: Find code from transactions where a matching record exists in sales with the same type. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = txn.type );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "code", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_08445
train
T1
v2
Schema: invoices (alias: inv)(amount, id, salary, value) schedules(code, name, id, status) Task: Find code from invoices where a matching record exists in schedules with the same status. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = inv.status );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "code", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_08446
train
T1
v3
Schema: categories (alias: catg)(date, amount, code, value) departments(date, id, salary, level) Task: Retrieve salary from categories with salary above the AVG(salary) of departments rows sharing the same code. SQL:
SELECT salary FROM categories AS catg WHERE salary > ( SELECT AVG(salary) FROM departments AS dept WHERE dept.code = catg.code );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_08447
train
T2
v1
Schema: warehouses (alias: whs)(name, status, level, code) departments(salary, level, type, value) Task: Select name from warehouses where id exists in departments for the same level. SQL:
SELECT name FROM warehouses AS whs WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "departments", "outer_alias": "whs", "inner_alias": "dept", "proj_col": "name", "filter_col": "id", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_08448
train
T2
v2
Schema: items (alias: lne)(code, salary, date, id) services(code, date, salary, amount) Task: Retrieve name from items that have at least one corresponding entry in services sharing the same id. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = lne.id );
{ "outer_table": "items", "inner_table": "services", "outer_alias": "lne", "inner_alias": "srvc", "proj_col": "name", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_08449
train
T2
v3
Schema: budgets (alias: budg)(date, amount, code, name) shipments(value, salary, code, type) Task: Retrieve salary from budgets with salary above the SUM(amount) of shipments rows sharing the same status. SQL:
SELECT salary FROM budgets AS budg WHERE salary > ( SELECT SUM(amount) FROM shipments AS shp WHERE shp.status = budg.status );
{ "outer_table": "budgets", "inner_table": "shipments", "outer_alias": "budg", "inner_alias": "shp", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_08450
train
T2
v2
Schema: budgets (alias: budg)(date, status, level, salary) categories(amount, id, salary, type) Task: Retrieve code from budgets that have at least one corresponding entry in categories sharing the same status. SQL:
SELECT code FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = budg.status );
{ "outer_table": "budgets", "inner_table": "categories", "outer_alias": "budg", "inner_alias": "catg", "proj_col": "code", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_08451
train
T2
v3
Schema: employees (alias: emp)(date, salary, amount, id) categories(salary, date, amount, name) Task: Retrieve id from employees with value above the MIN(value) of categories rows sharing the same type. SQL:
SELECT id FROM employees AS emp WHERE value > ( SELECT MIN(value) FROM categories AS catg WHERE catg.type = emp.type );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_08452
train
T1
v1
Schema: orders (alias: ord)(id, status, code, date) managers(level, amount, value, code) Task: Select id from orders where level exists in managers for the same code. SQL:
SELECT id FROM orders AS ord WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.code = ord.code );
{ "outer_table": "orders", "inner_table": "managers", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_08453
train
T1
v1
Schema: regions (alias: rgn)(code, amount, status, salary) departments(date, status, name, value) Task: Retrieve id from regions whose level is found in departments rows where id matches the outer record. SQL:
SELECT id FROM regions AS rgn WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.id = rgn.id );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_08454
train
T2
v2
Schema: departments (alias: dept)(name, amount, type, salary) budgets(type, level, status, value) Task: Find code from departments where a matching record exists in budgets with the same type. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.type = dept.type );
{ "outer_table": "departments", "inner_table": "budgets", "outer_alias": "dept", "inner_alias": "budg", "proj_col": "code", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_08455
train
T1
v2
Schema: budgets (alias: budg)(date, status, type, code) requests(date, code, salary, id) Task: Retrieve name from budgets that have at least one corresponding entry in requests sharing the same level. SQL:
SELECT name FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = budg.level );
{ "outer_table": "budgets", "inner_table": "requests", "outer_alias": "budg", "inner_alias": "ordr", "proj_col": "name", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_08456
train
T2
v1
Schema: products (alias: prod)(name, type, id, code) managers(amount, id, value, code) Task: Find name from products where code appears in managers entries with matching code. SQL:
SELECT name FROM products AS prod WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.code = prod.code );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_08457
train
T1
v3
Schema: products (alias: prod)(id, salary, date, name) requests(value, amount, level, date) Task: Find id from products where salary exceeds the average salary from requests for the same level. SQL:
SELECT id FROM products AS prod WHERE salary > ( SELECT COUNT(salary) FROM requests AS ordr WHERE ordr.level = prod.level );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_08458
train
T1
v2
Schema: sales (alias: sale)(id, amount, code, date) customers(salary, amount, date, code) Task: Find salary from sales where a matching record exists in customers with the same level. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = sale.level );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "salary", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_08459
train
T1
v3
Schema: orders (alias: ord)(id, value, salary, level) budgets(code, level, name, amount) Task: Find id from orders where salary exceeds the average amount from budgets for the same id. SQL:
SELECT id FROM orders AS ord WHERE salary > ( SELECT AVG(amount) FROM budgets AS budg WHERE budg.id = ord.id );
{ "outer_table": "orders", "inner_table": "budgets", "outer_alias": "ord", "inner_alias": "budg", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_08460
train
T1
v2
Schema: warehouses (alias: whs)(level, amount, name, id) orders(level, date, salary, amount) Task: Retrieve amount from warehouses that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT amount FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "orders", "outer_alias": "whs", "inner_alias": "ord", "proj_col": "amount", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_08461
train
T2
v2
Schema: staff (alias: empl)(id, date, amount, name) schedules(amount, level, code, salary) Task: Retrieve value from staff that have at least one corresponding entry in schedules sharing the same id. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = empl.id );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "value", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_08462
train
T2
v3
Schema: employees (alias: emp)(date, level, id, salary) invoices(status, value, amount, name) Task: Find code from employees where amount exceeds the average salary from invoices for the same level. SQL:
SELECT code FROM employees AS emp WHERE amount > ( SELECT SUM(salary) FROM invoices AS inv WHERE inv.level = emp.level );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_08463
train
T1
v2
Schema: staff (alias: empl)(name, level, status, amount) employees(id, level, date, value) Task: Find salary from staff where a matching record exists in employees with the same id. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = empl.id );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "salary", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_08464
train
T2
v3
Schema: shipments (alias: shp)(status, code, level, salary) accounts(salary, date, level, value) Task: Find name from shipments where amount exceeds the average amount from accounts for the same level. SQL:
SELECT name FROM shipments AS shp WHERE amount > ( SELECT MIN(amount) FROM accounts AS acct WHERE acct.level = shp.level );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_08465
train
T2
v3
Schema: warehouses (alias: whs)(name, level, date, type) budgets(value, id, salary, amount) Task: Retrieve value from warehouses with amount above the COUNT(value) of budgets rows sharing the same status. SQL:
SELECT value FROM warehouses AS whs WHERE amount > ( SELECT COUNT(value) FROM budgets AS budg WHERE budg.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "budgets", "outer_alias": "whs", "inner_alias": "budg", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_08466
train
T2
v2
Schema: orders (alias: ord)(name, value, id, salary) requests(type, status, id, level) Task: Find name from orders where a matching record exists in requests with the same status. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = ord.status );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "name", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_08467
train
T1
v1
Schema: schedules (alias: schd)(code, id, amount, level) staff(value, level, type, name) Task: Retrieve amount from schedules whose id is found in staff rows where level matches the outer record. SQL:
SELECT amount 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": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_08468
train
T2
v2
Schema: regions (alias: rgn)(date, level, id, amount) budgets(status, salary, type, level) Task: Find amount from regions where a matching record exists in budgets with the same status. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.status = rgn.status );
{ "outer_table": "regions", "inner_table": "budgets", "outer_alias": "rgn", "inner_alias": "budg", "proj_col": "amount", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_08469
train
T2
v1
Schema: invoices (alias: inv)(status, value, id, date) schedules(type, date, salary, level) Task: Select name from invoices where id exists in schedules for the same code. SQL:
SELECT name FROM invoices AS inv WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.code = inv.code );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_08470
train
T1
v2
Schema: categories (alias: catg)(type, status, code, amount) customers(status, date, value, level) Task: Find name from categories where a matching record exists in customers with the same type. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = catg.type );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "name", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_08471
train
T2
v1
Schema: requests (alias: ordr)(code, salary, status, name) accounts(level, type, name, salary) Task: Retrieve amount from requests whose level is found in accounts rows where type matches the outer record. SQL:
SELECT amount FROM requests AS ordr WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.type = ordr.type );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "amount", "filter_col": "level", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_08472
train
T2
v2
Schema: transactions (alias: txn)(amount, code, status, salary) warehouses(name, status, salary, type) Task: Retrieve value from transactions that have at least one corresponding entry in warehouses sharing the same id. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.id = txn.id );
{ "outer_table": "transactions", "inner_table": "warehouses", "outer_alias": "txn", "inner_alias": "whs", "proj_col": "value", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_08473
train
T1
v2
Schema: managers (alias: mgr)(date, value, status, code) products(status, level, amount, salary) Task: Retrieve code from managers that have at least one corresponding entry in products sharing the same status. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = mgr.status );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "code", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_08474
train
T1
v1
Schema: regions (alias: rgn)(salary, amount, type, name) shipments(name, level, salary, date) Task: Retrieve amount from regions whose code is found in shipments rows where id matches the outer record. SQL:
SELECT amount FROM regions AS rgn WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.id = rgn.id );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "amount", "filter_col": "code", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_08475
train
T2
v2
Schema: products (alias: prod)(date, amount, name, status) customers(salary, status, name, type) Task: Retrieve code from products that have at least one corresponding entry in customers sharing the same id. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = prod.id );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "code", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_08476
train
T1
v3
Schema: invoices (alias: inv)(status, level, amount, salary) requests(id, status, name, amount) Task: Retrieve salary from invoices with value above the AVG(amount) of requests rows sharing the same id. SQL:
SELECT salary FROM invoices AS inv WHERE value > ( SELECT AVG(amount) FROM requests AS ordr WHERE ordr.id = inv.id );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_08477
train
T1
v2
Schema: employees (alias: emp)(salary, amount, name, status) requests(amount, status, level, date) Task: Retrieve value from employees that have at least one corresponding entry in requests sharing the same code. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = emp.code );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "value", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_08478
train
T1
v1
Schema: transactions (alias: txn)(name, status, code, amount) orders(type, name, date, id) Task: Find amount from transactions where level appears in orders entries with matching level. SQL:
SELECT amount FROM transactions AS txn WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.level = txn.level );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "amount", "filter_col": "level", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_08479
train
T1
v1
Schema: departments (alias: dept)(date, amount, value, salary) employees(date, type, amount, id) Task: Select amount from departments where code exists in employees for the same level. SQL:
SELECT amount FROM departments AS dept WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.level = dept.level );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_08480
train
T1
v1
Schema: transactions (alias: txn)(type, level, amount, date) sales(code, status, amount, type) Task: Retrieve id from transactions whose status is found in sales rows where level matches the outer record. SQL:
SELECT id FROM transactions AS txn WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.level = txn.level );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "id", "filter_col": "status", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_08481
train
T1
v1
Schema: shipments (alias: shp)(id, name, status, salary) regions(code, type, salary, status) Task: Select salary from shipments where status exists in regions for the same status. SQL:
SELECT salary FROM shipments AS shp WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.status = shp.status );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_08482
train
T2
v2
Schema: schedules (alias: schd)(status, id, type, level) managers(level, name, salary, type) Task: Find salary from schedules where a matching record exists in managers with the same level. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = schd.level );
{ "outer_table": "schedules", "inner_table": "managers", "outer_alias": "schd", "inner_alias": "mgr", "proj_col": "salary", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_08483
train
T2
v2
Schema: products (alias: prod)(salary, name, date, value) warehouses(code, name, status, salary) Task: Find id from products where a matching record exists in warehouses with the same code. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.code = prod.code );
{ "outer_table": "products", "inner_table": "warehouses", "outer_alias": "prod", "inner_alias": "whs", "proj_col": "id", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_08484
train
T1
v2
Schema: budgets (alias: budg)(level, type, id, amount) sales(value, salary, code, date) Task: Retrieve code from budgets that have at least one corresponding entry in sales sharing the same id. SQL:
SELECT code FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = budg.id );
{ "outer_table": "budgets", "inner_table": "sales", "outer_alias": "budg", "inner_alias": "sale", "proj_col": "code", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_08485
train
T2
v1
Schema: customers (alias: cust)(value, type, level, name) transactions(code, status, amount, id) Task: Retrieve value from customers whose type is found in transactions rows where level matches the outer record. SQL:
SELECT value FROM customers AS cust WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.level = cust.level );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_08486
train
T1
v3
Schema: invoices (alias: inv)(amount, code, name, level) customers(level, date, name, status) Task: Find code from invoices where salary exceeds the average value from customers for the same id. SQL:
SELECT code FROM invoices AS inv WHERE salary > ( SELECT COUNT(value) FROM customers AS cust WHERE cust.id = inv.id );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_08487
train
T1
v1
Schema: employees (alias: emp)(level, salary, date, status) accounts(status, code, value, name) Task: Retrieve salary from employees whose type is found in accounts rows where type matches the outer record. SQL:
SELECT salary FROM employees AS emp WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.type = emp.type );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_08488
train
T1
v1
Schema: schedules (alias: schd)(type, value, level, status) orders(type, code, id, salary) Task: Find value from schedules where code appears in orders entries with matching id. SQL:
SELECT value FROM schedules AS schd WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.id = schd.id );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_08489
train
T2
v2
Schema: staff (alias: empl)(salary, status, level, code) products(amount, code, type, level) Task: Find id from staff where a matching record exists in products with the same code. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = empl.code );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "id", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_08490
train
T2
v3
Schema: schedules (alias: schd)(name, amount, value, code) departments(id, salary, status, type) Task: Find value from schedules where salary exceeds the average salary from departments for the same id. SQL:
SELECT value FROM schedules AS schd WHERE salary > ( SELECT COUNT(salary) FROM departments AS dept WHERE dept.id = schd.id );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_08491
train
T2
v3
Schema: staff (alias: empl)(code, name, type, status) categories(name, level, type, salary) Task: Find value from staff where salary exceeds the average salary from categories for the same level. SQL:
SELECT value FROM staff AS empl WHERE salary > ( SELECT MIN(salary) FROM categories AS catg WHERE catg.level = empl.level );
{ "outer_table": "staff", "inner_table": "categories", "outer_alias": "empl", "inner_alias": "catg", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_08492
train
T2
v2
Schema: transactions (alias: txn)(id, amount, status, level) customers(id, status, code, type) Task: Find amount from transactions where a matching record exists in customers with the same type. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = txn.type );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "amount", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_08493
train
T1
v3
Schema: customers (alias: cust)(status, salary, value, name) departments(id, amount, level, type) Task: Find code from customers where value exceeds the average salary from departments for the same status. SQL:
SELECT code FROM customers AS cust WHERE value > ( SELECT COUNT(salary) FROM departments AS dept WHERE dept.status = cust.status );
{ "outer_table": "customers", "inner_table": "departments", "outer_alias": "cust", "inner_alias": "dept", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_08494
train
T1
v2
Schema: regions (alias: rgn)(salary, name, level, id) warehouses(date, name, value, type) Task: Retrieve id from regions that have at least one corresponding entry in warehouses sharing the same type. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.type = rgn.type );
{ "outer_table": "regions", "inner_table": "warehouses", "outer_alias": "rgn", "inner_alias": "whs", "proj_col": "id", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_08495
train
T2
v3
Schema: services (alias: srvc)(date, id, amount, level) departments(id, name, date, amount) Task: Find value from services where amount exceeds the average amount from departments for the same type. SQL:
SELECT value FROM services AS srvc WHERE amount > ( SELECT AVG(amount) FROM departments AS dept WHERE dept.type = srvc.type );
{ "outer_table": "services", "inner_table": "departments", "outer_alias": "srvc", "inner_alias": "dept", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_08496
train
T2
v3
Schema: employees (alias: emp)(value, salary, level, status) managers(level, id, date, code) Task: Find amount from employees where salary exceeds the average amount from managers for the same status. SQL:
SELECT amount FROM employees AS emp WHERE salary > ( SELECT MAX(amount) FROM managers AS mgr WHERE mgr.status = emp.status );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_08497
train
T1
v3
Schema: orders (alias: ord)(status, amount, date, salary) managers(status, name, salary, id) Task: Find value from orders where value exceeds the average value from managers for the same id. SQL:
SELECT value FROM orders AS ord WHERE value > ( SELECT COUNT(value) FROM managers AS mgr WHERE mgr.id = ord.id );
{ "outer_table": "orders", "inner_table": "managers", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_08498
train
T1
v3
Schema: schedules (alias: schd)(type, status, name, value) employees(amount, type, status, salary) Task: Find amount from schedules where amount exceeds the average amount from employees for the same id. SQL:
SELECT amount FROM schedules AS schd WHERE amount > ( SELECT MIN(amount) FROM employees AS emp WHERE emp.id = schd.id );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_08499
train
T2