variant
stringclasses
3 values
prompt
stringlengths
163
237
sql
stringlengths
103
143
metadata
unknown
id
stringlengths
21
21
split
stringclasses
1 value
token_group
stringclasses
2 values
v3
Schema: schedules (alias: schd)(amount, type, value, salary) customers(value, level, amount, salary) Task: Retrieve salary from schedules with amount above the SUM(value) of customers rows sharing the same level. SQL:
SELECT salary FROM schedules AS schd WHERE amount > ( SELECT SUM(value) FROM customers AS cust WHERE cust.level = schd.level );
{ "outer_table": "schedules", "inner_table": "customers", "outer_alias": "schd", "inner_alias": "cust", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_02000
train
T2
v3
Schema: transactions (alias: txn)(id, status, code, amount) managers(salary, code, id, date) Task: Find amount from transactions where salary exceeds the average amount from managers for the same type. SQL:
SELECT amount FROM transactions AS txn WHERE salary > ( SELECT MIN(amount) FROM managers AS mgr WHERE mgr.type = txn.type );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_02001
train
T1
v2
Schema: employees (alias: emp)(value, level, status, id) requests(status, value, salary, level) Task: Retrieve id from employees that have at least one corresponding entry in requests sharing the same type. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = emp.type );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "id", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_02002
train
T1
v2
Schema: sales (alias: sale)(level, date, salary, type) products(level, code, date, type) Task: Retrieve name from sales that have at least one corresponding entry in products sharing the same code. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = sale.code );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "name", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_02003
train
T1
v1
Schema: orders (alias: ord)(amount, salary, id, date) schedules(salary, level, type, amount) Task: Find value from orders where code appears in schedules entries with matching level. SQL:
SELECT value FROM orders AS ord WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.level = ord.level );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_02004
train
T1
v1
Schema: requests (alias: ordr)(date, salary, code, type) services(type, id, date, salary) Task: Retrieve salary from requests whose id is found in services rows where level matches the outer record. SQL:
SELECT salary FROM requests AS ordr WHERE id IN ( SELECT id FROM services AS srvc WHERE srvc.level = ordr.level );
{ "outer_table": "requests", "inner_table": "services", "outer_alias": "ordr", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "id", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_02005
train
T2
v2
Schema: customers (alias: cust)(code, salary, date, amount) services(value, code, id, date) Task: Find amount from customers where a matching record exists in services with the same status. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.status = cust.status );
{ "outer_table": "customers", "inner_table": "services", "outer_alias": "cust", "inner_alias": "srvc", "proj_col": "amount", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_02006
train
T1
v1
Schema: schedules (alias: schd)(id, level, amount, name) staff(value, id, code, status) Task: Find amount from schedules where status appears in staff entries with matching id. SQL:
SELECT amount FROM schedules AS schd WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.id = schd.id );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_02007
train
T2
v2
Schema: invoices (alias: inv)(name, amount, level, code) customers(amount, level, id, type) Task: Retrieve code from invoices that have at least one corresponding entry in customers sharing the same type. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = inv.type );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_02008
train
T1
v1
Schema: requests (alias: ordr)(status, amount, id, name) regions(salary, type, value, date) Task: Retrieve amount from requests whose level is found in regions rows where status matches the outer record. SQL:
SELECT amount FROM requests AS ordr WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.status = ordr.status );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_02009
train
T2
v1
Schema: services (alias: srvc)(level, name, date, amount) categories(amount, id, date, level) Task: Select code from services where code exists in categories for the same code. SQL:
SELECT code FROM services AS srvc WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.code = srvc.code );
{ "outer_table": "services", "inner_table": "categories", "outer_alias": "srvc", "inner_alias": "catg", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_02010
train
T2
v3
Schema: shipments (alias: shp)(amount, date, level, code) employees(name, code, date, status) Task: Find amount from shipments where amount exceeds the average value from employees for the same status. SQL:
SELECT amount FROM shipments AS shp WHERE amount > ( SELECT MAX(value) FROM employees AS emp WHERE emp.status = shp.status );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_02011
train
T2
v3
Schema: departments (alias: dept)(code, amount, salary, type) managers(name, id, amount, level) Task: Retrieve name from departments with salary above the MIN(amount) of managers rows sharing the same code. SQL:
SELECT name FROM departments AS dept WHERE salary > ( SELECT MIN(amount) FROM managers AS mgr WHERE mgr.code = dept.code );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_02012
train
T1
v1
Schema: budgets (alias: budg)(code, id, status, date) products(status, type, level, name) Task: Retrieve code from budgets whose code is found in products rows where level matches the outer record. SQL:
SELECT code FROM budgets AS budg WHERE code IN ( SELECT code FROM products AS prod WHERE prod.level = budg.level );
{ "outer_table": "budgets", "inner_table": "products", "outer_alias": "budg", "inner_alias": "prod", "proj_col": "code", "filter_col": "code", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_02013
train
T2
v2
Schema: services (alias: srvc)(date, amount, id, value) transactions(type, id, salary, status) Task: Find value from services where a matching record exists in transactions with the same status. SQL:
SELECT value FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = srvc.status );
{ "outer_table": "services", "inner_table": "transactions", "outer_alias": "srvc", "inner_alias": "txn", "proj_col": "value", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_02014
train
T2
v3
Schema: accounts (alias: acct)(date, value, id, name) customers(amount, status, date, salary) Task: Find amount from accounts where value exceeds the average salary from customers for the same type. SQL:
SELECT amount FROM accounts AS acct WHERE value > ( SELECT COUNT(salary) FROM customers AS cust WHERE cust.type = acct.type );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_02015
train
T1
v1
Schema: items (alias: lne)(level, name, salary, amount) requests(type, amount, status, value) Task: Find salary from items where level appears in requests entries with matching type. SQL:
SELECT salary FROM items AS lne WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.type = lne.type );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "level", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_02016
train
T2
v1
Schema: schedules (alias: schd)(level, salary, code, status) transactions(date, value, name, level) Task: Select amount from schedules where type exists in transactions for the same type. SQL:
SELECT amount FROM schedules AS schd WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.type = schd.type );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_02017
train
T2
v3
Schema: transactions (alias: txn)(amount, id, code, level) requests(type, amount, code, status) Task: Retrieve code from transactions with salary above the MIN(amount) of requests rows sharing the same id. SQL:
SELECT code FROM transactions AS txn WHERE salary > ( SELECT MIN(amount) FROM requests AS ordr WHERE ordr.id = txn.id );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_02018
train
T1
v2
Schema: schedules (alias: schd)(code, level, name, type) invoices(amount, type, value, level) Task: Retrieve id from schedules that have at least one corresponding entry in invoices sharing the same code. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = schd.code );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "id", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_02019
train
T2
v3
Schema: accounts (alias: acct)(code, id, salary, type) orders(name, level, date, code) Task: Find salary from accounts where value exceeds the average salary from orders for the same level. SQL:
SELECT salary FROM accounts AS acct WHERE value > ( SELECT COUNT(salary) FROM orders AS ord WHERE ord.level = acct.level );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_02020
train
T1
v1
Schema: products (alias: prod)(status, name, amount, date) schedules(date, type, id, level) Task: Select id from products where id exists in schedules for the same type. SQL:
SELECT id FROM products AS prod WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.type = prod.type );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_02021
train
T1
v3
Schema: orders (alias: ord)(amount, salary, id, value) services(type, name, salary, code) Task: Retrieve salary from orders with amount above the AVG(value) of services rows sharing the same type. SQL:
SELECT salary FROM orders AS ord WHERE amount > ( SELECT AVG(value) FROM services AS srvc WHERE srvc.type = ord.type );
{ "outer_table": "orders", "inner_table": "services", "outer_alias": "ord", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_02022
train
T1
v2
Schema: products (alias: prod)(type, date, value, amount) orders(level, status, id, date) Task: Retrieve value from products that have at least one corresponding entry in orders sharing the same status. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = prod.status );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "value", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_02023
train
T1
v3
Schema: categories (alias: catg)(date, id, status, code) schedules(level, date, type, code) Task: Find amount from categories where amount exceeds the average salary from schedules for the same type. SQL:
SELECT amount FROM categories AS catg WHERE amount > ( SELECT SUM(salary) FROM schedules AS schd WHERE schd.type = catg.type );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_02024
train
T2
v2
Schema: employees (alias: emp)(value, status, type, salary) schedules(value, id, level, type) Task: Retrieve name from employees that have at least one corresponding entry in schedules sharing the same id. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = emp.id );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "name", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_02025
train
T1
v2
Schema: employees (alias: emp)(code, name, type, date) invoices(salary, id, code, status) Task: Find name from employees where a matching record exists in invoices with the same id. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = emp.id );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "name", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_02026
train
T1
v1
Schema: customers (alias: cust)(value, level, salary, id) categories(value, salary, status, code) Task: Select amount from customers where status exists in categories for the same status. SQL:
SELECT amount FROM customers AS cust WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.status = cust.status );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_02027
train
T1
v1
Schema: warehouses (alias: whs)(date, type, salary, status) schedules(type, status, name, amount) Task: Find name from warehouses where id appears in schedules entries with matching type. SQL:
SELECT name FROM warehouses AS whs WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "schedules", "outer_alias": "whs", "inner_alias": "schd", "proj_col": "name", "filter_col": "id", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_02028
train
T2
v1
Schema: shipments (alias: shp)(name, level, value, id) transactions(salary, id, amount, value) Task: Retrieve amount from shipments whose code is found in transactions rows where status matches the outer record. SQL:
SELECT amount FROM shipments AS shp WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.status = shp.status );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_02029
train
T2
v1
Schema: customers (alias: cust)(date, name, id, amount) accounts(amount, level, status, name) Task: Select code from customers where type exists in accounts for the same status. SQL:
SELECT code FROM customers AS cust WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.status = cust.status );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_02030
train
T1
v2
Schema: invoices (alias: inv)(value, date, amount, type) orders(id, type, status, level) Task: Retrieve amount from invoices that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = inv.code );
{ "outer_table": "invoices", "inner_table": "orders", "outer_alias": "inv", "inner_alias": "ord", "proj_col": "amount", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_02031
train
T1
v3
Schema: accounts (alias: acct)(date, salary, type, amount) managers(code, type, value, date) Task: Retrieve code from accounts with value above the COUNT(salary) of managers rows sharing the same code. SQL:
SELECT code FROM accounts AS acct WHERE value > ( SELECT COUNT(salary) FROM managers AS mgr WHERE mgr.code = acct.code );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_02032
train
T1
v1
Schema: regions (alias: rgn)(date, id, type, salary) services(id, status, name, date) Task: Retrieve code from regions whose code is found in services rows where id matches the outer record. SQL:
SELECT code FROM regions AS rgn WHERE code IN ( SELECT code FROM services AS srvc WHERE srvc.id = rgn.id );
{ "outer_table": "regions", "inner_table": "services", "outer_alias": "rgn", "inner_alias": "srvc", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_02033
train
T2
v3
Schema: shipments (alias: shp)(type, salary, value, amount) products(name, date, type, salary) Task: Retrieve id from shipments with amount above the COUNT(salary) of products rows sharing the same code. SQL:
SELECT id FROM shipments AS shp WHERE amount > ( SELECT COUNT(salary) FROM products AS prod WHERE prod.code = shp.code );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_02034
train
T2
v2
Schema: requests (alias: ordr)(level, code, id, status) accounts(type, salary, amount, status) Task: Retrieve code from requests that have at least one corresponding entry in accounts sharing the same status. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = ordr.status );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "code", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_02035
train
T2
v1
Schema: transactions (alias: txn)(amount, salary, code, status) services(code, status, name, value) Task: Select id from transactions where status exists in services for the same code. SQL:
SELECT id FROM transactions AS txn WHERE status IN ( SELECT status FROM services AS srvc WHERE srvc.code = txn.code );
{ "outer_table": "transactions", "inner_table": "services", "outer_alias": "txn", "inner_alias": "srvc", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_02036
train
T1
v2
Schema: products (alias: prod)(name, type, id, value) schedules(status, salary, level, name) Task: Find salary from products where a matching record exists in schedules with the same status. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = prod.status );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "salary", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_02037
train
T1
v3
Schema: sales (alias: sale)(salary, type, level, amount) schedules(salary, code, type, status) Task: Find value from sales where salary exceeds the average salary from schedules for the same type. SQL:
SELECT value FROM sales AS sale WHERE salary > ( SELECT MIN(salary) FROM schedules AS schd WHERE schd.type = sale.type );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_02038
train
T1
v3
Schema: managers (alias: mgr)(name, date, amount, status) transactions(type, level, salary, status) Task: Find id from managers where amount exceeds the average salary from transactions for the same status. SQL:
SELECT id FROM managers AS mgr WHERE amount > ( SELECT MIN(salary) FROM transactions AS txn WHERE txn.status = mgr.status );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_02039
train
T1
v3
Schema: orders (alias: ord)(status, level, id, amount) warehouses(date, salary, value, status) Task: Find salary from orders where salary exceeds the average salary from warehouses for the same level. SQL:
SELECT salary FROM orders AS ord WHERE salary > ( SELECT AVG(salary) FROM warehouses AS whs WHERE whs.level = ord.level );
{ "outer_table": "orders", "inner_table": "warehouses", "outer_alias": "ord", "inner_alias": "whs", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_02040
train
T1
v3
Schema: accounts (alias: acct)(salary, status, code, level) sales(id, salary, name, date) Task: Find code from accounts where amount exceeds the average value from sales for the same id. SQL:
SELECT code FROM accounts AS acct WHERE amount > ( SELECT AVG(value) FROM sales AS sale WHERE sale.id = acct.id );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_02041
train
T1
v2
Schema: products (alias: prod)(level, date, amount, value) departments(salary, value, date, status) Task: Find code from products where a matching record exists in departments with the same code. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = prod.code );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "code", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_02042
train
T1
v3
Schema: requests (alias: ordr)(level, code, amount, value) customers(status, date, level, amount) Task: Find code from requests where value exceeds the average value from customers for the same id. SQL:
SELECT code FROM requests AS ordr WHERE value > ( SELECT MAX(value) FROM customers AS cust WHERE cust.id = ordr.id );
{ "outer_table": "requests", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_02043
train
T2
v2
Schema: customers (alias: cust)(code, date, name, value) products(date, salary, level, type) Task: Retrieve value from customers that have at least one corresponding entry in products sharing the same status. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = cust.status );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "value", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_02044
train
T1
v1
Schema: categories (alias: catg)(amount, code, salary, status) services(status, code, type, amount) Task: Find id from categories where level appears in services entries with matching status. SQL:
SELECT id FROM categories AS catg WHERE level IN ( SELECT level FROM services AS srvc WHERE srvc.status = catg.status );
{ "outer_table": "categories", "inner_table": "services", "outer_alias": "catg", "inner_alias": "srvc", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_02045
train
T2
v3
Schema: schedules (alias: schd)(value, type, date, id) services(salary, type, status, amount) Task: Find id from schedules where amount exceeds the average salary from services for the same id. SQL:
SELECT id FROM schedules AS schd WHERE amount > ( SELECT MAX(salary) FROM services AS srvc WHERE srvc.id = schd.id );
{ "outer_table": "schedules", "inner_table": "services", "outer_alias": "schd", "inner_alias": "srvc", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_02046
train
T2
v3
Schema: shipments (alias: shp)(name, type, status, amount) departments(level, type, name, status) Task: Find amount from shipments where value exceeds the average amount from departments for the same type. SQL:
SELECT amount FROM shipments AS shp WHERE value > ( SELECT SUM(amount) FROM departments AS dept WHERE dept.type = shp.type );
{ "outer_table": "shipments", "inner_table": "departments", "outer_alias": "shp", "inner_alias": "dept", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_02047
train
T2
v2
Schema: invoices (alias: inv)(value, amount, level, code) products(id, amount, salary, code) Task: Find salary from invoices where a matching record exists in products with the same type. SQL:
SELECT salary FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = inv.type );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "salary", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_02048
train
T1
v3
Schema: regions (alias: rgn)(code, salary, id, name) warehouses(id, code, type, name) Task: Find salary from regions where amount exceeds the average value from warehouses for the same code. SQL:
SELECT salary FROM regions AS rgn WHERE amount > ( SELECT SUM(value) FROM warehouses AS whs WHERE whs.code = rgn.code );
{ "outer_table": "regions", "inner_table": "warehouses", "outer_alias": "rgn", "inner_alias": "whs", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_02049
train
T2
v2
Schema: departments (alias: dept)(value, name, date, salary) employees(name, amount, status, salary) Task: Find id from departments where a matching record exists in employees with the same status. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = dept.status );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "id", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_02050
train
T1
v3
Schema: items (alias: lne)(type, code, level, status) accounts(date, amount, level, type) Task: Find salary from items where salary exceeds the average value from accounts for the same code. SQL:
SELECT salary FROM items AS lne WHERE salary > ( SELECT SUM(value) FROM accounts AS acct WHERE acct.code = lne.code );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_02051
train
T2
v3
Schema: orders (alias: ord)(code, type, salary, amount) departments(salary, name, value, date) Task: Retrieve value from orders with amount above the AVG(value) of departments rows sharing the same id. SQL:
SELECT value FROM orders AS ord WHERE amount > ( SELECT AVG(value) FROM departments AS dept WHERE dept.id = ord.id );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_02052
train
T1
v2
Schema: customers (alias: cust)(name, salary, type, date) transactions(amount, type, salary, code) Task: Find id from customers where a matching record exists in transactions with the same status. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = cust.status );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "id", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_02053
train
T1
v3
Schema: customers (alias: cust)(id, status, type, name) regions(type, id, level, name) Task: Retrieve salary from customers with salary above the AVG(value) of regions rows sharing the same code. SQL:
SELECT salary FROM customers AS cust WHERE salary > ( SELECT AVG(value) FROM regions AS rgn WHERE rgn.code = cust.code );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_02054
train
T1
v3
Schema: products (alias: prod)(level, id, salary, amount) accounts(level, name, amount, code) Task: Retrieve name from products with salary above the AVG(salary) of accounts rows sharing the same status. SQL:
SELECT name FROM products AS prod WHERE salary > ( SELECT AVG(salary) FROM accounts AS acct WHERE acct.status = prod.status );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_02055
train
T1
v2
Schema: requests (alias: ordr)(amount, level, date, status) services(value, type, code, status) Task: Retrieve value from requests that have at least one corresponding entry in services sharing the same status. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.status = ordr.status );
{ "outer_table": "requests", "inner_table": "services", "outer_alias": "ordr", "inner_alias": "srvc", "proj_col": "value", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_02056
train
T2
v3
Schema: categories (alias: catg)(value, type, name, salary) warehouses(type, level, salary, name) Task: Retrieve code from categories with salary above the MIN(salary) of warehouses rows sharing the same type. SQL:
SELECT code FROM categories AS catg WHERE salary > ( SELECT MIN(salary) FROM warehouses AS whs WHERE whs.type = catg.type );
{ "outer_table": "categories", "inner_table": "warehouses", "outer_alias": "catg", "inner_alias": "whs", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_02057
train
T2
v1
Schema: accounts (alias: acct)(value, name, amount, type) orders(value, amount, name, status) Task: Select id from accounts where code exists in orders for the same code. SQL:
SELECT id FROM accounts AS acct WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.code = acct.code );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_02058
train
T1
v2
Schema: categories (alias: catg)(date, level, status, name) orders(id, amount, code, value) Task: Retrieve value from categories that have at least one corresponding entry in orders sharing the same type. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = catg.type );
{ "outer_table": "categories", "inner_table": "orders", "outer_alias": "catg", "inner_alias": "ord", "proj_col": "value", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_02059
train
T2
v3
Schema: staff (alias: empl)(id, code, status, value) requests(type, level, name, salary) Task: Find code from staff where amount exceeds the average salary from requests for the same status. SQL:
SELECT code FROM staff AS empl WHERE amount > ( SELECT COUNT(salary) FROM requests AS ordr WHERE ordr.status = empl.status );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_02060
train
T2
v3
Schema: shipments (alias: shp)(date, status, type, id) staff(salary, id, level, name) Task: Retrieve amount from shipments with amount above the COUNT(salary) of staff rows sharing the same code. SQL:
SELECT amount FROM shipments AS shp WHERE amount > ( SELECT COUNT(salary) FROM staff AS empl WHERE empl.code = shp.code );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_02061
train
T2
v2
Schema: employees (alias: emp)(amount, code, value, level) requests(date, id, amount, status) Task: Find value from employees where a matching record exists in requests with the same code. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = emp.code );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "value", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_02062
train
T1
v2
Schema: staff (alias: empl)(level, id, code, name) departments(code, status, salary, id) Task: Retrieve amount from staff that have at least one corresponding entry in departments sharing the same level. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = empl.level );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "amount", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_02063
train
T2
v3
Schema: customers (alias: cust)(amount, code, status, level) transactions(date, id, type, amount) Task: Retrieve code from customers with value above the MAX(value) of transactions rows sharing the same id. SQL:
SELECT code FROM customers AS cust WHERE value > ( SELECT MAX(value) FROM transactions AS txn WHERE txn.id = cust.id );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_02064
train
T1
v1
Schema: items (alias: lne)(id, amount, level, date) transactions(date, salary, code, name) Task: Retrieve id from items whose id is found in transactions rows where type matches the outer record. SQL:
SELECT id FROM items AS lne WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.type = lne.type );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_02065
train
T2
v3
Schema: managers (alias: mgr)(value, name, code, date) shipments(level, salary, name, id) Task: Find salary from managers where value exceeds the average salary from shipments for the same status. SQL:
SELECT salary FROM managers AS mgr WHERE value > ( SELECT SUM(salary) FROM shipments AS shp WHERE shp.status = mgr.status );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_02066
train
T1
v1
Schema: employees (alias: emp)(salary, name, type, value) categories(code, date, amount, status) Task: Retrieve name from employees whose code is found in categories rows where status matches the outer record. SQL:
SELECT name FROM employees AS emp WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.status = emp.status );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_02067
train
T1
v2
Schema: requests (alias: ordr)(salary, level, value, amount) products(status, level, amount, value) Task: Retrieve id from requests that have at least one corresponding entry in products sharing the same id. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = ordr.id );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "id", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_02068
train
T2
v2
Schema: staff (alias: empl)(type, amount, name, level) managers(status, name, date, value) Task: Retrieve salary from staff that have at least one corresponding entry in managers sharing the same status. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = empl.status );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "salary", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_02069
train
T2
v3
Schema: warehouses (alias: whs)(date, status, value, salary) shipments(status, name, code, type) Task: Find id from warehouses where value exceeds the average salary from shipments for the same status. SQL:
SELECT id FROM warehouses AS whs WHERE value > ( SELECT COUNT(salary) FROM shipments AS shp WHERE shp.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "shipments", "outer_alias": "whs", "inner_alias": "shp", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_02070
train
T2
v1
Schema: managers (alias: mgr)(id, name, salary, amount) employees(id, value, status, type) Task: Retrieve name from managers whose id is found in employees rows where code matches the outer record. SQL:
SELECT name FROM managers AS mgr WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.code = mgr.code );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_02071
train
T1
v1
Schema: staff (alias: empl)(date, code, type, status) categories(salary, type, level, date) Task: Select salary from staff where code exists in categories for the same type. SQL:
SELECT salary FROM staff AS empl WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.type = empl.type );
{ "outer_table": "staff", "inner_table": "categories", "outer_alias": "empl", "inner_alias": "catg", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_02072
train
T2
v2
Schema: schedules (alias: schd)(level, amount, salary, date) sales(type, id, level, date) Task: Find id from schedules where a matching record exists in sales with the same level. SQL:
SELECT id 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": "id", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_02073
train
T2
v1
Schema: budgets (alias: budg)(value, type, status, date) transactions(amount, salary, type, value) Task: Select salary from budgets where status exists in transactions for the same code. SQL:
SELECT salary FROM budgets AS budg WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.code = budg.code );
{ "outer_table": "budgets", "inner_table": "transactions", "outer_alias": "budg", "inner_alias": "txn", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_02074
train
T2
v3
Schema: accounts (alias: acct)(amount, type, code, salary) invoices(salary, amount, type, date) Task: Find code from accounts where amount exceeds the average salary from invoices for the same id. SQL:
SELECT code FROM accounts AS acct WHERE amount > ( SELECT MIN(salary) FROM invoices AS inv WHERE inv.id = acct.id );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_02075
train
T1
v2
Schema: services (alias: srvc)(salary, date, amount, id) categories(status, name, value, date) Task: Retrieve amount from services that have at least one corresponding entry in categories sharing the same type. SQL:
SELECT amount FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = srvc.type );
{ "outer_table": "services", "inner_table": "categories", "outer_alias": "srvc", "inner_alias": "catg", "proj_col": "amount", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_02076
train
T2
v2
Schema: employees (alias: emp)(code, date, amount, type) warehouses(date, value, level, status) Task: Find id from employees where a matching record exists in warehouses with the same id. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.id = emp.id );
{ "outer_table": "employees", "inner_table": "warehouses", "outer_alias": "emp", "inner_alias": "whs", "proj_col": "id", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_02077
train
T1
v3
Schema: budgets (alias: budg)(level, date, status, salary) regions(amount, name, type, value) Task: Retrieve code from budgets with value above the MAX(value) of regions rows sharing the same level. SQL:
SELECT code FROM budgets AS budg WHERE value > ( SELECT MAX(value) FROM regions AS rgn WHERE rgn.level = budg.level );
{ "outer_table": "budgets", "inner_table": "regions", "outer_alias": "budg", "inner_alias": "rgn", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_02078
train
T2
v2
Schema: products (alias: prod)(amount, id, type, status) items(status, code, amount, id) Task: Retrieve value from products that have at least one corresponding entry in items sharing the same type. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = prod.type );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "value", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_02079
train
T1
v3
Schema: requests (alias: ordr)(status, type, level, salary) departments(amount, salary, type, value) Task: Find amount from requests where salary exceeds the average amount from departments for the same code. SQL:
SELECT amount FROM requests AS ordr WHERE salary > ( SELECT MAX(amount) FROM departments AS dept WHERE dept.code = ordr.code );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_02080
train
T2
v2
Schema: accounts (alias: acct)(date, amount, value, salary) regions(type, name, status, salary) Task: Retrieve amount from accounts that have at least one corresponding entry in regions sharing the same code. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = acct.code );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "amount", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_02081
train
T1
v1
Schema: schedules (alias: schd)(type, value, amount, salary) shipments(status, amount, type, name) Task: Retrieve value from schedules whose level is found in shipments rows where code matches the outer record. SQL:
SELECT value FROM schedules AS schd WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.code = schd.code );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_02082
train
T2
v3
Schema: staff (alias: empl)(level, value, code, type) transactions(date, amount, type, id) Task: Find code from staff where salary exceeds the average amount from transactions for the same level. SQL:
SELECT code FROM staff AS empl WHERE salary > ( SELECT MAX(amount) FROM transactions AS txn WHERE txn.level = empl.level );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_02083
train
T2
v2
Schema: staff (alias: empl)(status, level, salary, amount) departments(code, value, amount, status) Task: Retrieve salary from staff that have at least one corresponding entry in departments sharing the same code. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = empl.code );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "salary", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_02084
train
T2
v3
Schema: categories (alias: catg)(salary, code, type, name) staff(date, salary, code, type) Task: Find id from categories where salary exceeds the average salary from staff for the same code. SQL:
SELECT id FROM categories AS catg WHERE salary > ( SELECT AVG(salary) FROM staff AS empl WHERE empl.code = catg.code );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_02085
train
T2
v2
Schema: managers (alias: mgr)(date, amount, salary, type) warehouses(amount, salary, code, status) Task: Retrieve name from managers that have at least one corresponding entry in warehouses sharing the same id. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.id = mgr.id );
{ "outer_table": "managers", "inner_table": "warehouses", "outer_alias": "mgr", "inner_alias": "whs", "proj_col": "name", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_02086
train
T1
v3
Schema: orders (alias: ord)(type, level, id, salary) regions(name, code, date, type) Task: Retrieve id from orders with value above the SUM(amount) of regions rows sharing the same status. SQL:
SELECT id FROM orders AS ord WHERE value > ( SELECT SUM(amount) FROM regions AS rgn WHERE rgn.status = ord.status );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_02087
train
T1
v1
Schema: customers (alias: cust)(level, id, date, value) categories(name, id, date, type) Task: Select amount from customers where type exists in categories for the same id. SQL:
SELECT amount FROM customers AS cust WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.id = cust.id );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_02088
train
T1
v2
Schema: employees (alias: emp)(type, level, code, value) accounts(value, status, id, amount) Task: Find name from employees where a matching record exists in accounts with the same code. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = emp.code );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "name", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_02089
train
T1
v2
Schema: requests (alias: ordr)(status, value, amount, level) staff(status, type, id, salary) Task: Retrieve value from requests that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = ordr.status );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "value", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_02090
train
T2
v1
Schema: transactions (alias: txn)(code, level, status, value) services(status, level, name, date) Task: Select name from transactions where id exists in services for the same level. SQL:
SELECT name FROM transactions AS txn WHERE id IN ( SELECT id FROM services AS srvc WHERE srvc.level = txn.level );
{ "outer_table": "transactions", "inner_table": "services", "outer_alias": "txn", "inner_alias": "srvc", "proj_col": "name", "filter_col": "id", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_02091
train
T1
v2
Schema: products (alias: prod)(value, level, code, amount) requests(salary, id, name, amount) Task: Find code from products where a matching record exists in requests with the same code. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = prod.code );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "code", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_02092
train
T1
v1
Schema: requests (alias: ordr)(name, date, level, id) managers(code, date, value, id) Task: Retrieve amount from requests whose status is found in managers rows where status matches the outer record. SQL:
SELECT amount FROM requests AS ordr WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.status = ordr.status );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_02093
train
T2
v2
Schema: invoices (alias: inv)(level, id, type, date) requests(name, level, value, amount) Task: Find id from invoices where a matching record exists in requests with the same id. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = inv.id );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "id", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_02094
train
T1
v3
Schema: invoices (alias: inv)(type, name, id, value) employees(date, amount, salary, code) Task: Retrieve value from invoices with amount above the MAX(salary) of employees rows sharing the same status. SQL:
SELECT value FROM invoices AS inv WHERE amount > ( SELECT MAX(salary) FROM employees AS emp WHERE emp.status = inv.status );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_02095
train
T1
v2
Schema: employees (alias: emp)(id, level, date, code) shipments(name, id, salary, level) Task: Retrieve id from employees that have at least one corresponding entry in shipments sharing the same level. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = emp.level );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "id", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_02096
train
T1
v2
Schema: regions (alias: rgn)(id, value, name, salary) products(code, level, id, date) Task: Retrieve salary from regions that have at least one corresponding entry in products sharing the same code. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = rgn.code );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "salary", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_02097
train
T2
v1
Schema: accounts (alias: acct)(date, value, id, status) warehouses(id, level, amount, name) Task: Find name from accounts where status appears in warehouses entries with matching level. SQL:
SELECT name FROM accounts AS acct WHERE status IN ( SELECT status FROM warehouses AS whs WHERE whs.level = acct.level );
{ "outer_table": "accounts", "inner_table": "warehouses", "outer_alias": "acct", "inner_alias": "whs", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_02098
train
T1
v3
Schema: warehouses (alias: whs)(code, date, level, type) orders(code, id, amount, type) Task: Find amount from warehouses where salary exceeds the average amount from orders for the same id. SQL:
SELECT amount FROM warehouses AS whs WHERE salary > ( SELECT COUNT(amount) FROM orders AS ord WHERE ord.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "orders", "outer_alias": "whs", "inner_alias": "ord", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_02099
train
T2