variant
stringclasses
3 values
prompt
stringlengths
163
237
sql
stringlengths
103
143
metadata
unknown
id
stringlengths
21
21
split
stringclasses
1 value
token_group
stringclasses
2 values
v3
Schema: regions (alias: rgn)(value, date, amount, level) managers(id, name, salary, date) Task: Retrieve code from regions with salary above the SUM(salary) of managers rows sharing the same type. SQL:
SELECT code FROM regions AS rgn WHERE salary > ( SELECT SUM(salary) FROM managers AS mgr WHERE mgr.type = rgn.type );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_07500
train
T2
v2
Schema: schedules (alias: schd)(level, date, value, amount) budgets(id, salary, code, value) Task: Retrieve salary from schedules that have at least one corresponding entry in budgets sharing the same code. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.code = schd.code );
{ "outer_table": "schedules", "inner_table": "budgets", "outer_alias": "schd", "inner_alias": "budg", "proj_col": "salary", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_07501
train
T2
v1
Schema: invoices (alias: inv)(name, id, code, amount) managers(code, date, status, amount) Task: Select id from invoices where type exists in managers for the same id. SQL:
SELECT id FROM invoices AS inv WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.id = inv.id );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_07502
train
T1
v2
Schema: categories (alias: catg)(amount, level, value, id) schedules(id, level, type, code) Task: Retrieve value from categories that have at least one corresponding entry in schedules sharing the same level. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = catg.level );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "value", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_07503
train
T2
v2
Schema: sales (alias: sale)(value, status, date, level) regions(salary, status, date, amount) Task: Retrieve code from sales that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = sale.level );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "code", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_07504
train
T1
v2
Schema: sales (alias: sale)(value, name, code, level) departments(salary, amount, value, date) Task: Retrieve code from sales that have at least one corresponding entry in departments sharing the same type. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = sale.type );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "code", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_07505
train
T1
v3
Schema: regions (alias: rgn)(id, code, value, level) departments(date, status, id, level) Task: Retrieve salary from regions with amount above the COUNT(value) of departments rows sharing the same id. SQL:
SELECT salary FROM regions AS rgn WHERE amount > ( SELECT COUNT(value) FROM departments AS dept WHERE dept.id = rgn.id );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_07506
train
T2
v1
Schema: departments (alias: dept)(name, status, salary, level) schedules(salary, level, id, type) Task: Retrieve name from departments whose level is found in schedules rows where level matches the outer record. SQL:
SELECT name FROM departments AS dept WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.level = dept.level );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_07507
train
T1
v2
Schema: orders (alias: ord)(name, amount, code, date) requests(name, type, level, code) Task: Find value from orders where a matching record exists in requests with the same level. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = ord.level );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "value", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_07508
train
T1
v3
Schema: warehouses (alias: whs)(salary, code, id, type) departments(value, level, amount, status) Task: Retrieve salary from warehouses with amount above the COUNT(value) of departments rows sharing the same id. SQL:
SELECT salary FROM warehouses AS whs WHERE amount > ( SELECT COUNT(value) FROM departments AS dept WHERE dept.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "departments", "outer_alias": "whs", "inner_alias": "dept", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_07509
train
T2
v1
Schema: sales (alias: sale)(value, status, level, date) schedules(code, status, id, level) Task: Select name from sales where level exists in schedules for the same code. SQL:
SELECT name FROM sales AS sale WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.code = sale.code );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_07510
train
T1
v1
Schema: managers (alias: mgr)(name, type, level, code) budgets(name, level, value, status) Task: Retrieve code from managers whose level is found in budgets rows where type matches the outer record. SQL:
SELECT code FROM managers AS mgr WHERE level IN ( SELECT level FROM budgets AS budg WHERE budg.type = mgr.type );
{ "outer_table": "managers", "inner_table": "budgets", "outer_alias": "mgr", "inner_alias": "budg", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_07511
train
T1
v3
Schema: departments (alias: dept)(date, salary, code, amount) transactions(id, status, value, code) Task: Retrieve amount from departments with amount above the AVG(salary) of transactions rows sharing the same type. SQL:
SELECT amount FROM departments AS dept WHERE amount > ( SELECT AVG(salary) FROM transactions AS txn WHERE txn.type = dept.type );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_07512
train
T1
v3
Schema: sales (alias: sale)(status, code, type, amount) staff(level, value, salary, status) Task: Find name from sales where value exceeds the average value from staff for the same type. SQL:
SELECT name FROM sales AS sale WHERE value > ( SELECT MAX(value) FROM staff AS empl WHERE empl.type = sale.type );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_07513
train
T1
v3
Schema: departments (alias: dept)(id, status, amount, value) budgets(value, date, code, salary) Task: Retrieve id from departments with salary above the AVG(value) of budgets rows sharing the same status. SQL:
SELECT id FROM departments AS dept WHERE salary > ( SELECT AVG(value) FROM budgets AS budg WHERE budg.status = dept.status );
{ "outer_table": "departments", "inner_table": "budgets", "outer_alias": "dept", "inner_alias": "budg", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_07514
train
T1
v1
Schema: shipments (alias: shp)(value, level, status, date) departments(name, id, salary, code) Task: Retrieve name from shipments whose code is found in departments rows where id matches the outer record. SQL:
SELECT name FROM shipments AS shp WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.id = shp.id );
{ "outer_table": "shipments", "inner_table": "departments", "outer_alias": "shp", "inner_alias": "dept", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_07515
train
T2
v2
Schema: items (alias: lne)(type, amount, code, value) employees(name, date, id, level) Task: Find id from items where a matching record exists in employees with the same type. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = lne.type );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "id", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_07516
train
T2
v1
Schema: departments (alias: dept)(code, type, status, salary) customers(salary, level, status, date) Task: Find value from departments where id appears in customers entries with matching level. SQL:
SELECT value FROM departments AS dept WHERE id IN ( SELECT id 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": "id", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_07517
train
T1
v2
Schema: budgets (alias: budg)(code, level, name, salary) services(value, type, amount, date) Task: Retrieve id from budgets that have at least one corresponding entry in services sharing the same id. SQL:
SELECT id FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = budg.id );
{ "outer_table": "budgets", "inner_table": "services", "outer_alias": "budg", "inner_alias": "srvc", "proj_col": "id", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_07518
train
T2
v3
Schema: items (alias: lne)(amount, value, salary, level) staff(level, date, type, amount) Task: Retrieve name from items with amount above the MIN(value) of staff rows sharing the same id. SQL:
SELECT name FROM items AS lne WHERE amount > ( SELECT MIN(value) FROM staff AS empl WHERE empl.id = lne.id );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_07519
train
T2
v2
Schema: sales (alias: sale)(amount, salary, code, date) orders(code, amount, name, salary) Task: Find id from sales where a matching record exists in orders with the same id. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = sale.id );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "id", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_07520
train
T1
v1
Schema: employees (alias: emp)(code, salary, amount, value) services(value, date, id, type) Task: Retrieve id from employees whose id is found in services rows where type matches the outer record. SQL:
SELECT id FROM employees AS emp WHERE id IN ( SELECT id FROM services AS srvc WHERE srvc.type = emp.type );
{ "outer_table": "employees", "inner_table": "services", "outer_alias": "emp", "inner_alias": "srvc", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_07521
train
T1
v1
Schema: orders (alias: ord)(type, amount, name, level) schedules(code, type, level, salary) Task: Find salary from orders where code appears in schedules entries with matching id. SQL:
SELECT salary FROM orders AS ord WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.id = ord.id );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_07522
train
T1
v3
Schema: accounts (alias: acct)(salary, name, type, date) staff(code, type, level, name) Task: Retrieve name from accounts with amount above the MIN(salary) of staff rows sharing the same id. SQL:
SELECT name FROM accounts AS acct WHERE amount > ( SELECT MIN(salary) FROM staff AS empl WHERE empl.id = acct.id );
{ "outer_table": "accounts", "inner_table": "staff", "outer_alias": "acct", "inner_alias": "empl", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_07523
train
T1
v1
Schema: services (alias: srvc)(level, name, date, salary) categories(level, amount, status, value) Task: Find amount from services where id appears in categories entries with matching level. SQL:
SELECT amount FROM services AS srvc WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.level = srvc.level );
{ "outer_table": "services", "inner_table": "categories", "outer_alias": "srvc", "inner_alias": "catg", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_07524
train
T2
v3
Schema: employees (alias: emp)(id, status, level, amount) invoices(date, amount, salary, name) Task: Find salary from employees where value exceeds the average salary from invoices for the same type. SQL:
SELECT salary FROM employees AS emp WHERE value > ( SELECT MAX(salary) FROM invoices AS inv WHERE inv.type = emp.type );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_07525
train
T1
v2
Schema: employees (alias: emp)(amount, value, id, type) orders(level, salary, id, type) Task: Retrieve id from employees that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = emp.code );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "id", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_07526
train
T1
v1
Schema: customers (alias: cust)(code, level, status, id) orders(id, status, code, name) Task: Retrieve amount from customers whose code is found in orders rows where status matches the outer record. SQL:
SELECT amount FROM customers AS cust WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.status = cust.status );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_07527
train
T1
v2
Schema: products (alias: prod)(salary, id, status, date) items(date, value, name, id) Task: Retrieve amount from products that have at least one corresponding entry in items sharing the same type. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = prod.type );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "amount", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_07528
train
T1
v1
Schema: regions (alias: rgn)(code, date, level, name) orders(value, name, code, id) Task: Retrieve code from regions whose level is found in orders rows where status matches the outer record. SQL:
SELECT code FROM regions AS rgn WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.status = rgn.status );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_07529
train
T2
v2
Schema: invoices (alias: inv)(status, amount, value, level) sales(date, level, status, id) Task: Find salary from invoices where a matching record exists in sales with the same code. SQL:
SELECT salary FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = inv.code );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "salary", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_07530
train
T1
v2
Schema: customers (alias: cust)(id, status, value, type) warehouses(type, id, value, salary) Task: Retrieve value from customers that have at least one corresponding entry in warehouses sharing the same level. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.level = cust.level );
{ "outer_table": "customers", "inner_table": "warehouses", "outer_alias": "cust", "inner_alias": "whs", "proj_col": "value", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_07531
train
T1
v2
Schema: customers (alias: cust)(amount, level, salary, id) services(status, id, code, level) Task: Retrieve name from customers that have at least one corresponding entry in services sharing the same id. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = cust.id );
{ "outer_table": "customers", "inner_table": "services", "outer_alias": "cust", "inner_alias": "srvc", "proj_col": "name", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_07532
train
T1
v2
Schema: schedules (alias: schd)(name, code, salary, level) budgets(id, date, amount, value) Task: Find value from schedules where a matching record exists in budgets with the same status. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.status = schd.status );
{ "outer_table": "schedules", "inner_table": "budgets", "outer_alias": "schd", "inner_alias": "budg", "proj_col": "value", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_07533
train
T2
v3
Schema: categories (alias: catg)(salary, amount, value, code) products(id, date, type, salary) Task: Find salary from categories where amount exceeds the average amount from products for the same type. SQL:
SELECT salary FROM categories AS catg WHERE amount > ( SELECT AVG(amount) FROM products AS prod WHERE prod.type = catg.type );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_07534
train
T2
v3
Schema: sales (alias: sale)(type, level, name, amount) warehouses(status, code, date, name) Task: Find value from sales where salary exceeds the average amount from warehouses for the same level. SQL:
SELECT value FROM sales AS sale WHERE salary > ( SELECT MAX(amount) FROM warehouses AS whs WHERE whs.level = sale.level );
{ "outer_table": "sales", "inner_table": "warehouses", "outer_alias": "sale", "inner_alias": "whs", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_07535
train
T1
v2
Schema: warehouses (alias: whs)(value, level, date, type) shipments(date, id, status, level) Task: Retrieve value from warehouses that have at least one corresponding entry in shipments sharing the same code. SQL:
SELECT value FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "shipments", "outer_alias": "whs", "inner_alias": "shp", "proj_col": "value", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_07536
train
T2
v1
Schema: regions (alias: rgn)(name, value, amount, salary) managers(code, name, id, type) Task: Retrieve code from regions whose code is found in managers rows where level matches the outer record. SQL:
SELECT code FROM regions AS rgn WHERE code IN ( SELECT code 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": "code", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_07537
train
T2
v2
Schema: sales (alias: sale)(amount, date, name, type) warehouses(status, type, value, id) Task: Retrieve id from sales that have at least one corresponding entry in warehouses sharing the same level. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.level = sale.level );
{ "outer_table": "sales", "inner_table": "warehouses", "outer_alias": "sale", "inner_alias": "whs", "proj_col": "id", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_07538
train
T1
v3
Schema: items (alias: lne)(code, type, id, value) invoices(status, salary, id, date) Task: Find salary from items where value exceeds the average value from invoices for the same type. SQL:
SELECT salary FROM items AS lne WHERE value > ( SELECT SUM(value) FROM invoices AS inv WHERE inv.type = lne.type );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_07539
train
T2
v2
Schema: employees (alias: emp)(status, date, name, amount) orders(salary, code, type, level) Task: Find salary from employees where a matching record exists in orders with the same id. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = emp.id );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "salary", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_07540
train
T1
v2
Schema: accounts (alias: acct)(id, salary, value, amount) warehouses(id, salary, name, status) Task: Find id from accounts where a matching record exists in warehouses with the same code. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.code = acct.code );
{ "outer_table": "accounts", "inner_table": "warehouses", "outer_alias": "acct", "inner_alias": "whs", "proj_col": "id", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_07541
train
T1
v3
Schema: budgets (alias: budg)(salary, type, code, date) accounts(salary, amount, status, level) Task: Retrieve code from budgets with amount above the SUM(salary) of accounts rows sharing the same code. SQL:
SELECT code FROM budgets AS budg WHERE amount > ( SELECT SUM(salary) FROM accounts AS acct WHERE acct.code = budg.code );
{ "outer_table": "budgets", "inner_table": "accounts", "outer_alias": "budg", "inner_alias": "acct", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_07542
train
T2
v2
Schema: shipments (alias: shp)(name, level, date, code) products(status, date, name, type) Task: Retrieve amount from shipments that have at least one corresponding entry in products sharing the same status. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = shp.status );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "amount", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_07543
train
T2
v2
Schema: categories (alias: catg)(id, level, code, amount) items(status, salary, code, id) Task: Find value from categories where a matching record exists in items with the same status. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = catg.status );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "value", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_07544
train
T2
v2
Schema: accounts (alias: acct)(value, type, code, date) departments(status, id, name, type) Task: Retrieve code from accounts that have at least one corresponding entry in departments sharing the same status. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = acct.status );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "code", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_07545
train
T1
v2
Schema: transactions (alias: txn)(amount, salary, date, status) managers(level, type, name, status) Task: Retrieve name from transactions that have at least one corresponding entry in managers sharing the same level. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = txn.level );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "name", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_07546
train
T1
v3
Schema: products (alias: prod)(type, level, value, name) customers(status, id, type, level) Task: Retrieve amount from products with salary above the MIN(value) of customers rows sharing the same id. SQL:
SELECT amount FROM products AS prod WHERE salary > ( SELECT MIN(value) FROM customers AS cust WHERE cust.id = prod.id );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_07547
train
T1
v1
Schema: sales (alias: sale)(name, amount, id, date) items(name, salary, type, id) Task: Find code from sales where type appears in items entries with matching type. SQL:
SELECT code FROM sales AS sale WHERE type IN ( SELECT type FROM items AS lne WHERE lne.type = sale.type );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "code", "filter_col": "type", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_07548
train
T1
v3
Schema: departments (alias: dept)(code, value, type, date) items(code, date, salary, amount) Task: Retrieve amount from departments with salary above the MIN(salary) of items rows sharing the same type. SQL:
SELECT amount FROM departments AS dept WHERE salary > ( SELECT MIN(salary) FROM items AS lne WHERE lne.type = dept.type );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_07549
train
T1
v1
Schema: items (alias: lne)(name, value, status, date) warehouses(level, value, id, status) Task: Select name from items where code exists in warehouses for the same type. SQL:
SELECT name FROM items AS lne WHERE code IN ( SELECT code FROM warehouses AS whs WHERE whs.type = lne.type );
{ "outer_table": "items", "inner_table": "warehouses", "outer_alias": "lne", "inner_alias": "whs", "proj_col": "name", "filter_col": "code", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_07550
train
T2
v2
Schema: schedules (alias: schd)(level, name, value, date) services(type, date, value, amount) Task: Find salary from schedules where a matching record exists in services with the same status. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.status = schd.status );
{ "outer_table": "schedules", "inner_table": "services", "outer_alias": "schd", "inner_alias": "srvc", "proj_col": "salary", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_07551
train
T2
v1
Schema: requests (alias: ordr)(type, level, status, date) accounts(status, name, date, amount) Task: Select id from requests where level exists in accounts for the same level. SQL:
SELECT id FROM requests AS ordr WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.level = ordr.level );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_07552
train
T2
v2
Schema: regions (alias: rgn)(name, level, id, salary) sales(id, level, amount, type) Task: Retrieve id from regions that have at least one corresponding entry in sales sharing the same status. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = rgn.status );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "id", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_07553
train
T2
v3
Schema: products (alias: prod)(salary, amount, code, date) categories(date, type, status, salary) Task: Find value from products where salary exceeds the average amount from categories for the same id. SQL:
SELECT value FROM products AS prod WHERE salary > ( SELECT MAX(amount) FROM categories AS catg WHERE catg.id = prod.id );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_07554
train
T1
v2
Schema: invoices (alias: inv)(amount, name, type, status) services(status, code, type, amount) Task: Find id from invoices where a matching record exists in services with the same id. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = inv.id );
{ "outer_table": "invoices", "inner_table": "services", "outer_alias": "inv", "inner_alias": "srvc", "proj_col": "id", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_07555
train
T1
v1
Schema: transactions (alias: txn)(salary, value, level, type) requests(name, level, type, value) Task: Find value from transactions where level appears in requests entries with matching id. SQL:
SELECT value FROM transactions AS txn WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.id = txn.id );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "value", "filter_col": "level", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_07556
train
T1
v3
Schema: services (alias: srvc)(value, name, code, status) departments(amount, type, value, code) Task: Retrieve code from services with salary above the COUNT(amount) of departments rows sharing the same level. SQL:
SELECT code FROM services AS srvc WHERE salary > ( SELECT COUNT(amount) FROM departments AS dept WHERE dept.level = srvc.level );
{ "outer_table": "services", "inner_table": "departments", "outer_alias": "srvc", "inner_alias": "dept", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_07557
train
T2
v1
Schema: staff (alias: empl)(id, salary, date, amount) departments(value, type, level, name) Task: Select code from staff where level exists in departments for the same type. SQL:
SELECT code FROM staff AS empl WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.type = empl.type );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_07558
train
T2
v3
Schema: sales (alias: sale)(type, date, name, status) requests(status, level, value, code) Task: Retrieve id from sales with salary above the SUM(value) of requests rows sharing the same level. SQL:
SELECT id FROM sales AS sale WHERE salary > ( SELECT SUM(value) FROM requests AS ordr WHERE ordr.level = sale.level );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_07559
train
T1
v2
Schema: requests (alias: ordr)(date, amount, status, id) employees(value, status, level, amount) Task: Retrieve id from requests that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = ordr.status );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "id", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_07560
train
T2
v3
Schema: invoices (alias: inv)(amount, code, level, name) staff(name, level, amount, id) Task: Find amount from invoices where salary exceeds the average value from staff for the same id. SQL:
SELECT amount FROM invoices AS inv WHERE salary > ( SELECT MAX(value) FROM staff AS empl WHERE empl.id = inv.id );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_07561
train
T1
v2
Schema: invoices (alias: inv)(status, name, id, code) employees(amount, type, value, date) Task: Retrieve value from invoices that have at least one corresponding entry in employees sharing the same id. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = inv.id );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "value", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_07562
train
T1
v1
Schema: transactions (alias: txn)(amount, code, name, status) invoices(id, name, code, value) Task: Select amount from transactions where id exists in invoices for the same type. SQL:
SELECT amount FROM transactions AS txn WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.type = txn.type );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_07563
train
T1
v1
Schema: services (alias: srvc)(id, type, value, salary) customers(id, salary, status, value) Task: Find name from services where status appears in customers entries with matching id. SQL:
SELECT name FROM services AS srvc WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.id = srvc.id );
{ "outer_table": "services", "inner_table": "customers", "outer_alias": "srvc", "inner_alias": "cust", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_07564
train
T2
v2
Schema: budgets (alias: budg)(status, code, value, amount) categories(code, id, value, amount) Task: Retrieve code from budgets that have at least one corresponding entry in categories sharing the same id. SQL:
SELECT code FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = budg.id );
{ "outer_table": "budgets", "inner_table": "categories", "outer_alias": "budg", "inner_alias": "catg", "proj_col": "code", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_07565
train
T2
v3
Schema: schedules (alias: schd)(salary, amount, type, status) employees(value, salary, id, amount) Task: Find name from schedules where value exceeds the average amount from employees for the same type. SQL:
SELECT name FROM schedules AS schd WHERE value > ( SELECT SUM(amount) FROM employees AS emp WHERE emp.type = schd.type );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_07566
train
T2
v3
Schema: products (alias: prod)(name, status, value, salary) sales(status, salary, id, code) Task: Find value from products where amount exceeds the average value from sales for the same code. SQL:
SELECT value FROM products AS prod WHERE amount > ( SELECT MIN(value) FROM sales AS sale WHERE sale.code = prod.code );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_07567
train
T1
v3
Schema: shipments (alias: shp)(type, value, date, level) warehouses(salary, amount, value, date) Task: Retrieve name from shipments with value above the AVG(value) of warehouses rows sharing the same type. SQL:
SELECT name FROM shipments AS shp WHERE value > ( SELECT AVG(value) FROM warehouses AS whs WHERE whs.type = shp.type );
{ "outer_table": "shipments", "inner_table": "warehouses", "outer_alias": "shp", "inner_alias": "whs", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_07568
train
T2
v2
Schema: customers (alias: cust)(code, type, status, id) warehouses(value, status, level, type) Task: Retrieve amount from customers that have at least one corresponding entry in warehouses sharing the same type. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.type = cust.type );
{ "outer_table": "customers", "inner_table": "warehouses", "outer_alias": "cust", "inner_alias": "whs", "proj_col": "amount", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_07569
train
T1
v2
Schema: warehouses (alias: whs)(id, name, amount, salary) invoices(value, id, level, salary) Task: Retrieve amount from warehouses that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT amount FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "invoices", "outer_alias": "whs", "inner_alias": "inv", "proj_col": "amount", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_07570
train
T2
v1
Schema: requests (alias: ordr)(id, salary, name, value) orders(type, name, code, id) Task: Find id from requests where status appears in orders entries with matching id. SQL:
SELECT id FROM requests AS ordr WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.id = ordr.id );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_07571
train
T2
v3
Schema: requests (alias: ordr)(level, status, value, type) services(value, amount, code, type) Task: Find id from requests where value exceeds the average salary from services for the same type. SQL:
SELECT id FROM requests AS ordr WHERE value > ( SELECT MIN(salary) FROM services AS srvc WHERE srvc.type = ordr.type );
{ "outer_table": "requests", "inner_table": "services", "outer_alias": "ordr", "inner_alias": "srvc", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_07572
train
T2
v1
Schema: categories (alias: catg)(id, name, type, code) departments(salary, name, date, amount) Task: Find id from categories where id appears in departments entries with matching status. SQL:
SELECT id FROM categories AS catg WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.status = catg.status );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "id", "filter_col": "id", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_07573
train
T2
v3
Schema: managers (alias: mgr)(name, value, amount, date) budgets(id, amount, type, code) Task: Find amount from managers where value exceeds the average value from budgets for the same level. SQL:
SELECT amount FROM managers AS mgr WHERE value > ( SELECT MIN(value) FROM budgets AS budg WHERE budg.level = mgr.level );
{ "outer_table": "managers", "inner_table": "budgets", "outer_alias": "mgr", "inner_alias": "budg", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_07574
train
T1
v2
Schema: items (alias: lne)(name, id, date, amount) transactions(level, status, type, date) Task: Find id from items where a matching record exists in transactions with the same type. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = lne.type );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "id", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_07575
train
T2
v2
Schema: products (alias: prod)(level, status, id, salary) managers(status, salary, date, amount) Task: Find value from products where a matching record exists in managers with the same id. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = prod.id );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "value", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_07576
train
T1
v2
Schema: products (alias: prod)(date, name, code, status) warehouses(value, status, name, code) Task: Retrieve salary from products that have at least one corresponding entry in warehouses sharing the same type. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.type = prod.type );
{ "outer_table": "products", "inner_table": "warehouses", "outer_alias": "prod", "inner_alias": "whs", "proj_col": "salary", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_07577
train
T1
v1
Schema: budgets (alias: budg)(level, date, code, value) products(level, type, salary, status) Task: Retrieve value from budgets whose level is found in products rows where code matches the outer record. SQL:
SELECT value FROM budgets AS budg WHERE level IN ( SELECT level FROM products AS prod WHERE prod.code = budg.code );
{ "outer_table": "budgets", "inner_table": "products", "outer_alias": "budg", "inner_alias": "prod", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_07578
train
T2
v2
Schema: transactions (alias: txn)(value, level, name, salary) invoices(id, amount, type, date) Task: Retrieve salary from transactions that have at least one corresponding entry in invoices sharing the same level. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = txn.level );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "salary", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_07579
train
T1
v3
Schema: regions (alias: rgn)(amount, name, value, date) items(type, name, id, status) Task: Find salary from regions where amount exceeds the average amount from items for the same type. SQL:
SELECT salary FROM regions AS rgn WHERE amount > ( SELECT MAX(amount) FROM items AS lne WHERE lne.type = rgn.type );
{ "outer_table": "regions", "inner_table": "items", "outer_alias": "rgn", "inner_alias": "lne", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_07580
train
T2
v1
Schema: warehouses (alias: whs)(value, status, salary, level) categories(salary, amount, level, value) Task: Retrieve code from warehouses whose level is found in categories rows where id matches the outer record. SQL:
SELECT code FROM warehouses AS whs WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "categories", "outer_alias": "whs", "inner_alias": "catg", "proj_col": "code", "filter_col": "level", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_07581
train
T2
v3
Schema: requests (alias: ordr)(date, level, salary, amount) invoices(code, status, level, type) Task: Retrieve code from requests with amount above the AVG(value) of invoices rows sharing the same code. SQL:
SELECT code FROM requests AS ordr WHERE amount > ( SELECT AVG(value) FROM invoices AS inv WHERE inv.code = ordr.code );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_07582
train
T2
v1
Schema: invoices (alias: inv)(id, type, name, date) staff(id, date, name, salary) Task: Retrieve salary from invoices whose code is found in staff rows where status matches the outer record. SQL:
SELECT salary FROM invoices AS inv WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.status = inv.status );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_07583
train
T1
v1
Schema: shipments (alias: shp)(id, name, code, salary) customers(value, amount, id, salary) Task: Select name from shipments where level exists in customers for the same level. SQL:
SELECT name FROM shipments AS shp WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.level = shp.level );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_07584
train
T2
v3
Schema: warehouses (alias: whs)(date, status, code, value) invoices(id, name, value, level) Task: Retrieve salary from warehouses with salary above the AVG(value) of invoices rows sharing the same type. SQL:
SELECT salary FROM warehouses AS whs WHERE salary > ( SELECT AVG(value) FROM invoices AS inv WHERE inv.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "invoices", "outer_alias": "whs", "inner_alias": "inv", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_07585
train
T2
v2
Schema: managers (alias: mgr)(value, type, salary, level) employees(value, amount, id, level) Task: Find name from managers where a matching record exists in employees with the same status. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = mgr.status );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "name", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_07586
train
T1
v2
Schema: accounts (alias: acct)(salary, value, amount, type) employees(value, name, salary, amount) Task: Retrieve value from accounts that have at least one corresponding entry in employees sharing the same id. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = acct.id );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "value", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_07587
train
T1
v3
Schema: schedules (alias: schd)(name, date, salary, code) budgets(salary, value, status, name) Task: Find code from schedules where amount exceeds the average salary from budgets for the same level. SQL:
SELECT code FROM schedules AS schd WHERE amount > ( SELECT AVG(salary) FROM budgets AS budg WHERE budg.level = schd.level );
{ "outer_table": "schedules", "inner_table": "budgets", "outer_alias": "schd", "inner_alias": "budg", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_07588
train
T2
v2
Schema: items (alias: lne)(status, name, amount, value) services(level, amount, value, salary) Task: Retrieve value from items that have at least one corresponding entry in services sharing the same status. SQL:
SELECT value 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": "value", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_07589
train
T2
v3
Schema: orders (alias: ord)(salary, amount, type, date) accounts(type, level, code, value) Task: Find amount from orders where amount exceeds the average amount from accounts for the same type. SQL:
SELECT amount FROM orders AS ord WHERE amount > ( SELECT MAX(amount) FROM accounts AS acct WHERE acct.type = ord.type );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_07590
train
T1
v3
Schema: staff (alias: empl)(name, code, date, salary) shipments(value, salary, id, name) Task: Find id from staff where salary exceeds the average salary from shipments for the same status. SQL:
SELECT id FROM staff AS empl WHERE salary > ( SELECT MAX(salary) FROM shipments AS shp WHERE shp.status = empl.status );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_07591
train
T2
v1
Schema: transactions (alias: txn)(id, value, amount, type) budgets(id, salary, type, level) Task: Retrieve salary from transactions whose level is found in budgets rows where status matches the outer record. SQL:
SELECT salary FROM transactions AS txn WHERE level IN ( SELECT level FROM budgets AS budg WHERE budg.status = txn.status );
{ "outer_table": "transactions", "inner_table": "budgets", "outer_alias": "txn", "inner_alias": "budg", "proj_col": "salary", "filter_col": "level", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_07592
train
T1
v3
Schema: items (alias: lne)(name, amount, value, level) accounts(date, status, code, id) Task: Retrieve value from items with salary above the MAX(salary) of accounts rows sharing the same type. SQL:
SELECT value FROM items AS lne WHERE salary > ( SELECT MAX(salary) FROM accounts AS acct WHERE acct.type = lne.type );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_07593
train
T2
v1
Schema: sales (alias: sale)(amount, id, status, salary) schedules(value, date, salary, amount) Task: Retrieve id from sales whose level is found in schedules rows where level matches the outer record. SQL:
SELECT id FROM sales AS sale WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.level = sale.level );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_07594
train
T1
v1
Schema: requests (alias: ordr)(value, id, level, status) accounts(level, amount, status, id) Task: Retrieve code from requests whose type is found in accounts rows where code matches the outer record. SQL:
SELECT code FROM requests AS ordr WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.code = ordr.code );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_07595
train
T2
v2
Schema: warehouses (alias: whs)(name, date, code, value) shipments(value, id, type, date) Task: Retrieve amount from warehouses that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT amount FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "shipments", "outer_alias": "whs", "inner_alias": "shp", "proj_col": "amount", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_07596
train
T2
v1
Schema: employees (alias: emp)(name, amount, code, date) departments(salary, level, id, name) Task: Retrieve value from employees whose id is found in departments rows where id matches the outer record. SQL:
SELECT value FROM employees AS emp WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.id = emp.id );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_07597
train
T1
v2
Schema: employees (alias: emp)(value, date, status, code) managers(id, status, salary, value) Task: Retrieve value from employees that have at least one corresponding entry in managers sharing the same level. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = emp.level );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "value", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_07598
train
T1
v1
Schema: regions (alias: rgn)(level, type, salary, value) sales(status, name, amount, type) Task: Retrieve amount from regions whose level is found in sales rows where level matches the outer record. SQL:
SELECT amount FROM regions AS rgn WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.level = rgn.level );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "amount", "filter_col": "level", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_07599
train
T2