variant
stringclasses
3 values
prompt
stringlengths
163
237
sql
stringlengths
103
143
metadata
unknown
id
stringlengths
21
21
split
stringclasses
1 value
token_group
stringclasses
2 values
v1
Schema: services (alias: srvc)(name, type, salary, code) managers(salary, id, name, code) Task: Retrieve value from services whose level is found in managers rows where code matches the outer record. SQL:
SELECT value FROM services AS srvc WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.code = srvc.code );
{ "outer_table": "services", "inner_table": "managers", "outer_alias": "srvc", "inner_alias": "mgr", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_08600
train
T2
v2
Schema: invoices (alias: inv)(date, status, code, salary) managers(id, status, level, type) Task: Retrieve code from invoices that have at least one corresponding entry in managers sharing the same id. SQL:
SELECT code 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": "code", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_08601
train
T1
v3
Schema: items (alias: lne)(salary, value, id, date) transactions(salary, value, status, level) Task: Find name from items where value exceeds the average value from transactions for the same status. SQL:
SELECT name FROM items AS lne WHERE value > ( SELECT COUNT(value) FROM transactions AS txn WHERE txn.status = lne.status );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_08602
train
T2
v2
Schema: staff (alias: empl)(amount, value, id, type) transactions(date, id, type, value) Task: Retrieve id from staff that have at least one corresponding entry in transactions sharing the same status. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = empl.status );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "id", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_08603
train
T2
v1
Schema: schedules (alias: schd)(date, status, id, level) employees(value, date, name, status) Task: Retrieve salary from schedules whose status is found in employees rows where level matches the outer record. SQL:
SELECT salary FROM schedules AS schd WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.level = schd.level );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_08604
train
T2
v2
Schema: requests (alias: ordr)(salary, type, value, status) staff(salary, status, level, type) Task: Retrieve amount from requests that have at least one corresponding entry in staff sharing the same code. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = ordr.code );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "amount", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_08605
train
T2
v2
Schema: departments (alias: dept)(status, level, value, date) managers(type, status, value, code) Task: Find id from departments where a matching record exists in managers with the same level. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = dept.level );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "id", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_08606
train
T1
v3
Schema: accounts (alias: acct)(id, name, salary, value) requests(date, id, type, salary) Task: Find name from accounts where amount exceeds the average value from requests for the same type. SQL:
SELECT name FROM accounts AS acct WHERE amount > ( SELECT MIN(value) FROM requests AS ordr WHERE ordr.type = acct.type );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_08607
train
T1
v2
Schema: warehouses (alias: whs)(type, id, level, date) staff(id, date, type, amount) Task: Find code from warehouses where a matching record exists in staff with the same id. SQL:
SELECT code FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "staff", "outer_alias": "whs", "inner_alias": "empl", "proj_col": "code", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_08608
train
T2
v1
Schema: requests (alias: ordr)(date, id, amount, status) sales(type, code, name, date) Task: Find amount from requests where status appears in sales entries with matching id. SQL:
SELECT amount FROM requests AS ordr WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.id = ordr.id );
{ "outer_table": "requests", "inner_table": "sales", "outer_alias": "ordr", "inner_alias": "sale", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_08609
train
T2
v1
Schema: schedules (alias: schd)(status, date, type, id) invoices(date, value, id, status) Task: Select name from schedules where code exists in invoices for the same level. SQL:
SELECT name FROM schedules AS schd WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.level = schd.level );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_08610
train
T2
v2
Schema: services (alias: srvc)(level, code, name, date) employees(level, code, status, id) Task: Find amount from services where a matching record exists in employees with the same type. SQL:
SELECT amount FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = srvc.type );
{ "outer_table": "services", "inner_table": "employees", "outer_alias": "srvc", "inner_alias": "emp", "proj_col": "amount", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_08611
train
T2
v2
Schema: warehouses (alias: whs)(value, date, salary, status) categories(date, level, id, value) Task: Retrieve name from warehouses that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT name FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "categories", "outer_alias": "whs", "inner_alias": "catg", "proj_col": "name", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_08612
train
T2
v3
Schema: employees (alias: emp)(date, code, salary, amount) warehouses(value, amount, code, name) Task: Retrieve name from employees with value above the SUM(amount) of warehouses rows sharing the same id. SQL:
SELECT name FROM employees AS emp WHERE value > ( SELECT SUM(amount) FROM warehouses AS whs WHERE whs.id = emp.id );
{ "outer_table": "employees", "inner_table": "warehouses", "outer_alias": "emp", "inner_alias": "whs", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_08613
train
T1
v3
Schema: orders (alias: ord)(id, date, salary, code) transactions(id, level, salary, amount) Task: Retrieve value from orders with amount above the SUM(value) of transactions rows sharing the same type. SQL:
SELECT value FROM orders AS ord WHERE amount > ( SELECT SUM(value) FROM transactions AS txn WHERE txn.type = ord.type );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_08614
train
T1
v1
Schema: orders (alias: ord)(status, level, id, type) staff(amount, name, value, date) Task: Retrieve salary from orders whose level is found in staff rows where code matches the outer record. SQL:
SELECT salary FROM orders AS ord WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.code = ord.code );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "salary", "filter_col": "level", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_08615
train
T1
v1
Schema: schedules (alias: schd)(name, value, date, amount) products(id, type, value, code) Task: Retrieve amount from schedules whose id is found in products rows where id matches the outer record. SQL:
SELECT amount FROM schedules AS schd WHERE id IN ( SELECT id FROM products AS prod WHERE prod.id = schd.id );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "amount", "filter_col": "id", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_08616
train
T2
v3
Schema: sales (alias: sale)(salary, date, name, code) requests(value, status, type, date) Task: Retrieve id from sales with value above the MIN(value) of requests rows sharing the same id. SQL:
SELECT id FROM sales AS sale WHERE value > ( SELECT MIN(value) FROM requests AS ordr WHERE ordr.id = sale.id );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_08617
train
T1
v3
Schema: regions (alias: rgn)(salary, status, type, amount) sales(date, amount, name, value) Task: Find code from regions where salary exceeds the average salary from sales for the same level. SQL:
SELECT code FROM regions AS rgn WHERE salary > ( SELECT AVG(salary) FROM sales AS sale WHERE sale.level = rgn.level );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_08618
train
T2
v1
Schema: schedules (alias: schd)(type, status, date, level) regions(code, name, amount, value) Task: Find amount from schedules where level appears in regions entries with matching status. SQL:
SELECT amount FROM schedules AS schd WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.status = schd.status );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_08619
train
T2
v3
Schema: customers (alias: cust)(salary, status, amount, value) shipments(id, status, code, value) Task: Find amount from customers where amount exceeds the average value from shipments for the same id. SQL:
SELECT amount FROM customers AS cust WHERE amount > ( SELECT SUM(value) FROM shipments AS shp WHERE shp.id = cust.id );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_08620
train
T1
v2
Schema: employees (alias: emp)(salary, value, code, type) items(status, name, date, code) Task: Find salary from employees where a matching record exists in items with the same status. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = emp.status );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "salary", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_08621
train
T1
v1
Schema: invoices (alias: inv)(level, salary, type, amount) accounts(code, status, name, salary) Task: Select code from invoices where type exists in accounts for the same code. SQL:
SELECT code FROM invoices AS inv WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.code = inv.code );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_08622
train
T1
v1
Schema: schedules (alias: schd)(date, code, level, status) budgets(date, status, salary, value) Task: Select name from schedules where level exists in budgets for the same status. SQL:
SELECT name FROM schedules AS schd WHERE level IN ( SELECT level FROM budgets AS budg WHERE budg.status = schd.status );
{ "outer_table": "schedules", "inner_table": "budgets", "outer_alias": "schd", "inner_alias": "budg", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_08623
train
T2
v3
Schema: items (alias: lne)(type, salary, status, id) customers(code, type, level, salary) Task: Find amount from items where salary exceeds the average salary from customers for the same type. SQL:
SELECT amount FROM items AS lne WHERE salary > ( SELECT MIN(salary) FROM customers AS cust WHERE cust.type = lne.type );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_08624
train
T2
v1
Schema: customers (alias: cust)(status, value, code, amount) departments(type, name, level, salary) Task: Retrieve id from customers whose level is found in departments rows where code matches the outer record. SQL:
SELECT id FROM customers AS cust WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.code = cust.code );
{ "outer_table": "customers", "inner_table": "departments", "outer_alias": "cust", "inner_alias": "dept", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_08625
train
T1
v1
Schema: services (alias: srvc)(name, type, code, salary) warehouses(value, code, date, amount) Task: Retrieve amount from services whose id is found in warehouses rows where status matches the outer record. SQL:
SELECT amount FROM services AS srvc WHERE id IN ( SELECT id FROM warehouses AS whs WHERE whs.status = srvc.status );
{ "outer_table": "services", "inner_table": "warehouses", "outer_alias": "srvc", "inner_alias": "whs", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_08626
train
T2
v3
Schema: transactions (alias: txn)(name, type, id, salary) departments(salary, amount, code, status) Task: Retrieve salary from transactions with salary above the COUNT(value) of departments rows sharing the same id. SQL:
SELECT salary FROM transactions AS txn WHERE salary > ( SELECT COUNT(value) FROM departments AS dept WHERE dept.id = txn.id );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_08627
train
T1
v3
Schema: customers (alias: cust)(date, code, id, value) schedules(type, level, code, amount) Task: Retrieve salary from customers with amount above the AVG(amount) of schedules rows sharing the same code. SQL:
SELECT salary FROM customers AS cust WHERE amount > ( SELECT AVG(amount) FROM schedules AS schd WHERE schd.code = cust.code );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_08628
train
T1
v1
Schema: orders (alias: ord)(salary, value, date, amount) employees(name, code, amount, salary) Task: Select name from orders where status exists in employees for the same type. SQL:
SELECT name FROM orders AS ord WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.type = ord.type );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_08629
train
T1
v1
Schema: shipments (alias: shp)(name, amount, date, level) regions(level, type, amount, date) Task: Retrieve name from shipments whose level is found in regions rows where status matches the outer record. SQL:
SELECT name FROM shipments AS shp WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.status = shp.status );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_08630
train
T2
v2
Schema: orders (alias: ord)(salary, amount, status, level) products(name, salary, amount, code) Task: Find salary from orders where a matching record exists in products with the same status. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = ord.status );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "salary", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_08631
train
T1
v2
Schema: staff (alias: empl)(date, value, status, amount) orders(type, name, status, value) Task: Find amount from staff where a matching record exists in orders with the same id. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = empl.id );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "amount", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_08632
train
T2
v2
Schema: invoices (alias: inv)(code, level, status, value) customers(level, code, salary, status) Task: Retrieve amount from invoices that have at least one corresponding entry in customers sharing the same type. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = inv.type );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "amount", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_08633
train
T1
v3
Schema: sales (alias: sale)(amount, name, date, code) invoices(code, level, type, id) Task: Retrieve id from sales with value above the MIN(salary) of invoices rows sharing the same type. SQL:
SELECT id FROM sales AS sale WHERE value > ( SELECT MIN(salary) FROM invoices AS inv WHERE inv.type = sale.type );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_08634
train
T1
v3
Schema: items (alias: lne)(name, level, code, type) sales(date, id, amount, level) Task: Retrieve amount from items with amount above the AVG(salary) of sales rows sharing the same id. SQL:
SELECT amount FROM items AS lne WHERE amount > ( SELECT AVG(salary) FROM sales AS sale WHERE sale.id = lne.id );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_08635
train
T2
v2
Schema: regions (alias: rgn)(value, id, status, date) employees(value, amount, code, level) Task: Find value from regions where a matching record exists in employees with the same code. SQL:
SELECT value FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = rgn.code );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "value", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_08636
train
T2
v2
Schema: items (alias: lne)(code, value, amount, status) shipments(date, salary, type, name) Task: Find code from items where a matching record exists in shipments with the same status. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = lne.status );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "code", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_08637
train
T2
v1
Schema: transactions (alias: txn)(status, id, value, amount) warehouses(salary, id, level, amount) Task: Retrieve id from transactions whose code is found in warehouses rows where status matches the outer record. SQL:
SELECT id FROM transactions AS txn WHERE code IN ( SELECT code FROM warehouses AS whs WHERE whs.status = txn.status );
{ "outer_table": "transactions", "inner_table": "warehouses", "outer_alias": "txn", "inner_alias": "whs", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_08638
train
T1
v1
Schema: departments (alias: dept)(code, amount, salary, status) sales(level, name, id, date) Task: Retrieve name from departments whose status is found in sales rows where code matches the outer record. SQL:
SELECT name FROM departments AS dept WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.code = dept.code );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_08639
train
T1
v3
Schema: invoices (alias: inv)(salary, code, id, type) managers(status, code, id, date) Task: Retrieve name from invoices with salary above the COUNT(value) of managers rows sharing the same id. SQL:
SELECT name FROM invoices AS inv WHERE salary > ( SELECT COUNT(value) FROM managers AS mgr WHERE mgr.id = inv.id );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_08640
train
T1
v1
Schema: staff (alias: empl)(level, status, amount, salary) warehouses(value, name, level, salary) Task: Select code from staff where level exists in warehouses for the same status. SQL:
SELECT code FROM staff AS empl WHERE level IN ( SELECT level FROM warehouses AS whs WHERE whs.status = empl.status );
{ "outer_table": "staff", "inner_table": "warehouses", "outer_alias": "empl", "inner_alias": "whs", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_08641
train
T2
v2
Schema: departments (alias: dept)(level, id, code, value) items(value, status, type, id) Task: Retrieve value from departments that have at least one corresponding entry in items sharing the same status. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = dept.status );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "value", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_08642
train
T1
v3
Schema: warehouses (alias: whs)(status, name, date, type) transactions(name, level, code, amount) Task: Retrieve name from warehouses with amount above the SUM(value) of transactions rows sharing the same type. SQL:
SELECT name FROM warehouses AS whs WHERE amount > ( SELECT SUM(value) FROM transactions AS txn WHERE txn.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "transactions", "outer_alias": "whs", "inner_alias": "txn", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_08643
train
T2
v1
Schema: sales (alias: sale)(date, name, amount, type) budgets(type, date, level, id) Task: Retrieve id from sales whose level is found in budgets rows where type matches the outer record. SQL:
SELECT id FROM sales AS sale WHERE level IN ( SELECT level FROM budgets AS budg WHERE budg.type = sale.type );
{ "outer_table": "sales", "inner_table": "budgets", "outer_alias": "sale", "inner_alias": "budg", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_08644
train
T1
v3
Schema: employees (alias: emp)(level, type, amount, status) requests(code, amount, date, id) Task: Retrieve code from employees with salary above the MAX(amount) of requests rows sharing the same level. SQL:
SELECT code FROM employees AS emp WHERE salary > ( SELECT MAX(amount) FROM requests AS ordr WHERE ordr.level = emp.level );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_08645
train
T1
v1
Schema: managers (alias: mgr)(name, value, amount, code) products(salary, date, type, status) Task: Find code from managers where type appears in products entries with matching status. SQL:
SELECT code FROM managers AS mgr WHERE type IN ( SELECT type FROM products AS prod WHERE prod.status = mgr.status );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_08646
train
T1
v2
Schema: departments (alias: dept)(value, date, type, status) regions(amount, name, salary, code) Task: Retrieve amount from departments that have at least one corresponding entry in regions sharing the same status. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = dept.status );
{ "outer_table": "departments", "inner_table": "regions", "outer_alias": "dept", "inner_alias": "rgn", "proj_col": "amount", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_08647
train
T1
v2
Schema: managers (alias: mgr)(type, code, status, value) regions(salary, amount, status, name) Task: Retrieve code from managers that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = mgr.level );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "code", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_08648
train
T1
v2
Schema: staff (alias: empl)(id, name, date, salary) orders(name, value, date, level) Task: Retrieve id from staff that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = empl.level );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "id", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_08649
train
T2
v2
Schema: orders (alias: ord)(status, name, salary, id) budgets(status, value, type, date) Task: Find amount from orders where a matching record exists in budgets with the same level. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.level = ord.level );
{ "outer_table": "orders", "inner_table": "budgets", "outer_alias": "ord", "inner_alias": "budg", "proj_col": "amount", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_08650
train
T1
v1
Schema: departments (alias: dept)(type, value, date, status) requests(id, amount, salary, date) Task: Select code from departments where code exists in requests for the same level. SQL:
SELECT code FROM departments AS dept WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.level = dept.level );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "code", "filter_col": "code", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_08651
train
T1
v1
Schema: staff (alias: empl)(name, status, value, level) items(value, amount, status, salary) Task: Find amount from staff where code appears in items entries with matching id. SQL:
SELECT amount FROM staff AS empl WHERE code IN ( SELECT code FROM items AS lne WHERE lne.id = empl.id );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "amount", "filter_col": "code", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_08652
train
T2
v1
Schema: staff (alias: empl)(salary, name, type, date) invoices(amount, status, name, value) Task: Select name from staff where level exists in invoices for the same code. SQL:
SELECT name FROM staff AS empl WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.code = empl.code );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_08653
train
T2
v2
Schema: sales (alias: sale)(code, id, level, amount) regions(code, amount, id, name) Task: Retrieve value from sales that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT value 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": "value", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_08654
train
T1
v2
Schema: items (alias: lne)(id, salary, name, type) customers(code, name, type, status) Task: Retrieve value from items that have at least one corresponding entry in customers sharing the same level. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = lne.level );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "value", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_08655
train
T2
v2
Schema: orders (alias: ord)(type, date, status, id) categories(name, id, code, type) Task: Find value from orders where a matching record exists in categories with the same type. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = ord.type );
{ "outer_table": "orders", "inner_table": "categories", "outer_alias": "ord", "inner_alias": "catg", "proj_col": "value", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_08656
train
T1
v1
Schema: employees (alias: emp)(amount, name, value, status) requests(type, date, value, code) Task: Find name from employees where status appears in requests entries with matching code. SQL:
SELECT name FROM employees AS emp WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.code = emp.code );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_08657
train
T1
v2
Schema: budgets (alias: budg)(type, name, date, code) items(id, date, type, amount) Task: Retrieve id from budgets that have at least one corresponding entry in items sharing the same type. SQL:
SELECT id FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = budg.type );
{ "outer_table": "budgets", "inner_table": "items", "outer_alias": "budg", "inner_alias": "lne", "proj_col": "id", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_08658
train
T2
v3
Schema: schedules (alias: schd)(code, salary, date, value) customers(value, status, type, amount) Task: Find id from schedules where value exceeds the average value from customers for the same status. SQL:
SELECT id FROM schedules AS schd WHERE value > ( SELECT SUM(value) FROM customers AS cust WHERE cust.status = schd.status );
{ "outer_table": "schedules", "inner_table": "customers", "outer_alias": "schd", "inner_alias": "cust", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_08659
train
T2
v1
Schema: managers (alias: mgr)(code, id, date, value) staff(name, value, status, id) Task: Find code from managers where code appears in staff entries with matching type. SQL:
SELECT code FROM managers AS mgr WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.type = mgr.type );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "code", "filter_col": "code", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_08660
train
T1
v3
Schema: budgets (alias: budg)(name, date, id, status) orders(name, level, value, type) Task: Retrieve amount from budgets with salary above the AVG(amount) of orders rows sharing the same level. SQL:
SELECT amount FROM budgets AS budg WHERE salary > ( SELECT AVG(amount) FROM orders AS ord WHERE ord.level = budg.level );
{ "outer_table": "budgets", "inner_table": "orders", "outer_alias": "budg", "inner_alias": "ord", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_08661
train
T2
v2
Schema: categories (alias: catg)(id, type, value, amount) staff(date, amount, salary, type) Task: Find name from categories where a matching record exists in staff with the same level. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = catg.level );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "name", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_08662
train
T2
v2
Schema: invoices (alias: inv)(id, code, salary, amount) customers(level, id, type, code) Task: Find name from invoices where a matching record exists in customers with the same code. SQL:
SELECT name FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = inv.code );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "name", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_08663
train
T1
v3
Schema: services (alias: srvc)(amount, date, id, value) regions(code, level, name, amount) Task: Find id from services where value exceeds the average salary from regions for the same type. SQL:
SELECT id FROM services AS srvc WHERE value > ( SELECT COUNT(salary) FROM regions AS rgn WHERE rgn.type = srvc.type );
{ "outer_table": "services", "inner_table": "regions", "outer_alias": "srvc", "inner_alias": "rgn", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_08664
train
T2
v1
Schema: managers (alias: mgr)(id, level, code, name) requests(type, salary, name, amount) Task: Retrieve id from managers whose type is found in requests rows where code matches the outer record. SQL:
SELECT id FROM managers AS mgr WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.code = mgr.code );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_08665
train
T1
v3
Schema: warehouses (alias: whs)(id, date, salary, level) invoices(type, id, amount, salary) Task: Find salary from warehouses where value exceeds the average salary from invoices for the same type. SQL:
SELECT salary FROM warehouses AS whs WHERE value > ( SELECT COUNT(salary) 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": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_08666
train
T2
v2
Schema: categories (alias: catg)(code, amount, salary, level) transactions(name, id, level, amount) Task: Retrieve code from categories that have at least one corresponding entry in transactions sharing the same id. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = catg.id );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "code", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_08667
train
T2
v3
Schema: customers (alias: cust)(name, type, id, value) accounts(value, status, amount, type) Task: Find salary from customers where amount exceeds the average amount from accounts for the same type. SQL:
SELECT salary FROM customers AS cust WHERE amount > ( SELECT COUNT(amount) FROM accounts AS acct WHERE acct.type = cust.type );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_08668
train
T1
v2
Schema: invoices (alias: inv)(amount, type, code, id) items(date, type, name, id) Task: Find value from invoices where a matching record exists in items with the same code. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = inv.code );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "value", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_08669
train
T1
v2
Schema: customers (alias: cust)(salary, code, amount, status) services(level, amount, status, code) Task: Find code from customers where a matching record exists in services with the same level. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.level = cust.level );
{ "outer_table": "customers", "inner_table": "services", "outer_alias": "cust", "inner_alias": "srvc", "proj_col": "code", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_08670
train
T1
v3
Schema: categories (alias: catg)(status, type, level, date) schedules(value, code, type, level) Task: Find value from categories where amount exceeds the average amount from schedules for the same id. SQL:
SELECT value FROM categories AS catg WHERE amount > ( SELECT COUNT(amount) FROM schedules AS schd WHERE schd.id = catg.id );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_08671
train
T2
v2
Schema: accounts (alias: acct)(value, status, code, level) regions(code, date, value, level) Task: Retrieve id from accounts that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = acct.level );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "id", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_08672
train
T1
v3
Schema: invoices (alias: inv)(status, amount, salary, id) requests(value, level, amount, status) Task: Find name from invoices where value exceeds the average amount from requests for the same id. SQL:
SELECT name FROM invoices AS inv WHERE value > ( SELECT MIN(amount) FROM requests AS ordr WHERE ordr.id = inv.id );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_08673
train
T1
v3
Schema: shipments (alias: shp)(value, salary, code, date) accounts(id, code, amount, level) Task: Find id from shipments where amount exceeds the average value from accounts for the same level. SQL:
SELECT id FROM shipments AS shp WHERE amount > ( SELECT AVG(value) FROM accounts AS acct WHERE acct.level = shp.level );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_08674
train
T2
v3
Schema: accounts (alias: acct)(status, amount, code, level) shipments(type, value, code, name) Task: Retrieve amount from accounts with amount above the SUM(value) of shipments rows sharing the same code. SQL:
SELECT amount FROM accounts AS acct WHERE amount > ( SELECT SUM(value) FROM shipments AS shp WHERE shp.code = acct.code );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_08675
train
T1
v1
Schema: orders (alias: ord)(status, date, amount, salary) categories(level, code, salary, status) Task: Select id from orders where id exists in categories for the same id. SQL:
SELECT id FROM orders AS ord WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.id = ord.id );
{ "outer_table": "orders", "inner_table": "categories", "outer_alias": "ord", "inner_alias": "catg", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_08676
train
T1
v2
Schema: products (alias: prod)(id, value, type, date) customers(name, salary, level, type) Task: Retrieve value from products that have at least one corresponding entry in customers sharing the same code. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = prod.code );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "value", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_08677
train
T1
v3
Schema: items (alias: lne)(date, level, value, amount) requests(code, level, id, amount) Task: Find amount from items where value exceeds the average value from requests for the same id. SQL:
SELECT amount FROM items AS lne WHERE value > ( SELECT MAX(value) FROM requests AS ordr WHERE ordr.id = lne.id );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_08678
train
T2
v2
Schema: requests (alias: ordr)(status, name, salary, date) employees(level, value, salary, status) Task: Retrieve amount from requests that have at least one corresponding entry in employees sharing the same id. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = ordr.id );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "amount", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_08679
train
T2
v2
Schema: accounts (alias: acct)(name, amount, id, value) budgets(id, name, type, value) Task: Find name from accounts where a matching record exists in budgets with the same type. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.type = acct.type );
{ "outer_table": "accounts", "inner_table": "budgets", "outer_alias": "acct", "inner_alias": "budg", "proj_col": "name", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_08680
train
T1
v1
Schema: transactions (alias: txn)(code, value, name, status) shipments(value, type, date, level) Task: Select value from transactions where id exists in shipments for the same code. SQL:
SELECT value FROM transactions AS txn WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.code = txn.code );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_08681
train
T1
v2
Schema: departments (alias: dept)(date, type, code, salary) employees(name, value, date, code) Task: Retrieve id from departments that have at least one corresponding entry in employees sharing the same type. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = dept.type );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "id", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_08682
train
T1
v1
Schema: orders (alias: ord)(code, type, date, level) invoices(id, status, amount, code) Task: Retrieve code from orders whose code is found in invoices rows where code matches the outer record. SQL:
SELECT code FROM orders AS ord WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.code = ord.code );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_08683
train
T1
v2
Schema: staff (alias: empl)(level, id, code, date) accounts(id, name, level, salary) Task: Retrieve value from staff that have at least one corresponding entry in accounts sharing the same code. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = empl.code );
{ "outer_table": "staff", "inner_table": "accounts", "outer_alias": "empl", "inner_alias": "acct", "proj_col": "value", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_08684
train
T2
v3
Schema: requests (alias: ordr)(value, name, status, code) managers(type, salary, date, code) Task: Retrieve amount from requests with salary above the AVG(value) of managers rows sharing the same type. SQL:
SELECT amount FROM requests AS ordr WHERE salary > ( SELECT AVG(value) FROM managers AS mgr WHERE mgr.type = ordr.type );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_08685
train
T2
v1
Schema: services (alias: srvc)(type, date, value, code) sales(value, status, id, date) Task: Select id from services where type exists in sales for the same level. SQL:
SELECT id FROM services AS srvc WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.level = srvc.level );
{ "outer_table": "services", "inner_table": "sales", "outer_alias": "srvc", "inner_alias": "sale", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_08686
train
T2
v3
Schema: requests (alias: ordr)(value, date, type, salary) products(name, code, date, id) Task: Retrieve salary from requests with salary above the SUM(salary) of products rows sharing the same id. SQL:
SELECT salary FROM requests AS ordr WHERE salary > ( SELECT SUM(salary) FROM products AS prod WHERE prod.id = ordr.id );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_08687
train
T2
v3
Schema: items (alias: lne)(code, amount, date, level) requests(type, value, name, amount) Task: Find name from items where salary exceeds the average salary from requests for the same level. SQL:
SELECT name FROM items AS lne WHERE salary > ( SELECT SUM(salary) FROM requests AS ordr WHERE ordr.level = lne.level );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_08688
train
T2
v3
Schema: departments (alias: dept)(type, salary, amount, level) shipments(amount, status, salary, value) Task: Retrieve value from departments with amount above the AVG(amount) of shipments rows sharing the same level. SQL:
SELECT value FROM departments AS dept WHERE amount > ( SELECT AVG(amount) FROM shipments AS shp WHERE shp.level = dept.level );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_08689
train
T1
v1
Schema: requests (alias: ordr)(salary, amount, date, type) staff(id, value, code, salary) Task: Retrieve value from requests whose id is found in staff rows where code matches the outer record. SQL:
SELECT value FROM requests AS ordr WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.code = ordr.code );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_08690
train
T2
v3
Schema: shipments (alias: shp)(value, date, type, salary) sales(name, type, date, amount) Task: Retrieve id from shipments with salary above the MAX(value) of sales rows sharing the same type. SQL:
SELECT id FROM shipments AS shp WHERE salary > ( SELECT MAX(value) FROM sales AS sale WHERE sale.type = shp.type );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_08691
train
T2
v2
Schema: requests (alias: ordr)(salary, level, id, name) regions(level, value, type, id) Task: Find salary from requests where a matching record exists in regions with the same level. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = ordr.level );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "salary", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_08692
train
T2
v1
Schema: invoices (alias: inv)(value, status, salary, code) customers(value, name, type, salary) Task: Select code from invoices where id exists in customers for the same code. SQL:
SELECT code FROM invoices AS inv WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.code = inv.code );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "code", "filter_col": "id", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_08693
train
T1
v3
Schema: products (alias: prod)(status, value, amount, salary) categories(type, code, status, name) Task: Retrieve id from products with salary above the COUNT(value) of categories rows sharing the same code. SQL:
SELECT id FROM products AS prod WHERE salary > ( SELECT COUNT(value) FROM categories AS catg WHERE catg.code = prod.code );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_08694
train
T1
v3
Schema: budgets (alias: budg)(amount, type, code, level) requests(type, code, amount, value) Task: Retrieve value from budgets with amount above the AVG(salary) of requests rows sharing the same level. SQL:
SELECT value FROM budgets AS budg WHERE amount > ( SELECT AVG(salary) FROM requests AS ordr WHERE ordr.level = budg.level );
{ "outer_table": "budgets", "inner_table": "requests", "outer_alias": "budg", "inner_alias": "ordr", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_08695
train
T2
v2
Schema: employees (alias: emp)(name, amount, status, code) departments(amount, status, code, id) Task: Retrieve id from employees that have at least one corresponding entry in departments sharing the same code. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = emp.code );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "id", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_08696
train
T1
v2
Schema: budgets (alias: budg)(date, type, level, value) sales(amount, date, type, name) Task: Retrieve value from budgets that have at least one corresponding entry in sales sharing the same status. SQL:
SELECT value FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = budg.status );
{ "outer_table": "budgets", "inner_table": "sales", "outer_alias": "budg", "inner_alias": "sale", "proj_col": "value", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_08697
train
T2
v2
Schema: employees (alias: emp)(amount, id, type, name) products(name, date, level, status) Task: Retrieve code from employees that have at least one corresponding entry in products sharing the same level. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = emp.level );
{ "outer_table": "employees", "inner_table": "products", "outer_alias": "emp", "inner_alias": "prod", "proj_col": "code", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_08698
train
T1
v2
Schema: categories (alias: catg)(value, name, id, status) regions(level, value, type, date) Task: Retrieve value from categories that have at least one corresponding entry in regions sharing the same id. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = catg.id );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "value", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_08699
train
T2