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
v1
Schema: products (alias: prod)(type, salary, status, code) requests(amount, level, date, code) Task: Select salary from products where id exists in requests for the same level. SQL:
SELECT salary FROM products AS prod WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.level = prod.level );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "id", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_01400
train
T1
v1
Schema: customers (alias: cust)(value, name, salary, date) employees(name, type, value, status) Task: Retrieve id from customers whose level is found in employees rows where status matches the outer record. SQL:
SELECT id FROM customers AS cust WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.status = cust.status );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_01401
train
T1
v1
Schema: schedules (alias: schd)(amount, status, id, level) accounts(status, level, id, salary) Task: Select id from schedules where status exists in accounts for the same status. SQL:
SELECT id FROM schedules AS schd WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.status = schd.status );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_01402
train
T2
v1
Schema: requests (alias: ordr)(amount, date, level, type) services(type, level, salary, id) Task: Select id from requests where status exists in services for the same type. SQL:
SELECT id FROM requests AS ordr WHERE status IN ( SELECT status FROM services AS srvc WHERE srvc.type = ordr.type );
{ "outer_table": "requests", "inner_table": "services", "outer_alias": "ordr", "inner_alias": "srvc", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_01403
train
T2
v2
Schema: managers (alias: mgr)(type, status, id, value) services(name, level, date, salary) Task: Retrieve code from managers that have at least one corresponding entry in services sharing the same type. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.type = mgr.type );
{ "outer_table": "managers", "inner_table": "services", "outer_alias": "mgr", "inner_alias": "srvc", "proj_col": "code", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_01404
train
T1
v1
Schema: accounts (alias: acct)(salary, status, code, name) budgets(salary, date, type, amount) Task: Find salary from accounts where level appears in budgets entries with matching type. SQL:
SELECT salary FROM accounts AS acct WHERE level IN ( SELECT level FROM budgets AS budg WHERE budg.type = acct.type );
{ "outer_table": "accounts", "inner_table": "budgets", "outer_alias": "acct", "inner_alias": "budg", "proj_col": "salary", "filter_col": "level", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_01405
train
T1
v2
Schema: managers (alias: mgr)(value, date, amount, status) shipments(id, salary, level, amount) Task: Retrieve code from managers that have at least one corresponding entry in shipments sharing the same level. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = mgr.level );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "code", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_01406
train
T1
v3
Schema: schedules (alias: schd)(value, salary, status, type) shipments(salary, level, date, type) Task: Find id from schedules where value exceeds the average amount from shipments for the same type. SQL:
SELECT id FROM schedules AS schd WHERE value > ( SELECT MAX(amount) FROM shipments AS shp WHERE shp.type = schd.type );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_01407
train
T2
v3
Schema: sales (alias: sale)(id, amount, salary, code) shipments(salary, value, date, code) Task: Retrieve code from sales with salary above the MAX(amount) of shipments rows sharing the same id. SQL:
SELECT code FROM sales AS sale WHERE salary > ( SELECT MAX(amount) FROM shipments AS shp WHERE shp.id = sale.id );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_01408
train
T1
v3
Schema: sales (alias: sale)(name, id, type, value) warehouses(amount, type, level, status) Task: Find code from sales where salary exceeds the average salary from warehouses for the same code. SQL:
SELECT code FROM sales AS sale WHERE salary > ( SELECT AVG(salary) FROM warehouses AS whs WHERE whs.code = sale.code );
{ "outer_table": "sales", "inner_table": "warehouses", "outer_alias": "sale", "inner_alias": "whs", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_01409
train
T1
v3
Schema: staff (alias: empl)(amount, value, id, date) budgets(status, salary, id, code) Task: Retrieve name from staff with value above the AVG(amount) of budgets rows sharing the same id. SQL:
SELECT name FROM staff AS empl WHERE value > ( SELECT AVG(amount) FROM budgets AS budg WHERE budg.id = empl.id );
{ "outer_table": "staff", "inner_table": "budgets", "outer_alias": "empl", "inner_alias": "budg", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_01410
train
T2
v2
Schema: transactions (alias: txn)(code, date, name, value) shipments(salary, value, name, date) Task: Find value from transactions where a matching record exists in shipments with the same code. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = txn.code );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "value", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_01411
train
T1
v2
Schema: services (alias: srvc)(level, value, salary, status) shipments(status, type, value, level) Task: Find code from services where a matching record exists in shipments with the same id. SQL:
SELECT code FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = srvc.id );
{ "outer_table": "services", "inner_table": "shipments", "outer_alias": "srvc", "inner_alias": "shp", "proj_col": "code", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_01412
train
T2
v3
Schema: managers (alias: mgr)(amount, code, id, status) accounts(code, date, level, salary) Task: Retrieve value from managers with value above the AVG(value) of accounts rows sharing the same type. SQL:
SELECT value FROM managers AS mgr WHERE value > ( SELECT AVG(value) FROM accounts AS acct WHERE acct.type = mgr.type );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_01413
train
T1
v3
Schema: orders (alias: ord)(salary, amount, code, id) items(code, status, value, amount) Task: Retrieve code from orders with value above the MIN(salary) of items rows sharing the same id. SQL:
SELECT code FROM orders AS ord WHERE value > ( SELECT MIN(salary) FROM items AS lne WHERE lne.id = ord.id );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_01414
train
T1
v2
Schema: employees (alias: emp)(code, date, value, status) warehouses(amount, code, date, name) Task: Find id from employees where a matching record exists in warehouses with the same type. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.type = emp.type );
{ "outer_table": "employees", "inner_table": "warehouses", "outer_alias": "emp", "inner_alias": "whs", "proj_col": "id", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_01415
train
T1
v3
Schema: requests (alias: ordr)(type, name, value, level) categories(level, date, code, type) Task: Find id from requests where salary exceeds the average amount from categories for the same status. SQL:
SELECT id FROM requests AS ordr WHERE salary > ( SELECT MIN(amount) FROM categories AS catg WHERE catg.status = ordr.status );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_01416
train
T2
v1
Schema: employees (alias: emp)(status, salary, date, level) departments(status, type, amount, id) Task: Retrieve amount from employees whose level is found in departments rows where type matches the outer record. SQL:
SELECT amount FROM employees AS emp WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.type = emp.type );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "amount", "filter_col": "level", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_01417
train
T1
v1
Schema: orders (alias: ord)(code, type, value, id) customers(id, type, status, code) Task: Select id from orders where id exists in customers for the same type. SQL:
SELECT id FROM orders AS ord WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.type = ord.type );
{ "outer_table": "orders", "inner_table": "customers", "outer_alias": "ord", "inner_alias": "cust", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_01418
train
T1
v2
Schema: employees (alias: emp)(amount, value, code, salary) staff(value, type, id, level) Task: Retrieve id from employees that have at least one corresponding entry in staff sharing the same level. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = emp.level );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "id", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_01419
train
T1
v3
Schema: departments (alias: dept)(code, name, status, date) employees(name, level, type, amount) Task: Retrieve salary from departments with salary above the AVG(amount) of employees rows sharing the same level. SQL:
SELECT salary FROM departments AS dept WHERE salary > ( SELECT AVG(amount) FROM employees AS emp WHERE emp.level = dept.level );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_01420
train
T1
v1
Schema: requests (alias: ordr)(status, salary, id, type) departments(status, salary, value, name) Task: Select amount from requests where code exists in departments for the same type. SQL:
SELECT amount FROM requests AS ordr WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.type = ordr.type );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_01421
train
T2
v1
Schema: regions (alias: rgn)(amount, value, id, type) invoices(id, date, salary, code) Task: Select name from regions where id exists in invoices for the same status. SQL:
SELECT name FROM regions AS rgn WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.status = rgn.status );
{ "outer_table": "regions", "inner_table": "invoices", "outer_alias": "rgn", "inner_alias": "inv", "proj_col": "name", "filter_col": "id", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_01422
train
T2
v2
Schema: invoices (alias: inv)(status, id, type, amount) requests(salary, date, type, amount) Task: Retrieve id from invoices that have at least one corresponding entry in requests sharing the same code. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = inv.code );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "id", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_01423
train
T1
v2
Schema: categories (alias: catg)(id, name, date, value) sales(id, code, salary, name) Task: Find salary from categories where a matching record exists in sales with the same status. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = catg.status );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "salary", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_01424
train
T2
v1
Schema: services (alias: srvc)(date, name, value, id) orders(value, date, salary, status) Task: Select code from services where level exists in orders for the same id. SQL:
SELECT code FROM services AS srvc WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.id = srvc.id );
{ "outer_table": "services", "inner_table": "orders", "outer_alias": "srvc", "inner_alias": "ord", "proj_col": "code", "filter_col": "level", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_01425
train
T2
v1
Schema: staff (alias: empl)(id, date, value, name) budgets(status, level, date, value) Task: Retrieve code from staff whose level is found in budgets rows where level matches the outer record. SQL:
SELECT code FROM staff AS empl WHERE level IN ( SELECT level FROM budgets AS budg WHERE budg.level = empl.level );
{ "outer_table": "staff", "inner_table": "budgets", "outer_alias": "empl", "inner_alias": "budg", "proj_col": "code", "filter_col": "level", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_01426
train
T2
v1
Schema: employees (alias: emp)(date, amount, id, code) managers(status, salary, name, value) Task: Find code from employees where status appears in managers entries with matching type. SQL:
SELECT code FROM employees AS emp WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.type = emp.type );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_01427
train
T1
v1
Schema: employees (alias: emp)(date, level, type, value) requests(amount, id, code, date) Task: Find salary from employees where code appears in requests entries with matching code. SQL:
SELECT salary FROM employees AS emp WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.code = emp.code );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_01428
train
T1
v3
Schema: budgets (alias: budg)(date, salary, name, level) invoices(id, level, date, amount) Task: Find code from budgets where value exceeds the average amount from invoices for the same code. SQL:
SELECT code FROM budgets AS budg WHERE value > ( SELECT SUM(amount) FROM invoices AS inv WHERE inv.code = budg.code );
{ "outer_table": "budgets", "inner_table": "invoices", "outer_alias": "budg", "inner_alias": "inv", "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_01429
train
T2
v3
Schema: items (alias: lne)(amount, level, value, name) warehouses(id, date, name, amount) Task: Retrieve id from items with salary above the AVG(amount) of warehouses rows sharing the same level. SQL:
SELECT id FROM items AS lne WHERE salary > ( SELECT AVG(amount) FROM warehouses AS whs WHERE whs.level = lne.level );
{ "outer_table": "items", "inner_table": "warehouses", "outer_alias": "lne", "inner_alias": "whs", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_01430
train
T2
v3
Schema: budgets (alias: budg)(name, status, id, amount) invoices(date, name, type, level) Task: Find code from budgets where value exceeds the average amount from invoices for the same id. SQL:
SELECT code FROM budgets AS budg WHERE value > ( SELECT SUM(amount) FROM invoices AS inv WHERE inv.id = budg.id );
{ "outer_table": "budgets", "inner_table": "invoices", "outer_alias": "budg", "inner_alias": "inv", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_01431
train
T2
v2
Schema: categories (alias: catg)(id, code, salary, level) schedules(id, level, code, value) Task: Retrieve id from categories that have at least one corresponding entry in schedules sharing the same id. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = catg.id );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "id", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_01432
train
T2
v2
Schema: transactions (alias: txn)(status, code, salary, value) shipments(salary, id, date, level) Task: Retrieve salary from transactions that have at least one corresponding entry in shipments sharing the same code. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = txn.code );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "salary", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_01433
train
T1
v1
Schema: customers (alias: cust)(value, id, type, name) schedules(date, level, value, amount) Task: Select amount from customers where id exists in schedules for the same status. SQL:
SELECT amount FROM customers AS cust WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.status = cust.status );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_01434
train
T1
v2
Schema: schedules (alias: schd)(code, type, status, name) transactions(type, value, salary, date) Task: Find id from schedules where a matching record exists in transactions with the same status. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = schd.status );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "id", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_01435
train
T2
v3
Schema: requests (alias: ordr)(amount, name, value, id) budgets(name, salary, type, amount) Task: Find amount from requests where salary exceeds the average amount from budgets for the same status. SQL:
SELECT amount FROM requests AS ordr WHERE salary > ( SELECT SUM(amount) FROM budgets AS budg WHERE budg.status = ordr.status );
{ "outer_table": "requests", "inner_table": "budgets", "outer_alias": "ordr", "inner_alias": "budg", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_01436
train
T2
v2
Schema: customers (alias: cust)(value, id, level, amount) requests(level, id, amount, type) Task: Find code from customers where a matching record exists in requests with the same code. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = cust.code );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_01437
train
T1
v1
Schema: categories (alias: catg)(code, type, level, date) customers(type, date, name, status) Task: Select amount from categories where type exists in customers for the same status. SQL:
SELECT amount FROM categories AS catg WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.status = catg.status );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_01438
train
T2
v1
Schema: services (alias: srvc)(id, amount, status, code) customers(name, amount, code, type) Task: Find value from services where status appears in customers entries with matching status. SQL:
SELECT value FROM services AS srvc WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.status = srvc.status );
{ "outer_table": "services", "inner_table": "customers", "outer_alias": "srvc", "inner_alias": "cust", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_01439
train
T2
v2
Schema: items (alias: lne)(type, code, id, amount) staff(date, level, code, value) Task: Retrieve id from items that have at least one corresponding entry in staff sharing the same id. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = lne.id );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "id", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_01440
train
T2
v1
Schema: shipments (alias: shp)(name, id, code, type) warehouses(id, name, salary, value) Task: Select code from shipments where status exists in warehouses for the same level. SQL:
SELECT code FROM shipments AS shp WHERE status IN ( SELECT status FROM warehouses AS whs WHERE whs.level = shp.level );
{ "outer_table": "shipments", "inner_table": "warehouses", "outer_alias": "shp", "inner_alias": "whs", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_01441
train
T2
v1
Schema: sales (alias: sale)(status, date, type, level) departments(value, level, id, salary) Task: Retrieve code from sales whose level is found in departments rows where status matches the outer record. SQL:
SELECT code FROM sales AS sale WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.status = sale.status );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_01442
train
T1
v3
Schema: orders (alias: ord)(status, code, name, id) transactions(salary, type, name, date) Task: Retrieve value from orders with salary above the MIN(value) of transactions rows sharing the same status. SQL:
SELECT value FROM orders AS ord WHERE salary > ( SELECT MIN(value) FROM transactions AS txn WHERE txn.status = ord.status );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_01443
train
T1
v2
Schema: categories (alias: catg)(code, date, amount, type) products(status, type, date, amount) Task: Find code from categories where a matching record exists in products with the same status. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = catg.status );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "code", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_01444
train
T2
v3
Schema: accounts (alias: acct)(salary, id, value, date) orders(type, value, salary, id) Task: Find salary from accounts where value exceeds the average amount from orders for the same id. SQL:
SELECT salary FROM accounts AS acct WHERE value > ( SELECT COUNT(amount) FROM orders AS ord WHERE ord.id = acct.id );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_01445
train
T1
v1
Schema: warehouses (alias: whs)(amount, status, value, name) regions(date, name, code, type) Task: Retrieve amount from warehouses whose level is found in regions rows where status matches the outer record. SQL:
SELECT amount FROM warehouses AS whs WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "regions", "outer_alias": "whs", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_01446
train
T2
v2
Schema: items (alias: lne)(status, id, value, type) orders(id, type, code, status) Task: Find name from items where a matching record exists in orders with the same type. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = lne.type );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "name", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_01447
train
T2
v3
Schema: budgets (alias: budg)(date, status, type, value) categories(id, level, date, salary) Task: Retrieve amount from budgets with amount above the MAX(salary) of categories rows sharing the same id. SQL:
SELECT amount FROM budgets AS budg WHERE amount > ( SELECT MAX(salary) FROM categories AS catg WHERE catg.id = budg.id );
{ "outer_table": "budgets", "inner_table": "categories", "outer_alias": "budg", "inner_alias": "catg", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_01448
train
T2
v1
Schema: budgets (alias: budg)(type, date, level, salary) shipments(date, value, id, code) Task: Find code from budgets where type appears in shipments entries with matching level. SQL:
SELECT code FROM budgets AS budg WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.level = budg.level );
{ "outer_table": "budgets", "inner_table": "shipments", "outer_alias": "budg", "inner_alias": "shp", "proj_col": "code", "filter_col": "type", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_01449
train
T2
v2
Schema: invoices (alias: inv)(type, id, level, status) products(code, value, status, name) Task: Find code from invoices where a matching record exists in products with the same code. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = inv.code );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "code", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_01450
train
T1
v1
Schema: budgets (alias: budg)(date, salary, id, name) schedules(type, status, amount, level) Task: Find id from budgets where level appears in schedules entries with matching status. SQL:
SELECT id FROM budgets AS budg WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.status = budg.status );
{ "outer_table": "budgets", "inner_table": "schedules", "outer_alias": "budg", "inner_alias": "schd", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_01451
train
T2
v3
Schema: accounts (alias: acct)(id, date, code, value) categories(salary, value, status, date) Task: Retrieve id from accounts with amount above the MAX(salary) of categories rows sharing the same level. SQL:
SELECT id FROM accounts AS acct WHERE amount > ( SELECT MAX(salary) FROM categories AS catg WHERE catg.level = acct.level );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_01452
train
T1
v3
Schema: orders (alias: ord)(date, salary, amount, type) categories(level, amount, value, name) Task: Retrieve id from orders with salary above the AVG(value) of categories rows sharing the same type. SQL:
SELECT id FROM orders AS ord WHERE salary > ( SELECT AVG(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": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_01453
train
T1
v2
Schema: services (alias: srvc)(date, code, value, name) managers(code, date, id, amount) Task: Find id from services where a matching record exists in managers with the same code. SQL:
SELECT id FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = srvc.code );
{ "outer_table": "services", "inner_table": "managers", "outer_alias": "srvc", "inner_alias": "mgr", "proj_col": "id", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_01454
train
T2
v3
Schema: customers (alias: cust)(level, amount, value, code) sales(amount, id, level, code) Task: Find salary from customers where amount exceeds the average salary from sales for the same status. SQL:
SELECT salary FROM customers AS cust WHERE amount > ( SELECT SUM(salary) FROM sales AS sale WHERE sale.status = cust.status );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_01455
train
T1
v3
Schema: schedules (alias: schd)(name, type, date, status) services(salary, name, id, amount) Task: Retrieve amount from schedules with amount above the MIN(value) of services rows sharing the same id. SQL:
SELECT amount FROM schedules AS schd WHERE amount > ( SELECT MIN(value) FROM services AS srvc WHERE srvc.id = schd.id );
{ "outer_table": "schedules", "inner_table": "services", "outer_alias": "schd", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_01456
train
T2
v1
Schema: regions (alias: rgn)(type, salary, status, code) sales(code, value, amount, id) Task: Find value from regions where code appears in sales entries with matching type. SQL:
SELECT value FROM regions AS rgn WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.type = rgn.type );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_01457
train
T2
v2
Schema: customers (alias: cust)(amount, date, type, code) products(id, date, type, status) Task: Find id from customers where a matching record exists in products with the same code. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = cust.code );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "id", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_01458
train
T1
v3
Schema: categories (alias: catg)(type, level, amount, value) products(level, amount, date, id) Task: Retrieve salary from categories with salary above the COUNT(amount) of products rows sharing the same status. SQL:
SELECT salary FROM categories AS catg WHERE salary > ( SELECT COUNT(amount) FROM products AS prod WHERE prod.status = catg.status );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_01459
train
T2
v2
Schema: regions (alias: rgn)(type, amount, date, name) budgets(amount, id, type, code) Task: Find amount from regions where a matching record exists in budgets with the same level. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.level = rgn.level );
{ "outer_table": "regions", "inner_table": "budgets", "outer_alias": "rgn", "inner_alias": "budg", "proj_col": "amount", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_01460
train
T2
v3
Schema: requests (alias: ordr)(code, type, level, status) items(id, name, salary, level) Task: Find id from requests where salary exceeds the average amount from items for the same status. SQL:
SELECT id FROM requests AS ordr WHERE salary > ( SELECT AVG(amount) FROM items AS lne WHERE lne.status = ordr.status );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_01461
train
T2
v2
Schema: departments (alias: dept)(date, level, salary, status) staff(status, value, amount, salary) Task: Retrieve amount from departments that have at least one corresponding entry in staff sharing the same code. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = dept.code );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "amount", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_01462
train
T1
v3
Schema: sales (alias: sale)(value, status, level, salary) invoices(code, date, salary, name) Task: Retrieve salary from sales with salary above the MAX(value) of invoices rows sharing the same status. SQL:
SELECT salary FROM sales AS sale WHERE salary > ( SELECT MAX(value) FROM invoices AS inv WHERE inv.status = sale.status );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_01463
train
T1
v3
Schema: transactions (alias: txn)(level, amount, value, id) regions(name, date, value, id) Task: Find code from transactions where value exceeds the average value from regions for the same status. SQL:
SELECT code FROM transactions AS txn WHERE value > ( SELECT AVG(value) FROM regions AS rgn WHERE rgn.status = txn.status );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_01464
train
T1
v3
Schema: managers (alias: mgr)(code, level, salary, amount) shipments(value, salary, status, name) Task: Find code from managers where salary exceeds the average amount from shipments for the same id. SQL:
SELECT code FROM managers AS mgr WHERE salary > ( SELECT MIN(amount) FROM shipments AS shp WHERE shp.id = mgr.id );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_01465
train
T1
v1
Schema: staff (alias: empl)(date, level, amount, status) budgets(salary, value, level, type) Task: Find code from staff where level appears in budgets entries with matching type. SQL:
SELECT code FROM staff AS empl WHERE level IN ( SELECT level FROM budgets AS budg WHERE budg.type = empl.type );
{ "outer_table": "staff", "inner_table": "budgets", "outer_alias": "empl", "inner_alias": "budg", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_01466
train
T2
v3
Schema: warehouses (alias: whs)(salary, type, date, id) customers(type, date, value, code) Task: Find id from warehouses where amount exceeds the average salary from customers for the same code. SQL:
SELECT id FROM warehouses AS whs WHERE amount > ( SELECT MIN(salary) FROM customers AS cust WHERE cust.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "customers", "outer_alias": "whs", "inner_alias": "cust", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_01467
train
T2
v3
Schema: transactions (alias: txn)(code, salary, status, type) categories(name, type, status, amount) Task: Retrieve amount from transactions with value above the MAX(value) of categories rows sharing the same status. SQL:
SELECT amount FROM transactions AS txn WHERE value > ( SELECT MAX(value) FROM categories AS catg WHERE catg.status = txn.status );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_01468
train
T1
v2
Schema: requests (alias: ordr)(value, id, amount, type) transactions(amount, salary, status, value) Task: Find value from requests where a matching record exists in transactions with the same status. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = ordr.status );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "value", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_01469
train
T2
v1
Schema: transactions (alias: txn)(name, type, salary, level) shipments(type, date, name, status) Task: Select value from transactions where id exists in shipments for the same level. SQL:
SELECT value FROM transactions AS txn WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.level = txn.level );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_01470
train
T1
v1
Schema: products (alias: prod)(name, status, date, code) accounts(name, level, status, code) Task: Retrieve value from products whose status is found in accounts rows where status matches the outer record. SQL:
SELECT value FROM products AS prod WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.status = prod.status );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_01471
train
T1
v3
Schema: transactions (alias: txn)(value, date, status, salary) orders(level, id, name, salary) Task: Retrieve name from transactions with amount above the AVG(amount) of orders rows sharing the same id. SQL:
SELECT name FROM transactions AS txn WHERE amount > ( SELECT AVG(amount) FROM orders AS ord WHERE ord.id = txn.id );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_01472
train
T1
v1
Schema: sales (alias: sale)(status, salary, amount, date) accounts(status, date, salary, amount) Task: Find id from sales where level appears in accounts entries with matching id. SQL:
SELECT id FROM sales AS sale WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.id = sale.id );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_01473
train
T1
v2
Schema: staff (alias: empl)(level, name, value, amount) requests(date, level, value, code) Task: Find value from staff where a matching record exists in requests with the same level. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = empl.level );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "value", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_01474
train
T2
v3
Schema: sales (alias: sale)(id, amount, value, code) products(type, id, code, salary) Task: Find code from sales where salary exceeds the average value from products for the same level. SQL:
SELECT code FROM sales AS sale WHERE salary > ( SELECT SUM(value) FROM products AS prod WHERE prod.level = sale.level );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_01475
train
T1
v3
Schema: employees (alias: emp)(name, date, id, amount) departments(amount, status, date, type) Task: Retrieve salary from employees with amount above the SUM(salary) of departments rows sharing the same type. SQL:
SELECT salary FROM employees AS emp WHERE amount > ( SELECT SUM(salary) FROM departments AS dept WHERE dept.type = emp.type );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_01476
train
T1
v3
Schema: departments (alias: dept)(name, amount, value, id) shipments(level, value, salary, id) Task: Find code from departments where value exceeds the average salary from shipments for the same id. SQL:
SELECT code FROM departments AS dept WHERE value > ( SELECT AVG(salary) FROM shipments AS shp WHERE shp.id = dept.id );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_01477
train
T1
v2
Schema: transactions (alias: txn)(level, id, code, type) budgets(status, value, type, id) Task: Find id from transactions where a matching record exists in budgets with the same status. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.status = txn.status );
{ "outer_table": "transactions", "inner_table": "budgets", "outer_alias": "txn", "inner_alias": "budg", "proj_col": "id", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_01478
train
T1
v3
Schema: departments (alias: dept)(name, level, status, date) employees(type, id, date, salary) Task: Retrieve name from departments with salary above the MIN(value) of employees rows sharing the same code. SQL:
SELECT name FROM departments AS dept WHERE salary > ( SELECT MIN(value) FROM employees AS emp WHERE emp.code = dept.code );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_01479
train
T1
v2
Schema: products (alias: prod)(id, value, date, salary) requests(code, id, date, type) Task: Retrieve id from products that have at least one corresponding entry in requests sharing the same id. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = prod.id );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "id", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_01480
train
T1
v2
Schema: requests (alias: ordr)(id, code, date, type) staff(date, amount, value, type) Task: Retrieve id from requests that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = ordr.status );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "id", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_01481
train
T2
v3
Schema: departments (alias: dept)(name, status, value, date) items(value, amount, date, type) Task: Find code from departments where salary exceeds the average salary from items for the same level. SQL:
SELECT code FROM departments AS dept WHERE salary > ( SELECT COUNT(salary) FROM items AS lne WHERE lne.level = dept.level );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_01482
train
T1
v2
Schema: categories (alias: catg)(date, id, level, status) staff(date, salary, amount, id) Task: Find id from categories where a matching record exists in staff with the same status. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = catg.status );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "id", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_01483
train
T2
v1
Schema: shipments (alias: shp)(level, amount, value, id) managers(code, amount, level, id) Task: Retrieve salary from shipments whose code is found in managers rows where type matches the outer record. SQL:
SELECT salary FROM shipments AS shp WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.type = shp.type );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_01484
train
T2
v2
Schema: orders (alias: ord)(type, status, name, date) services(code, amount, status, id) Task: Retrieve value from orders that have at least one corresponding entry in services sharing the same id. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = ord.id );
{ "outer_table": "orders", "inner_table": "services", "outer_alias": "ord", "inner_alias": "srvc", "proj_col": "value", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_01485
train
T1
v2
Schema: sales (alias: sale)(status, date, amount, id) warehouses(code, type, id, salary) Task: Retrieve name from sales that have at least one corresponding entry in warehouses sharing the same level. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.level = sale.level );
{ "outer_table": "sales", "inner_table": "warehouses", "outer_alias": "sale", "inner_alias": "whs", "proj_col": "name", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_01486
train
T1
v2
Schema: invoices (alias: inv)(salary, date, id, code) shipments(code, date, id, value) Task: Retrieve value from invoices that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = inv.id );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "value", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_01487
train
T1
v2
Schema: orders (alias: ord)(salary, type, level, value) shipments(id, code, date, type) Task: Find id from orders where a matching record exists in shipments with the same status. SQL:
SELECT id FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = ord.status );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "id", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_01488
train
T1
v3
Schema: requests (alias: ordr)(salary, id, level, amount) categories(salary, name, type, level) Task: Find salary from requests where value exceeds the average amount from categories for the same type. SQL:
SELECT salary FROM requests AS ordr WHERE value > ( SELECT AVG(amount) FROM categories AS catg WHERE catg.type = ordr.type );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_01489
train
T2
v1
Schema: budgets (alias: budg)(salary, type, value, id) shipments(date, value, salary, name) Task: Select id from budgets where code exists in shipments for the same code. SQL:
SELECT id FROM budgets AS budg WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.code = budg.code );
{ "outer_table": "budgets", "inner_table": "shipments", "outer_alias": "budg", "inner_alias": "shp", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_01490
train
T2
v2
Schema: invoices (alias: inv)(value, name, id, date) staff(code, value, amount, status) Task: Retrieve id from invoices that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = inv.type );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "id", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_01491
train
T1
v3
Schema: staff (alias: empl)(level, code, type, value) services(amount, value, salary, code) Task: Find name from staff where value exceeds the average amount from services for the same level. SQL:
SELECT name FROM staff AS empl WHERE value > ( SELECT COUNT(amount) FROM services AS srvc WHERE srvc.level = empl.level );
{ "outer_table": "staff", "inner_table": "services", "outer_alias": "empl", "inner_alias": "srvc", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_01492
train
T2
v1
Schema: transactions (alias: txn)(amount, level, code, id) regions(date, code, id, name) Task: Retrieve value from transactions whose type is found in regions rows where id matches the outer record. SQL:
SELECT value FROM transactions AS txn WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.id = txn.id );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "value", "filter_col": "type", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_01493
train
T1
v3
Schema: products (alias: prod)(level, type, name, date) sales(amount, name, status, level) Task: Retrieve name from products with salary above the MIN(value) of sales rows sharing the same level. SQL:
SELECT name FROM products AS prod WHERE salary > ( SELECT MIN(value) FROM sales AS sale WHERE sale.level = prod.level );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_01494
train
T1
v3
Schema: budgets (alias: budg)(code, date, type, name) items(code, type, name, value) Task: Find salary from budgets where amount exceeds the average salary from items for the same level. SQL:
SELECT salary FROM budgets AS budg WHERE amount > ( SELECT SUM(salary) FROM items AS lne WHERE lne.level = budg.level );
{ "outer_table": "budgets", "inner_table": "items", "outer_alias": "budg", "inner_alias": "lne", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_01495
train
T2
v2
Schema: departments (alias: dept)(type, status, value, salary) shipments(name, date, status, code) Task: Find value from departments where a matching record exists in shipments with the same id. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = dept.id );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "value", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_01496
train
T1
v1
Schema: accounts (alias: acct)(status, salary, code, value) staff(code, type, value, level) Task: Retrieve value from accounts whose status is found in staff rows where code matches the outer record. SQL:
SELECT value FROM accounts AS acct WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.code = acct.code );
{ "outer_table": "accounts", "inner_table": "staff", "outer_alias": "acct", "inner_alias": "empl", "proj_col": "value", "filter_col": "status", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_01497
train
T1
v2
Schema: items (alias: lne)(salary, id, type, status) budgets(level, code, status, value) Task: Retrieve amount from items that have at least one corresponding entry in budgets sharing the same id. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.id = lne.id );
{ "outer_table": "items", "inner_table": "budgets", "outer_alias": "lne", "inner_alias": "budg", "proj_col": "amount", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_01498
train
T2
v1
Schema: budgets (alias: budg)(amount, name, salary, value) departments(type, code, date, level) Task: Select id from budgets where code exists in departments for the same status. SQL:
SELECT id FROM budgets AS budg WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.status = budg.status );
{ "outer_table": "budgets", "inner_table": "departments", "outer_alias": "budg", "inner_alias": "dept", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_01499
train
T2