variant
stringclasses
3 values
prompt
stringlengths
163
237
sql
stringlengths
103
143
metadata
unknown
id
stringlengths
21
21
split
stringclasses
1 value
token_group
stringclasses
2 values
v3
Schema: shipments (alias: shp)(amount, date, value, name) products(level, status, id, name) Task: Retrieve value from shipments with value above the AVG(amount) of products rows sharing the same id. SQL:
SELECT value FROM shipments AS shp WHERE value > ( SELECT AVG(amount) FROM products AS prod WHERE prod.id = shp.id );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_11500
train
T2
v3
Schema: items (alias: lne)(salary, code, amount, level) budgets(value, salary, level, date) Task: Find value from items where amount exceeds the average value from budgets for the same level. SQL:
SELECT value FROM items AS lne WHERE amount > ( SELECT AVG(value) FROM budgets AS budg WHERE budg.level = lne.level );
{ "outer_table": "items", "inner_table": "budgets", "outer_alias": "lne", "inner_alias": "budg", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_11501
train
T2
v2
Schema: budgets (alias: budg)(type, status, salary, date) employees(name, level, value, salary) Task: Retrieve salary from budgets that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT salary FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = budg.status );
{ "outer_table": "budgets", "inner_table": "employees", "outer_alias": "budg", "inner_alias": "emp", "proj_col": "salary", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_11502
train
T2
v2
Schema: sales (alias: sale)(name, type, salary, status) shipments(status, salary, code, level) Task: Retrieve name from sales that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = sale.status );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "name", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_11503
train
T1
v2
Schema: departments (alias: dept)(code, type, salary, status) accounts(amount, name, salary, id) Task: Retrieve salary from departments that have at least one corresponding entry in accounts sharing the same level. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = dept.level );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "salary", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_11504
train
T1
v3
Schema: invoices (alias: inv)(date, name, salary, type) requests(status, type, level, date) Task: Retrieve name from invoices with value above the MIN(value) of requests rows sharing the same type. SQL:
SELECT name FROM invoices AS inv WHERE value > ( SELECT MIN(value) FROM requests AS ordr WHERE ordr.type = inv.type );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_11505
train
T1
v2
Schema: departments (alias: dept)(status, date, type, amount) shipments(id, code, value, type) Task: Find id from departments where a matching record exists in shipments with the same status. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = dept.status );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "id", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_11506
train
T1
v3
Schema: accounts (alias: acct)(salary, date, code, type) requests(value, status, level, id) Task: Find id from accounts where value exceeds the average amount from requests for the same level. SQL:
SELECT id FROM accounts AS acct WHERE value > ( SELECT COUNT(amount) FROM requests AS ordr WHERE ordr.level = acct.level );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_11507
train
T1
v3
Schema: shipments (alias: shp)(value, salary, amount, level) accounts(salary, value, code, status) Task: Retrieve name from shipments with salary above the SUM(amount) of accounts rows sharing the same code. SQL:
SELECT name FROM shipments AS shp WHERE salary > ( SELECT SUM(amount) FROM accounts AS acct WHERE acct.code = shp.code );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_11508
train
T2
v1
Schema: products (alias: prod)(amount, name, status, type) sales(name, value, level, salary) Task: Find id from products where status appears in sales entries with matching code. SQL:
SELECT id FROM products AS prod WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.code = prod.code );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_11509
train
T1
v1
Schema: schedules (alias: schd)(id, type, code, amount) services(value, salary, amount, type) Task: Select id from schedules where type exists in services for the same type. SQL:
SELECT id FROM schedules AS schd WHERE type IN ( SELECT type FROM services AS srvc WHERE srvc.type = schd.type );
{ "outer_table": "schedules", "inner_table": "services", "outer_alias": "schd", "inner_alias": "srvc", "proj_col": "id", "filter_col": "type", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_11510
train
T2
v2
Schema: employees (alias: emp)(code, type, date, salary) customers(id, value, amount, type) Task: Find amount from employees where a matching record exists in customers with the same type. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = emp.type );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "amount", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_11511
train
T1
v1
Schema: customers (alias: cust)(code, amount, id, name) regions(name, type, status, level) Task: Find name from customers where code appears in regions entries with matching level. SQL:
SELECT name FROM customers AS cust WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.level = cust.level );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_11512
train
T1
v1
Schema: customers (alias: cust)(type, status, code, level) services(value, amount, type, date) Task: Find value from customers where level appears in services entries with matching id. SQL:
SELECT value FROM customers AS cust WHERE level IN ( SELECT level FROM services AS srvc WHERE srvc.id = cust.id );
{ "outer_table": "customers", "inner_table": "services", "outer_alias": "cust", "inner_alias": "srvc", "proj_col": "value", "filter_col": "level", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_11513
train
T1
v2
Schema: accounts (alias: acct)(name, date, level, type) budgets(salary, amount, value, level) Task: Find amount from accounts where a matching record exists in budgets with the same code. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.code = acct.code );
{ "outer_table": "accounts", "inner_table": "budgets", "outer_alias": "acct", "inner_alias": "budg", "proj_col": "amount", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_11514
train
T1
v2
Schema: sales (alias: sale)(salary, amount, date, id) orders(date, salary, id, name) Task: Find amount from sales where a matching record exists in orders with the same level. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = sale.level );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "amount", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_11515
train
T1
v2
Schema: regions (alias: rgn)(name, code, date, level) orders(amount, salary, level, id) Task: Find salary from regions where a matching record exists in orders with the same status. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = rgn.status );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "salary", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_11516
train
T2
v2
Schema: products (alias: prod)(code, name, salary, id) employees(value, amount, status, id) Task: Retrieve id from products that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = prod.status );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "id", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_11517
train
T1
v1
Schema: customers (alias: cust)(value, name, date, level) services(amount, status, code, date) Task: Select value from customers where id exists in services for the same level. SQL:
SELECT value FROM customers AS cust WHERE id IN ( SELECT id FROM services AS srvc WHERE srvc.level = cust.level );
{ "outer_table": "customers", "inner_table": "services", "outer_alias": "cust", "inner_alias": "srvc", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_11518
train
T1
v3
Schema: regions (alias: rgn)(salary, name, type, date) departments(id, amount, date, value) Task: Retrieve amount from regions with amount above the MIN(value) of departments rows sharing the same code. SQL:
SELECT amount FROM regions AS rgn WHERE amount > ( SELECT MIN(value) FROM departments AS dept WHERE dept.code = rgn.code );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_11519
train
T2
v1
Schema: invoices (alias: inv)(status, code, value, date) employees(level, date, status, amount) Task: Retrieve id from invoices whose code is found in employees rows where level matches the outer record. SQL:
SELECT id FROM invoices AS inv WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.level = inv.level );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "id", "filter_col": "code", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_11520
train
T1
v2
Schema: shipments (alias: shp)(level, name, salary, value) schedules(type, status, salary, name) Task: Find name from shipments where a matching record exists in schedules with the same level. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = shp.level );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "name", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_11521
train
T2
v3
Schema: transactions (alias: txn)(amount, salary, name, id) employees(date, name, id, salary) Task: Find value from transactions where amount exceeds the average value from employees for the same level. SQL:
SELECT value FROM transactions AS txn WHERE amount > ( SELECT AVG(value) FROM employees AS emp WHERE emp.level = txn.level );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_11522
train
T1
v1
Schema: services (alias: srvc)(level, code, type, id) staff(type, salary, id, level) Task: Select value from services where level exists in staff for the same code. SQL:
SELECT value FROM services AS srvc WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.code = srvc.code );
{ "outer_table": "services", "inner_table": "staff", "outer_alias": "srvc", "inner_alias": "empl", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_11523
train
T2
v2
Schema: orders (alias: ord)(date, id, amount, salary) schedules(value, salary, id, name) Task: Retrieve id from orders that have at least one corresponding entry in schedules sharing the same code. SQL:
SELECT id FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = ord.code );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "id", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_11524
train
T1
v3
Schema: services (alias: srvc)(status, id, code, name) budgets(date, amount, id, level) Task: Find amount from services where amount exceeds the average salary from budgets for the same type. SQL:
SELECT amount FROM services AS srvc WHERE amount > ( SELECT MIN(salary) 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": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_11525
train
T2
v3
Schema: customers (alias: cust)(name, code, salary, amount) warehouses(level, status, id, name) Task: Find salary from customers where amount exceeds the average salary from warehouses for the same code. SQL:
SELECT salary FROM customers AS cust WHERE amount > ( SELECT AVG(salary) FROM warehouses AS whs WHERE whs.code = cust.code );
{ "outer_table": "customers", "inner_table": "warehouses", "outer_alias": "cust", "inner_alias": "whs", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_11526
train
T1
v1
Schema: schedules (alias: schd)(amount, value, status, type) managers(type, id, amount, level) Task: Select name from schedules where type exists in managers for the same type. SQL:
SELECT name FROM schedules AS schd WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.type = schd.type );
{ "outer_table": "schedules", "inner_table": "managers", "outer_alias": "schd", "inner_alias": "mgr", "proj_col": "name", "filter_col": "type", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_11527
train
T2
v1
Schema: warehouses (alias: whs)(id, date, amount, value) orders(value, salary, id, type) Task: Select id from warehouses where level exists in orders for the same type. SQL:
SELECT id FROM warehouses AS whs WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "orders", "outer_alias": "whs", "inner_alias": "ord", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_11528
train
T2
v1
Schema: sales (alias: sale)(type, status, amount, date) schedules(value, amount, type, id) Task: Retrieve value from sales whose id is found in schedules rows where level matches the outer record. SQL:
SELECT value FROM sales AS sale WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.level = sale.level );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_11529
train
T1
v3
Schema: orders (alias: ord)(amount, value, status, date) items(name, code, level, date) Task: Find amount from orders where salary exceeds the average value from items for the same status. SQL:
SELECT amount FROM orders AS ord WHERE salary > ( SELECT MIN(value) FROM items AS lne WHERE lne.status = ord.status );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_11530
train
T1
v3
Schema: employees (alias: emp)(name, type, salary, code) invoices(name, amount, status, id) Task: Find salary from employees where amount exceeds the average salary from invoices for the same type. SQL:
SELECT salary FROM employees AS emp WHERE amount > ( SELECT MAX(salary) FROM invoices AS inv WHERE inv.type = emp.type );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_11531
train
T1
v1
Schema: warehouses (alias: whs)(amount, value, date, code) orders(date, salary, name, id) Task: Retrieve amount from warehouses whose type is found in orders rows where id matches the outer record. SQL:
SELECT amount FROM warehouses AS whs WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "orders", "outer_alias": "whs", "inner_alias": "ord", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_11532
train
T2
v3
Schema: orders (alias: ord)(status, code, name, amount) transactions(name, value, id, status) Task: Retrieve name from orders with salary above the SUM(value) of transactions rows sharing the same type. SQL:
SELECT name FROM orders AS ord WHERE salary > ( SELECT SUM(value) FROM transactions AS txn WHERE txn.type = ord.type );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_11533
train
T1
v2
Schema: orders (alias: ord)(id, salary, date, amount) regions(salary, value, id, type) Task: Find name from orders where a matching record exists in regions with the same level. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = ord.level );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "name", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_11534
train
T1
v2
Schema: customers (alias: cust)(status, amount, id, type) orders(type, level, name, id) Task: Retrieve name from customers that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = cust.level );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "name", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_11535
train
T1
v1
Schema: orders (alias: ord)(value, level, date, amount) transactions(code, level, name, date) Task: Select value from orders where type exists in transactions for the same id. SQL:
SELECT value FROM orders AS ord WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.id = ord.id );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "value", "filter_col": "type", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_11536
train
T1
v3
Schema: categories (alias: catg)(name, type, status, salary) orders(code, name, amount, date) Task: Retrieve name from categories with value above the COUNT(salary) of orders rows sharing the same status. SQL:
SELECT name FROM categories AS catg WHERE value > ( SELECT COUNT(salary) FROM orders AS ord WHERE ord.status = catg.status );
{ "outer_table": "categories", "inner_table": "orders", "outer_alias": "catg", "inner_alias": "ord", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_11537
train
T2
v2
Schema: services (alias: srvc)(date, value, salary, level) categories(name, level, status, date) Task: Find value from services where a matching record exists in categories with the same status. SQL:
SELECT value FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = srvc.status );
{ "outer_table": "services", "inner_table": "categories", "outer_alias": "srvc", "inner_alias": "catg", "proj_col": "value", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_11538
train
T2
v1
Schema: requests (alias: ordr)(code, status, id, date) departments(code, level, salary, amount) Task: Retrieve salary from requests whose level is found in departments rows where id matches the outer record. SQL:
SELECT salary FROM requests AS ordr WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.id = ordr.id );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "salary", "filter_col": "level", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_11539
train
T2
v2
Schema: sales (alias: sale)(date, type, value, status) departments(amount, salary, name, id) Task: Retrieve amount from sales that have at least one corresponding entry in departments sharing the same code. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = sale.code );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "amount", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_11540
train
T1
v3
Schema: transactions (alias: txn)(level, amount, value, status) regions(id, code, type, name) Task: Find salary from transactions where salary exceeds the average value from regions for the same code. SQL:
SELECT salary FROM transactions AS txn WHERE salary > ( SELECT MIN(value) FROM regions AS rgn WHERE rgn.code = txn.code );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_11541
train
T1
v1
Schema: schedules (alias: schd)(level, date, code, status) warehouses(id, code, type, salary) Task: Find salary from schedules where id appears in warehouses entries with matching type. SQL:
SELECT salary FROM schedules AS schd WHERE id IN ( SELECT id FROM warehouses AS whs WHERE whs.type = schd.type );
{ "outer_table": "schedules", "inner_table": "warehouses", "outer_alias": "schd", "inner_alias": "whs", "proj_col": "salary", "filter_col": "id", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_11542
train
T2
v3
Schema: customers (alias: cust)(id, level, code, value) shipments(date, id, status, code) Task: Find amount from customers where value exceeds the average value from shipments for the same status. SQL:
SELECT amount FROM customers AS cust WHERE value > ( SELECT MAX(value) FROM shipments AS shp WHERE shp.status = cust.status );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_11543
train
T1
v2
Schema: schedules (alias: schd)(name, amount, type, value) accounts(code, status, salary, name) Task: Find salary from schedules where a matching record exists in accounts with the same type. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = schd.type );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "salary", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_11544
train
T2
v3
Schema: products (alias: prod)(amount, salary, level, id) categories(value, code, name, status) Task: Retrieve amount from products with salary above the MAX(salary) of categories rows sharing the same level. SQL:
SELECT amount FROM products AS prod WHERE salary > ( SELECT MAX(salary) FROM categories AS catg WHERE catg.level = prod.level );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_11545
train
T1
v3
Schema: sales (alias: sale)(type, salary, status, code) orders(amount, name, value, code) Task: Retrieve code from sales with salary above the SUM(salary) of orders rows sharing the same status. SQL:
SELECT code FROM sales AS sale WHERE salary > ( SELECT SUM(salary) FROM orders AS ord WHERE ord.status = sale.status );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_11546
train
T1
v1
Schema: invoices (alias: inv)(name, value, salary, date) staff(amount, code, value, level) Task: Retrieve salary from invoices whose code is found in staff rows where id matches the outer record. SQL:
SELECT salary FROM invoices AS inv WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.id = inv.id );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_11547
train
T1
v3
Schema: sales (alias: sale)(type, name, date, salary) products(level, type, value, date) Task: Find id from sales where amount exceeds the average salary from products for the same type. SQL:
SELECT id FROM sales AS sale WHERE amount > ( SELECT MIN(salary) FROM products AS prod WHERE prod.type = sale.type );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_11548
train
T1
v2
Schema: accounts (alias: acct)(level, value, amount, name) schedules(date, value, code, salary) Task: Find name from accounts where a matching record exists in schedules with the same code. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = acct.code );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "name", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_11549
train
T1
v1
Schema: invoices (alias: inv)(value, amount, level, type) orders(code, salary, type, value) Task: Retrieve value from invoices whose code is found in orders rows where type matches the outer record. SQL:
SELECT value FROM invoices AS inv WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.type = inv.type );
{ "outer_table": "invoices", "inner_table": "orders", "outer_alias": "inv", "inner_alias": "ord", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_11550
train
T1
v2
Schema: managers (alias: mgr)(code, salary, date, value) staff(date, status, salary, name) Task: Find value from managers where a matching record exists in staff with the same type. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = mgr.type );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "value", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_11551
train
T1
v3
Schema: warehouses (alias: whs)(code, salary, id, level) categories(value, type, amount, code) Task: Find value from warehouses where salary exceeds the average amount from categories for the same status. SQL:
SELECT value FROM warehouses AS whs WHERE salary > ( SELECT MIN(amount) FROM categories AS catg WHERE catg.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "categories", "outer_alias": "whs", "inner_alias": "catg", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_11552
train
T2
v1
Schema: orders (alias: ord)(amount, id, status, code) departments(id, amount, name, type) Task: Find name from orders where type appears in departments entries with matching status. SQL:
SELECT name FROM orders AS ord WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.status = ord.status );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "name", "filter_col": "type", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_11553
train
T1
v1
Schema: requests (alias: ordr)(level, date, status, salary) regions(value, type, id, name) Task: Retrieve name from requests whose type is found in regions rows where status matches the outer record. SQL:
SELECT name FROM requests AS ordr WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.status = ordr.status );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "name", "filter_col": "type", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_11554
train
T2
v3
Schema: requests (alias: ordr)(salary, amount, level, type) categories(name, code, status, date) Task: Retrieve salary from requests with value above the SUM(amount) of categories rows sharing the same level. SQL:
SELECT salary FROM requests AS ordr WHERE value > ( SELECT SUM(amount) FROM categories AS catg WHERE catg.level = ordr.level );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_11555
train
T2
v1
Schema: shipments (alias: shp)(type, level, id, name) schedules(value, level, name, amount) Task: Find id from shipments where type appears in schedules entries with matching level. SQL:
SELECT id FROM shipments AS shp WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.level = shp.level );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_11556
train
T2
v3
Schema: employees (alias: emp)(type, salary, level, date) managers(date, id, type, amount) Task: Find code from employees where amount exceeds the average value from managers for the same code. SQL:
SELECT code FROM employees AS emp WHERE amount > ( SELECT COUNT(value) FROM managers AS mgr WHERE mgr.code = emp.code );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_11557
train
T1
v3
Schema: staff (alias: empl)(value, salary, status, level) regions(status, value, level, type) Task: Find salary from staff where salary exceeds the average value from regions for the same id. SQL:
SELECT salary FROM staff AS empl WHERE salary > ( SELECT COUNT(value) FROM regions AS rgn WHERE rgn.id = empl.id );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_11558
train
T2
v1
Schema: orders (alias: ord)(code, value, type, id) employees(id, salary, status, name) Task: Retrieve name from orders whose level is found in employees rows where id matches the outer record. SQL:
SELECT name FROM orders AS ord WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.id = ord.id );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "name", "filter_col": "level", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_11559
train
T1
v3
Schema: schedules (alias: schd)(value, code, level, status) regions(salary, code, id, name) Task: Find amount from schedules where amount exceeds the average salary from regions for the same level. SQL:
SELECT amount FROM schedules AS schd WHERE amount > ( SELECT COUNT(salary) FROM regions AS rgn WHERE rgn.level = schd.level );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_11560
train
T2
v1
Schema: transactions (alias: txn)(id, amount, salary, value) departments(name, value, date, code) Task: Select amount from transactions where level exists in departments for the same status. SQL:
SELECT amount FROM transactions AS txn WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.status = txn.status );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_11561
train
T1
v3
Schema: services (alias: srvc)(id, date, type, level) products(date, level, name, salary) Task: Find code from services where salary exceeds the average salary from products for the same status. SQL:
SELECT code FROM services AS srvc WHERE salary > ( SELECT COUNT(salary) FROM products AS prod WHERE prod.status = srvc.status );
{ "outer_table": "services", "inner_table": "products", "outer_alias": "srvc", "inner_alias": "prod", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_11562
train
T2
v1
Schema: employees (alias: emp)(salary, date, type, level) regions(amount, type, id, name) Task: Select value from employees where id exists in regions for the same level. SQL:
SELECT value FROM employees AS emp WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.level = emp.level );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_11563
train
T1
v1
Schema: requests (alias: ordr)(code, name, amount, value) regions(status, name, salary, type) Task: Select salary from requests where id exists in regions for the same type. SQL:
SELECT salary FROM requests AS ordr WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.type = ordr.type );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "id", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_11564
train
T2
v3
Schema: warehouses (alias: whs)(name, id, status, salary) regions(date, name, status, level) Task: Find id from warehouses where value exceeds the average salary from regions for the same code. SQL:
SELECT id FROM warehouses AS whs WHERE value > ( SELECT SUM(salary) FROM regions AS rgn WHERE rgn.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "regions", "outer_alias": "whs", "inner_alias": "rgn", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_11565
train
T2
v1
Schema: services (alias: srvc)(status, code, name, type) budgets(salary, type, amount, status) Task: Retrieve name from services whose level is found in budgets rows where type matches the outer record. SQL:
SELECT name FROM services AS srvc WHERE level IN ( SELECT level FROM budgets AS budg WHERE budg.type = srvc.type );
{ "outer_table": "services", "inner_table": "budgets", "outer_alias": "srvc", "inner_alias": "budg", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_11566
train
T2
v1
Schema: requests (alias: ordr)(amount, name, type, code) services(code, name, amount, type) Task: Find id from requests where level appears in services entries with matching status. SQL:
SELECT id FROM requests AS ordr WHERE level IN ( SELECT level FROM services AS srvc WHERE srvc.status = ordr.status );
{ "outer_table": "requests", "inner_table": "services", "outer_alias": "ordr", "inner_alias": "srvc", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_11567
train
T2
v1
Schema: regions (alias: rgn)(type, name, code, amount) transactions(status, value, amount, name) Task: Select value from regions where type exists in transactions for the same code. SQL:
SELECT value FROM regions AS rgn WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.code = rgn.code );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_11568
train
T2
v2
Schema: orders (alias: ord)(amount, name, level, code) shipments(id, name, date, value) Task: Find code from orders where a matching record exists in shipments with the same level. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = ord.level );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "code", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_11569
train
T1
v1
Schema: departments (alias: dept)(date, id, code, amount) items(level, salary, status, amount) Task: Find id from departments where code appears in items entries with matching type. SQL:
SELECT id FROM departments AS dept WHERE code IN ( SELECT code FROM items AS lne WHERE lne.type = dept.type );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "id", "filter_col": "code", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_11570
train
T1
v2
Schema: budgets (alias: budg)(name, status, salary, type) requests(id, name, type, level) Task: Retrieve id from budgets that have at least one corresponding entry in requests sharing the same level. SQL:
SELECT id 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": "id", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_11571
train
T2
v2
Schema: managers (alias: mgr)(type, value, level, date) categories(status, id, name, code) Task: Retrieve name from managers that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = mgr.code );
{ "outer_table": "managers", "inner_table": "categories", "outer_alias": "mgr", "inner_alias": "catg", "proj_col": "name", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_11572
train
T1
v1
Schema: sales (alias: sale)(status, type, date, amount) transactions(amount, salary, level, type) Task: Find name from sales where code appears in transactions entries with matching id. SQL:
SELECT name FROM sales AS sale WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.id = sale.id );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_11573
train
T1
v1
Schema: employees (alias: emp)(salary, level, date, name) departments(id, amount, type, level) Task: Select salary from employees where id exists in departments for the same level. SQL:
SELECT salary FROM employees AS emp WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.level = emp.level );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "salary", "filter_col": "id", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_11574
train
T1
v1
Schema: invoices (alias: inv)(type, level, id, amount) shipments(amount, date, level, value) Task: Find name from invoices where id appears in shipments entries with matching level. SQL:
SELECT name FROM invoices AS inv WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.level = inv.level );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "name", "filter_col": "id", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_11575
train
T1
v2
Schema: departments (alias: dept)(level, code, amount, type) shipments(code, status, date, name) Task: Retrieve value from departments that have at least one corresponding entry in shipments sharing the same level. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = dept.level );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "value", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_11576
train
T1
v2
Schema: services (alias: srvc)(code, level, id, date) accounts(type, date, salary, name) Task: Find value from services where a matching record exists in accounts with the same id. SQL:
SELECT value FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = srvc.id );
{ "outer_table": "services", "inner_table": "accounts", "outer_alias": "srvc", "inner_alias": "acct", "proj_col": "value", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_11577
train
T2
v1
Schema: budgets (alias: budg)(level, id, date, code) managers(code, level, type, name) Task: Retrieve amount from budgets whose type is found in managers rows where level matches the outer record. SQL:
SELECT amount FROM budgets AS budg WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.level = budg.level );
{ "outer_table": "budgets", "inner_table": "managers", "outer_alias": "budg", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_11578
train
T2
v2
Schema: transactions (alias: txn)(type, date, name, level) managers(code, type, value, name) Task: Find value from transactions where a matching record exists in managers with the same level. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = txn.level );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "value", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_11579
train
T1
v2
Schema: invoices (alias: inv)(amount, salary, value, status) budgets(status, id, date, salary) Task: Retrieve id from invoices that have at least one corresponding entry in budgets sharing the same level. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.level = inv.level );
{ "outer_table": "invoices", "inner_table": "budgets", "outer_alias": "inv", "inner_alias": "budg", "proj_col": "id", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_11580
train
T1
v3
Schema: customers (alias: cust)(date, value, id, type) warehouses(level, amount, name, salary) Task: Find salary from customers where value exceeds the average amount from warehouses for the same type. SQL:
SELECT salary FROM customers AS cust WHERE value > ( SELECT COUNT(amount) FROM warehouses AS whs WHERE whs.type = cust.type );
{ "outer_table": "customers", "inner_table": "warehouses", "outer_alias": "cust", "inner_alias": "whs", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_11581
train
T1
v2
Schema: items (alias: lne)(status, value, id, code) accounts(value, level, type, amount) Task: Find id from items where a matching record exists in accounts with the same code. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = lne.code );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "id", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_11582
train
T2
v3
Schema: items (alias: lne)(amount, status, level, date) customers(amount, level, type, value) Task: Find code from items where salary exceeds the average salary from customers for the same id. SQL:
SELECT code FROM items AS lne WHERE salary > ( SELECT COUNT(salary) FROM customers AS cust WHERE cust.id = lne.id );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_11583
train
T2
v1
Schema: departments (alias: dept)(type, date, amount, salary) accounts(code, amount, salary, date) Task: Select salary from departments where status exists in accounts for the same type. SQL:
SELECT salary FROM departments AS dept WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.type = dept.type );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_11584
train
T1
v1
Schema: budgets (alias: budg)(value, salary, code, amount) schedules(code, level, name, salary) Task: Retrieve code from budgets whose status is found in schedules rows where level matches the outer record. SQL:
SELECT code FROM budgets AS budg WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.level = budg.level );
{ "outer_table": "budgets", "inner_table": "schedules", "outer_alias": "budg", "inner_alias": "schd", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_11585
train
T2
v3
Schema: schedules (alias: schd)(date, status, salary, id) regions(salary, status, name, date) Task: Retrieve name from schedules with salary above the AVG(value) of regions rows sharing the same code. SQL:
SELECT name FROM schedules AS schd WHERE salary > ( SELECT AVG(value) FROM regions AS rgn WHERE rgn.code = schd.code );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_11586
train
T2
v2
Schema: products (alias: prod)(type, salary, name, amount) orders(id, date, salary, status) Task: Retrieve code from products that have at least one corresponding entry in orders sharing the same status. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = prod.status );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "code", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_11587
train
T1
v2
Schema: sales (alias: sale)(amount, code, name, salary) items(level, status, amount, date) Task: Retrieve code from sales that have at least one corresponding entry in items sharing the same id. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.id = sale.id );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "code", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_11588
train
T1
v3
Schema: products (alias: prod)(amount, id, name, level) services(salary, value, id, level) Task: Retrieve amount from products with amount above the COUNT(value) of services rows sharing the same status. SQL:
SELECT amount FROM products AS prod WHERE amount > ( SELECT COUNT(value) FROM services AS srvc WHERE srvc.status = prod.status );
{ "outer_table": "products", "inner_table": "services", "outer_alias": "prod", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_11589
train
T1
v2
Schema: categories (alias: catg)(amount, code, date, name) products(code, level, date, name) Task: Retrieve value from categories that have at least one corresponding entry in products sharing the same status. SQL:
SELECT value 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": "value", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_11590
train
T2
v3
Schema: departments (alias: dept)(status, date, level, id) services(code, value, name, id) Task: Find salary from departments where value exceeds the average amount from services for the same id. SQL:
SELECT salary FROM departments AS dept WHERE value > ( SELECT AVG(amount) FROM services AS srvc WHERE srvc.id = dept.id );
{ "outer_table": "departments", "inner_table": "services", "outer_alias": "dept", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_11591
train
T1
v2
Schema: departments (alias: dept)(name, salary, amount, type) regions(value, level, id, date) Task: Retrieve salary from departments that have at least one corresponding entry in regions sharing the same type. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = dept.type );
{ "outer_table": "departments", "inner_table": "regions", "outer_alias": "dept", "inner_alias": "rgn", "proj_col": "salary", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_11592
train
T1
v1
Schema: orders (alias: ord)(code, level, status, date) items(salary, amount, id, type) Task: Find value from orders where status appears in items entries with matching id. SQL:
SELECT value FROM orders AS ord WHERE status IN ( SELECT status FROM items AS lne WHERE lne.id = ord.id );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_11593
train
T1
v3
Schema: services (alias: srvc)(date, type, salary, value) budgets(salary, date, id, value) Task: Find name from services where value exceeds the average salary from budgets for the same level. SQL:
SELECT name FROM services AS srvc WHERE value > ( SELECT COUNT(salary) FROM budgets AS budg WHERE budg.level = srvc.level );
{ "outer_table": "services", "inner_table": "budgets", "outer_alias": "srvc", "inner_alias": "budg", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_11594
train
T2
v3
Schema: transactions (alias: txn)(type, status, value, amount) services(type, value, id, name) Task: Find amount from transactions where value exceeds the average value from services for the same type. SQL:
SELECT amount FROM transactions AS txn WHERE value > ( SELECT AVG(value) FROM services AS srvc WHERE srvc.type = txn.type );
{ "outer_table": "transactions", "inner_table": "services", "outer_alias": "txn", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_11595
train
T1
v1
Schema: managers (alias: mgr)(type, value, level, name) transactions(salary, type, amount, status) Task: Select amount from managers where type exists in transactions for the same code. SQL:
SELECT amount FROM managers AS mgr WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.code = mgr.code );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "amount", "filter_col": "type", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_11596
train
T1
v3
Schema: services (alias: srvc)(level, value, status, code) departments(salary, type, amount, id) Task: Find code from services where value exceeds the average salary from departments for the same level. SQL:
SELECT code FROM services AS srvc WHERE value > ( SELECT MAX(salary) FROM departments AS dept WHERE dept.level = srvc.level );
{ "outer_table": "services", "inner_table": "departments", "outer_alias": "srvc", "inner_alias": "dept", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_11597
train
T2
v3
Schema: managers (alias: mgr)(salary, type, name, date) accounts(status, code, id, salary) Task: Retrieve code from managers with value above the COUNT(amount) of accounts rows sharing the same type. SQL:
SELECT code FROM managers AS mgr WHERE value > ( SELECT COUNT(amount) FROM accounts AS acct WHERE acct.type = mgr.type );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_11598
train
T1
v3
Schema: transactions (alias: txn)(status, salary, type, code) products(type, id, name, code) Task: Retrieve id from transactions with value above the COUNT(value) of products rows sharing the same status. SQL:
SELECT id FROM transactions AS txn WHERE value > ( SELECT COUNT(value) FROM products AS prod WHERE prod.status = txn.status );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_11599
train
T1