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: employees (alias: emp)(value, id, amount, name) services(id, value, type, date) Task: Find name from employees where status appears in services entries with matching level. SQL:
SELECT name FROM employees AS emp WHERE status IN ( SELECT status FROM services AS srvc WHERE srvc.level = emp.level );
{ "outer_table": "employees", "inner_table": "services", "outer_alias": "emp", "inner_alias": "srvc", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_10400
train
T1
v1
Schema: managers (alias: mgr)(name, value, id, status) requests(code, id, status, name) Task: Select amount from managers where id exists in requests for the same level. SQL:
SELECT amount FROM managers AS mgr WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.level = mgr.level );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_10401
train
T1
v3
Schema: accounts (alias: acct)(type, status, salary, name) employees(date, level, value, amount) Task: Find salary from accounts where value exceeds the average salary from employees for the same level. SQL:
SELECT salary FROM accounts AS acct WHERE value > ( SELECT COUNT(salary) FROM employees AS emp WHERE emp.level = acct.level );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_10402
train
T1
v3
Schema: departments (alias: dept)(amount, level, id, value) managers(salary, name, amount, date) Task: Retrieve value from departments with value above the AVG(value) of managers rows sharing the same id. SQL:
SELECT value FROM departments AS dept WHERE value > ( SELECT AVG(value) FROM managers AS mgr WHERE mgr.id = dept.id );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_10403
train
T1
v3
Schema: customers (alias: cust)(code, name, value, date) products(name, level, salary, value) Task: Find code from customers where value exceeds the average value from products for the same type. SQL:
SELECT code FROM customers AS cust WHERE value > ( SELECT AVG(value) FROM products AS prod WHERE prod.type = cust.type );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_10404
train
T1
v3
Schema: managers (alias: mgr)(value, id, salary, status) staff(value, name, level, date) Task: Find id from managers where value exceeds the average salary from staff for the same level. SQL:
SELECT id FROM managers AS mgr WHERE value > ( SELECT COUNT(salary) FROM staff AS empl WHERE empl.level = mgr.level );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_10405
train
T1
v3
Schema: products (alias: prod)(status, type, name, amount) shipments(id, level, type, date) Task: Retrieve value from products with amount above the MIN(salary) of shipments rows sharing the same code. SQL:
SELECT value FROM products AS prod WHERE amount > ( SELECT MIN(salary) FROM shipments AS shp WHERE shp.code = prod.code );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_10406
train
T1
v1
Schema: accounts (alias: acct)(id, code, type, value) regions(salary, type, amount, code) Task: Find amount from accounts where id appears in regions entries with matching code. SQL:
SELECT amount FROM accounts AS acct WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.code = acct.code );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_10407
train
T1
v2
Schema: products (alias: prod)(value, name, code, type) departments(id, date, status, level) Task: Retrieve name from products that have at least one corresponding entry in departments sharing the same status. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = prod.status );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "name", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_10408
train
T1
v1
Schema: employees (alias: emp)(status, date, value, level) departments(date, code, level, amount) Task: Find id from employees where level appears in departments entries with matching id. SQL:
SELECT id FROM employees AS emp WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.id = emp.id );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_10409
train
T1
v2
Schema: invoices (alias: inv)(salary, status, type, date) products(amount, date, status, salary) Task: Find amount from invoices where a matching record exists in products with the same level. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = inv.level );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "amount", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_10410
train
T1
v2
Schema: categories (alias: catg)(date, salary, amount, id) services(type, value, salary, id) Task: Find salary from categories where a matching record exists in services with the same code. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.code = catg.code );
{ "outer_table": "categories", "inner_table": "services", "outer_alias": "catg", "inner_alias": "srvc", "proj_col": "salary", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_10411
train
T2
v3
Schema: shipments (alias: shp)(status, name, level, amount) warehouses(level, salary, code, type) Task: Retrieve value from shipments with amount above the MAX(salary) of warehouses rows sharing the same status. SQL:
SELECT value FROM shipments AS shp WHERE amount > ( SELECT MAX(salary) FROM warehouses AS whs WHERE whs.status = shp.status );
{ "outer_table": "shipments", "inner_table": "warehouses", "outer_alias": "shp", "inner_alias": "whs", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_10412
train
T2
v1
Schema: customers (alias: cust)(id, name, status, date) sales(salary, date, type, name) Task: Find name from customers where status appears in sales entries with matching type. SQL:
SELECT name FROM customers AS cust WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.type = cust.type );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_10413
train
T1
v1
Schema: invoices (alias: inv)(salary, date, name, code) transactions(type, level, date, value) Task: Retrieve amount from invoices whose code is found in transactions rows where status matches the outer record. SQL:
SELECT amount FROM invoices AS inv WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.status = inv.status );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_10414
train
T1
v2
Schema: accounts (alias: acct)(type, salary, name, value) budgets(code, salary, type, date) Task: Retrieve amount from accounts that have at least one corresponding entry in budgets sharing the same level. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.level = acct.level );
{ "outer_table": "accounts", "inner_table": "budgets", "outer_alias": "acct", "inner_alias": "budg", "proj_col": "amount", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_10415
train
T1
v2
Schema: staff (alias: empl)(date, id, level, code) items(code, salary, id, amount) Task: Retrieve id from staff that have at least one corresponding entry in items sharing the same level. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.level = empl.level );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "id", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_10416
train
T2
v1
Schema: items (alias: lne)(type, date, level, value) regions(level, type, date, name) Task: Retrieve code from items whose type is found in regions rows where code matches the outer record. SQL:
SELECT code FROM items AS lne WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.code = lne.code );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_10417
train
T2
v1
Schema: categories (alias: catg)(level, status, code, date) transactions(id, salary, name, code) Task: Select salary from categories where id exists in transactions for the same level. SQL:
SELECT salary FROM categories AS catg WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.level = catg.level );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "salary", "filter_col": "id", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_10418
train
T2
v3
Schema: departments (alias: dept)(date, type, code, name) invoices(value, date, level, status) Task: Retrieve value from departments with value above the MAX(amount) of invoices rows sharing the same type. SQL:
SELECT value FROM departments AS dept WHERE value > ( SELECT MAX(amount) FROM invoices AS inv WHERE inv.type = dept.type );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_10419
train
T1
v1
Schema: managers (alias: mgr)(name, type, level, status) products(salary, code, id, type) Task: Select id from managers where level exists in products for the same id. SQL:
SELECT id FROM managers AS mgr WHERE level IN ( SELECT level FROM products AS prod WHERE prod.id = mgr.id );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_10420
train
T1
v1
Schema: services (alias: srvc)(status, id, level, type) products(status, name, id, code) Task: Find code from services where code appears in products entries with matching status. SQL:
SELECT code FROM services AS srvc WHERE code IN ( SELECT code 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": "code", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_10421
train
T2
v2
Schema: sales (alias: sale)(level, id, type, name) customers(amount, type, level, code) Task: Find id from sales where a matching record exists in customers with the same type. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = sale.type );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "id", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_10422
train
T1
v1
Schema: managers (alias: mgr)(level, code, type, salary) regions(code, id, date, status) Task: Select name from managers where level exists in regions for the same id. SQL:
SELECT name FROM managers AS mgr WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.id = mgr.id );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "name", "filter_col": "level", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_10423
train
T1
v3
Schema: items (alias: lne)(value, type, salary, level) categories(code, type, value, id) Task: Find amount from items where amount exceeds the average value from categories for the same level. SQL:
SELECT amount FROM items AS lne WHERE amount > ( SELECT SUM(value) FROM categories AS catg WHERE catg.level = lne.level );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_10424
train
T2
v3
Schema: products (alias: prod)(code, amount, type, level) schedules(type, value, id, level) Task: Find name from products where amount exceeds the average amount from schedules for the same status. SQL:
SELECT name FROM products AS prod WHERE amount > ( SELECT MAX(amount) FROM schedules AS schd WHERE schd.status = prod.status );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_10425
train
T1
v2
Schema: departments (alias: dept)(amount, date, code, type) shipments(salary, type, value, level) Task: Find value from departments where a matching record exists in shipments with the same code. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = dept.code );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "value", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_10426
train
T1
v1
Schema: warehouses (alias: whs)(amount, status, code, date) budgets(name, date, status, code) Task: Find salary from warehouses where level appears in budgets entries with matching level. SQL:
SELECT salary FROM warehouses AS whs WHERE level IN ( SELECT level FROM budgets AS budg WHERE budg.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "budgets", "outer_alias": "whs", "inner_alias": "budg", "proj_col": "salary", "filter_col": "level", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_10427
train
T2
v1
Schema: schedules (alias: schd)(level, id, type, status) budgets(code, status, value, amount) Task: Select name from schedules where status exists in budgets for the same id. SQL:
SELECT name FROM schedules AS schd WHERE status IN ( SELECT status FROM budgets AS budg WHERE budg.id = schd.id );
{ "outer_table": "schedules", "inner_table": "budgets", "outer_alias": "schd", "inner_alias": "budg", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_10428
train
T2
v3
Schema: services (alias: srvc)(status, date, salary, code) regions(salary, level, amount, value) Task: Find amount from services where value exceeds the average amount from regions for the same code. SQL:
SELECT amount FROM services AS srvc WHERE value > ( SELECT MIN(amount) FROM regions AS rgn WHERE rgn.code = srvc.code );
{ "outer_table": "services", "inner_table": "regions", "outer_alias": "srvc", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_10429
train
T2
v1
Schema: items (alias: lne)(name, level, code, id) departments(date, code, amount, type) Task: Find id from items where id appears in departments entries with matching level. SQL:
SELECT id FROM items AS lne WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.level = lne.level );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_10430
train
T2
v2
Schema: warehouses (alias: whs)(date, status, value, name) requests(id, level, code, amount) Task: Retrieve id from warehouses that have at least one corresponding entry in requests sharing the same status. SQL:
SELECT id FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "requests", "outer_alias": "whs", "inner_alias": "ordr", "proj_col": "id", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_10431
train
T2
v1
Schema: regions (alias: rgn)(name, type, date, id) invoices(name, date, type, id) Task: Select amount from regions where status exists in invoices for the same status. SQL:
SELECT amount FROM regions AS rgn WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.status = rgn.status );
{ "outer_table": "regions", "inner_table": "invoices", "outer_alias": "rgn", "inner_alias": "inv", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_10432
train
T2
v2
Schema: departments (alias: dept)(type, amount, id, code) categories(id, level, status, amount) Task: Retrieve code from departments that have at least one corresponding entry in categories sharing the same status. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = dept.status );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "code", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_10433
train
T1
v1
Schema: transactions (alias: txn)(name, status, amount, value) accounts(type, amount, id, salary) Task: Select code from transactions where level exists in accounts for the same id. SQL:
SELECT code FROM transactions AS txn WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.id = txn.id );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "code", "filter_col": "level", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_10434
train
T1
v2
Schema: invoices (alias: inv)(code, value, name, type) transactions(type, id, value, name) Task: Retrieve code from invoices that have at least one corresponding entry in transactions sharing the same level. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = inv.level );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "code", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_10435
train
T1
v3
Schema: categories (alias: catg)(level, id, date, salary) services(date, name, code, level) Task: Find name from categories where salary exceeds the average amount from services for the same level. SQL:
SELECT name FROM categories AS catg WHERE salary > ( SELECT MAX(amount) FROM services AS srvc WHERE srvc.level = catg.level );
{ "outer_table": "categories", "inner_table": "services", "outer_alias": "catg", "inner_alias": "srvc", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_10436
train
T2
v2
Schema: services (alias: srvc)(status, level, date, value) customers(salary, value, id, type) Task: Retrieve salary from services that have at least one corresponding entry in customers sharing the same id. SQL:
SELECT salary FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = srvc.id );
{ "outer_table": "services", "inner_table": "customers", "outer_alias": "srvc", "inner_alias": "cust", "proj_col": "salary", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_10437
train
T2
v1
Schema: orders (alias: ord)(salary, date, level, code) employees(status, salary, id, level) Task: Retrieve salary from orders whose level is found in employees rows where code matches the outer record. SQL:
SELECT salary FROM orders AS ord WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.code = ord.code );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "salary", "filter_col": "level", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_10438
train
T1
v2
Schema: invoices (alias: inv)(status, type, value, salary) managers(status, name, value, type) Task: Find name from invoices where a matching record exists in managers with the same type. SQL:
SELECT name FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = inv.type );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "name", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_10439
train
T1
v1
Schema: transactions (alias: txn)(status, salary, amount, name) staff(salary, code, date, status) Task: Select amount from transactions where code exists in staff for the same status. SQL:
SELECT amount FROM transactions AS txn WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.status = txn.status );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_10440
train
T1
v1
Schema: categories (alias: catg)(code, type, date, id) orders(name, value, id, level) Task: Retrieve salary from categories whose status is found in orders rows where status matches the outer record. SQL:
SELECT salary FROM categories AS catg WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.status = catg.status );
{ "outer_table": "categories", "inner_table": "orders", "outer_alias": "catg", "inner_alias": "ord", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_10441
train
T2
v2
Schema: requests (alias: ordr)(amount, salary, status, name) staff(value, id, status, date) Task: Find value from requests where a matching record exists in staff with the same type. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = ordr.type );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "value", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_10442
train
T2
v1
Schema: schedules (alias: schd)(type, value, id, level) regions(date, id, code, name) Task: Select salary from schedules where type exists in regions for the same type. SQL:
SELECT salary FROM schedules AS schd WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.type = schd.type );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_10443
train
T2
v2
Schema: accounts (alias: acct)(name, salary, id, date) departments(level, code, date, id) Task: Retrieve name from accounts that have at least one corresponding entry in departments sharing the same level. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = acct.level );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "name", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_10444
train
T1
v1
Schema: shipments (alias: shp)(level, type, salary, name) staff(level, id, type, code) Task: Retrieve value from shipments whose code is found in staff rows where status matches the outer record. SQL:
SELECT value FROM shipments AS shp WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.status = shp.status );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_10445
train
T2
v1
Schema: orders (alias: ord)(amount, value, level, status) accounts(status, level, date, value) Task: Retrieve salary from orders whose type is found in accounts rows where id matches the outer record. SQL:
SELECT salary FROM orders AS ord WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.id = ord.id );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "salary", "filter_col": "type", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_10446
train
T1
v1
Schema: sales (alias: sale)(id, date, level, status) invoices(type, salary, code, name) Task: Retrieve code from sales whose code is found in invoices rows where id matches the outer record. SQL:
SELECT code FROM sales AS sale WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.id = sale.id );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_10447
train
T1
v3
Schema: budgets (alias: budg)(level, status, amount, name) shipments(type, status, name, id) Task: Retrieve code from budgets with value above the SUM(value) of shipments rows sharing the same id. SQL:
SELECT code FROM budgets AS budg WHERE value > ( SELECT SUM(value) FROM shipments AS shp WHERE shp.id = budg.id );
{ "outer_table": "budgets", "inner_table": "shipments", "outer_alias": "budg", "inner_alias": "shp", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_10448
train
T2
v2
Schema: warehouses (alias: whs)(level, value, name, date) transactions(date, type, name, code) Task: Find name from warehouses where a matching record exists in transactions with the same type. SQL:
SELECT name FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "transactions", "outer_alias": "whs", "inner_alias": "txn", "proj_col": "name", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_10449
train
T2
v1
Schema: shipments (alias: shp)(level, salary, code, value) departments(date, amount, salary, id) Task: Retrieve salary from shipments whose type is found in departments rows where type matches the outer record. SQL:
SELECT salary FROM shipments AS shp WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.type = shp.type );
{ "outer_table": "shipments", "inner_table": "departments", "outer_alias": "shp", "inner_alias": "dept", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_10450
train
T2
v3
Schema: products (alias: prod)(code, status, date, level) requests(value, id, status, level) Task: Retrieve id from products with amount above the MAX(value) of requests rows sharing the same status. SQL:
SELECT id FROM products AS prod WHERE amount > ( SELECT MAX(value) FROM requests AS ordr WHERE ordr.status = prod.status );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_10451
train
T1
v2
Schema: staff (alias: empl)(date, amount, status, name) invoices(amount, type, code, value) Task: Retrieve salary from staff that have at least one corresponding entry in invoices sharing the same code. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = empl.code );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "salary", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_10452
train
T2
v2
Schema: transactions (alias: txn)(type, id, amount, value) managers(value, name, date, level) Task: Find name from transactions where a matching record exists in managers with the same type. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = txn.type );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "name", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_10453
train
T1
v3
Schema: employees (alias: emp)(name, type, value, amount) budgets(level, id, name, status) Task: Find amount from employees where value exceeds the average salary from budgets for the same code. SQL:
SELECT amount FROM employees AS emp WHERE value > ( SELECT MAX(salary) FROM budgets AS budg WHERE budg.code = emp.code );
{ "outer_table": "employees", "inner_table": "budgets", "outer_alias": "emp", "inner_alias": "budg", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_10454
train
T1
v1
Schema: budgets (alias: budg)(amount, level, salary, name) items(value, type, salary, status) Task: Find amount from budgets where level appears in items entries with matching status. SQL:
SELECT amount FROM budgets AS budg WHERE level IN ( SELECT level FROM items AS lne WHERE lne.status = budg.status );
{ "outer_table": "budgets", "inner_table": "items", "outer_alias": "budg", "inner_alias": "lne", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_10455
train
T2
v3
Schema: managers (alias: mgr)(code, id, date, status) regions(name, id, code, value) Task: Retrieve name from managers with amount above the MAX(value) of regions rows sharing the same code. SQL:
SELECT name FROM managers AS mgr WHERE amount > ( SELECT MAX(value) FROM regions AS rgn WHERE rgn.code = mgr.code );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_10456
train
T1
v3
Schema: invoices (alias: inv)(salary, type, amount, id) categories(name, id, level, date) Task: Retrieve name from invoices with value above the MAX(salary) of categories rows sharing the same level. SQL:
SELECT name FROM invoices AS inv WHERE value > ( SELECT MAX(salary) FROM categories AS catg WHERE catg.level = inv.level );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_10457
train
T1
v3
Schema: shipments (alias: shp)(name, code, value, level) transactions(code, status, type, value) Task: Find salary from shipments where salary exceeds the average amount from transactions for the same status. SQL:
SELECT salary FROM shipments AS shp WHERE salary > ( SELECT COUNT(amount) FROM transactions AS txn WHERE txn.status = shp.status );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_10458
train
T2
v2
Schema: requests (alias: ordr)(type, date, id, name) orders(date, level, status, value) Task: Retrieve amount from requests that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = ordr.level );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "amount", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_10459
train
T2
v3
Schema: managers (alias: mgr)(id, value, salary, name) sales(code, amount, salary, name) Task: Find salary from managers where value exceeds the average value from sales for the same code. SQL:
SELECT salary FROM managers AS mgr WHERE value > ( SELECT AVG(value) FROM sales AS sale WHERE sale.code = mgr.code );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_10460
train
T1
v3
Schema: orders (alias: ord)(id, name, salary, value) staff(name, level, id, value) Task: Retrieve value from orders with value above the COUNT(salary) of staff rows sharing the same code. SQL:
SELECT value FROM orders AS ord WHERE value > ( SELECT COUNT(salary) FROM staff AS empl WHERE empl.code = ord.code );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_10461
train
T1
v1
Schema: employees (alias: emp)(salary, id, level, amount) staff(status, date, code, level) Task: Retrieve id from employees whose code is found in staff rows where status matches the outer record. SQL:
SELECT id FROM employees AS emp WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.status = emp.status );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_10462
train
T1
v2
Schema: sales (alias: sale)(value, salary, id, amount) managers(type, code, salary, status) Task: Retrieve value from sales that have at least one corresponding entry in managers sharing the same level. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = sale.level );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "value", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_10463
train
T1
v1
Schema: sales (alias: sale)(date, type, status, code) schedules(amount, salary, date, status) Task: Select code from sales where status exists in schedules for the same id. SQL:
SELECT code FROM sales AS sale WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.id = sale.id );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_10464
train
T1
v2
Schema: accounts (alias: acct)(name, type, id, salary) requests(code, status, level, amount) Task: Retrieve value from accounts that have at least one corresponding entry in requests sharing the same status. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = acct.status );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "value", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_10465
train
T1
v2
Schema: departments (alias: dept)(date, code, amount, level) requests(amount, level, date, id) Task: Retrieve name from departments that have at least one corresponding entry in requests sharing the same type. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = dept.type );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "name", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_10466
train
T1
v3
Schema: orders (alias: ord)(status, date, code, value) employees(level, status, id, value) Task: Retrieve value from orders with value above the COUNT(salary) of employees rows sharing the same code. SQL:
SELECT value FROM orders AS ord WHERE value > ( SELECT COUNT(salary) FROM employees AS emp WHERE emp.code = ord.code );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_10467
train
T1
v1
Schema: schedules (alias: schd)(date, amount, type, status) customers(salary, date, value, status) Task: Retrieve name from schedules whose code is found in customers rows where level matches the outer record. SQL:
SELECT name FROM schedules AS schd WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.level = schd.level );
{ "outer_table": "schedules", "inner_table": "customers", "outer_alias": "schd", "inner_alias": "cust", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_10468
train
T2
v1
Schema: departments (alias: dept)(level, code, status, value) customers(date, level, id, value) Task: Find value from departments where code appears in customers entries with matching level. SQL:
SELECT value FROM departments AS dept WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.level = dept.level );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_10469
train
T1
v3
Schema: services (alias: srvc)(id, value, name, type) categories(type, status, level, code) Task: Find name from services where amount exceeds the average value from categories for the same type. SQL:
SELECT name FROM services AS srvc WHERE amount > ( SELECT MIN(value) FROM categories AS catg WHERE catg.type = srvc.type );
{ "outer_table": "services", "inner_table": "categories", "outer_alias": "srvc", "inner_alias": "catg", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_10470
train
T2
v3
Schema: employees (alias: emp)(date, salary, status, id) departments(amount, id, name, code) Task: Retrieve id from employees with amount above the AVG(amount) of departments rows sharing the same level. SQL:
SELECT id FROM employees AS emp WHERE amount > ( SELECT AVG(amount) FROM departments AS dept WHERE dept.level = emp.level );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_10471
train
T1
v1
Schema: requests (alias: ordr)(level, id, type, code) categories(level, code, id, type) Task: Find value from requests where status appears in categories entries with matching status. SQL:
SELECT value FROM requests AS ordr WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.status = ordr.status );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_10472
train
T2
v3
Schema: categories (alias: catg)(amount, code, type, date) transactions(name, date, level, salary) Task: Retrieve salary from categories with amount above the MAX(salary) of transactions rows sharing the same code. SQL:
SELECT salary FROM categories AS catg WHERE amount > ( SELECT MAX(salary) FROM transactions AS txn WHERE txn.code = catg.code );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_10473
train
T2
v3
Schema: categories (alias: catg)(code, id, salary, level) departments(date, id, amount, code) Task: Retrieve code from categories with salary above the SUM(value) of departments rows sharing the same level. SQL:
SELECT code FROM categories AS catg WHERE salary > ( SELECT SUM(value) FROM departments AS dept WHERE dept.level = catg.level );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_10474
train
T2
v1
Schema: requests (alias: ordr)(status, value, id, level) customers(code, amount, id, type) Task: Retrieve id from requests whose code is found in customers rows where type matches the outer record. SQL:
SELECT id FROM requests AS ordr WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.type = ordr.type );
{ "outer_table": "requests", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "id", "filter_col": "code", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_10475
train
T2
v3
Schema: warehouses (alias: whs)(id, value, code, name) budgets(type, code, name, date) Task: Find value from warehouses where value exceeds the average salary from budgets for the same code. SQL:
SELECT value FROM warehouses AS whs WHERE value > ( SELECT SUM(salary) FROM budgets AS budg WHERE budg.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "budgets", "outer_alias": "whs", "inner_alias": "budg", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_10476
train
T2
v1
Schema: customers (alias: cust)(type, code, id, amount) departments(salary, level, date, value) Task: Find amount from customers where level appears in departments entries with matching type. SQL:
SELECT amount FROM customers AS cust WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.type = cust.type );
{ "outer_table": "customers", "inner_table": "departments", "outer_alias": "cust", "inner_alias": "dept", "proj_col": "amount", "filter_col": "level", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_10477
train
T1
v3
Schema: requests (alias: ordr)(id, type, name, level) sales(name, level, type, code) Task: Retrieve salary from requests with value above the COUNT(amount) of sales rows sharing the same id. SQL:
SELECT salary FROM requests AS ordr WHERE value > ( SELECT COUNT(amount) FROM sales AS sale WHERE sale.id = ordr.id );
{ "outer_table": "requests", "inner_table": "sales", "outer_alias": "ordr", "inner_alias": "sale", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_10478
train
T2
v1
Schema: services (alias: srvc)(amount, id, level, date) regions(name, salary, level, date) Task: Select value from services where level exists in regions for the same code. SQL:
SELECT value FROM services AS srvc WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.code = srvc.code );
{ "outer_table": "services", "inner_table": "regions", "outer_alias": "srvc", "inner_alias": "rgn", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_10479
train
T2
v1
Schema: managers (alias: mgr)(status, id, amount, name) requests(salary, date, code, amount) Task: Retrieve id from managers whose id is found in requests rows where type matches the outer record. SQL:
SELECT id FROM managers AS mgr WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.type = mgr.type );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_10480
train
T1
v1
Schema: shipments (alias: shp)(value, code, date, amount) schedules(salary, date, value, name) Task: Select code from shipments where level exists in schedules for the same type. SQL:
SELECT code FROM shipments AS shp WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.type = shp.type );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_10481
train
T2
v1
Schema: requests (alias: ordr)(value, date, salary, status) categories(amount, name, date, value) Task: Retrieve salary from requests whose code is found in categories rows where id matches the outer record. SQL:
SELECT salary FROM requests AS ordr WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.id = ordr.id );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_10482
train
T2
v2
Schema: sales (alias: sale)(status, type, code, salary) shipments(status, code, id, salary) Task: Find amount from sales where a matching record exists in shipments with the same id. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = sale.id );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "amount", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_10483
train
T1
v3
Schema: transactions (alias: txn)(date, id, status, level) accounts(salary, type, value, level) Task: Retrieve value from transactions with salary above the MAX(amount) of accounts rows sharing the same id. SQL:
SELECT value FROM transactions AS txn WHERE salary > ( SELECT MAX(amount) FROM accounts AS acct WHERE acct.id = txn.id );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_10484
train
T1
v1
Schema: customers (alias: cust)(date, id, amount, salary) transactions(level, code, name, date) Task: Select id from customers where type exists in transactions for the same id. SQL:
SELECT id FROM customers AS cust WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.id = cust.id );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_10485
train
T1
v1
Schema: items (alias: lne)(value, salary, name, id) accounts(name, value, id, amount) Task: Select code from items where level exists in accounts for the same type. SQL:
SELECT code FROM items AS lne WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.type = lne.type );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_10486
train
T2
v1
Schema: orders (alias: ord)(date, status, id, salary) services(code, status, value, date) Task: Select name from orders where type exists in services for the same code. SQL:
SELECT name FROM orders AS ord WHERE type IN ( SELECT type FROM services AS srvc WHERE srvc.code = ord.code );
{ "outer_table": "orders", "inner_table": "services", "outer_alias": "ord", "inner_alias": "srvc", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_10487
train
T1
v3
Schema: products (alias: prod)(code, level, amount, salary) transactions(type, level, value, salary) Task: Retrieve value from products with salary above the AVG(amount) of transactions rows sharing the same id. SQL:
SELECT value FROM products AS prod WHERE salary > ( SELECT AVG(amount) FROM transactions AS txn WHERE txn.id = prod.id );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_10488
train
T1
v3
Schema: items (alias: lne)(status, level, name, salary) accounts(id, name, status, code) Task: Retrieve code from items with amount above the COUNT(salary) of accounts rows sharing the same type. SQL:
SELECT code FROM items AS lne WHERE amount > ( SELECT COUNT(salary) FROM accounts AS acct WHERE acct.type = lne.type );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_10489
train
T2
v3
Schema: requests (alias: ordr)(id, date, status, name) managers(status, id, code, date) Task: Retrieve salary from requests with salary above the AVG(salary) of managers rows sharing the same status. SQL:
SELECT salary FROM requests AS ordr WHERE salary > ( SELECT AVG(salary) FROM managers AS mgr WHERE mgr.status = ordr.status );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_10490
train
T2
v1
Schema: services (alias: srvc)(level, type, salary, status) requests(status, id, code, salary) Task: Retrieve name from services whose code is found in requests rows where id matches the outer record. SQL:
SELECT name FROM services AS srvc WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.id = srvc.id );
{ "outer_table": "services", "inner_table": "requests", "outer_alias": "srvc", "inner_alias": "ordr", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_10491
train
T2
v2
Schema: sales (alias: sale)(level, amount, code, id) budgets(id, name, status, type) Task: Retrieve amount from sales that have at least one corresponding entry in budgets sharing the same code. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.code = sale.code );
{ "outer_table": "sales", "inner_table": "budgets", "outer_alias": "sale", "inner_alias": "budg", "proj_col": "amount", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_10492
train
T1
v2
Schema: accounts (alias: acct)(date, amount, id, salary) departments(amount, status, id, salary) Task: Retrieve salary from accounts that have at least one corresponding entry in departments sharing the same level. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = acct.level );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "salary", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_10493
train
T1
v3
Schema: schedules (alias: schd)(date, level, value, status) transactions(type, level, date, amount) Task: Find salary from schedules where salary exceeds the average value from transactions for the same type. SQL:
SELECT salary FROM schedules AS schd WHERE salary > ( SELECT AVG(value) FROM transactions AS txn WHERE txn.type = schd.type );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_10494
train
T2
v3
Schema: budgets (alias: budg)(level, type, value, code) schedules(value, level, salary, code) Task: Retrieve salary from budgets with value above the COUNT(amount) of schedules rows sharing the same type. SQL:
SELECT salary FROM budgets AS budg WHERE value > ( SELECT COUNT(amount) FROM schedules AS schd WHERE schd.type = budg.type );
{ "outer_table": "budgets", "inner_table": "schedules", "outer_alias": "budg", "inner_alias": "schd", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_10495
train
T2
v2
Schema: invoices (alias: inv)(amount, code, status, id) departments(value, id, level, type) Task: Retrieve name from invoices that have at least one corresponding entry in departments sharing the same code. SQL:
SELECT name FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = inv.code );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "name", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_10496
train
T1
v2
Schema: warehouses (alias: whs)(salary, value, name, status) employees(date, id, type, status) Task: Retrieve value from warehouses that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT value FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "employees", "outer_alias": "whs", "inner_alias": "emp", "proj_col": "value", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_10497
train
T2
v2
Schema: sales (alias: sale)(name, salary, code, id) managers(status, level, code, id) Task: Find amount from sales where a matching record exists in managers with the same type. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = sale.type );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "amount", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_10498
train
T1
v1
Schema: schedules (alias: schd)(id, date, name, level) requests(value, date, amount, status) Task: Select salary from schedules where type exists in requests for the same id. SQL:
SELECT salary FROM schedules AS schd WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.id = schd.id );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "type", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_10499
train
T2