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: warehouses (alias: whs)(code, amount, name, id) regions(value, id, level, salary) Task: Retrieve salary from warehouses whose code is found in regions rows where level matches the outer record. SQL:
SELECT salary FROM warehouses AS whs WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "regions", "outer_alias": "whs", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "code", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_11700
train
T2
v2
Schema: orders (alias: ord)(status, level, date, salary) regions(type, id, name, code) Task: Find amount from orders where a matching record exists in regions with the same type. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = ord.type );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "amount", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_11701
train
T1
v2
Schema: customers (alias: cust)(status, type, date, name) departments(code, value, status, date) Task: Retrieve salary from customers that have at least one corresponding entry in departments sharing the same code. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = cust.code );
{ "outer_table": "customers", "inner_table": "departments", "outer_alias": "cust", "inner_alias": "dept", "proj_col": "salary", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_11702
train
T1
v2
Schema: transactions (alias: txn)(date, name, status, value) requests(value, type, date, name) Task: Find amount from transactions where a matching record exists in requests with the same id. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = txn.id );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "amount", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_11703
train
T1
v2
Schema: employees (alias: emp)(level, salary, id, date) shipments(status, code, amount, id) Task: Retrieve id from employees that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = emp.id );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "id", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_11704
train
T1
v3
Schema: staff (alias: empl)(value, code, type, level) warehouses(level, code, name, id) Task: Retrieve value from staff with salary above the SUM(salary) of warehouses rows sharing the same level. SQL:
SELECT value FROM staff AS empl WHERE salary > ( SELECT SUM(salary) FROM warehouses AS whs WHERE whs.level = empl.level );
{ "outer_table": "staff", "inner_table": "warehouses", "outer_alias": "empl", "inner_alias": "whs", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_11705
train
T2
v3
Schema: budgets (alias: budg)(amount, level, status, code) services(salary, status, id, type) Task: Retrieve salary from budgets with value above the MIN(value) of services rows sharing the same type. SQL:
SELECT salary FROM budgets AS budg WHERE value > ( SELECT MIN(value) FROM services AS srvc WHERE srvc.type = budg.type );
{ "outer_table": "budgets", "inner_table": "services", "outer_alias": "budg", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_11706
train
T2
v2
Schema: invoices (alias: inv)(type, id, level, status) budgets(amount, id, name, salary) Task: Find code from invoices where a matching record exists in budgets with the same status. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.status = inv.status );
{ "outer_table": "invoices", "inner_table": "budgets", "outer_alias": "inv", "inner_alias": "budg", "proj_col": "code", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_11707
train
T1
v3
Schema: transactions (alias: txn)(date, level, type, status) requests(date, type, value, id) Task: Retrieve code from transactions with salary above the COUNT(amount) of requests rows sharing the same code. SQL:
SELECT code FROM transactions AS txn WHERE salary > ( SELECT COUNT(amount) FROM requests AS ordr WHERE ordr.code = txn.code );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_11708
train
T1
v1
Schema: requests (alias: ordr)(id, level, date, status) invoices(value, type, level, name) Task: Select id from requests where status exists in invoices for the same id. SQL:
SELECT id FROM requests AS ordr WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.id = ordr.id );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_11709
train
T2
v1
Schema: regions (alias: rgn)(status, code, salary, id) customers(level, code, salary, date) Task: Select id from regions where code exists in customers for the same code. SQL:
SELECT id FROM regions AS rgn WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.code = rgn.code );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_11710
train
T2
v1
Schema: transactions (alias: txn)(date, code, level, type) sales(status, salary, date, name) Task: Retrieve name from transactions whose status is found in sales rows where status matches the outer record. SQL:
SELECT name FROM transactions AS txn WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.status = txn.status );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_11711
train
T1
v3
Schema: customers (alias: cust)(id, status, name, level) warehouses(level, type, status, value) Task: Find amount from customers where salary exceeds the average salary from warehouses for the same id. SQL:
SELECT amount FROM customers AS cust WHERE salary > ( SELECT MIN(salary) FROM warehouses AS whs WHERE whs.id = cust.id );
{ "outer_table": "customers", "inner_table": "warehouses", "outer_alias": "cust", "inner_alias": "whs", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_11712
train
T1
v2
Schema: regions (alias: rgn)(date, status, salary, name) transactions(status, salary, amount, level) Task: Retrieve code from regions that have at least one corresponding entry in transactions sharing the same level. SQL:
SELECT code FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = rgn.level );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "code", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_11713
train
T2
v2
Schema: departments (alias: dept)(type, code, amount, value) requests(code, salary, status, amount) Task: Retrieve id from departments that have at least one corresponding entry in requests sharing the same code. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = dept.code );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "id", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_11714
train
T1
v1
Schema: products (alias: prod)(id, date, code, status) transactions(id, salary, code, date) Task: Retrieve id from products whose type is found in transactions rows where type matches the outer record. SQL:
SELECT id FROM products AS prod WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.type = prod.type );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "id", "filter_col": "type", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_11715
train
T1
v3
Schema: services (alias: srvc)(code, date, name, amount) warehouses(name, level, value, status) Task: Retrieve amount from services with value above the AVG(salary) of warehouses rows sharing the same level. SQL:
SELECT amount FROM services AS srvc WHERE value > ( SELECT AVG(salary) FROM warehouses AS whs WHERE whs.level = srvc.level );
{ "outer_table": "services", "inner_table": "warehouses", "outer_alias": "srvc", "inner_alias": "whs", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_11716
train
T2
v3
Schema: managers (alias: mgr)(amount, type, level, id) warehouses(date, value, status, name) Task: Find amount from managers where value exceeds the average value from warehouses for the same id. SQL:
SELECT amount FROM managers AS mgr WHERE value > ( SELECT MIN(value) FROM warehouses AS whs WHERE whs.id = mgr.id );
{ "outer_table": "managers", "inner_table": "warehouses", "outer_alias": "mgr", "inner_alias": "whs", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_11717
train
T1
v1
Schema: regions (alias: rgn)(name, type, level, code) employees(salary, amount, type, status) Task: Retrieve salary from regions whose id is found in employees rows where code matches the outer record. SQL:
SELECT salary FROM regions AS rgn WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.code = rgn.code );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_11718
train
T2
v2
Schema: staff (alias: empl)(level, value, type, status) transactions(date, name, salary, status) Task: Retrieve code from staff that have at least one corresponding entry in transactions sharing the same status. SQL:
SELECT code 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": "code", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_11719
train
T2
v1
Schema: products (alias: prod)(amount, salary, type, value) departments(name, type, date, amount) Task: Retrieve name from products whose code is found in departments rows where status matches the outer record. SQL:
SELECT name FROM products AS prod WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.status = prod.status );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_11720
train
T1
v1
Schema: products (alias: prod)(status, level, id, amount) orders(name, amount, id, salary) Task: Retrieve id from products whose type is found in orders rows where id matches the outer record. SQL:
SELECT id FROM products AS prod WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.id = prod.id );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_11721
train
T1
v3
Schema: customers (alias: cust)(date, level, type, name) schedules(amount, status, type, level) Task: Retrieve value from customers with salary above the MIN(salary) of schedules rows sharing the same level. SQL:
SELECT value FROM customers AS cust WHERE salary > ( SELECT MIN(salary) FROM schedules AS schd WHERE schd.level = cust.level );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_11722
train
T1
v3
Schema: transactions (alias: txn)(level, value, salary, date) employees(id, date, code, status) Task: Find code from transactions where value exceeds the average value from employees for the same level. SQL:
SELECT code FROM transactions AS txn WHERE value > ( SELECT COUNT(value) FROM employees AS emp WHERE emp.level = txn.level );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_11723
train
T1
v1
Schema: sales (alias: sale)(value, code, amount, name) accounts(code, value, salary, name) Task: Find id from sales where id appears in accounts entries with matching status. SQL:
SELECT id FROM sales AS sale WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.status = sale.status );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "id", "filter_col": "id", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_11724
train
T1
v3
Schema: shipments (alias: shp)(amount, salary, type, code) requests(type, salary, name, status) Task: Retrieve amount from shipments with salary above the COUNT(value) of requests rows sharing the same level. SQL:
SELECT amount FROM shipments AS shp WHERE salary > ( SELECT COUNT(value) FROM requests AS ordr WHERE ordr.level = shp.level );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_11725
train
T2
v2
Schema: invoices (alias: inv)(level, date, salary, status) services(amount, level, code, name) Task: Find id from invoices where a matching record exists in services with the same code. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.code = inv.code );
{ "outer_table": "invoices", "inner_table": "services", "outer_alias": "inv", "inner_alias": "srvc", "proj_col": "id", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_11726
train
T1
v3
Schema: transactions (alias: txn)(salary, value, amount, status) requests(value, date, code, amount) Task: Retrieve name from transactions with salary above the MAX(salary) of requests rows sharing the same code. SQL:
SELECT name FROM transactions AS txn WHERE salary > ( SELECT MAX(salary) FROM requests AS ordr WHERE ordr.code = txn.code );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_11727
train
T1
v2
Schema: budgets (alias: budg)(amount, date, level, name) accounts(level, id, code, amount) Task: Retrieve id from budgets that have at least one corresponding entry in accounts sharing the same level. SQL:
SELECT id FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = budg.level );
{ "outer_table": "budgets", "inner_table": "accounts", "outer_alias": "budg", "inner_alias": "acct", "proj_col": "id", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_11728
train
T2
v3
Schema: budgets (alias: budg)(amount, salary, type, value) sales(salary, status, id, code) Task: Retrieve id from budgets with amount above the COUNT(value) of sales rows sharing the same code. SQL:
SELECT id FROM budgets AS budg WHERE amount > ( SELECT COUNT(value) FROM sales AS sale WHERE sale.code = budg.code );
{ "outer_table": "budgets", "inner_table": "sales", "outer_alias": "budg", "inner_alias": "sale", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_11729
train
T2
v2
Schema: schedules (alias: schd)(salary, date, name, id) budgets(amount, status, level, type) Task: Find code from schedules where a matching record exists in budgets with the same id. SQL:
SELECT code FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.id = schd.id );
{ "outer_table": "schedules", "inner_table": "budgets", "outer_alias": "schd", "inner_alias": "budg", "proj_col": "code", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_11730
train
T2
v2
Schema: invoices (alias: inv)(id, amount, code, type) warehouses(status, date, code, amount) Task: Find amount from invoices where a matching record exists in warehouses with the same code. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.code = inv.code );
{ "outer_table": "invoices", "inner_table": "warehouses", "outer_alias": "inv", "inner_alias": "whs", "proj_col": "amount", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_11731
train
T1
v3
Schema: regions (alias: rgn)(name, status, type, date) orders(code, salary, id, amount) Task: Retrieve amount from regions with value above the AVG(value) of orders rows sharing the same id. SQL:
SELECT amount FROM regions AS rgn WHERE value > ( SELECT AVG(value) FROM orders AS ord WHERE ord.id = rgn.id );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_11732
train
T2
v1
Schema: warehouses (alias: whs)(code, name, amount, value) items(value, id, level, date) Task: Select value from warehouses where id exists in items for the same type. SQL:
SELECT value FROM warehouses AS whs WHERE id IN ( SELECT id FROM items AS lne WHERE lne.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "items", "outer_alias": "whs", "inner_alias": "lne", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_11733
train
T2
v2
Schema: warehouses (alias: whs)(level, code, salary, status) customers(status, amount, date, id) Task: Find salary from warehouses where a matching record exists in customers with the same id. SQL:
SELECT salary FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "customers", "outer_alias": "whs", "inner_alias": "cust", "proj_col": "salary", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_11734
train
T2
v3
Schema: sales (alias: sale)(code, id, level, date) warehouses(amount, date, name, salary) Task: Retrieve code from sales with amount above the MAX(value) of warehouses rows sharing the same id. SQL:
SELECT code FROM sales AS sale WHERE amount > ( SELECT MAX(value) FROM warehouses AS whs WHERE whs.id = sale.id );
{ "outer_table": "sales", "inner_table": "warehouses", "outer_alias": "sale", "inner_alias": "whs", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_11735
train
T1
v3
Schema: warehouses (alias: whs)(amount, id, salary, name) transactions(amount, date, salary, code) Task: Retrieve name from warehouses with amount above the AVG(amount) of transactions rows sharing the same id. SQL:
SELECT name FROM warehouses AS whs WHERE amount > ( SELECT AVG(amount) FROM transactions AS txn WHERE txn.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "transactions", "outer_alias": "whs", "inner_alias": "txn", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_11736
train
T2
v3
Schema: budgets (alias: budg)(level, salary, name, type) accounts(salary, type, level, amount) Task: Find amount from budgets where value exceeds the average value from accounts for the same id. SQL:
SELECT amount FROM budgets AS budg WHERE value > ( SELECT AVG(value) FROM accounts AS acct WHERE acct.id = budg.id );
{ "outer_table": "budgets", "inner_table": "accounts", "outer_alias": "budg", "inner_alias": "acct", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_11737
train
T2
v2
Schema: transactions (alias: txn)(level, value, salary, id) employees(date, code, value, status) Task: Find amount from transactions where a matching record exists in employees with the same type. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = txn.type );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "amount", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_11738
train
T1
v2
Schema: transactions (alias: txn)(name, id, value, level) budgets(type, name, value, id) Task: Retrieve id from transactions that have at least one corresponding entry in budgets sharing the same level. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.level = txn.level );
{ "outer_table": "transactions", "inner_table": "budgets", "outer_alias": "txn", "inner_alias": "budg", "proj_col": "id", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_11739
train
T1
v1
Schema: products (alias: prod)(id, salary, amount, type) managers(level, type, name, salary) Task: Select value from products where level exists in managers for the same level. SQL:
SELECT value FROM products AS prod WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.level = prod.level );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_11740
train
T1
v1
Schema: warehouses (alias: whs)(name, date, amount, id) services(level, status, date, amount) Task: Find id from warehouses where code appears in services entries with matching level. SQL:
SELECT id FROM warehouses AS whs WHERE code IN ( SELECT code FROM services AS srvc WHERE srvc.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "services", "outer_alias": "whs", "inner_alias": "srvc", "proj_col": "id", "filter_col": "code", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_11741
train
T2
v3
Schema: regions (alias: rgn)(level, status, value, name) sales(code, amount, level, date) Task: Retrieve salary from regions with amount above the COUNT(salary) of sales rows sharing the same type. SQL:
SELECT salary FROM regions AS rgn WHERE amount > ( SELECT COUNT(salary) FROM sales AS sale WHERE sale.type = rgn.type );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_11742
train
T2
v2
Schema: customers (alias: cust)(value, type, amount, name) requests(status, name, level, id) Task: Retrieve code from customers that have at least one corresponding entry in requests sharing the same status. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = cust.status );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "code", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_11743
train
T1
v3
Schema: regions (alias: rgn)(id, amount, salary, date) products(value, name, salary, amount) Task: Retrieve code from regions with amount above the AVG(value) of products rows sharing the same code. SQL:
SELECT code FROM regions AS rgn WHERE amount > ( SELECT AVG(value) FROM products AS prod WHERE prod.code = rgn.code );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_11744
train
T2
v3
Schema: requests (alias: ordr)(status, salary, code, date) sales(name, type, status, salary) Task: Find id from requests where value exceeds the average amount from sales for the same status. SQL:
SELECT id FROM requests AS ordr WHERE value > ( SELECT AVG(amount) FROM sales AS sale WHERE sale.status = ordr.status );
{ "outer_table": "requests", "inner_table": "sales", "outer_alias": "ordr", "inner_alias": "sale", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_11745
train
T2
v2
Schema: requests (alias: ordr)(level, code, value, date) categories(salary, code, level, status) Task: Find value from requests where a matching record exists in categories with the same type. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = ordr.type );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "value", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_11746
train
T2
v2
Schema: managers (alias: mgr)(id, code, salary, type) warehouses(value, status, date, id) Task: Retrieve id from managers that have at least one corresponding entry in warehouses sharing the same level. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.level = mgr.level );
{ "outer_table": "managers", "inner_table": "warehouses", "outer_alias": "mgr", "inner_alias": "whs", "proj_col": "id", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_11747
train
T1
v3
Schema: staff (alias: empl)(status, date, amount, code) shipments(name, type, date, salary) Task: Find code from staff where value exceeds the average salary from shipments for the same code. SQL:
SELECT code FROM staff AS empl WHERE value > ( SELECT MIN(salary) FROM shipments AS shp WHERE shp.code = empl.code );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_11748
train
T2
v3
Schema: products (alias: prod)(level, status, value, salary) managers(salary, name, level, value) Task: Find name from products where salary exceeds the average value from managers for the same code. SQL:
SELECT name FROM products AS prod WHERE salary > ( SELECT AVG(value) FROM managers AS mgr WHERE mgr.code = prod.code );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_11749
train
T1
v1
Schema: items (alias: lne)(level, status, name, id) employees(level, type, amount, name) Task: Find code from items where status appears in employees entries with matching type. SQL:
SELECT code FROM items AS lne WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.type = lne.type );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_11750
train
T2
v1
Schema: schedules (alias: schd)(code, amount, date, salary) shipments(code, id, name, value) Task: Select name from schedules where code exists in shipments for the same id. SQL:
SELECT name FROM schedules AS schd WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.id = schd.id );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_11751
train
T2
v2
Schema: departments (alias: dept)(salary, level, value, code) products(value, salary, type, date) Task: Find value from departments where a matching record exists in products with the same status. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = dept.status );
{ "outer_table": "departments", "inner_table": "products", "outer_alias": "dept", "inner_alias": "prod", "proj_col": "value", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_11752
train
T1
v2
Schema: customers (alias: cust)(code, id, type, status) accounts(status, name, amount, date) Task: Find code from customers where a matching record exists in accounts with the same level. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = cust.level );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "code", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_11753
train
T1
v1
Schema: staff (alias: empl)(amount, id, name, value) orders(level, status, value, date) Task: Select name from staff where type exists in orders for the same code. SQL:
SELECT name FROM staff AS empl WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.code = empl.code );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_11754
train
T2
v3
Schema: invoices (alias: inv)(level, salary, type, id) items(value, level, type, name) Task: Find name from invoices where salary exceeds the average amount from items for the same level. SQL:
SELECT name FROM invoices AS inv WHERE salary > ( SELECT COUNT(amount) FROM items AS lne WHERE lne.level = inv.level );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_11755
train
T1
v1
Schema: sales (alias: sale)(date, code, level, amount) products(id, status, salary, level) Task: Select value from sales where id exists in products for the same status. SQL:
SELECT value FROM sales AS sale WHERE id IN ( SELECT id FROM products AS prod WHERE prod.status = sale.status );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_11756
train
T1
v3
Schema: employees (alias: emp)(id, code, value, name) warehouses(value, date, type, id) Task: Retrieve value from employees with value above the AVG(amount) of warehouses rows sharing the same type. SQL:
SELECT value FROM employees AS emp WHERE value > ( SELECT AVG(amount) FROM warehouses AS whs WHERE whs.type = emp.type );
{ "outer_table": "employees", "inner_table": "warehouses", "outer_alias": "emp", "inner_alias": "whs", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_11757
train
T1
v3
Schema: invoices (alias: inv)(salary, date, code, amount) staff(level, type, amount, value) Task: Retrieve amount from invoices with salary above the AVG(value) of staff rows sharing the same status. SQL:
SELECT amount FROM invoices AS inv WHERE salary > ( SELECT AVG(value) FROM staff AS empl WHERE empl.status = inv.status );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_11758
train
T1
v1
Schema: customers (alias: cust)(amount, level, value, date) accounts(date, name, value, code) Task: Select name from customers where type exists in accounts for the same level. SQL:
SELECT name FROM customers AS cust WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.level = cust.level );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_11759
train
T1
v2
Schema: invoices (alias: inv)(type, id, salary, value) accounts(id, level, code, value) Task: Retrieve name from invoices that have at least one corresponding entry in accounts sharing the same status. SQL:
SELECT name FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = inv.status );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "name", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_11760
train
T1
v1
Schema: budgets (alias: budg)(level, amount, status, id) categories(date, code, amount, level) Task: Select code from budgets where code exists in categories for the same type. SQL:
SELECT code FROM budgets AS budg WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.type = budg.type );
{ "outer_table": "budgets", "inner_table": "categories", "outer_alias": "budg", "inner_alias": "catg", "proj_col": "code", "filter_col": "code", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_11761
train
T2
v1
Schema: services (alias: srvc)(value, id, level, name) departments(status, code, level, name) Task: Retrieve amount from services whose type is found in departments rows where id matches the outer record. SQL:
SELECT amount FROM services AS srvc WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.id = srvc.id );
{ "outer_table": "services", "inner_table": "departments", "outer_alias": "srvc", "inner_alias": "dept", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_11762
train
T2
v3
Schema: invoices (alias: inv)(level, name, amount, type) categories(type, name, level, amount) Task: Retrieve salary from invoices with salary above the MAX(value) of categories rows sharing the same status. SQL:
SELECT salary FROM invoices AS inv WHERE salary > ( SELECT MAX(value) FROM categories AS catg WHERE catg.status = inv.status );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_11763
train
T1
v1
Schema: employees (alias: emp)(salary, id, amount, value) items(level, salary, name, status) Task: Find code from employees where code appears in items entries with matching id. SQL:
SELECT code FROM employees AS emp WHERE code IN ( SELECT code FROM items AS lne WHERE lne.id = emp.id );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_11764
train
T1
v1
Schema: customers (alias: cust)(status, name, id, date) invoices(type, level, salary, status) Task: Select code from customers where type exists in invoices for the same id. SQL:
SELECT code FROM customers AS cust WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.id = cust.id );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "code", "filter_col": "type", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_11765
train
T1
v1
Schema: categories (alias: catg)(name, level, code, type) warehouses(name, status, salary, level) Task: Retrieve id from categories whose id is found in warehouses rows where id matches the outer record. SQL:
SELECT id FROM categories AS catg WHERE id IN ( SELECT id FROM warehouses AS whs WHERE whs.id = catg.id );
{ "outer_table": "categories", "inner_table": "warehouses", "outer_alias": "catg", "inner_alias": "whs", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_11766
train
T2
v1
Schema: customers (alias: cust)(date, type, id, salary) staff(status, salary, name, level) Task: Select id from customers where id exists in staff for the same type. SQL:
SELECT id FROM customers AS cust WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.type = cust.type );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_11767
train
T1
v1
Schema: requests (alias: ordr)(value, amount, name, date) warehouses(salary, status, type, amount) Task: Retrieve amount from requests whose id is found in warehouses rows where code matches the outer record. SQL:
SELECT amount FROM requests AS ordr WHERE id IN ( SELECT id FROM warehouses AS whs WHERE whs.code = ordr.code );
{ "outer_table": "requests", "inner_table": "warehouses", "outer_alias": "ordr", "inner_alias": "whs", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_11768
train
T2
v1
Schema: categories (alias: catg)(level, status, salary, value) invoices(type, amount, level, code) Task: Retrieve code from categories whose level is found in invoices rows where level matches the outer record. SQL:
SELECT code FROM categories AS catg WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.level = catg.level );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "code", "filter_col": "level", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_11769
train
T2
v2
Schema: employees (alias: emp)(salary, id, name, code) warehouses(type, id, salary, value) Task: Retrieve code from employees that have at least one corresponding entry in warehouses sharing the same level. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.level = emp.level );
{ "outer_table": "employees", "inner_table": "warehouses", "outer_alias": "emp", "inner_alias": "whs", "proj_col": "code", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_11770
train
T1
v1
Schema: sales (alias: sale)(level, id, date, type) categories(name, amount, code, type) Task: Retrieve amount from sales whose status is found in categories rows where status matches the outer record. SQL:
SELECT amount FROM sales AS sale WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.status = sale.status );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_11771
train
T1
v3
Schema: invoices (alias: inv)(value, type, id, level) accounts(name, amount, code, salary) Task: Find value from invoices where amount exceeds the average amount from accounts for the same code. SQL:
SELECT value FROM invoices AS inv WHERE amount > ( SELECT SUM(amount) FROM accounts AS acct WHERE acct.code = inv.code );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_11772
train
T1
v1
Schema: customers (alias: cust)(salary, value, date, level) products(amount, value, name, date) Task: Find salary from customers where code appears in products entries with matching code. SQL:
SELECT salary FROM customers AS cust WHERE code IN ( SELECT code FROM products AS prod WHERE prod.code = cust.code );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_11773
train
T1
v3
Schema: customers (alias: cust)(type, name, id, value) requests(status, date, type, amount) Task: Find value from customers where value exceeds the average salary from requests for the same code. SQL:
SELECT value FROM customers AS cust WHERE value > ( SELECT SUM(salary) FROM requests AS ordr WHERE ordr.code = cust.code );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_11774
train
T1
v1
Schema: managers (alias: mgr)(id, amount, value, level) products(type, name, date, status) Task: Select salary from managers where type exists in products for the same type. SQL:
SELECT salary FROM managers AS mgr WHERE type IN ( SELECT type FROM products AS prod WHERE prod.type = mgr.type );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_11775
train
T1
v1
Schema: regions (alias: rgn)(id, amount, name, date) services(code, amount, id, date) Task: Select value from regions where level exists in services for the same code. SQL:
SELECT value FROM regions AS rgn WHERE level IN ( SELECT level FROM services AS srvc WHERE srvc.code = rgn.code );
{ "outer_table": "regions", "inner_table": "services", "outer_alias": "rgn", "inner_alias": "srvc", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_11776
train
T2
v1
Schema: staff (alias: empl)(name, date, status, value) budgets(amount, code, level, type) Task: Retrieve salary from staff whose id is found in budgets rows where level matches the outer record. SQL:
SELECT salary FROM staff AS empl WHERE id IN ( SELECT id FROM budgets AS budg WHERE budg.level = empl.level );
{ "outer_table": "staff", "inner_table": "budgets", "outer_alias": "empl", "inner_alias": "budg", "proj_col": "salary", "filter_col": "id", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_11777
train
T2
v3
Schema: warehouses (alias: whs)(value, salary, type, id) regions(type, id, value, level) Task: Retrieve id from warehouses with salary above the COUNT(value) of regions rows sharing the same type. SQL:
SELECT id FROM warehouses AS whs WHERE salary > ( SELECT COUNT(value) FROM regions AS rgn WHERE rgn.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "regions", "outer_alias": "whs", "inner_alias": "rgn", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_11778
train
T2
v1
Schema: shipments (alias: shp)(level, value, code, salary) schedules(status, value, amount, name) Task: Select value from shipments where level exists in schedules for the same level. SQL:
SELECT value FROM shipments AS shp WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.level = shp.level );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_11779
train
T2
v3
Schema: services (alias: srvc)(value, salary, name, status) customers(type, value, level, status) Task: Retrieve salary from services with amount above the MIN(salary) of customers rows sharing the same level. SQL:
SELECT salary FROM services AS srvc WHERE amount > ( SELECT MIN(salary) FROM customers AS cust WHERE cust.level = srvc.level );
{ "outer_table": "services", "inner_table": "customers", "outer_alias": "srvc", "inner_alias": "cust", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_11780
train
T2
v2
Schema: schedules (alias: schd)(value, name, salary, type) sales(name, salary, amount, date) Task: Retrieve salary from schedules that have at least one corresponding entry in sales sharing the same level. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = schd.level );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "salary", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_11781
train
T2
v3
Schema: shipments (alias: shp)(name, amount, code, status) budgets(code, level, date, value) Task: Retrieve amount from shipments with amount above the MIN(amount) of budgets rows sharing the same type. SQL:
SELECT amount FROM shipments AS shp WHERE amount > ( SELECT MIN(amount) FROM budgets AS budg WHERE budg.type = shp.type );
{ "outer_table": "shipments", "inner_table": "budgets", "outer_alias": "shp", "inner_alias": "budg", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_11782
train
T2
v2
Schema: accounts (alias: acct)(name, amount, id, type) invoices(code, value, status, level) Task: Find code from accounts where a matching record exists in invoices with the same level. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = acct.level );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "code", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_11783
train
T1
v2
Schema: services (alias: srvc)(code, date, id, salary) orders(code, type, status, name) Task: Retrieve value from services that have at least one corresponding entry in orders sharing the same id. SQL:
SELECT value FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = srvc.id );
{ "outer_table": "services", "inner_table": "orders", "outer_alias": "srvc", "inner_alias": "ord", "proj_col": "value", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_11784
train
T2
v2
Schema: products (alias: prod)(salary, name, value, amount) budgets(date, name, salary, type) Task: Find salary from products where a matching record exists in budgets with the same level. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.level = prod.level );
{ "outer_table": "products", "inner_table": "budgets", "outer_alias": "prod", "inner_alias": "budg", "proj_col": "salary", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_11785
train
T1
v3
Schema: schedules (alias: schd)(id, amount, name, status) transactions(id, value, date, salary) Task: Find code from schedules where value exceeds the average salary from transactions for the same type. SQL:
SELECT code FROM schedules AS schd WHERE value > ( SELECT COUNT(salary) FROM transactions AS txn WHERE txn.type = schd.type );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_11786
train
T2
v3
Schema: staff (alias: empl)(date, id, amount, level) sales(value, amount, name, status) Task: Find code from staff where value exceeds the average salary from sales for the same status. SQL:
SELECT code FROM staff AS empl WHERE value > ( SELECT AVG(salary) FROM sales AS sale WHERE sale.status = empl.status );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_11787
train
T2
v3
Schema: products (alias: prod)(id, date, code, amount) items(id, status, type, salary) Task: Find name from products where salary exceeds the average salary from items for the same id. SQL:
SELECT name FROM products AS prod WHERE salary > ( SELECT MAX(salary) FROM items AS lne WHERE lne.id = prod.id );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_11788
train
T1
v2
Schema: warehouses (alias: whs)(amount, id, date, status) managers(id, type, level, amount) Task: Retrieve salary from warehouses that have at least one corresponding entry in managers sharing the same code. SQL:
SELECT salary FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "managers", "outer_alias": "whs", "inner_alias": "mgr", "proj_col": "salary", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_11789
train
T2
v2
Schema: categories (alias: catg)(salary, amount, level, value) transactions(date, id, value, name) Task: Find value from categories where a matching record exists in transactions with the same type. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = catg.type );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "value", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_11790
train
T2
v2
Schema: staff (alias: empl)(date, value, code, level) schedules(id, salary, amount, status) Task: Retrieve salary from staff that have at least one corresponding entry in schedules sharing the same id. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = empl.id );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "salary", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_11791
train
T2
v1
Schema: departments (alias: dept)(date, salary, value, amount) accounts(status, type, id, level) Task: Find name from departments where level appears in accounts entries with matching level. SQL:
SELECT name FROM departments AS dept WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.level = dept.level );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_11792
train
T1
v2
Schema: orders (alias: ord)(code, level, id, date) schedules(level, name, id, code) Task: Find value from orders where a matching record exists in schedules with the same type. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = ord.type );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "value", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_11793
train
T1
v1
Schema: requests (alias: ordr)(name, id, level, date) orders(status, amount, id, type) Task: Retrieve code from requests whose type is found in orders rows where status matches the outer record. SQL:
SELECT code FROM requests AS ordr WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.status = ordr.status );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_11794
train
T2
v3
Schema: regions (alias: rgn)(status, value, date, type) customers(id, name, amount, code) Task: Retrieve amount from regions with amount above the MIN(amount) of customers rows sharing the same level. SQL:
SELECT amount FROM regions AS rgn WHERE amount > ( SELECT MIN(amount) FROM customers AS cust WHERE cust.level = rgn.level );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_11795
train
T2
v1
Schema: schedules (alias: schd)(salary, id, status, level) departments(type, value, code, amount) Task: Find salary from schedules where type appears in departments entries with matching code. SQL:
SELECT salary FROM schedules AS schd WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.code = schd.code );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "salary", "filter_col": "type", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_11796
train
T2
v2
Schema: managers (alias: mgr)(code, id, type, level) products(type, date, name, salary) Task: Find value from managers where a matching record exists in products with the same id. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = mgr.id );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "value", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_11797
train
T1
v2
Schema: managers (alias: mgr)(level, type, date, id) orders(code, date, status, salary) Task: Retrieve name from managers that have at least one corresponding entry in orders sharing the same type. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = mgr.type );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "name", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_11798
train
T1
v2
Schema: staff (alias: empl)(amount, value, type, level) categories(amount, type, id, name) Task: Find amount from staff where a matching record exists in categories with the same status. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = empl.status );
{ "outer_table": "staff", "inner_table": "categories", "outer_alias": "empl", "inner_alias": "catg", "proj_col": "amount", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_11799
train
T2