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: customers (alias: cust)(date, status, salary, code) regions(salary, value, code, id) Task: Retrieve id from customers whose type is found in regions rows where level matches the outer record. SQL:
SELECT id FROM customers AS cust WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.level = cust.level );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_01000
train
T1
v1
Schema: services (alias: srvc)(salary, id, type, status) items(amount, name, id, code) Task: Retrieve code from services whose id is found in items rows where status matches the outer record. SQL:
SELECT code FROM services AS srvc WHERE id IN ( SELECT id FROM items AS lne WHERE lne.status = srvc.status );
{ "outer_table": "services", "inner_table": "items", "outer_alias": "srvc", "inner_alias": "lne", "proj_col": "code", "filter_col": "id", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_01001
train
T2
v1
Schema: customers (alias: cust)(level, salary, status, value) transactions(value, date, type, level) Task: Retrieve amount from customers whose status is found in transactions rows where code matches the outer record. SQL:
SELECT amount FROM customers AS cust WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.code = cust.code );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "amount", "filter_col": "status", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_01002
train
T1
v3
Schema: items (alias: lne)(name, salary, status, value) regions(amount, type, code, status) Task: Find salary from items where amount exceeds the average amount from regions for the same type. SQL:
SELECT salary FROM items AS lne WHERE amount > ( SELECT SUM(amount) FROM regions AS rgn WHERE rgn.type = lne.type );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_01003
train
T2
v1
Schema: services (alias: srvc)(type, id, amount, level) customers(type, level, amount, salary) Task: Find name from services where status appears in customers entries with matching id. SQL:
SELECT name FROM services AS srvc WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.id = srvc.id );
{ "outer_table": "services", "inner_table": "customers", "outer_alias": "srvc", "inner_alias": "cust", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_01004
train
T2
v1
Schema: categories (alias: catg)(name, type, date, status) shipments(date, name, status, amount) Task: Select id from categories where id exists in shipments for the same status. SQL:
SELECT id FROM categories AS catg WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.status = catg.status );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "catg", "inner_alias": "shp", "proj_col": "id", "filter_col": "id", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_01005
train
T2
v1
Schema: invoices (alias: inv)(salary, amount, date, type) departments(value, amount, salary, date) Task: Retrieve id from invoices whose id is found in departments rows where status matches the outer record. SQL:
SELECT id FROM invoices AS inv WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.status = inv.status );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "id", "filter_col": "id", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_01006
train
T1
v2
Schema: warehouses (alias: whs)(salary, level, amount, id) schedules(date, type, name, status) Task: Find salary from warehouses where a matching record exists in schedules with the same type. SQL:
SELECT salary FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "schedules", "outer_alias": "whs", "inner_alias": "schd", "proj_col": "salary", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_01007
train
T2
v3
Schema: departments (alias: dept)(name, date, level, code) schedules(date, status, salary, level) Task: Retrieve name from departments with salary above the AVG(value) of schedules rows sharing the same id. SQL:
SELECT name FROM departments AS dept WHERE salary > ( SELECT AVG(value) FROM schedules AS schd WHERE schd.id = dept.id );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_01008
train
T1
v2
Schema: budgets (alias: budg)(level, type, code, value) customers(id, name, amount, status) Task: Find salary from budgets where a matching record exists in customers with the same status. SQL:
SELECT salary FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = budg.status );
{ "outer_table": "budgets", "inner_table": "customers", "outer_alias": "budg", "inner_alias": "cust", "proj_col": "salary", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_01009
train
T2
v1
Schema: requests (alias: ordr)(status, id, amount, salary) managers(code, level, type, amount) Task: Select value from requests where status exists in managers for the same id. SQL:
SELECT value FROM requests AS ordr WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.id = ordr.id );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_01010
train
T2
v3
Schema: schedules (alias: schd)(name, salary, amount, type) employees(name, level, type, status) Task: Find salary from schedules where value exceeds the average value from employees for the same level. SQL:
SELECT salary FROM schedules AS schd WHERE value > ( SELECT COUNT(value) 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": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_01011
train
T2
v2
Schema: staff (alias: empl)(type, name, amount, code) regions(salary, type, id, name) Task: Retrieve amount from staff that have at least one corresponding entry in regions sharing the same code. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = empl.code );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "amount", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_01012
train
T2
v1
Schema: products (alias: prod)(date, salary, level, code) orders(type, level, code, id) Task: Retrieve amount from products whose status is found in orders rows where level matches the outer record. SQL:
SELECT amount FROM products AS prod WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.level = prod.level );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_01013
train
T1
v2
Schema: warehouses (alias: whs)(level, salary, name, amount) services(id, type, level, name) Task: Find code from warehouses where a matching record exists in services with the same status. SQL:
SELECT code FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "services", "outer_alias": "whs", "inner_alias": "srvc", "proj_col": "code", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_01014
train
T2
v1
Schema: requests (alias: ordr)(type, amount, salary, name) regions(status, name, salary, id) Task: Find salary from requests where level appears in regions entries with matching id. SQL:
SELECT salary FROM requests AS ordr WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.id = ordr.id );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "level", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_01015
train
T2
v2
Schema: employees (alias: emp)(value, id, status, name) categories(id, value, level, code) Task: Retrieve id from employees that have at least one corresponding entry in categories sharing the same level. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = emp.level );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "id", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_01016
train
T1
v3
Schema: schedules (alias: schd)(date, id, amount, type) budgets(id, name, date, level) Task: Retrieve name from schedules with amount above the COUNT(amount) of budgets rows sharing the same status. SQL:
SELECT name FROM schedules AS schd WHERE amount > ( SELECT COUNT(amount) 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": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_01017
train
T2
v1
Schema: regions (alias: rgn)(status, name, value, type) products(name, status, id, date) Task: Select name from regions where level exists in products for the same type. SQL:
SELECT name FROM regions AS rgn WHERE level IN ( SELECT level FROM products AS prod WHERE prod.type = rgn.type );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_01018
train
T2
v3
Schema: sales (alias: sale)(id, amount, name, value) categories(salary, value, status, type) Task: Find salary from sales where value exceeds the average amount from categories for the same level. SQL:
SELECT salary FROM sales AS sale WHERE value > ( SELECT MAX(amount) FROM categories AS catg WHERE catg.level = sale.level );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_01019
train
T1
v1
Schema: schedules (alias: schd)(type, date, salary, code) products(name, level, salary, id) Task: Find amount from schedules where code appears in products entries with matching level. SQL:
SELECT amount FROM schedules AS schd WHERE code IN ( SELECT code FROM products AS prod WHERE prod.level = schd.level );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_01020
train
T2
v1
Schema: items (alias: lne)(code, type, amount, id) staff(type, id, salary, amount) Task: Select id from items where type exists in staff for the same level. SQL:
SELECT id FROM items AS lne WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.level = lne.level );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_01021
train
T2
v3
Schema: customers (alias: cust)(date, level, type, status) shipments(name, id, status, level) Task: Find name from customers where amount exceeds the average salary from shipments for the same type. SQL:
SELECT name FROM customers AS cust WHERE amount > ( SELECT AVG(salary) FROM shipments AS shp WHERE shp.type = cust.type );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_01022
train
T1
v2
Schema: orders (alias: ord)(status, type, value, date) products(name, level, amount, status) Task: Find code from orders where a matching record exists in products with the same type. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = ord.type );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "code", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_01023
train
T1
v3
Schema: departments (alias: dept)(salary, code, id, amount) invoices(amount, code, status, name) Task: Find code from departments where amount exceeds the average amount from invoices for the same level. SQL:
SELECT code FROM departments AS dept WHERE amount > ( SELECT MIN(amount) FROM invoices AS inv WHERE inv.level = dept.level );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_01024
train
T1
v2
Schema: invoices (alias: inv)(type, code, id, status) departments(id, salary, level, date) Task: Find amount from invoices where a matching record exists in departments with the same id. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = inv.id );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "amount", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_01025
train
T1
v2
Schema: warehouses (alias: whs)(salary, code, value, level) products(id, status, amount, date) Task: Retrieve amount from warehouses that have at least one corresponding entry in products sharing the same type. SQL:
SELECT amount FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "products", "outer_alias": "whs", "inner_alias": "prod", "proj_col": "amount", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_01026
train
T2
v3
Schema: orders (alias: ord)(salary, code, name, date) employees(id, value, salary, level) Task: Find value from orders where value exceeds the average amount from employees for the same status. SQL:
SELECT value FROM orders AS ord WHERE value > ( SELECT SUM(amount) FROM employees AS emp WHERE emp.status = ord.status );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_01027
train
T1
v3
Schema: managers (alias: mgr)(status, id, level, date) budgets(code, amount, id, date) Task: Retrieve amount from managers with salary above the MAX(amount) of budgets rows sharing the same id. SQL:
SELECT amount FROM managers AS mgr WHERE salary > ( SELECT MAX(amount) FROM budgets AS budg WHERE budg.id = mgr.id );
{ "outer_table": "managers", "inner_table": "budgets", "outer_alias": "mgr", "inner_alias": "budg", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_01028
train
T1
v2
Schema: accounts (alias: acct)(name, amount, id, value) managers(id, type, code, value) Task: Find salary from accounts where a matching record exists in managers with the same status. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = acct.status );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "salary", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_01029
train
T1
v3
Schema: accounts (alias: acct)(amount, type, value, salary) managers(name, code, salary, amount) Task: Find value from accounts where salary exceeds the average salary from managers for the same status. SQL:
SELECT value FROM accounts AS acct WHERE salary > ( SELECT MAX(salary) FROM managers AS mgr WHERE mgr.status = acct.status );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_01030
train
T1
v3
Schema: sales (alias: sale)(value, salary, date, id) customers(amount, name, date, code) Task: Retrieve salary from sales with salary above the MIN(salary) of customers rows sharing the same level. SQL:
SELECT salary FROM sales AS sale WHERE salary > ( SELECT MIN(salary) FROM customers AS cust WHERE cust.level = sale.level );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_01031
train
T1
v1
Schema: requests (alias: ordr)(name, code, type, id) shipments(amount, salary, code, status) Task: Retrieve id from requests whose code is found in shipments rows where type matches the outer record. SQL:
SELECT id FROM requests AS ordr WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.type = ordr.type );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "id", "filter_col": "code", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_01032
train
T2
v3
Schema: schedules (alias: schd)(level, name, status, date) sales(level, status, salary, id) Task: Retrieve code from schedules with value above the SUM(amount) of sales rows sharing the same type. SQL:
SELECT code FROM schedules AS schd WHERE value > ( SELECT SUM(amount) FROM sales AS sale WHERE sale.type = schd.type );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_01033
train
T2
v2
Schema: budgets (alias: budg)(name, code, id, salary) transactions(status, code, level, salary) Task: Retrieve salary from budgets that have at least one corresponding entry in transactions sharing the same type. SQL:
SELECT salary FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = budg.type );
{ "outer_table": "budgets", "inner_table": "transactions", "outer_alias": "budg", "inner_alias": "txn", "proj_col": "salary", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_01034
train
T2
v1
Schema: accounts (alias: acct)(date, amount, type, salary) customers(name, amount, code, salary) Task: Find salary from accounts where code appears in customers entries with matching code. SQL:
SELECT salary FROM accounts AS acct WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.code = acct.code );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_01035
train
T1
v3
Schema: requests (alias: ordr)(code, status, level, amount) warehouses(type, status, name, id) Task: Find value from requests where value exceeds the average salary from warehouses for the same level. SQL:
SELECT value FROM requests AS ordr WHERE value > ( SELECT COUNT(salary) FROM warehouses AS whs WHERE whs.level = ordr.level );
{ "outer_table": "requests", "inner_table": "warehouses", "outer_alias": "ordr", "inner_alias": "whs", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_01036
train
T2
v1
Schema: requests (alias: ordr)(amount, salary, level, type) managers(date, salary, status, amount) Task: Select name from requests where code exists in managers for the same status. SQL:
SELECT name FROM requests AS ordr WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.status = ordr.status );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_01037
train
T2
v2
Schema: staff (alias: empl)(id, amount, value, level) products(type, status, code, level) Task: Find amount from staff where a matching record exists in products with the same level. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = empl.level );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "amount", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_01038
train
T2
v1
Schema: sales (alias: sale)(code, date, id, value) invoices(name, date, value, salary) Task: Retrieve name from sales whose code is found in invoices rows where type matches the outer record. SQL:
SELECT name FROM sales AS sale WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.type = sale.type );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "name", "filter_col": "code", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_01039
train
T1
v1
Schema: items (alias: lne)(id, name, date, type) employees(level, value, name, status) Task: Find value from items where id appears in employees entries with matching level. SQL:
SELECT value FROM items AS lne WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.level = lne.level );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_01040
train
T2
v1
Schema: requests (alias: ordr)(salary, type, level, name) categories(salary, status, type, name) Task: Retrieve id from requests whose code is found in categories rows where code matches the outer record. SQL:
SELECT id FROM requests AS ordr WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.code = ordr.code );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_01041
train
T2
v1
Schema: shipments (alias: shp)(value, type, salary, code) schedules(id, type, salary, name) Task: Find name from shipments where code appears in schedules entries with matching type. SQL:
SELECT name FROM shipments AS shp WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.type = shp.type );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "name", "filter_col": "code", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_01042
train
T2
v2
Schema: departments (alias: dept)(value, level, amount, status) services(status, code, date, name) Task: Retrieve code from departments that have at least one corresponding entry in services sharing the same code. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.code = dept.code );
{ "outer_table": "departments", "inner_table": "services", "outer_alias": "dept", "inner_alias": "srvc", "proj_col": "code", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_01043
train
T1
v2
Schema: regions (alias: rgn)(status, level, salary, code) managers(id, salary, name, amount) Task: Retrieve amount from regions that have at least one corresponding entry in managers sharing the same type. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = rgn.type );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "amount", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_01044
train
T2
v1
Schema: managers (alias: mgr)(type, name, salary, id) invoices(status, name, date, level) Task: Select name from managers where id exists in invoices for the same type. SQL:
SELECT name FROM managers AS mgr WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.type = mgr.type );
{ "outer_table": "managers", "inner_table": "invoices", "outer_alias": "mgr", "inner_alias": "inv", "proj_col": "name", "filter_col": "id", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_01045
train
T1
v1
Schema: invoices (alias: inv)(date, name, status, code) warehouses(code, value, level, name) Task: Select code from invoices where id exists in warehouses for the same id. SQL:
SELECT code FROM invoices AS inv WHERE id IN ( SELECT id FROM warehouses AS whs WHERE whs.id = inv.id );
{ "outer_table": "invoices", "inner_table": "warehouses", "outer_alias": "inv", "inner_alias": "whs", "proj_col": "code", "filter_col": "id", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_01046
train
T1
v1
Schema: services (alias: srvc)(amount, salary, code, status) staff(value, name, code, id) Task: Retrieve id from services whose level is found in staff rows where id matches the outer record. SQL:
SELECT id FROM services AS srvc WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.id = srvc.id );
{ "outer_table": "services", "inner_table": "staff", "outer_alias": "srvc", "inner_alias": "empl", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_01047
train
T2
v2
Schema: categories (alias: catg)(type, status, amount, name) transactions(code, value, type, salary) Task: Retrieve name from categories that have at least one corresponding entry in transactions sharing the same code. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = catg.code );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "name", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_01048
train
T2
v3
Schema: regions (alias: rgn)(value, date, level, status) products(value, date, code, id) Task: Find salary from regions where value exceeds the average value from products for the same type. SQL:
SELECT salary FROM regions AS rgn WHERE value > ( SELECT COUNT(value) FROM products AS prod WHERE prod.type = rgn.type );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_01049
train
T2
v1
Schema: requests (alias: ordr)(type, value, status, level) orders(type, code, id, status) Task: Retrieve value from requests whose code is found in orders rows where id matches the outer record. SQL:
SELECT value FROM requests AS ordr WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.id = ordr.id );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_01050
train
T2
v2
Schema: accounts (alias: acct)(name, amount, type, level) invoices(name, status, amount, date) Task: Retrieve id from accounts that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = acct.type );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "id", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_01051
train
T1
v3
Schema: orders (alias: ord)(code, value, type, date) employees(date, amount, id, type) Task: Find amount from orders where salary exceeds the average value from employees for the same type. SQL:
SELECT amount FROM orders AS ord WHERE salary > ( SELECT MAX(value) FROM employees AS emp WHERE emp.type = ord.type );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_01052
train
T1
v1
Schema: shipments (alias: shp)(type, amount, status, salary) budgets(type, code, status, amount) Task: Find id from shipments where status appears in budgets entries with matching status. SQL:
SELECT id FROM shipments AS shp WHERE status IN ( SELECT status FROM budgets AS budg WHERE budg.status = shp.status );
{ "outer_table": "shipments", "inner_table": "budgets", "outer_alias": "shp", "inner_alias": "budg", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_01053
train
T2
v1
Schema: shipments (alias: shp)(salary, code, id, status) warehouses(code, salary, type, id) Task: Find value from shipments where type appears in warehouses entries with matching type. SQL:
SELECT value FROM shipments AS shp WHERE type IN ( SELECT type FROM warehouses AS whs WHERE whs.type = shp.type );
{ "outer_table": "shipments", "inner_table": "warehouses", "outer_alias": "shp", "inner_alias": "whs", "proj_col": "value", "filter_col": "type", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_01054
train
T2
v2
Schema: categories (alias: catg)(date, salary, level, value) employees(id, code, amount, type) Task: Find id from categories where a matching record exists in employees with the same type. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = catg.type );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "id", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_01055
train
T2
v1
Schema: budgets (alias: budg)(value, code, amount, date) services(name, amount, type, level) Task: Find code from budgets where type appears in services entries with matching level. SQL:
SELECT code FROM budgets AS budg WHERE type IN ( SELECT type FROM services AS srvc WHERE srvc.level = budg.level );
{ "outer_table": "budgets", "inner_table": "services", "outer_alias": "budg", "inner_alias": "srvc", "proj_col": "code", "filter_col": "type", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_01056
train
T2
v1
Schema: schedules (alias: schd)(type, id, name, salary) regions(id, salary, level, type) Task: Retrieve code from schedules whose status is found in regions rows where status matches the outer record. SQL:
SELECT code FROM schedules AS schd WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.status = schd.status );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "code", "filter_col": "status", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_01057
train
T2
v1
Schema: employees (alias: emp)(amount, name, level, value) schedules(amount, name, value, type) Task: Select salary from employees where code exists in schedules for the same level. SQL:
SELECT salary FROM employees AS emp WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.level = emp.level );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "salary", "filter_col": "code", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_01058
train
T1
v3
Schema: employees (alias: emp)(status, type, salary, date) managers(level, type, code, value) Task: Retrieve amount from employees with value above the MAX(value) of managers rows sharing the same id. SQL:
SELECT amount FROM employees AS emp WHERE value > ( SELECT MAX(value) FROM managers AS mgr WHERE mgr.id = emp.id );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_01059
train
T1
v3
Schema: shipments (alias: shp)(id, salary, name, date) staff(status, level, value, name) Task: Retrieve id from shipments with amount above the MAX(value) of staff rows sharing the same level. SQL:
SELECT id FROM shipments AS shp WHERE amount > ( SELECT MAX(value) FROM staff AS empl WHERE empl.level = shp.level );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_01060
train
T2
v3
Schema: sales (alias: sale)(name, value, id, code) transactions(date, code, status, name) Task: Find value from sales where amount exceeds the average amount from transactions for the same type. SQL:
SELECT value FROM sales AS sale WHERE amount > ( SELECT AVG(amount) FROM transactions AS txn WHERE txn.type = sale.type );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_01061
train
T1
v2
Schema: warehouses (alias: whs)(salary, id, status, amount) employees(name, code, status, amount) Task: Retrieve name from warehouses that have at least one corresponding entry in employees sharing the same code. SQL:
SELECT name FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "employees", "outer_alias": "whs", "inner_alias": "emp", "proj_col": "name", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_01062
train
T2
v3
Schema: schedules (alias: schd)(amount, salary, code, name) orders(level, date, code, status) Task: Find salary from schedules where salary exceeds the average amount from orders for the same id. SQL:
SELECT salary FROM schedules AS schd WHERE salary > ( SELECT SUM(amount) FROM orders AS ord WHERE ord.id = schd.id );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_01063
train
T2
v3
Schema: warehouses (alias: whs)(date, code, level, salary) budgets(name, date, id, type) Task: Find code from warehouses where value exceeds the average salary from budgets for the same code. SQL:
SELECT code FROM warehouses AS whs WHERE value > ( SELECT COUNT(salary) FROM budgets AS budg WHERE budg.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "budgets", "outer_alias": "whs", "inner_alias": "budg", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_01064
train
T2
v3
Schema: transactions (alias: txn)(type, name, amount, value) warehouses(name, date, value, amount) Task: Find name from transactions where amount exceeds the average value from warehouses for the same level. SQL:
SELECT name FROM transactions AS txn WHERE amount > ( SELECT MIN(value) FROM warehouses AS whs WHERE whs.level = txn.level );
{ "outer_table": "transactions", "inner_table": "warehouses", "outer_alias": "txn", "inner_alias": "whs", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_01065
train
T1
v1
Schema: staff (alias: empl)(name, id, code, value) schedules(name, value, code, salary) Task: Select code from staff where level exists in schedules for the same level. SQL:
SELECT code FROM staff AS empl WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.level = empl.level );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "code", "filter_col": "level", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_01066
train
T2
v1
Schema: invoices (alias: inv)(id, value, amount, name) departments(salary, type, value, date) Task: Select code from invoices where level exists in departments for the same level. SQL:
SELECT code FROM invoices AS inv WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.level = inv.level );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "code", "filter_col": "level", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_01067
train
T1
v1
Schema: products (alias: prod)(amount, id, value, status) categories(level, value, amount, date) Task: Select code from products where level exists in categories for the same type. SQL:
SELECT code FROM products AS prod WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.type = prod.type );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_01068
train
T1
v1
Schema: requests (alias: ordr)(salary, level, code, value) products(salary, status, date, value) Task: Select name from requests where status exists in products for the same id. SQL:
SELECT name FROM requests AS ordr WHERE status IN ( SELECT status FROM products AS prod WHERE prod.id = ordr.id );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_01069
train
T2
v2
Schema: categories (alias: catg)(salary, id, date, type) employees(type, level, date, code) Task: Retrieve value from categories that have at least one corresponding entry in employees sharing the same type. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = catg.type );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "value", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_01070
train
T2
v2
Schema: requests (alias: ordr)(code, amount, salary, value) schedules(value, id, name, salary) Task: Retrieve name from requests that have at least one corresponding entry in schedules sharing the same status. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = ordr.status );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "name", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_01071
train
T2
v1
Schema: customers (alias: cust)(value, status, level, salary) managers(status, id, salary, type) Task: Find amount from customers where code appears in managers entries with matching type. SQL:
SELECT amount FROM customers AS cust WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.type = cust.type );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_01072
train
T1
v1
Schema: schedules (alias: schd)(id, salary, amount, level) employees(name, salary, value, type) Task: Select name from schedules where type exists in employees for the same id. SQL:
SELECT name FROM schedules AS schd WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.id = schd.id );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "name", "filter_col": "type", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_01073
train
T2
v1
Schema: departments (alias: dept)(amount, id, date, level) warehouses(amount, salary, name, value) Task: Find value from departments where type appears in warehouses entries with matching code. SQL:
SELECT value FROM departments AS dept WHERE type IN ( SELECT type FROM warehouses AS whs WHERE whs.code = dept.code );
{ "outer_table": "departments", "inner_table": "warehouses", "outer_alias": "dept", "inner_alias": "whs", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_01074
train
T1
v2
Schema: employees (alias: emp)(code, salary, type, amount) departments(id, type, value, code) Task: Find amount from employees where a matching record exists in departments with the same id. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = emp.id );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "amount", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_01075
train
T1
v3
Schema: invoices (alias: inv)(type, status, salary, level) products(value, type, amount, name) Task: Retrieve name from invoices with amount above the AVG(value) of products rows sharing the same type. SQL:
SELECT name FROM invoices AS inv WHERE amount > ( SELECT AVG(value) FROM products AS prod WHERE prod.type = inv.type );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_01076
train
T1
v3
Schema: services (alias: srvc)(status, date, salary, level) budgets(level, status, value, code) Task: Retrieve id from services with value above the COUNT(value) of budgets rows sharing the same type. SQL:
SELECT id FROM services AS srvc WHERE value > ( SELECT COUNT(value) FROM budgets AS budg WHERE budg.type = srvc.type );
{ "outer_table": "services", "inner_table": "budgets", "outer_alias": "srvc", "inner_alias": "budg", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_01077
train
T2
v3
Schema: budgets (alias: budg)(status, level, value, type) invoices(id, code, status, level) Task: Retrieve name from budgets with value above the MAX(salary) of invoices rows sharing the same id. SQL:
SELECT name FROM budgets AS budg WHERE value > ( SELECT MAX(salary) FROM invoices AS inv WHERE inv.id = budg.id );
{ "outer_table": "budgets", "inner_table": "invoices", "outer_alias": "budg", "inner_alias": "inv", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_01078
train
T2
v3
Schema: categories (alias: catg)(type, date, name, level) accounts(value, date, amount, level) Task: Find amount from categories where value exceeds the average amount from accounts for the same id. SQL:
SELECT amount FROM categories AS catg WHERE value > ( SELECT COUNT(amount) FROM accounts AS acct WHERE acct.id = catg.id );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_01079
train
T2
v1
Schema: managers (alias: mgr)(id, level, salary, name) schedules(level, name, type, salary) Task: Select code from managers where status exists in schedules for the same code. SQL:
SELECT code FROM managers AS mgr WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.code = mgr.code );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "code", "filter_col": "status", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_01080
train
T1
v3
Schema: regions (alias: rgn)(type, salary, date, status) customers(type, status, amount, level) Task: Retrieve id from regions with salary above the MIN(salary) of customers rows sharing the same code. SQL:
SELECT id FROM regions AS rgn WHERE salary > ( SELECT MIN(salary) 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": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_01081
train
T2
v3
Schema: regions (alias: rgn)(date, level, amount, name) staff(date, salary, value, code) Task: Retrieve value from regions with value above the MIN(amount) of staff rows sharing the same type. SQL:
SELECT value FROM regions AS rgn WHERE value > ( SELECT MIN(amount) FROM staff AS empl WHERE empl.type = rgn.type );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_01082
train
T2
v1
Schema: products (alias: prod)(salary, name, code, status) warehouses(id, salary, value, level) Task: Select value from products where type exists in warehouses for the same type. SQL:
SELECT value FROM products AS prod WHERE type IN ( SELECT type FROM warehouses AS whs WHERE whs.type = prod.type );
{ "outer_table": "products", "inner_table": "warehouses", "outer_alias": "prod", "inner_alias": "whs", "proj_col": "value", "filter_col": "type", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_01083
train
T1
v1
Schema: shipments (alias: shp)(date, status, salary, type) customers(name, salary, code, value) Task: Retrieve id from shipments whose type is found in customers rows where id matches the outer record. SQL:
SELECT id FROM shipments AS shp WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.id = shp.id );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_01084
train
T2
v3
Schema: regions (alias: rgn)(status, salary, name, type) customers(id, status, code, amount) Task: Retrieve amount from regions with amount above the AVG(salary) of customers rows sharing the same status. SQL:
SELECT amount FROM regions AS rgn WHERE amount > ( SELECT AVG(salary) FROM customers AS cust WHERE cust.status = rgn.status );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_01085
train
T2
v2
Schema: invoices (alias: inv)(status, type, code, level) accounts(code, value, date, name) Task: Find code from invoices where a matching record exists in accounts with the same id. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = inv.id );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "code", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_01086
train
T1
v2
Schema: staff (alias: empl)(date, id, code, salary) services(code, date, value, level) Task: Find name from staff where a matching record exists in services with the same id. SQL:
SELECT name FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = empl.id );
{ "outer_table": "staff", "inner_table": "services", "outer_alias": "empl", "inner_alias": "srvc", "proj_col": "name", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_01087
train
T2
v2
Schema: warehouses (alias: whs)(code, status, salary, date) regions(amount, code, value, id) Task: Find value from warehouses where a matching record exists in regions with the same level. SQL:
SELECT value FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "regions", "outer_alias": "whs", "inner_alias": "rgn", "proj_col": "value", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_01088
train
T2
v3
Schema: managers (alias: mgr)(name, status, id, level) categories(code, salary, status, value) Task: Retrieve salary from managers with amount above the AVG(salary) of categories rows sharing the same level. SQL:
SELECT salary FROM managers AS mgr WHERE amount > ( SELECT AVG(salary) FROM categories AS catg WHERE catg.level = mgr.level );
{ "outer_table": "managers", "inner_table": "categories", "outer_alias": "mgr", "inner_alias": "catg", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_01089
train
T1
v2
Schema: budgets (alias: budg)(amount, level, status, name) staff(level, status, code, value) Task: Find amount from budgets where a matching record exists in staff with the same level. SQL:
SELECT amount FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = budg.level );
{ "outer_table": "budgets", "inner_table": "staff", "outer_alias": "budg", "inner_alias": "empl", "proj_col": "amount", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_01090
train
T2
v3
Schema: orders (alias: ord)(value, name, salary, id) items(id, code, type, value) Task: Retrieve salary from orders with value above the MAX(amount) of items rows sharing the same id. SQL:
SELECT salary FROM orders AS ord WHERE value > ( SELECT MAX(amount) FROM items AS lne WHERE lne.id = ord.id );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_01091
train
T1
v3
Schema: requests (alias: ordr)(date, type, amount, name) services(name, type, level, status) Task: Find value from requests where value exceeds the average value from services for the same type. SQL:
SELECT value FROM requests AS ordr WHERE value > ( SELECT COUNT(value) FROM services AS srvc WHERE srvc.type = ordr.type );
{ "outer_table": "requests", "inner_table": "services", "outer_alias": "ordr", "inner_alias": "srvc", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_01092
train
T2
v2
Schema: employees (alias: emp)(value, code, type, name) sales(name, date, amount, salary) Task: Retrieve code from employees that have at least one corresponding entry in sales sharing the same id. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = emp.id );
{ "outer_table": "employees", "inner_table": "sales", "outer_alias": "emp", "inner_alias": "sale", "proj_col": "code", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_01093
train
T1
v2
Schema: warehouses (alias: whs)(date, code, id, name) categories(date, amount, id, type) Task: Retrieve salary from warehouses that have at least one corresponding entry in categories sharing the same id. SQL:
SELECT salary FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "categories", "outer_alias": "whs", "inner_alias": "catg", "proj_col": "salary", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_01094
train
T2
v3
Schema: schedules (alias: schd)(date, level, salary, value) shipments(amount, value, code, date) Task: Find code from schedules where salary exceeds the average value from shipments for the same level. SQL:
SELECT code FROM schedules AS schd WHERE salary > ( SELECT AVG(value) FROM shipments AS shp WHERE shp.level = schd.level );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_01095
train
T2
v3
Schema: warehouses (alias: whs)(status, salary, amount, date) departments(amount, name, salary, value) Task: Find value from warehouses where amount exceeds the average salary from departments for the same status. SQL:
SELECT value FROM warehouses AS whs WHERE amount > ( SELECT COUNT(salary) FROM departments AS dept WHERE dept.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "departments", "outer_alias": "whs", "inner_alias": "dept", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_01096
train
T2
v1
Schema: products (alias: prod)(id, amount, salary, value) regions(code, type, level, id) Task: Find amount from products where code appears in regions entries with matching type. SQL:
SELECT amount FROM products AS prod WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.type = prod.type );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_01097
train
T1
v2
Schema: items (alias: lne)(value, amount, status, type) departments(amount, type, code, name) Task: Retrieve value from items that have at least one corresponding entry in departments sharing the same status. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = lne.status );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "value", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_01098
train
T2
v3
Schema: schedules (alias: schd)(salary, value, code, amount) budgets(type, code, status, name) Task: Find value from schedules where salary exceeds the average value from budgets for the same type. SQL:
SELECT value FROM schedules AS schd WHERE salary > ( SELECT AVG(value) FROM budgets AS budg WHERE budg.type = schd.type );
{ "outer_table": "schedules", "inner_table": "budgets", "outer_alias": "schd", "inner_alias": "budg", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_01099
train
T2