variant
stringclasses
3 values
prompt
stringlengths
163
237
sql
stringlengths
103
143
metadata
unknown
id
stringlengths
21
21
split
stringclasses
1 value
token_group
stringclasses
2 values
v1
Schema: customers (alias: cust)(id, amount, name, level) orders(value, id, code, type) Task: Find name from customers where type appears in orders entries with matching level. SQL:
SELECT name FROM customers AS cust WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.level = cust.level );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_08000
train
T1
v3
Schema: orders (alias: ord)(code, amount, salary, name) budgets(code, name, date, type) Task: Retrieve value from orders with value above the COUNT(value) of budgets rows sharing the same level. SQL:
SELECT value FROM orders AS ord WHERE value > ( SELECT COUNT(value) FROM budgets AS budg WHERE budg.level = ord.level );
{ "outer_table": "orders", "inner_table": "budgets", "outer_alias": "ord", "inner_alias": "budg", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_08001
train
T1
v2
Schema: warehouses (alias: whs)(date, status, salary, amount) products(type, code, salary, amount) Task: Find code from warehouses where a matching record exists in products with the same status. SQL:
SELECT code FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "products", "outer_alias": "whs", "inner_alias": "prod", "proj_col": "code", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_08002
train
T2
v2
Schema: requests (alias: ordr)(salary, code, value, level) schedules(code, type, date, status) Task: Retrieve value from requests that have at least one corresponding entry in schedules sharing the same status. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = ordr.status );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "value", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_08003
train
T2
v1
Schema: regions (alias: rgn)(status, salary, level, value) requests(code, level, id, name) Task: Find amount from regions where level appears in requests entries with matching level. SQL:
SELECT amount FROM regions AS rgn WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.level = rgn.level );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "level", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_08004
train
T2
v3
Schema: items (alias: lne)(name, id, amount, type) regions(level, id, code, value) Task: Retrieve name from items with salary above the MIN(salary) of regions rows sharing the same type. SQL:
SELECT name FROM items AS lne WHERE salary > ( SELECT MIN(salary) FROM regions AS rgn WHERE rgn.type = lne.type );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_08005
train
T2
v2
Schema: categories (alias: catg)(amount, id, code, value) accounts(code, type, salary, date) Task: Retrieve name from categories that have at least one corresponding entry in accounts sharing the same code. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = catg.code );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "name", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_08006
train
T2
v3
Schema: accounts (alias: acct)(value, date, amount, type) staff(amount, level, salary, value) Task: Retrieve id from accounts with salary above the MIN(amount) of staff rows sharing the same level. SQL:
SELECT id FROM accounts AS acct WHERE salary > ( SELECT MIN(amount) FROM staff AS empl WHERE empl.level = acct.level );
{ "outer_table": "accounts", "inner_table": "staff", "outer_alias": "acct", "inner_alias": "empl", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_08007
train
T1
v3
Schema: sales (alias: sale)(level, id, salary, amount) accounts(date, type, salary, status) Task: Retrieve code from sales with value above the AVG(amount) of accounts rows sharing the same id. SQL:
SELECT code FROM sales AS sale WHERE value > ( SELECT AVG(amount) FROM accounts AS acct WHERE acct.id = sale.id );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_08008
train
T1
v2
Schema: schedules (alias: schd)(value, type, amount, salary) warehouses(id, amount, name, status) Task: Find id from schedules where a matching record exists in warehouses with the same id. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.id = schd.id );
{ "outer_table": "schedules", "inner_table": "warehouses", "outer_alias": "schd", "inner_alias": "whs", "proj_col": "id", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_08009
train
T2
v3
Schema: sales (alias: sale)(id, date, type, value) categories(code, type, salary, level) Task: Retrieve salary from sales with value above the MIN(salary) of categories rows sharing the same level. SQL:
SELECT salary FROM sales AS sale WHERE value > ( SELECT MIN(salary) FROM categories AS catg WHERE catg.level = sale.level );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_08010
train
T1
v1
Schema: orders (alias: ord)(code, level, value, amount) services(date, status, salary, value) Task: Find value from orders where level appears in services entries with matching type. SQL:
SELECT value FROM orders AS ord WHERE level IN ( SELECT level FROM services AS srvc WHERE srvc.type = ord.type );
{ "outer_table": "orders", "inner_table": "services", "outer_alias": "ord", "inner_alias": "srvc", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_08011
train
T1
v3
Schema: regions (alias: rgn)(value, level, amount, code) shipments(value, id, name, type) Task: Find value from regions where value exceeds the average amount from shipments for the same code. SQL:
SELECT value FROM regions AS rgn WHERE value > ( SELECT MAX(amount) FROM shipments AS shp WHERE shp.code = rgn.code );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_08012
train
T2
v3
Schema: shipments (alias: shp)(value, date, name, amount) customers(amount, level, type, name) Task: Find name from shipments where amount exceeds the average value from customers for the same level. SQL:
SELECT name FROM shipments AS shp WHERE amount > ( SELECT AVG(value) FROM customers AS cust WHERE cust.level = shp.level );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_08013
train
T2
v1
Schema: accounts (alias: acct)(amount, type, date, salary) orders(value, amount, id, date) Task: Find value from accounts where type appears in orders entries with matching type. SQL:
SELECT value FROM accounts AS acct WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.type = acct.type );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "value", "filter_col": "type", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_08014
train
T1
v3
Schema: items (alias: lne)(type, amount, name, level) shipments(value, type, status, id) Task: Retrieve value from items with amount above the MAX(value) of shipments rows sharing the same status. SQL:
SELECT value FROM items AS lne WHERE amount > ( SELECT MAX(value) FROM shipments AS shp WHERE shp.status = lne.status );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_08015
train
T2
v1
Schema: managers (alias: mgr)(id, amount, level, name) sales(id, type, code, value) Task: Retrieve code from managers whose code is found in sales rows where type matches the outer record. SQL:
SELECT code FROM managers AS mgr WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.type = mgr.type );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "code", "filter_col": "code", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_08016
train
T1
v1
Schema: employees (alias: emp)(status, salary, value, code) requests(level, name, amount, code) Task: Find value from employees where level appears in requests entries with matching type. SQL:
SELECT value FROM employees AS emp WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.type = emp.type );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_08017
train
T1
v1
Schema: budgets (alias: budg)(salary, id, level, value) products(value, date, level, salary) Task: Retrieve name from budgets whose status is found in products rows where type matches the outer record. SQL:
SELECT name FROM budgets AS budg WHERE status IN ( SELECT status FROM products AS prod WHERE prod.type = budg.type );
{ "outer_table": "budgets", "inner_table": "products", "outer_alias": "budg", "inner_alias": "prod", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_08018
train
T2
v1
Schema: accounts (alias: acct)(type, status, date, name) shipments(status, amount, value, level) Task: Find code from accounts where id appears in shipments entries with matching code. SQL:
SELECT code FROM accounts AS acct WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.code = acct.code );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "code", "filter_col": "id", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_08019
train
T1
v2
Schema: transactions (alias: txn)(amount, code, value, date) warehouses(value, salary, date, type) Task: Find id from transactions where a matching record exists in warehouses with the same status. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.status = txn.status );
{ "outer_table": "transactions", "inner_table": "warehouses", "outer_alias": "txn", "inner_alias": "whs", "proj_col": "id", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_08020
train
T1
v2
Schema: items (alias: lne)(level, status, date, type) staff(status, value, level, code) Task: Retrieve code from items that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = lne.status );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "code", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_08021
train
T2
v2
Schema: requests (alias: ordr)(level, type, status, code) categories(date, code, type, value) Task: Find code from requests where a matching record exists in categories with the same id. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = ordr.id );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "code", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_08022
train
T2
v2
Schema: regions (alias: rgn)(id, date, value, level) customers(type, date, value, level) Task: Retrieve amount from regions that have at least one corresponding entry in customers sharing the same type. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = rgn.type );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "amount", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_08023
train
T2
v2
Schema: customers (alias: cust)(salary, level, id, type) budgets(level, status, amount, type) Task: Retrieve code from customers that have at least one corresponding entry in budgets sharing the same status. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.status = cust.status );
{ "outer_table": "customers", "inner_table": "budgets", "outer_alias": "cust", "inner_alias": "budg", "proj_col": "code", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_08024
train
T1
v3
Schema: staff (alias: empl)(salary, type, id, status) customers(id, date, value, amount) Task: Retrieve code from staff with amount above the AVG(value) of customers rows sharing the same status. SQL:
SELECT code FROM staff AS empl WHERE amount > ( SELECT AVG(value) FROM customers AS cust WHERE cust.status = empl.status );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_08025
train
T2
v1
Schema: sales (alias: sale)(id, amount, salary, level) items(level, amount, id, date) Task: Retrieve name from sales whose code is found in items rows where level matches the outer record. SQL:
SELECT name FROM sales AS sale WHERE code IN ( SELECT code FROM items AS lne WHERE lne.level = sale.level );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_08026
train
T1
v2
Schema: shipments (alias: shp)(level, id, type, status) staff(type, amount, date, code) Task: Find name from shipments where a matching record exists in staff with the same id. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = shp.id );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "name", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_08027
train
T2
v1
Schema: items (alias: lne)(status, value, name, type) departments(code, type, date, id) Task: Select salary from items where id exists in departments for the same status. SQL:
SELECT salary FROM items AS lne WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.status = lne.status );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_08028
train
T2
v2
Schema: shipments (alias: shp)(type, amount, value, date) employees(type, level, status, amount) Task: Retrieve value from shipments that have at least one corresponding entry in employees sharing the same level. SQL:
SELECT value FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = shp.level );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "value", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_08029
train
T2
v3
Schema: warehouses (alias: whs)(value, status, code, amount) requests(id, status, date, value) Task: Find salary from warehouses where salary exceeds the average salary from requests for the same code. SQL:
SELECT salary FROM warehouses AS whs WHERE salary > ( SELECT MIN(salary) FROM requests AS ordr WHERE ordr.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "requests", "outer_alias": "whs", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_08030
train
T2
v1
Schema: employees (alias: emp)(level, code, date, salary) customers(code, value, name, id) Task: Find code from employees where code appears in customers entries with matching type. SQL:
SELECT code FROM employees AS emp WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.type = emp.type );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "code", "filter_col": "code", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_08031
train
T1
v1
Schema: departments (alias: dept)(code, status, salary, type) products(id, value, salary, date) Task: Find value from departments where status appears in products entries with matching code. SQL:
SELECT value FROM departments AS dept WHERE status IN ( SELECT status FROM products AS prod WHERE prod.code = dept.code );
{ "outer_table": "departments", "inner_table": "products", "outer_alias": "dept", "inner_alias": "prod", "proj_col": "value", "filter_col": "status", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_08032
train
T1
v2
Schema: products (alias: prod)(status, name, code, id) shipments(name, level, type, date) Task: Retrieve salary from products that have at least one corresponding entry in shipments sharing the same type. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = prod.type );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "salary", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_08033
train
T1
v3
Schema: accounts (alias: acct)(id, name, status, code) requests(date, code, amount, value) Task: Retrieve value from accounts with value above the MIN(salary) of requests rows sharing the same status. SQL:
SELECT value FROM accounts AS acct WHERE value > ( SELECT MIN(salary) FROM requests AS ordr WHERE ordr.status = acct.status );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_08034
train
T1
v3
Schema: managers (alias: mgr)(value, salary, id, level) budgets(salary, name, code, amount) Task: Find amount from managers where salary exceeds the average value from budgets for the same id. SQL:
SELECT amount FROM managers AS mgr WHERE salary > ( SELECT AVG(value) FROM budgets AS budg WHERE budg.id = mgr.id );
{ "outer_table": "managers", "inner_table": "budgets", "outer_alias": "mgr", "inner_alias": "budg", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_08035
train
T1
v3
Schema: transactions (alias: txn)(amount, salary, type, value) regions(code, status, date, id) Task: Retrieve name from transactions with amount above the AVG(amount) of regions rows sharing the same status. SQL:
SELECT name FROM transactions AS txn WHERE amount > ( SELECT AVG(amount) FROM regions AS rgn WHERE rgn.status = txn.status );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_08036
train
T1
v1
Schema: sales (alias: sale)(value, salary, status, type) warehouses(code, level, name, value) Task: Select salary from sales where code exists in warehouses for the same id. SQL:
SELECT salary FROM sales AS sale WHERE code IN ( SELECT code FROM warehouses AS whs WHERE whs.id = sale.id );
{ "outer_table": "sales", "inner_table": "warehouses", "outer_alias": "sale", "inner_alias": "whs", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_08037
train
T1
v1
Schema: managers (alias: mgr)(code, salary, level, amount) shipments(level, value, amount, salary) Task: Retrieve value from managers whose level is found in shipments rows where id matches the outer record. SQL:
SELECT value FROM managers AS mgr WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.id = mgr.id );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "value", "filter_col": "level", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_08038
train
T1
v3
Schema: accounts (alias: acct)(amount, value, name, status) warehouses(status, amount, date, code) Task: Retrieve value from accounts with amount above the AVG(value) of warehouses rows sharing the same id. SQL:
SELECT value FROM accounts AS acct WHERE amount > ( SELECT AVG(value) FROM warehouses AS whs WHERE whs.id = acct.id );
{ "outer_table": "accounts", "inner_table": "warehouses", "outer_alias": "acct", "inner_alias": "whs", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_08039
train
T1
v1
Schema: managers (alias: mgr)(value, name, code, id) customers(salary, code, name, id) Task: Select code from managers where id exists in customers for the same level. SQL:
SELECT code FROM managers AS mgr WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.level = mgr.level );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "code", "filter_col": "id", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_08040
train
T1
v3
Schema: warehouses (alias: whs)(type, amount, level, code) budgets(amount, name, value, type) Task: Retrieve amount from warehouses with amount above the MIN(salary) of budgets rows sharing the same level. SQL:
SELECT amount FROM warehouses AS whs WHERE amount > ( SELECT MIN(salary) FROM budgets AS budg WHERE budg.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "budgets", "outer_alias": "whs", "inner_alias": "budg", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_08041
train
T2
v3
Schema: transactions (alias: txn)(status, type, name, date) items(amount, date, type, level) Task: Retrieve name from transactions with salary above the SUM(salary) of items rows sharing the same status. SQL:
SELECT name FROM transactions AS txn WHERE salary > ( SELECT SUM(salary) FROM items AS lne WHERE lne.status = txn.status );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_08042
train
T1
v1
Schema: items (alias: lne)(salary, name, type, code) budgets(salary, code, type, amount) Task: Select value from items where code exists in budgets for the same status. SQL:
SELECT value FROM items AS lne WHERE code IN ( SELECT code FROM budgets AS budg WHERE budg.status = lne.status );
{ "outer_table": "items", "inner_table": "budgets", "outer_alias": "lne", "inner_alias": "budg", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_08043
train
T2
v2
Schema: shipments (alias: shp)(level, id, amount, type) invoices(value, status, id, name) Task: Retrieve salary from shipments that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = shp.type );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "salary", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_08044
train
T2
v2
Schema: items (alias: lne)(id, date, value, level) departments(value, salary, status, type) Task: Retrieve id from items that have at least one corresponding entry in departments sharing the same id. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = lne.id );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "id", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_08045
train
T2
v2
Schema: warehouses (alias: whs)(status, name, level, id) requests(status, name, value, code) Task: Find salary from warehouses where a matching record exists in requests with the same id. SQL:
SELECT salary FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "requests", "outer_alias": "whs", "inner_alias": "ordr", "proj_col": "salary", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_08046
train
T2
v1
Schema: transactions (alias: txn)(code, name, amount, date) categories(level, type, code, salary) Task: Find id from transactions where id appears in categories entries with matching level. SQL:
SELECT id FROM transactions AS txn WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.level = txn.level );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_08047
train
T1
v1
Schema: services (alias: srvc)(status, level, type, name) sales(value, id, date, name) Task: Find code from services where id appears in sales entries with matching status. SQL:
SELECT code FROM services AS srvc WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.status = srvc.status );
{ "outer_table": "services", "inner_table": "sales", "outer_alias": "srvc", "inner_alias": "sale", "proj_col": "code", "filter_col": "id", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_08048
train
T2
v1
Schema: products (alias: prod)(amount, level, salary, value) departments(value, amount, type, salary) Task: Find amount from products where type appears in departments entries with matching level. SQL:
SELECT amount FROM products AS prod WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.level = prod.level );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_08049
train
T1
v1
Schema: schedules (alias: schd)(status, value, code, id) budgets(value, level, code, type) Task: Retrieve code from schedules whose level is found in budgets rows where code matches the outer record. SQL:
SELECT code FROM schedules AS schd WHERE level IN ( SELECT level FROM budgets AS budg WHERE budg.code = schd.code );
{ "outer_table": "schedules", "inner_table": "budgets", "outer_alias": "schd", "inner_alias": "budg", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_08050
train
T2
v3
Schema: managers (alias: mgr)(status, type, value, id) schedules(salary, level, name, code) Task: Retrieve amount from managers with salary above the MIN(amount) of schedules rows sharing the same id. SQL:
SELECT amount FROM managers AS mgr WHERE salary > ( SELECT MIN(amount) FROM schedules AS schd WHERE schd.id = mgr.id );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_08051
train
T1
v1
Schema: invoices (alias: inv)(level, code, name, date) services(name, salary, id, status) Task: Select amount from invoices where level exists in services for the same level. SQL:
SELECT amount FROM invoices AS inv WHERE level IN ( SELECT level FROM services AS srvc WHERE srvc.level = inv.level );
{ "outer_table": "invoices", "inner_table": "services", "outer_alias": "inv", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "level", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_08052
train
T1
v2
Schema: sales (alias: sale)(date, type, level, amount) staff(status, salary, name, value) Task: Retrieve name from sales that have at least one corresponding entry in staff sharing the same code. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = sale.code );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "name", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_08053
train
T1
v2
Schema: staff (alias: empl)(amount, level, date, id) transactions(id, code, level, salary) Task: Retrieve salary from staff that have at least one corresponding entry in transactions sharing the same status. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = empl.status );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "salary", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_08054
train
T2
v3
Schema: requests (alias: ordr)(code, level, status, id) invoices(type, salary, id, status) Task: Retrieve salary from requests with value above the MAX(value) of invoices rows sharing the same type. SQL:
SELECT salary FROM requests AS ordr WHERE value > ( SELECT MAX(value) FROM invoices AS inv WHERE inv.type = ordr.type );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_08055
train
T2
v2
Schema: managers (alias: mgr)(status, id, type, name) shipments(level, name, code, value) Task: Find salary from managers where a matching record exists in shipments with the same id. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = mgr.id );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "salary", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_08056
train
T1
v1
Schema: regions (alias: rgn)(id, level, name, date) services(amount, type, value, date) Task: Find value from regions where level appears in services entries with matching id. SQL:
SELECT value FROM regions AS rgn WHERE level IN ( SELECT level FROM services AS srvc WHERE srvc.id = rgn.id );
{ "outer_table": "regions", "inner_table": "services", "outer_alias": "rgn", "inner_alias": "srvc", "proj_col": "value", "filter_col": "level", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_08057
train
T2
v2
Schema: warehouses (alias: whs)(level, date, salary, code) sales(value, amount, date, code) Task: Find code from warehouses where a matching record exists in sales with the same type. SQL:
SELECT code FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "sales", "outer_alias": "whs", "inner_alias": "sale", "proj_col": "code", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_08058
train
T2
v1
Schema: transactions (alias: txn)(salary, level, amount, id) invoices(level, date, status, code) Task: Select name from transactions where code exists in invoices for the same id. SQL:
SELECT name FROM transactions AS txn WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.id = txn.id );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_08059
train
T1
v3
Schema: orders (alias: ord)(salary, amount, code, level) transactions(amount, date, id, code) Task: Retrieve code from orders with amount above the SUM(salary) of transactions rows sharing the same type. SQL:
SELECT code FROM orders AS ord WHERE amount > ( SELECT SUM(salary) FROM transactions AS txn WHERE txn.type = ord.type );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_08060
train
T1
v3
Schema: orders (alias: ord)(status, name, amount, type) transactions(salary, name, value, level) Task: Find value from orders where salary exceeds the average value from transactions for the same id. SQL:
SELECT value FROM orders AS ord WHERE salary > ( SELECT MAX(value) FROM transactions AS txn WHERE txn.id = ord.id );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_08061
train
T1
v3
Schema: schedules (alias: schd)(date, level, code, name) transactions(level, code, value, salary) Task: Retrieve value from schedules with amount above the SUM(salary) of transactions rows sharing the same id. SQL:
SELECT value FROM schedules AS schd WHERE amount > ( SELECT SUM(salary) FROM transactions AS txn WHERE txn.id = schd.id );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_08062
train
T2
v3
Schema: categories (alias: catg)(type, status, date, level) accounts(id, type, value, name) Task: Find salary from categories where salary exceeds the average amount from accounts for the same type. SQL:
SELECT salary FROM categories AS catg WHERE salary > ( SELECT SUM(amount) FROM accounts AS acct WHERE acct.type = catg.type );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_08063
train
T2
v2
Schema: customers (alias: cust)(level, date, status, id) requests(id, level, salary, type) Task: Retrieve amount from customers that have at least one corresponding entry in requests sharing the same level. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = cust.level );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "amount", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_08064
train
T1
v3
Schema: warehouses (alias: whs)(level, type, status, date) orders(code, status, amount, salary) Task: Find value from warehouses where value exceeds the average value from orders for the same code. SQL:
SELECT value FROM warehouses AS whs WHERE value > ( SELECT AVG(value) FROM orders AS ord WHERE ord.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "orders", "outer_alias": "whs", "inner_alias": "ord", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_08065
train
T2
v1
Schema: items (alias: lne)(salary, amount, status, name) categories(level, value, amount, id) Task: Retrieve id from items whose code is found in categories rows where code matches the outer record. SQL:
SELECT id FROM items AS lne WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.code = lne.code );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_08066
train
T2
v2
Schema: transactions (alias: txn)(code, value, salary, amount) managers(level, status, type, id) Task: Find value from transactions where a matching record exists in managers with the same status. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = txn.status );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "value", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_08067
train
T1
v1
Schema: customers (alias: cust)(name, status, level, code) categories(value, salary, amount, status) Task: Retrieve name from customers whose level is found in categories rows where level matches the outer record. SQL:
SELECT name FROM customers AS cust WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.level = cust.level );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_08068
train
T1
v1
Schema: accounts (alias: acct)(id, value, amount, status) schedules(date, amount, id, level) Task: Find amount from accounts where code appears in schedules entries with matching code. SQL:
SELECT amount FROM accounts AS acct WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.code = acct.code );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_08069
train
T1
v3
Schema: customers (alias: cust)(amount, id, code, salary) schedules(status, value, type, amount) Task: Retrieve id from customers with salary above the SUM(value) of schedules rows sharing the same type. SQL:
SELECT id FROM customers AS cust WHERE salary > ( SELECT SUM(value) FROM schedules AS schd WHERE schd.type = cust.type );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_08070
train
T1
v2
Schema: items (alias: lne)(type, status, code, id) departments(date, name, status, salary) Task: Retrieve code from items that have at least one corresponding entry in departments sharing the same level. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = lne.level );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "code", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_08071
train
T2
v1
Schema: managers (alias: mgr)(level, name, status, date) services(type, name, salary, level) Task: Find name from managers where status appears in services entries with matching code. SQL:
SELECT name FROM managers AS mgr WHERE status IN ( SELECT status FROM services AS srvc WHERE srvc.code = mgr.code );
{ "outer_table": "managers", "inner_table": "services", "outer_alias": "mgr", "inner_alias": "srvc", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_08072
train
T1
v2
Schema: employees (alias: emp)(id, salary, type, amount) transactions(amount, date, code, type) Task: Find code from employees where a matching record exists in transactions with the same code. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = emp.code );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "code", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_08073
train
T1
v1
Schema: requests (alias: ordr)(date, status, level, amount) schedules(type, code, id, salary) Task: Retrieve amount from requests whose status is found in schedules rows where code matches the outer record. SQL:
SELECT amount FROM requests AS ordr WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.code = ordr.code );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "amount", "filter_col": "status", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_08074
train
T2
v3
Schema: invoices (alias: inv)(salary, type, id, amount) requests(level, type, status, amount) Task: Find amount from invoices where salary exceeds the average salary from requests for the same type. SQL:
SELECT amount FROM invoices AS inv WHERE salary > ( SELECT COUNT(salary) FROM requests AS ordr WHERE ordr.type = inv.type );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_08075
train
T1
v2
Schema: regions (alias: rgn)(name, status, date, type) services(date, type, status, salary) Task: Retrieve salary from regions that have at least one corresponding entry in services sharing the same code. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.code = rgn.code );
{ "outer_table": "regions", "inner_table": "services", "outer_alias": "rgn", "inner_alias": "srvc", "proj_col": "salary", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_08076
train
T2
v3
Schema: accounts (alias: acct)(type, id, value, amount) warehouses(status, salary, date, name) Task: Find id from accounts where value exceeds the average value from warehouses for the same id. SQL:
SELECT id FROM accounts AS acct WHERE value > ( SELECT AVG(value) FROM warehouses AS whs WHERE whs.id = acct.id );
{ "outer_table": "accounts", "inner_table": "warehouses", "outer_alias": "acct", "inner_alias": "whs", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_08077
train
T1
v2
Schema: products (alias: prod)(code, level, value, date) budgets(status, amount, type, id) Task: Find value from products where a matching record exists in budgets with the same code. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.code = prod.code );
{ "outer_table": "products", "inner_table": "budgets", "outer_alias": "prod", "inner_alias": "budg", "proj_col": "value", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_08078
train
T1
v3
Schema: customers (alias: cust)(date, amount, type, name) categories(status, name, level, date) Task: Find name from customers where value exceeds the average salary from categories for the same status. SQL:
SELECT name FROM customers AS cust WHERE value > ( SELECT MAX(salary) FROM categories AS catg WHERE catg.status = cust.status );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_08079
train
T1
v2
Schema: customers (alias: cust)(salary, value, code, name) products(code, date, id, amount) Task: Find id from customers where a matching record exists in products with the same code. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = cust.code );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "id", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_08080
train
T1
v1
Schema: warehouses (alias: whs)(level, name, amount, salary) staff(level, value, status, type) Task: Select amount from warehouses where status exists in staff for the same level. SQL:
SELECT amount FROM warehouses AS whs WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "staff", "outer_alias": "whs", "inner_alias": "empl", "proj_col": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_08081
train
T2
v1
Schema: products (alias: prod)(id, status, name, code) departments(id, amount, level, value) Task: Find id from products where level appears in departments entries with matching status. SQL:
SELECT id FROM products AS prod WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.status = prod.status );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_08082
train
T1
v3
Schema: managers (alias: mgr)(type, name, status, value) departments(name, code, salary, level) Task: Find name from managers where salary exceeds the average salary from departments for the same level. SQL:
SELECT name FROM managers AS mgr WHERE salary > ( SELECT MAX(salary) FROM departments AS dept WHERE dept.level = mgr.level );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_08083
train
T1
v3
Schema: staff (alias: empl)(name, code, value, date) items(amount, value, status, name) Task: Retrieve salary from staff with amount above the SUM(value) of items rows sharing the same level. SQL:
SELECT salary FROM staff AS empl WHERE amount > ( SELECT SUM(value) FROM items AS lne WHERE lne.level = empl.level );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_08084
train
T2
v3
Schema: categories (alias: catg)(status, id, value, date) products(code, value, type, amount) Task: Retrieve amount from categories with amount above the COUNT(amount) of products rows sharing the same code. SQL:
SELECT amount FROM categories AS catg WHERE amount > ( SELECT COUNT(amount) FROM products AS prod WHERE prod.code = catg.code );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_08085
train
T2
v3
Schema: orders (alias: ord)(id, name, amount, type) budgets(salary, id, type, amount) Task: Find value from orders where salary exceeds the average value from budgets for the same id. SQL:
SELECT value FROM orders AS ord WHERE salary > ( SELECT MIN(value) FROM budgets AS budg WHERE budg.id = ord.id );
{ "outer_table": "orders", "inner_table": "budgets", "outer_alias": "ord", "inner_alias": "budg", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_08086
train
T1
v2
Schema: requests (alias: ordr)(status, code, value, salary) regions(name, code, value, status) Task: Find amount from requests where a matching record exists in regions with the same id. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = ordr.id );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "amount", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_08087
train
T2
v3
Schema: employees (alias: emp)(status, id, amount, name) warehouses(value, status, date, amount) Task: Find code from employees where salary exceeds the average salary from warehouses for the same code. SQL:
SELECT code FROM employees AS emp WHERE salary > ( SELECT AVG(salary) FROM warehouses AS whs WHERE whs.code = emp.code );
{ "outer_table": "employees", "inner_table": "warehouses", "outer_alias": "emp", "inner_alias": "whs", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_08088
train
T1
v1
Schema: customers (alias: cust)(code, level, date, id) transactions(salary, code, value, id) Task: Retrieve code from customers whose id is found in transactions rows where code matches the outer record. SQL:
SELECT code FROM customers AS cust WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.code = cust.code );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "code", "filter_col": "id", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_08089
train
T1
v2
Schema: employees (alias: emp)(id, code, status, name) budgets(date, name, type, status) Task: Find salary from employees where a matching record exists in budgets with the same status. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.status = emp.status );
{ "outer_table": "employees", "inner_table": "budgets", "outer_alias": "emp", "inner_alias": "budg", "proj_col": "salary", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_08090
train
T1
v2
Schema: managers (alias: mgr)(type, value, salary, status) accounts(code, amount, type, value) Task: Find amount from managers where a matching record exists in accounts with the same id. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = mgr.id );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "amount", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_08091
train
T1
v1
Schema: schedules (alias: schd)(value, type, amount, name) customers(status, type, code, value) Task: Find salary from schedules where code appears in customers entries with matching type. SQL:
SELECT salary FROM schedules AS schd WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.type = schd.type );
{ "outer_table": "schedules", "inner_table": "customers", "outer_alias": "schd", "inner_alias": "cust", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_08092
train
T2
v2
Schema: warehouses (alias: whs)(type, name, id, code) staff(code, status, name, id) Task: Retrieve amount from warehouses that have at least one corresponding entry in staff sharing the same code. SQL:
SELECT amount FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "staff", "outer_alias": "whs", "inner_alias": "empl", "proj_col": "amount", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_08093
train
T2
v2
Schema: services (alias: srvc)(salary, type, name, code) accounts(level, code, id, amount) Task: Retrieve amount from services that have at least one corresponding entry in accounts sharing the same code. SQL:
SELECT amount FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = srvc.code );
{ "outer_table": "services", "inner_table": "accounts", "outer_alias": "srvc", "inner_alias": "acct", "proj_col": "amount", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_08094
train
T2
v2
Schema: warehouses (alias: whs)(amount, value, id, level) departments(salary, type, amount, level) Task: Find amount from warehouses where a matching record exists in departments with the same type. SQL:
SELECT amount FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "departments", "outer_alias": "whs", "inner_alias": "dept", "proj_col": "amount", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_08095
train
T2
v3
Schema: warehouses (alias: whs)(type, code, id, value) regions(status, value, salary, level) Task: Retrieve name from warehouses with value above the AVG(value) of regions rows sharing the same level. SQL:
SELECT name FROM warehouses AS whs WHERE value > ( SELECT AVG(value) FROM regions AS rgn WHERE rgn.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "regions", "outer_alias": "whs", "inner_alias": "rgn", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_08096
train
T2
v2
Schema: transactions (alias: txn)(status, date, type, value) orders(date, amount, salary, name) Task: Retrieve amount from transactions that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = txn.level );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "amount", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_08097
train
T1
v2
Schema: transactions (alias: txn)(level, salary, status, date) services(date, type, code, id) Task: Retrieve value from transactions that have at least one corresponding entry in services sharing the same status. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.status = txn.status );
{ "outer_table": "transactions", "inner_table": "services", "outer_alias": "txn", "inner_alias": "srvc", "proj_col": "value", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_08098
train
T1
v2
Schema: employees (alias: emp)(code, salary, status, type) products(status, salary, name, id) Task: Retrieve value from employees that have at least one corresponding entry in products sharing the same status. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = emp.status );
{ "outer_table": "employees", "inner_table": "products", "outer_alias": "emp", "inner_alias": "prod", "proj_col": "value", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_08099
train
T1