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: categories (alias: catg)(date, id, level, type) staff(id, value, code, amount) Task: Find amount from categories where code appears in staff entries with matching status. SQL:
SELECT amount FROM categories AS catg WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.status = catg.status );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_03000
train
T2
v2
Schema: regions (alias: rgn)(salary, name, code, level) categories(value, code, amount, type) Task: Retrieve value from regions that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT value FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = rgn.code );
{ "outer_table": "regions", "inner_table": "categories", "outer_alias": "rgn", "inner_alias": "catg", "proj_col": "value", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_03001
train
T2
v2
Schema: managers (alias: mgr)(salary, name, status, amount) warehouses(level, status, salary, value) Task: Retrieve id from managers that have at least one corresponding entry in warehouses sharing the same type. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.type = mgr.type );
{ "outer_table": "managers", "inner_table": "warehouses", "outer_alias": "mgr", "inner_alias": "whs", "proj_col": "id", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_03002
train
T1
v3
Schema: staff (alias: empl)(value, salary, amount, type) warehouses(name, salary, id, type) Task: Find name from staff where value exceeds the average amount from warehouses for the same code. SQL:
SELECT name FROM staff AS empl WHERE value > ( SELECT COUNT(amount) FROM warehouses AS whs WHERE whs.code = empl.code );
{ "outer_table": "staff", "inner_table": "warehouses", "outer_alias": "empl", "inner_alias": "whs", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_03003
train
T2
v2
Schema: regions (alias: rgn)(code, date, amount, type) employees(name, id, date, level) Task: Find name from regions where a matching record exists in employees with the same status. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = rgn.status );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "name", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_03004
train
T2
v2
Schema: regions (alias: rgn)(id, salary, status, amount) staff(id, status, value, name) Task: Find code from regions where a matching record exists in staff with the same id. SQL:
SELECT code FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = rgn.id );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "code", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_03005
train
T2
v3
Schema: employees (alias: emp)(type, id, status, level) customers(status, date, name, level) Task: Find code from employees where value exceeds the average salary from customers for the same code. SQL:
SELECT code FROM employees AS emp WHERE value > ( SELECT AVG(salary) FROM customers AS cust WHERE cust.code = emp.code );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_03006
train
T1
v1
Schema: warehouses (alias: whs)(id, code, name, date) staff(salary, id, level, type) Task: Retrieve name from warehouses whose level is found in staff rows where code matches the outer record. SQL:
SELECT name FROM warehouses AS whs WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "staff", "outer_alias": "whs", "inner_alias": "empl", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_03007
train
T2
v1
Schema: services (alias: srvc)(date, status, value, code) managers(name, level, code, date) Task: Select name from services where code exists in managers for the same code. SQL:
SELECT name FROM services AS srvc WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.code = srvc.code );
{ "outer_table": "services", "inner_table": "managers", "outer_alias": "srvc", "inner_alias": "mgr", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_03008
train
T2
v2
Schema: managers (alias: mgr)(value, type, amount, name) accounts(type, status, id, name) Task: Retrieve id from managers that have at least one corresponding entry in accounts sharing the same level. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = mgr.level );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "id", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_03009
train
T1
v3
Schema: shipments (alias: shp)(salary, date, status, name) managers(type, status, id, salary) Task: Find amount from shipments where amount exceeds the average salary from managers for the same status. SQL:
SELECT amount FROM shipments AS shp WHERE amount > ( SELECT COUNT(salary) FROM managers AS mgr WHERE mgr.status = shp.status );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_03010
train
T2
v2
Schema: warehouses (alias: whs)(status, salary, code, amount) budgets(name, amount, date, type) Task: Retrieve name from warehouses that have at least one corresponding entry in budgets sharing the same code. SQL:
SELECT name FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "budgets", "outer_alias": "whs", "inner_alias": "budg", "proj_col": "name", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_03011
train
T2
v3
Schema: invoices (alias: inv)(id, salary, status, type) items(amount, salary, code, date) Task: Retrieve name from invoices with amount above the MAX(salary) of items rows sharing the same type. SQL:
SELECT name FROM invoices AS inv WHERE amount > ( SELECT MAX(salary) FROM items AS lne WHERE lne.type = inv.type );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_03012
train
T1
v1
Schema: warehouses (alias: whs)(salary, type, status, value) accounts(code, id, name, amount) Task: Select amount from warehouses where status exists in accounts for the same status. SQL:
SELECT amount FROM warehouses AS whs WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "accounts", "outer_alias": "whs", "inner_alias": "acct", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_03013
train
T2
v2
Schema: products (alias: prod)(id, amount, salary, code) accounts(amount, date, value, id) Task: Retrieve salary from products that have at least one corresponding entry in accounts sharing the same status. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = prod.status );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "salary", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_03014
train
T1
v1
Schema: employees (alias: emp)(status, type, date, salary) accounts(level, id, code, salary) Task: Retrieve name from employees whose level is found in accounts rows where type matches the outer record. SQL:
SELECT name FROM employees AS emp WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.type = emp.type );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_03015
train
T1
v3
Schema: managers (alias: mgr)(level, value, salary, name) departments(status, salary, id, code) Task: Find code from managers where value exceeds the average value from departments for the same level. SQL:
SELECT code FROM managers AS mgr WHERE value > ( SELECT COUNT(value) FROM departments AS dept WHERE dept.level = mgr.level );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_03016
train
T1
v3
Schema: requests (alias: ordr)(level, amount, status, code) orders(value, date, code, type) Task: Find code from requests where salary exceeds the average salary from orders for the same id. SQL:
SELECT code FROM requests AS ordr WHERE salary > ( SELECT MIN(salary) FROM orders AS ord WHERE ord.id = ordr.id );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_03017
train
T2
v3
Schema: sales (alias: sale)(amount, value, id, level) regions(type, value, status, id) Task: Retrieve id from sales with amount above the COUNT(value) of regions rows sharing the same type. SQL:
SELECT id FROM sales AS sale WHERE amount > ( SELECT COUNT(value) FROM regions AS rgn WHERE rgn.type = sale.type );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_03018
train
T1
v1
Schema: items (alias: lne)(status, amount, date, code) schedules(status, name, id, level) Task: Retrieve amount from items whose status is found in schedules rows where status matches the outer record. SQL:
SELECT amount FROM items AS lne WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.status = lne.status );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_03019
train
T2
v3
Schema: transactions (alias: txn)(date, level, value, salary) departments(salary, status, type, id) Task: Find code from transactions where salary exceeds the average salary from departments for the same id. SQL:
SELECT code FROM transactions AS txn WHERE salary > ( SELECT COUNT(salary) FROM departments AS dept WHERE dept.id = txn.id );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_03020
train
T1
v1
Schema: transactions (alias: txn)(type, id, salary, amount) categories(id, level, date, code) Task: Select code from transactions where type exists in categories for the same code. SQL:
SELECT code FROM transactions AS txn WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.code = txn.code );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_03021
train
T1
v3
Schema: categories (alias: catg)(code, amount, name, type) products(code, level, status, amount) Task: Find value from categories where value exceeds the average value from products for the same id. SQL:
SELECT value FROM categories AS catg WHERE value > ( SELECT COUNT(value) FROM products AS prod WHERE prod.id = catg.id );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_03022
train
T2
v1
Schema: budgets (alias: budg)(code, type, status, value) requests(code, type, id, level) Task: Retrieve code from budgets whose status is found in requests rows where level matches the outer record. SQL:
SELECT code FROM budgets AS budg WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.level = budg.level );
{ "outer_table": "budgets", "inner_table": "requests", "outer_alias": "budg", "inner_alias": "ordr", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_03023
train
T2
v2
Schema: managers (alias: mgr)(type, date, code, status) transactions(value, level, name, code) Task: Retrieve salary from managers that have at least one corresponding entry in transactions sharing the same id. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = mgr.id );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "salary", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_03024
train
T1
v3
Schema: departments (alias: dept)(code, id, amount, status) orders(salary, level, date, code) Task: Retrieve salary from departments with amount above the MAX(amount) of orders rows sharing the same type. SQL:
SELECT salary FROM departments AS dept WHERE amount > ( SELECT MAX(amount) FROM orders AS ord WHERE ord.type = dept.type );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_03025
train
T1
v1
Schema: employees (alias: emp)(type, value, level, salary) products(code, status, type, level) Task: Select code from employees where code exists in products for the same code. SQL:
SELECT code FROM employees AS emp WHERE code IN ( SELECT code FROM products AS prod WHERE prod.code = emp.code );
{ "outer_table": "employees", "inner_table": "products", "outer_alias": "emp", "inner_alias": "prod", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_03026
train
T1
v2
Schema: categories (alias: catg)(code, type, salary, date) services(level, date, value, amount) Task: Find name from categories where a matching record exists in services with the same code. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.code = catg.code );
{ "outer_table": "categories", "inner_table": "services", "outer_alias": "catg", "inner_alias": "srvc", "proj_col": "name", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_03027
train
T2
v3
Schema: orders (alias: ord)(date, value, salary, code) accounts(value, type, amount, date) Task: Find id from orders where value exceeds the average amount from accounts for the same type. SQL:
SELECT id FROM orders AS ord WHERE value > ( SELECT MAX(amount) FROM accounts AS acct WHERE acct.type = ord.type );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_03028
train
T1
v1
Schema: orders (alias: ord)(code, type, date, id) requests(salary, amount, date, status) Task: Find id from orders where code appears in requests entries with matching status. SQL:
SELECT id FROM orders AS ord WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.status = ord.status );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_03029
train
T1
v2
Schema: orders (alias: ord)(type, id, status, date) employees(date, id, type, name) Task: Retrieve name from orders that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = ord.status );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "name", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_03030
train
T1
v1
Schema: orders (alias: ord)(id, date, type, name) invoices(type, salary, status, level) Task: Retrieve code from orders whose level is found in invoices rows where status matches the outer record. SQL:
SELECT code FROM orders AS ord WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.status = ord.status );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_03031
train
T1
v1
Schema: regions (alias: rgn)(level, id, code, amount) requests(code, id, value, amount) Task: Retrieve amount from regions whose id is found in requests rows where code matches the outer record. SQL:
SELECT amount FROM regions AS rgn WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.code = rgn.code );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_03032
train
T2
v1
Schema: managers (alias: mgr)(value, salary, date, type) employees(id, amount, code, name) Task: Select value from managers where id exists in employees for the same status. SQL:
SELECT value FROM managers AS mgr WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.status = mgr.status );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_03033
train
T1
v1
Schema: services (alias: srvc)(type, amount, code, level) products(amount, type, salary, code) Task: Select value from services where type exists in products for the same level. SQL:
SELECT value FROM services AS srvc WHERE type IN ( SELECT type FROM products AS prod WHERE prod.level = srvc.level );
{ "outer_table": "services", "inner_table": "products", "outer_alias": "srvc", "inner_alias": "prod", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_03034
train
T2
v3
Schema: accounts (alias: acct)(code, level, amount, name) employees(id, name, status, type) Task: Find name from accounts where salary exceeds the average amount from employees for the same level. SQL:
SELECT name FROM accounts AS acct WHERE salary > ( SELECT AVG(amount) FROM employees AS emp WHERE emp.level = acct.level );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_03035
train
T1
v1
Schema: sales (alias: sale)(name, amount, level, salary) accounts(value, name, type, level) Task: Find value from sales where level appears in accounts entries with matching level. SQL:
SELECT value FROM sales AS sale WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.level = sale.level );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_03036
train
T1
v2
Schema: employees (alias: emp)(level, value, id, name) transactions(salary, name, value, id) Task: Find value from employees where a matching record exists in transactions with the same level. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = emp.level );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "value", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_03037
train
T1
v3
Schema: requests (alias: ordr)(type, level, value, id) staff(date, id, status, name) Task: Retrieve amount from requests with value above the COUNT(value) of staff rows sharing the same type. SQL:
SELECT amount FROM requests AS ordr WHERE value > ( SELECT COUNT(value) FROM staff AS empl WHERE empl.type = ordr.type );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_03038
train
T2
v1
Schema: requests (alias: ordr)(date, level, amount, name) invoices(status, salary, type, amount) Task: Select id from requests where level exists in invoices for the same level. SQL:
SELECT id FROM requests AS ordr WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.level = ordr.level );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_03039
train
T2
v2
Schema: regions (alias: rgn)(status, date, level, code) schedules(type, value, status, amount) Task: Find amount from regions where a matching record exists in schedules with the same id. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = rgn.id );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "amount", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_03040
train
T2
v2
Schema: services (alias: srvc)(date, type, id, code) staff(code, name, level, status) Task: Retrieve code from services that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT code FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = srvc.status );
{ "outer_table": "services", "inner_table": "staff", "outer_alias": "srvc", "inner_alias": "empl", "proj_col": "code", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_03041
train
T2
v1
Schema: orders (alias: ord)(level, type, id, value) warehouses(code, id, salary, name) Task: Select id from orders where id exists in warehouses for the same level. SQL:
SELECT id FROM orders AS ord WHERE id IN ( SELECT id FROM warehouses AS whs WHERE whs.level = ord.level );
{ "outer_table": "orders", "inner_table": "warehouses", "outer_alias": "ord", "inner_alias": "whs", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_03042
train
T1
v1
Schema: requests (alias: ordr)(status, code, name, level) departments(date, id, value, level) Task: Select amount from requests where status exists in departments for the same type. SQL:
SELECT amount FROM requests AS ordr WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.type = ordr.type );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "amount", "filter_col": "status", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_03043
train
T2
v3
Schema: transactions (alias: txn)(value, amount, code, salary) regions(status, date, type, value) Task: Find amount from transactions where amount exceeds the average amount from regions for the same level. SQL:
SELECT amount FROM transactions AS txn WHERE amount > ( SELECT COUNT(amount) FROM regions AS rgn WHERE rgn.level = txn.level );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_03044
train
T1
v3
Schema: orders (alias: ord)(salary, id, status, date) schedules(name, date, type, amount) Task: Retrieve salary from orders with amount above the MAX(value) of schedules rows sharing the same status. SQL:
SELECT salary FROM orders AS ord WHERE amount > ( SELECT MAX(value) FROM schedules AS schd WHERE schd.status = ord.status );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_03045
train
T1
v2
Schema: transactions (alias: txn)(level, value, status, name) staff(date, value, id, level) Task: Retrieve salary from transactions that have at least one corresponding entry in staff sharing the same code. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = txn.code );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "salary", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_03046
train
T1
v3
Schema: orders (alias: ord)(type, code, level, id) transactions(type, date, level, value) Task: Retrieve amount from orders with salary above the MAX(salary) of transactions rows sharing the same level. SQL:
SELECT amount FROM orders AS ord WHERE salary > ( SELECT MAX(salary) FROM transactions AS txn WHERE txn.level = ord.level );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_03047
train
T1
v2
Schema: warehouses (alias: whs)(status, date, name, amount) items(type, id, level, status) Task: Find id from warehouses where a matching record exists in items with the same code. SQL:
SELECT id FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "items", "outer_alias": "whs", "inner_alias": "lne", "proj_col": "id", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_03048
train
T2
v3
Schema: accounts (alias: acct)(code, level, amount, salary) regions(level, amount, type, name) Task: Find salary from accounts where amount exceeds the average value from regions for the same level. SQL:
SELECT salary FROM accounts AS acct WHERE amount > ( SELECT MIN(value) FROM regions AS rgn WHERE rgn.level = acct.level );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_03049
train
T1
v1
Schema: services (alias: srvc)(code, amount, level, date) departments(name, status, code, id) Task: Find salary from services where id appears in departments entries with matching id. SQL:
SELECT salary FROM services AS srvc WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.id = srvc.id );
{ "outer_table": "services", "inner_table": "departments", "outer_alias": "srvc", "inner_alias": "dept", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_03050
train
T2
v3
Schema: staff (alias: empl)(status, date, amount, level) invoices(value, id, level, date) Task: Retrieve id from staff with salary above the MAX(value) of invoices rows sharing the same type. SQL:
SELECT id FROM staff AS empl WHERE salary > ( SELECT MAX(value) FROM invoices AS inv WHERE inv.type = empl.type );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_03051
train
T2
v1
Schema: transactions (alias: txn)(status, type, date, id) sales(salary, value, name, id) Task: Find amount from transactions where level appears in sales entries with matching id. SQL:
SELECT amount FROM transactions AS txn WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.id = txn.id );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_03052
train
T1
v3
Schema: warehouses (alias: whs)(date, value, type, salary) employees(value, level, amount, name) Task: Retrieve name from warehouses with salary above the COUNT(amount) of employees rows sharing the same code. SQL:
SELECT name FROM warehouses AS whs WHERE salary > ( SELECT COUNT(amount) FROM employees AS emp WHERE emp.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "employees", "outer_alias": "whs", "inner_alias": "emp", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_03053
train
T2
v1
Schema: managers (alias: mgr)(date, value, name, code) items(amount, salary, date, value) Task: Select amount from managers where level exists in items for the same status. SQL:
SELECT amount FROM managers AS mgr WHERE level IN ( SELECT level FROM items AS lne WHERE lne.status = mgr.status );
{ "outer_table": "managers", "inner_table": "items", "outer_alias": "mgr", "inner_alias": "lne", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_03054
train
T1
v2
Schema: customers (alias: cust)(amount, type, value, code) products(level, date, status, id) Task: Find salary from customers where a matching record exists in products with the same level. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = cust.level );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "salary", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_03055
train
T1
v2
Schema: employees (alias: emp)(status, value, amount, id) warehouses(date, amount, value, salary) Task: Find code from employees where a matching record exists in warehouses with the same code. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.code = emp.code );
{ "outer_table": "employees", "inner_table": "warehouses", "outer_alias": "emp", "inner_alias": "whs", "proj_col": "code", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_03056
train
T1
v3
Schema: schedules (alias: schd)(date, name, level, code) categories(name, status, id, code) Task: Find amount from schedules where value exceeds the average amount from categories for the same code. SQL:
SELECT amount FROM schedules AS schd WHERE value > ( SELECT MAX(amount) FROM categories AS catg WHERE catg.code = schd.code );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_03057
train
T2
v3
Schema: sales (alias: sale)(name, id, type, value) regions(type, salary, amount, code) Task: Retrieve salary from sales with amount above the MIN(value) of regions rows sharing the same status. SQL:
SELECT salary FROM sales AS sale WHERE amount > ( SELECT MIN(value) FROM regions AS rgn WHERE rgn.status = sale.status );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_03058
train
T1
v3
Schema: orders (alias: ord)(name, code, date, status) staff(salary, name, code, id) Task: Find salary from orders where salary exceeds the average value from staff for the same id. SQL:
SELECT salary FROM orders AS ord WHERE salary > ( SELECT AVG(value) FROM staff AS empl WHERE empl.id = ord.id );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_03059
train
T1
v2
Schema: accounts (alias: acct)(salary, id, name, type) shipments(date, level, amount, name) Task: Retrieve value from accounts that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = acct.id );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "value", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_03060
train
T1
v2
Schema: items (alias: lne)(id, date, amount, salary) products(level, name, salary, amount) Task: Find salary from items where a matching record exists in products with the same status. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = lne.status );
{ "outer_table": "items", "inner_table": "products", "outer_alias": "lne", "inner_alias": "prod", "proj_col": "salary", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_03061
train
T2
v3
Schema: requests (alias: ordr)(name, amount, status, level) schedules(name, amount, status, date) Task: Find salary from requests where salary exceeds the average salary from schedules for the same id. SQL:
SELECT salary FROM requests AS ordr WHERE salary > ( SELECT SUM(salary) FROM schedules AS schd WHERE schd.id = ordr.id );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_03062
train
T2
v1
Schema: sales (alias: sale)(id, type, status, salary) departments(id, code, type, level) Task: Select salary from sales where code exists in departments for the same status. SQL:
SELECT salary FROM sales AS sale WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.status = sale.status );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_03063
train
T1
v1
Schema: orders (alias: ord)(id, salary, date, code) schedules(status, salary, type, amount) Task: Retrieve salary from orders whose type is found in schedules rows where id matches the outer record. SQL:
SELECT salary FROM orders AS ord WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.id = ord.id );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "salary", "filter_col": "type", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_03064
train
T1
v2
Schema: products (alias: prod)(code, value, level, id) managers(date, code, status, name) Task: Retrieve value from products that have at least one corresponding entry in managers sharing the same status. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = prod.status );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "value", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_03065
train
T1
v1
Schema: customers (alias: cust)(value, name, status, salary) managers(date, id, salary, value) Task: Retrieve code from customers whose level is found in managers rows where type matches the outer record. SQL:
SELECT code FROM customers AS cust WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.type = cust.type );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_03066
train
T1
v2
Schema: sales (alias: sale)(amount, status, salary, type) schedules(salary, amount, value, id) Task: Find value from sales where a matching record exists in schedules with the same type. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = sale.type );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "value", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_03067
train
T1
v2
Schema: shipments (alias: shp)(date, code, value, salary) warehouses(id, date, type, status) Task: Retrieve value from shipments that have at least one corresponding entry in warehouses sharing the same type. SQL:
SELECT value FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.type = shp.type );
{ "outer_table": "shipments", "inner_table": "warehouses", "outer_alias": "shp", "inner_alias": "whs", "proj_col": "value", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_03068
train
T2
v2
Schema: regions (alias: rgn)(name, value, code, level) sales(code, amount, type, salary) Task: Retrieve amount from regions that have at least one corresponding entry in sales sharing the same type. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = rgn.type );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "amount", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_03069
train
T2
v1
Schema: accounts (alias: acct)(amount, status, level, name) services(value, status, id, name) Task: Retrieve amount from accounts whose status is found in services rows where id matches the outer record. SQL:
SELECT amount FROM accounts AS acct WHERE status IN ( SELECT status FROM services AS srvc WHERE srvc.id = acct.id );
{ "outer_table": "accounts", "inner_table": "services", "outer_alias": "acct", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_03070
train
T1
v3
Schema: accounts (alias: acct)(amount, code, status, salary) sales(type, id, value, code) Task: Find code from accounts where amount exceeds the average amount from sales for the same id. SQL:
SELECT code FROM accounts AS acct WHERE amount > ( SELECT COUNT(amount) 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": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_03071
train
T1
v2
Schema: services (alias: srvc)(amount, value, status, salary) customers(date, name, salary, code) Task: Find value from services where a matching record exists in customers with the same id. SQL:
SELECT value FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = srvc.id );
{ "outer_table": "services", "inner_table": "customers", "outer_alias": "srvc", "inner_alias": "cust", "proj_col": "value", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_03072
train
T2
v1
Schema: invoices (alias: inv)(salary, id, status, level) shipments(id, date, amount, level) Task: Find value from invoices where status appears in shipments entries with matching id. SQL:
SELECT value FROM invoices AS inv WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.id = inv.id );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_03073
train
T1
v2
Schema: requests (alias: ordr)(status, code, value, id) items(value, name, type, date) Task: Find salary from requests where a matching record exists in items with the same status. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = ordr.status );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "salary", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_03074
train
T2
v1
Schema: shipments (alias: shp)(amount, value, name, level) transactions(status, date, id, value) Task: Retrieve code from shipments whose level is found in transactions rows where type matches the outer record. SQL:
SELECT code FROM shipments AS shp WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.type = shp.type );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_03075
train
T2
v2
Schema: departments (alias: dept)(value, level, amount, salary) regions(name, status, code, type) Task: Find code from departments where a matching record exists in regions with the same id. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = dept.id );
{ "outer_table": "departments", "inner_table": "regions", "outer_alias": "dept", "inner_alias": "rgn", "proj_col": "code", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_03076
train
T1
v1
Schema: regions (alias: rgn)(salary, type, status, code) services(value, level, status, name) Task: Select salary from regions where type exists in services for the same code. SQL:
SELECT salary FROM regions AS rgn WHERE type IN ( SELECT type FROM services AS srvc WHERE srvc.code = rgn.code );
{ "outer_table": "regions", "inner_table": "services", "outer_alias": "rgn", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "type", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_03077
train
T2
v2
Schema: shipments (alias: shp)(date, level, status, type) staff(date, amount, name, salary) Task: Find salary from shipments where a matching record exists in staff with the same type. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = shp.type );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "salary", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_03078
train
T2
v2
Schema: departments (alias: dept)(code, name, value, type) accounts(date, status, value, level) Task: Find salary from departments where a matching record exists in accounts with the same code. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = dept.code );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "salary", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_03079
train
T1
v3
Schema: departments (alias: dept)(type, salary, status, id) invoices(code, amount, type, level) Task: Find name from departments where amount exceeds the average value from invoices for the same type. SQL:
SELECT name FROM departments AS dept WHERE amount > ( SELECT MAX(value) FROM invoices AS inv WHERE inv.type = dept.type );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_03080
train
T1
v3
Schema: sales (alias: sale)(id, type, value, status) orders(amount, value, level, id) Task: Find id from sales where salary exceeds the average amount from orders for the same level. SQL:
SELECT id FROM sales AS sale WHERE salary > ( SELECT MAX(amount) FROM orders AS ord WHERE ord.level = sale.level );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_03081
train
T1
v2
Schema: departments (alias: dept)(value, status, amount, level) regions(amount, date, name, value) Task: Retrieve amount from departments that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = dept.level );
{ "outer_table": "departments", "inner_table": "regions", "outer_alias": "dept", "inner_alias": "rgn", "proj_col": "amount", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_03082
train
T1
v1
Schema: products (alias: prod)(value, level, code, name) sales(amount, date, id, level) Task: Select code from products where type exists in sales for the same id. SQL:
SELECT code FROM products AS prod WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.id = prod.id );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "code", "filter_col": "type", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_03083
train
T1
v2
Schema: products (alias: prod)(name, salary, date, value) warehouses(amount, code, salary, status) Task: Find name from products where a matching record exists in warehouses with the same id. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.id = prod.id );
{ "outer_table": "products", "inner_table": "warehouses", "outer_alias": "prod", "inner_alias": "whs", "proj_col": "name", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_03084
train
T1
v1
Schema: items (alias: lne)(amount, status, name, type) services(code, level, status, type) Task: Find id from items where id appears in services entries with matching level. SQL:
SELECT id FROM items AS lne WHERE id IN ( SELECT id FROM services AS srvc WHERE srvc.level = lne.level );
{ "outer_table": "items", "inner_table": "services", "outer_alias": "lne", "inner_alias": "srvc", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_03085
train
T2
v3
Schema: invoices (alias: inv)(date, name, value, code) budgets(date, salary, status, id) Task: Retrieve id from invoices with salary above the SUM(amount) of budgets rows sharing the same status. SQL:
SELECT id FROM invoices AS inv WHERE salary > ( SELECT SUM(amount) FROM budgets AS budg WHERE budg.status = inv.status );
{ "outer_table": "invoices", "inner_table": "budgets", "outer_alias": "inv", "inner_alias": "budg", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_03086
train
T1
v2
Schema: regions (alias: rgn)(name, level, code, date) transactions(level, date, value, amount) Task: Find id from regions where a matching record exists in transactions with the same type. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = rgn.type );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "id", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_03087
train
T2
v1
Schema: services (alias: srvc)(salary, value, status, name) staff(salary, code, value, type) Task: Find salary from services where level appears in staff entries with matching id. SQL:
SELECT salary 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": "salary", "filter_col": "level", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_03088
train
T2
v3
Schema: departments (alias: dept)(value, type, amount, status) schedules(id, value, amount, salary) Task: Find id from departments where amount exceeds the average value from schedules for the same id. SQL:
SELECT id FROM departments AS dept WHERE amount > ( SELECT COUNT(value) FROM schedules AS schd WHERE schd.id = dept.id );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_03089
train
T1
v2
Schema: warehouses (alias: whs)(id, salary, type, status) categories(name, status, date, code) Task: Retrieve amount from warehouses that have at least one corresponding entry in categories sharing the same id. SQL:
SELECT amount 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": "amount", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_03090
train
T2
v1
Schema: services (alias: srvc)(value, name, status, salary) employees(salary, date, code, status) Task: Find id from services where status appears in employees entries with matching type. SQL:
SELECT id FROM services AS srvc WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.type = srvc.type );
{ "outer_table": "services", "inner_table": "employees", "outer_alias": "srvc", "inner_alias": "emp", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_03091
train
T2
v1
Schema: warehouses (alias: whs)(date, id, code, name) orders(salary, date, level, id) Task: Select salary from warehouses where status exists in orders for the same status. SQL:
SELECT salary FROM warehouses AS whs WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "orders", "outer_alias": "whs", "inner_alias": "ord", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_03092
train
T2
v2
Schema: orders (alias: ord)(code, salary, type, amount) budgets(salary, id, amount, date) Task: Find id from orders where a matching record exists in budgets with the same code. SQL:
SELECT id FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.code = ord.code );
{ "outer_table": "orders", "inner_table": "budgets", "outer_alias": "ord", "inner_alias": "budg", "proj_col": "id", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_03093
train
T1
v2
Schema: categories (alias: catg)(status, id, name, value) shipments(date, level, status, salary) Task: Find amount from categories where a matching record exists in shipments with the same type. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = catg.type );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "catg", "inner_alias": "shp", "proj_col": "amount", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_03094
train
T2
v1
Schema: accounts (alias: acct)(code, level, id, value) requests(code, type, id, value) Task: Find code from accounts where status appears in requests entries with matching level. SQL:
SELECT code FROM accounts AS acct WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.level = acct.level );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_03095
train
T1
v2
Schema: customers (alias: cust)(date, name, value, status) requests(id, salary, name, level) Task: Retrieve value from customers that have at least one corresponding entry in requests sharing the same type. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = cust.type );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "value", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_03096
train
T1
v3
Schema: items (alias: lne)(name, code, date, type) sales(type, salary, value, id) Task: Find salary from items where value exceeds the average value from sales for the same code. SQL:
SELECT salary FROM items AS lne WHERE value > ( SELECT SUM(value) FROM sales AS sale WHERE sale.code = lne.code );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_03097
train
T2
v1
Schema: budgets (alias: budg)(value, type, id, status) regions(name, id, type, value) Task: Find salary from budgets where id appears in regions entries with matching type. SQL:
SELECT salary FROM budgets AS budg WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.type = budg.type );
{ "outer_table": "budgets", "inner_table": "regions", "outer_alias": "budg", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "id", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_03098
train
T2
v2
Schema: regions (alias: rgn)(status, name, type, id) customers(id, status, name, type) Task: Retrieve id from regions that have at least one corresponding entry in customers sharing the same status. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = rgn.status );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "id", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_03099
train
T2