variant
stringclasses
3 values
prompt
stringlengths
163
237
sql
stringlengths
103
143
metadata
unknown
id
stringlengths
21
21
split
stringclasses
1 value
token_group
stringclasses
2 values
v2
Schema: budgets (alias: budg)(date, name, type, code) regions(name, status, level, id) Task: Find name from budgets where a matching record exists in regions with the same type. SQL:
SELECT name FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = budg.type );
{ "outer_table": "budgets", "inner_table": "regions", "outer_alias": "budg", "inner_alias": "rgn", "proj_col": "name", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_01500
train
T2
v3
Schema: managers (alias: mgr)(name, status, amount, type) services(amount, date, type, name) Task: Find salary from managers where salary exceeds the average value from services for the same type. SQL:
SELECT salary FROM managers AS mgr WHERE salary > ( SELECT MAX(value) FROM services AS srvc WHERE srvc.type = mgr.type );
{ "outer_table": "managers", "inner_table": "services", "outer_alias": "mgr", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_01501
train
T1
v2
Schema: warehouses (alias: whs)(amount, type, date, value) products(date, level, type, value) Task: Find value from warehouses where a matching record exists in products with the same level. SQL:
SELECT value FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "products", "outer_alias": "whs", "inner_alias": "prod", "proj_col": "value", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_01502
train
T2
v1
Schema: customers (alias: cust)(salary, level, amount, name) schedules(status, level, value, id) Task: Select amount from customers where status exists in schedules for the same type. SQL:
SELECT amount FROM customers AS cust WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.type = cust.type );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "amount", "filter_col": "status", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_01503
train
T1
v2
Schema: orders (alias: ord)(name, value, date, status) schedules(date, value, level, type) Task: Retrieve value from orders that have at least one corresponding entry in schedules sharing the same id. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = ord.id );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "value", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_01504
train
T1
v2
Schema: invoices (alias: inv)(salary, status, date, value) schedules(id, type, value, name) Task: Find amount from invoices where a matching record exists in schedules with the same code. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = inv.code );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "amount", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_01505
train
T1
v2
Schema: invoices (alias: inv)(code, type, name, id) managers(name, date, salary, code) Task: Retrieve name from invoices that have at least one corresponding entry in managers sharing the same id. SQL:
SELECT name FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = inv.id );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "name", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_01506
train
T1
v3
Schema: items (alias: lne)(level, status, value, type) shipments(name, amount, id, type) Task: Retrieve code from items with value above the MAX(value) of shipments rows sharing the same status. SQL:
SELECT code FROM items AS lne WHERE value > ( SELECT MAX(value) FROM shipments AS shp WHERE shp.status = lne.status );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_01507
train
T2
v2
Schema: departments (alias: dept)(value, code, type, amount) staff(status, type, amount, date) Task: Find value from departments where a matching record exists in staff with the same type. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = dept.type );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "value", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_01508
train
T1
v2
Schema: sales (alias: sale)(type, code, level, name) products(date, salary, status, amount) Task: Retrieve salary from sales that have at least one corresponding entry in products sharing the same id. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = sale.id );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "salary", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_01509
train
T1
v3
Schema: budgets (alias: budg)(value, status, level, code) requests(type, level, amount, value) Task: Retrieve amount from budgets with value above the COUNT(amount) of requests rows sharing the same code. SQL:
SELECT amount FROM budgets AS budg WHERE value > ( SELECT COUNT(amount) FROM requests AS ordr WHERE ordr.code = budg.code );
{ "outer_table": "budgets", "inner_table": "requests", "outer_alias": "budg", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_01510
train
T2
v2
Schema: managers (alias: mgr)(date, value, level, status) products(amount, id, code, date) Task: Retrieve code from managers that have at least one corresponding entry in products sharing the same id. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = mgr.id );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "code", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_01511
train
T1
v3
Schema: departments (alias: dept)(type, status, date, name) employees(id, code, salary, amount) Task: Retrieve name from departments with salary above the AVG(amount) of employees rows sharing the same id. SQL:
SELECT name FROM departments AS dept WHERE salary > ( SELECT AVG(amount) FROM employees AS emp WHERE emp.id = dept.id );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_01512
train
T1
v2
Schema: orders (alias: ord)(status, id, amount, code) requests(salary, code, date, amount) Task: Find id from orders where a matching record exists in requests with the same type. SQL:
SELECT id FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = ord.type );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "id", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_01513
train
T1
v1
Schema: employees (alias: emp)(type, id, amount, name) staff(id, salary, amount, value) Task: Select code from employees where code exists in staff for the same status. SQL:
SELECT code 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": "code", "filter_col": "code", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_01514
train
T1
v2
Schema: invoices (alias: inv)(level, amount, value, name) employees(date, code, level, status) Task: Retrieve amount from invoices that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = inv.status );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "amount", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_01515
train
T1
v2
Schema: services (alias: srvc)(type, status, id, level) staff(id, status, value, salary) Task: Retrieve code from services that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT code FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = srvc.status );
{ "outer_table": "services", "inner_table": "staff", "outer_alias": "srvc", "inner_alias": "empl", "proj_col": "code", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_01516
train
T2
v1
Schema: employees (alias: emp)(salary, amount, type, value) invoices(name, value, date, status) Task: Select amount from employees where status exists in invoices for the same level. SQL:
SELECT amount FROM employees AS emp WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.level = emp.level );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_01517
train
T1
v1
Schema: products (alias: prod)(type, date, id, value) requests(code, amount, status, value) Task: Find salary from products where status appears in requests entries with matching code. SQL:
SELECT salary FROM products AS prod WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.code = prod.code );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_01518
train
T1
v2
Schema: shipments (alias: shp)(value, amount, code, type) items(code, id, date, amount) Task: Find amount from shipments where a matching record exists in items with the same status. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = shp.status );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "amount", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_01519
train
T2
v1
Schema: regions (alias: rgn)(name, date, status, code) customers(type, salary, status, code) Task: Retrieve salary from regions whose level is found in customers rows where id matches the outer record. SQL:
SELECT salary FROM regions AS rgn WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.id = rgn.id );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "salary", "filter_col": "level", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_01520
train
T2
v1
Schema: sales (alias: sale)(level, salary, type, id) staff(name, status, amount, value) Task: Select code from sales where status exists in staff for the same id. SQL:
SELECT code FROM sales AS sale WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.id = sale.id );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_01521
train
T1
v1
Schema: warehouses (alias: whs)(status, id, level, salary) employees(status, type, level, id) Task: Find value from warehouses where id appears in employees entries with matching id. SQL:
SELECT value FROM warehouses AS whs WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "employees", "outer_alias": "whs", "inner_alias": "emp", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_01522
train
T2
v3
Schema: shipments (alias: shp)(amount, name, status, id) customers(status, id, amount, code) Task: Retrieve salary from shipments with amount above the AVG(value) of customers rows sharing the same type. SQL:
SELECT salary FROM shipments AS shp WHERE amount > ( SELECT AVG(value) FROM customers AS cust WHERE cust.type = shp.type );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_01523
train
T2
v1
Schema: staff (alias: empl)(name, amount, level, id) items(name, type, date, id) Task: Retrieve code from staff whose level is found in items rows where status matches the outer record. SQL:
SELECT code FROM staff AS empl WHERE level IN ( SELECT level FROM items AS lne WHERE lne.status = empl.status );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_01524
train
T2
v1
Schema: budgets (alias: budg)(status, type, name, amount) categories(amount, value, name, date) Task: Select code from budgets where code exists in categories for the same code. SQL:
SELECT code FROM budgets AS budg WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.code = budg.code );
{ "outer_table": "budgets", "inner_table": "categories", "outer_alias": "budg", "inner_alias": "catg", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_01525
train
T2
v1
Schema: departments (alias: dept)(salary, amount, status, code) items(amount, name, date, status) Task: Find code from departments where status appears in items entries with matching type. SQL:
SELECT code FROM departments AS dept WHERE status IN ( SELECT status FROM items AS lne WHERE lne.type = dept.type );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_01526
train
T1
v2
Schema: shipments (alias: shp)(date, code, id, status) managers(salary, code, date, level) Task: Find value from shipments where a matching record exists in managers with the same level. SQL:
SELECT value FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = shp.level );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "value", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_01527
train
T2
v1
Schema: departments (alias: dept)(id, code, name, type) shipments(code, name, date, value) Task: Retrieve code from departments whose code is found in shipments rows where status matches the outer record. SQL:
SELECT code FROM departments AS dept WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.status = dept.status );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "code", "filter_col": "code", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_01528
train
T1
v3
Schema: budgets (alias: budg)(level, name, id, salary) managers(type, name, status, level) Task: Find value from budgets where salary exceeds the average value from managers for the same status. SQL:
SELECT value FROM budgets AS budg WHERE salary > ( SELECT COUNT(value) FROM managers AS mgr WHERE mgr.status = budg.status );
{ "outer_table": "budgets", "inner_table": "managers", "outer_alias": "budg", "inner_alias": "mgr", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_01529
train
T2
v1
Schema: orders (alias: ord)(level, amount, id, salary) schedules(date, amount, name, id) Task: Retrieve code from orders whose type is found in schedules rows where id matches the outer record. SQL:
SELECT code FROM orders AS ord WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.id = ord.id );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "code", "filter_col": "type", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_01530
train
T1
v1
Schema: transactions (alias: txn)(code, type, name, level) shipments(id, value, code, date) Task: Select amount from transactions where code exists in shipments for the same code. SQL:
SELECT amount FROM transactions AS txn WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.code = txn.code );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_01531
train
T1
v2
Schema: budgets (alias: budg)(type, salary, id, value) warehouses(name, value, date, salary) Task: Find name from budgets where a matching record exists in warehouses with the same status. SQL:
SELECT name FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.status = budg.status );
{ "outer_table": "budgets", "inner_table": "warehouses", "outer_alias": "budg", "inner_alias": "whs", "proj_col": "name", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_01532
train
T2
v3
Schema: managers (alias: mgr)(amount, level, status, id) budgets(type, status, level, salary) Task: Find name from managers where value exceeds the average salary from budgets for the same code. SQL:
SELECT name FROM managers AS mgr WHERE value > ( SELECT AVG(salary) FROM budgets AS budg WHERE budg.code = mgr.code );
{ "outer_table": "managers", "inner_table": "budgets", "outer_alias": "mgr", "inner_alias": "budg", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_01533
train
T1
v1
Schema: services (alias: srvc)(date, id, code, salary) sales(level, value, id, salary) Task: Find id from services where code appears in sales entries with matching code. SQL:
SELECT id FROM services AS srvc WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.code = srvc.code );
{ "outer_table": "services", "inner_table": "sales", "outer_alias": "srvc", "inner_alias": "sale", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_01534
train
T2
v1
Schema: regions (alias: rgn)(value, salary, level, code) customers(salary, value, name, date) Task: Find salary from regions where type appears in customers entries with matching id. SQL:
SELECT salary FROM regions AS rgn WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.id = rgn.id );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "salary", "filter_col": "type", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_01535
train
T2
v2
Schema: sales (alias: sale)(name, status, level, amount) shipments(id, salary, status, value) Task: Retrieve value from sales that have at least one corresponding entry in shipments sharing the same type. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = sale.type );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "value", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_01536
train
T1
v1
Schema: departments (alias: dept)(type, status, amount, date) employees(salary, code, status, amount) Task: Select code from departments where level exists in employees for the same status. SQL:
SELECT code FROM departments AS dept WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.status = dept.status );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_01537
train
T1
v1
Schema: accounts (alias: acct)(status, id, date, amount) items(type, status, amount, value) Task: Find value from accounts where level appears in items entries with matching type. SQL:
SELECT value FROM accounts AS acct WHERE level IN ( SELECT level FROM items AS lne WHERE lne.type = acct.type );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_01538
train
T1
v3
Schema: categories (alias: catg)(salary, name, date, status) requests(type, amount, salary, level) Task: Retrieve value from categories with value above the AVG(salary) of requests rows sharing the same status. SQL:
SELECT value FROM categories AS catg WHERE value > ( SELECT AVG(salary) FROM requests AS ordr WHERE ordr.status = catg.status );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_01539
train
T2
v2
Schema: departments (alias: dept)(id, status, level, value) customers(date, amount, value, level) Task: Retrieve code from departments that have at least one corresponding entry in customers sharing the same code. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = dept.code );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "code", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_01540
train
T1
v2
Schema: invoices (alias: inv)(level, code, salary, status) employees(level, name, code, value) Task: Retrieve name from invoices that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT name FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = inv.status );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "name", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_01541
train
T1
v2
Schema: services (alias: srvc)(amount, date, type, name) accounts(id, amount, type, level) Task: Find salary from services where a matching record exists in accounts with the same level. SQL:
SELECT salary FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = srvc.level );
{ "outer_table": "services", "inner_table": "accounts", "outer_alias": "srvc", "inner_alias": "acct", "proj_col": "salary", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_01542
train
T2
v3
Schema: accounts (alias: acct)(amount, name, value, status) schedules(type, level, value, status) Task: Find id from accounts where salary exceeds the average value from schedules for the same id. SQL:
SELECT id FROM accounts AS acct WHERE salary > ( SELECT MIN(value) FROM schedules AS schd WHERE schd.id = acct.id );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_01543
train
T1
v1
Schema: warehouses (alias: whs)(status, code, value, id) staff(salary, amount, type, date) Task: Retrieve id from warehouses whose type is found in staff rows where level matches the outer record. SQL:
SELECT id FROM warehouses AS whs WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "staff", "outer_alias": "whs", "inner_alias": "empl", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_01544
train
T2
v3
Schema: schedules (alias: schd)(value, status, date, amount) staff(name, status, value, type) Task: Find salary from schedules where amount exceeds the average value from staff for the same id. SQL:
SELECT salary FROM schedules AS schd WHERE amount > ( SELECT MIN(value) FROM staff AS empl WHERE empl.id = schd.id );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_01545
train
T2
v3
Schema: transactions (alias: txn)(code, type, status, amount) invoices(value, name, id, amount) Task: Find id from transactions where value exceeds the average salary from invoices for the same code. SQL:
SELECT id FROM transactions AS txn WHERE value > ( SELECT MIN(salary) FROM invoices AS inv WHERE inv.code = txn.code );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_01546
train
T1
v3
Schema: shipments (alias: shp)(name, status, date, salary) schedules(code, name, date, salary) Task: Find salary from shipments where value exceeds the average salary from schedules for the same type. SQL:
SELECT salary FROM shipments AS shp WHERE value > ( SELECT MAX(salary) FROM schedules AS schd WHERE schd.type = shp.type );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_01547
train
T2
v2
Schema: staff (alias: empl)(value, name, status, type) items(type, code, value, id) Task: Find value from staff where a matching record exists in items with the same code. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = empl.code );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "value", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_01548
train
T2
v2
Schema: products (alias: prod)(level, amount, type, value) sales(name, id, status, value) Task: Find code from products where a matching record exists in sales with the same status. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = prod.status );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "code", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_01549
train
T1
v3
Schema: requests (alias: ordr)(code, salary, status, value) invoices(code, name, amount, id) Task: Find amount from requests where amount exceeds the average amount from invoices for the same status. SQL:
SELECT amount FROM requests AS ordr WHERE amount > ( SELECT MAX(amount) FROM invoices AS inv WHERE inv.status = ordr.status );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_01550
train
T2
v3
Schema: regions (alias: rgn)(level, type, salary, name) customers(code, value, id, type) Task: Find salary from regions where amount exceeds the average salary from customers for the same code. SQL:
SELECT salary FROM regions AS rgn WHERE amount > ( SELECT MAX(salary) FROM customers AS cust WHERE cust.code = rgn.code );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_01551
train
T2
v3
Schema: invoices (alias: inv)(value, salary, name, level) warehouses(type, salary, date, level) Task: Find id from invoices where amount exceeds the average value from warehouses for the same code. SQL:
SELECT id FROM invoices AS inv WHERE amount > ( SELECT COUNT(value) FROM warehouses AS whs WHERE whs.code = inv.code );
{ "outer_table": "invoices", "inner_table": "warehouses", "outer_alias": "inv", "inner_alias": "whs", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_01552
train
T1
v1
Schema: invoices (alias: inv)(date, salary, amount, type) services(id, level, status, code) Task: Retrieve name from invoices whose id is found in services rows where id matches the outer record. SQL:
SELECT name FROM invoices AS inv WHERE id IN ( SELECT id FROM services AS srvc WHERE srvc.id = inv.id );
{ "outer_table": "invoices", "inner_table": "services", "outer_alias": "inv", "inner_alias": "srvc", "proj_col": "name", "filter_col": "id", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_01553
train
T1
v3
Schema: managers (alias: mgr)(amount, name, type, level) budgets(name, salary, status, value) Task: Retrieve salary from managers with amount above the SUM(salary) of budgets rows sharing the same level. SQL:
SELECT salary FROM managers AS mgr WHERE amount > ( SELECT SUM(salary) FROM budgets AS budg WHERE budg.level = mgr.level );
{ "outer_table": "managers", "inner_table": "budgets", "outer_alias": "mgr", "inner_alias": "budg", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_01554
train
T1
v2
Schema: services (alias: srvc)(amount, name, level, value) accounts(date, status, amount, code) Task: Retrieve salary from services that have at least one corresponding entry in accounts sharing the same status. SQL:
SELECT salary FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = srvc.status );
{ "outer_table": "services", "inner_table": "accounts", "outer_alias": "srvc", "inner_alias": "acct", "proj_col": "salary", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_01555
train
T2
v1
Schema: employees (alias: emp)(id, value, salary, date) budgets(amount, code, salary, level) Task: Retrieve name from employees whose status is found in budgets rows where status matches the outer record. SQL:
SELECT name FROM employees AS emp WHERE status IN ( SELECT status FROM budgets AS budg WHERE budg.status = emp.status );
{ "outer_table": "employees", "inner_table": "budgets", "outer_alias": "emp", "inner_alias": "budg", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_01556
train
T1
v3
Schema: invoices (alias: inv)(id, name, salary, level) managers(code, amount, level, date) Task: Retrieve name from invoices with salary above the SUM(value) of managers rows sharing the same status. SQL:
SELECT name FROM invoices AS inv WHERE salary > ( SELECT SUM(value) FROM managers AS mgr WHERE mgr.status = inv.status );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_01557
train
T1
v2
Schema: services (alias: srvc)(id, date, code, amount) managers(status, code, date, value) Task: Find amount from services where a matching record exists in managers with the same id. SQL:
SELECT amount FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = srvc.id );
{ "outer_table": "services", "inner_table": "managers", "outer_alias": "srvc", "inner_alias": "mgr", "proj_col": "amount", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_01558
train
T2
v1
Schema: staff (alias: empl)(level, amount, code, id) services(value, level, status, salary) Task: Find id from staff where id appears in services entries with matching level. SQL:
SELECT id FROM staff AS empl WHERE id IN ( SELECT id FROM services AS srvc WHERE srvc.level = empl.level );
{ "outer_table": "staff", "inner_table": "services", "outer_alias": "empl", "inner_alias": "srvc", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_01559
train
T2
v1
Schema: categories (alias: catg)(level, value, name, amount) budgets(level, type, amount, name) Task: Retrieve amount from categories whose level is found in budgets rows where status matches the outer record. SQL:
SELECT amount FROM categories AS catg WHERE level IN ( SELECT level FROM budgets AS budg WHERE budg.status = catg.status );
{ "outer_table": "categories", "inner_table": "budgets", "outer_alias": "catg", "inner_alias": "budg", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_01560
train
T2
v3
Schema: items (alias: lne)(name, date, salary, id) products(status, value, amount, date) Task: Find value from items where amount exceeds the average value from products for the same code. SQL:
SELECT value FROM items AS lne WHERE amount > ( SELECT COUNT(value) FROM products AS prod WHERE prod.code = lne.code );
{ "outer_table": "items", "inner_table": "products", "outer_alias": "lne", "inner_alias": "prod", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_01561
train
T2
v2
Schema: staff (alias: empl)(date, code, type, level) regions(level, name, amount, value) Task: Retrieve id from staff that have at least one corresponding entry in regions sharing the same status. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = empl.status );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "id", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_01562
train
T2
v3
Schema: requests (alias: ordr)(code, salary, name, amount) sales(status, amount, code, date) Task: Retrieve code from requests with amount above the MIN(value) of sales rows sharing the same status. SQL:
SELECT code FROM requests AS ordr WHERE amount > ( SELECT MIN(value) FROM sales AS sale WHERE sale.status = ordr.status );
{ "outer_table": "requests", "inner_table": "sales", "outer_alias": "ordr", "inner_alias": "sale", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_01563
train
T2
v2
Schema: warehouses (alias: whs)(id, name, salary, date) employees(id, value, date, salary) Task: Retrieve salary from warehouses that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT salary 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": "salary", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_01564
train
T2
v1
Schema: sales (alias: sale)(amount, value, date, level) transactions(date, name, id, value) Task: Find amount from sales where code appears in transactions entries with matching status. SQL:
SELECT amount FROM sales AS sale WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.status = sale.status );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_01565
train
T1
v2
Schema: employees (alias: emp)(salary, amount, status, code) budgets(code, id, level, amount) Task: Retrieve salary from employees that have at least one corresponding entry in budgets sharing the same type. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.type = emp.type );
{ "outer_table": "employees", "inner_table": "budgets", "outer_alias": "emp", "inner_alias": "budg", "proj_col": "salary", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_01566
train
T1
v1
Schema: items (alias: lne)(status, type, name, salary) transactions(amount, id, level, value) Task: Find name from items where status appears in transactions entries with matching type. SQL:
SELECT name FROM items AS lne WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.type = lne.type );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_01567
train
T2
v1
Schema: items (alias: lne)(amount, status, name, value) staff(status, salary, date, id) Task: Retrieve value from items whose status is found in staff rows where level matches the outer record. SQL:
SELECT value FROM items AS lne WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.level = lne.level );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_01568
train
T2
v3
Schema: departments (alias: dept)(level, amount, salary, date) items(level, type, date, id) Task: Find value from departments where value exceeds the average value from items for the same level. SQL:
SELECT value FROM departments AS dept WHERE value > ( SELECT AVG(value) FROM items AS lne WHERE lne.level = dept.level );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_01569
train
T1
v3
Schema: accounts (alias: acct)(amount, salary, status, type) categories(date, name, code, salary) Task: Retrieve value from accounts with salary above the MAX(amount) of categories rows sharing the same type. SQL:
SELECT value FROM accounts AS acct WHERE salary > ( SELECT MAX(amount) FROM categories AS catg WHERE catg.type = acct.type );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_01570
train
T1
v3
Schema: transactions (alias: txn)(code, status, id, type) products(id, level, status, value) Task: Find id from transactions where amount exceeds the average amount from products for the same id. SQL:
SELECT id FROM transactions AS txn WHERE amount > ( SELECT SUM(amount) FROM products AS prod WHERE prod.id = txn.id );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_01571
train
T1
v2
Schema: employees (alias: emp)(salary, code, id, value) orders(salary, amount, name, type) Task: Retrieve amount from employees that have at least one corresponding entry in orders sharing the same type. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = emp.type );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "amount", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_01572
train
T1
v3
Schema: invoices (alias: inv)(value, status, code, name) budgets(value, code, type, level) Task: Retrieve name from invoices with amount above the AVG(salary) of budgets rows sharing the same status. SQL:
SELECT name FROM invoices AS inv WHERE amount > ( SELECT AVG(salary) FROM budgets AS budg WHERE budg.status = inv.status );
{ "outer_table": "invoices", "inner_table": "budgets", "outer_alias": "inv", "inner_alias": "budg", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_01573
train
T1
v3
Schema: managers (alias: mgr)(amount, level, id, value) sales(date, id, code, type) Task: Find amount from managers where salary exceeds the average amount from sales for the same status. SQL:
SELECT amount FROM managers AS mgr WHERE salary > ( SELECT SUM(amount) FROM sales AS sale WHERE sale.status = mgr.status );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_01574
train
T1
v2
Schema: managers (alias: mgr)(status, amount, level, date) orders(status, level, salary, name) Task: Retrieve id from managers that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = mgr.code );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "id", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_01575
train
T1
v1
Schema: customers (alias: cust)(type, level, status, value) categories(value, name, date, level) Task: Select code from customers where code exists in categories for the same code. SQL:
SELECT code FROM customers AS cust WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.code = cust.code );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_01576
train
T1
v1
Schema: employees (alias: emp)(level, value, type, amount) orders(type, amount, date, name) Task: Select salary from employees where code exists in orders for the same id. SQL:
SELECT salary FROM employees AS emp WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.id = emp.id );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_01577
train
T1
v1
Schema: invoices (alias: inv)(value, salary, level, status) shipments(date, salary, id, value) Task: Retrieve value from invoices whose type is found in shipments rows where id matches the outer record. SQL:
SELECT value FROM invoices AS inv WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.id = inv.id );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "value", "filter_col": "type", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_01578
train
T1
v1
Schema: regions (alias: rgn)(id, salary, type, status) managers(level, date, type, id) Task: Select code from regions where level exists in managers for the same level. SQL:
SELECT code FROM regions AS rgn WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.level = rgn.level );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "code", "filter_col": "level", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_01579
train
T2
v2
Schema: managers (alias: mgr)(level, salary, id, type) categories(status, salary, code, type) Task: Retrieve id from managers that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT id 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": "id", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_01580
train
T1
v2
Schema: warehouses (alias: whs)(value, status, type, name) departments(type, value, id, salary) Task: Find id from warehouses where a matching record exists in departments with the same code. SQL:
SELECT id FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "departments", "outer_alias": "whs", "inner_alias": "dept", "proj_col": "id", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_01581
train
T2
v3
Schema: requests (alias: ordr)(status, id, code, level) warehouses(salary, value, date, code) Task: Retrieve code from requests with value above the MAX(amount) of warehouses rows sharing the same status. SQL:
SELECT code FROM requests AS ordr WHERE value > ( SELECT MAX(amount) FROM warehouses AS whs WHERE whs.status = ordr.status );
{ "outer_table": "requests", "inner_table": "warehouses", "outer_alias": "ordr", "inner_alias": "whs", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_01582
train
T2
v1
Schema: products (alias: prod)(value, id, name, date) customers(salary, status, type, level) Task: Select code from products where code exists in customers for the same type. SQL:
SELECT code FROM products AS prod WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.type = prod.type );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "code", "filter_col": "code", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_01583
train
T1
v2
Schema: regions (alias: rgn)(level, type, date, amount) customers(salary, id, status, level) Task: Find code from regions where a matching record exists in customers with the same status. SQL:
SELECT code FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = rgn.status );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "code", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_01584
train
T2
v2
Schema: employees (alias: emp)(name, type, date, status) transactions(code, id, status, value) Task: Find salary from employees where a matching record exists in transactions with the same id. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = emp.id );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "salary", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_01585
train
T1
v1
Schema: invoices (alias: inv)(name, date, amount, value) items(value, code, salary, name) Task: Select id from invoices where id exists in items for the same id. SQL:
SELECT id FROM invoices AS inv WHERE id IN ( SELECT id FROM items AS lne WHERE lne.id = inv.id );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_01586
train
T1
v3
Schema: invoices (alias: inv)(level, date, code, salary) services(value, amount, level, id) Task: Find salary from invoices where salary exceeds the average salary from services for the same type. SQL:
SELECT salary FROM invoices AS inv WHERE salary > ( SELECT AVG(salary) FROM services AS srvc WHERE srvc.type = inv.type );
{ "outer_table": "invoices", "inner_table": "services", "outer_alias": "inv", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_01587
train
T1
v2
Schema: warehouses (alias: whs)(salary, id, name, value) products(salary, date, level, status) Task: Retrieve amount from warehouses that have at least one corresponding entry in products sharing the same id. SQL:
SELECT amount FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "products", "outer_alias": "whs", "inner_alias": "prod", "proj_col": "amount", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_01588
train
T2
v1
Schema: warehouses (alias: whs)(type, status, level, code) services(amount, type, date, name) Task: Select name from warehouses where level exists in services for the same status. SQL:
SELECT name FROM warehouses AS whs WHERE level IN ( SELECT level FROM services AS srvc WHERE srvc.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "services", "outer_alias": "whs", "inner_alias": "srvc", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_01589
train
T2
v3
Schema: employees (alias: emp)(status, level, id, date) customers(id, code, amount, status) Task: Retrieve name from employees with salary above the COUNT(value) of customers rows sharing the same code. SQL:
SELECT name FROM employees AS emp WHERE salary > ( SELECT COUNT(value) FROM customers AS cust WHERE cust.code = emp.code );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_01590
train
T1
v1
Schema: products (alias: prod)(level, salary, amount, date) departments(status, name, level, id) Task: Retrieve amount from products whose level is found in departments rows where id matches the outer record. SQL:
SELECT amount FROM products AS prod WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.id = prod.id );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_01591
train
T1
v3
Schema: accounts (alias: acct)(date, name, code, status) staff(level, date, value, salary) Task: Retrieve salary from accounts with amount above the AVG(amount) of staff rows sharing the same type. SQL:
SELECT salary FROM accounts AS acct WHERE amount > ( SELECT AVG(amount) FROM staff AS empl WHERE empl.type = acct.type );
{ "outer_table": "accounts", "inner_table": "staff", "outer_alias": "acct", "inner_alias": "empl", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_01592
train
T1
v3
Schema: budgets (alias: budg)(date, type, salary, code) staff(value, salary, status, type) Task: Find id from budgets where amount exceeds the average amount from staff for the same type. SQL:
SELECT id FROM budgets AS budg WHERE amount > ( SELECT MAX(amount) FROM staff AS empl WHERE empl.type = budg.type );
{ "outer_table": "budgets", "inner_table": "staff", "outer_alias": "budg", "inner_alias": "empl", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_01593
train
T2
v3
Schema: regions (alias: rgn)(level, type, salary, status) items(status, type, date, amount) Task: Retrieve name from regions with amount above the SUM(amount) of items rows sharing the same id. SQL:
SELECT name FROM regions AS rgn WHERE amount > ( SELECT SUM(amount) FROM items AS lne WHERE lne.id = rgn.id );
{ "outer_table": "regions", "inner_table": "items", "outer_alias": "rgn", "inner_alias": "lne", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_01594
train
T2
v3
Schema: products (alias: prod)(status, name, amount, level) items(date, salary, id, type) Task: Retrieve id from products with amount above the MAX(amount) of items rows sharing the same id. SQL:
SELECT id FROM products AS prod WHERE amount > ( SELECT MAX(amount) FROM items AS lne WHERE lne.id = prod.id );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_01595
train
T1
v2
Schema: products (alias: prod)(salary, level, amount, status) staff(amount, date, code, name) Task: Find value from products where a matching record exists in staff with the same type. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = prod.type );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "value", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_01596
train
T1
v3
Schema: orders (alias: ord)(status, value, id, amount) items(salary, date, status, level) Task: Find name from orders where salary exceeds the average amount from items for the same code. SQL:
SELECT name FROM orders AS ord WHERE salary > ( SELECT MAX(amount) FROM items AS lne WHERE lne.code = ord.code );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_01597
train
T1
v3
Schema: warehouses (alias: whs)(salary, status, date, type) staff(value, salary, amount, id) Task: Retrieve name from warehouses with value above the MAX(value) of staff rows sharing the same type. SQL:
SELECT name FROM warehouses AS whs WHERE value > ( SELECT MAX(value) FROM staff AS empl WHERE empl.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "staff", "outer_alias": "whs", "inner_alias": "empl", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_01598
train
T2
v2
Schema: items (alias: lne)(id, code, level, date) services(date, name, salary, type) Task: Find name from items where a matching record exists in services with the same status. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.status = lne.status );
{ "outer_table": "items", "inner_table": "services", "outer_alias": "lne", "inner_alias": "srvc", "proj_col": "name", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_01599
train
T2