variant
stringclasses
3 values
prompt
stringlengths
163
237
sql
stringlengths
103
143
metadata
unknown
id
stringlengths
21
21
split
stringclasses
1 value
token_group
stringclasses
2 values
v3
Schema: departments (alias: dept)(id, value, status, name) categories(salary, amount, date, level) Task: Retrieve name from departments with amount above the COUNT(value) of categories rows sharing the same id. SQL:
SELECT name FROM departments AS dept WHERE amount > ( SELECT COUNT(value) FROM categories AS catg WHERE catg.id = dept.id );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_05000
train
T1
v1
Schema: employees (alias: emp)(code, type, level, status) services(date, code, name, value) Task: Retrieve code from employees whose code is found in services rows where level matches the outer record. SQL:
SELECT code FROM employees AS emp WHERE code IN ( SELECT code FROM services AS srvc WHERE srvc.level = emp.level );
{ "outer_table": "employees", "inner_table": "services", "outer_alias": "emp", "inner_alias": "srvc", "proj_col": "code", "filter_col": "code", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_05001
train
T1
v3
Schema: warehouses (alias: whs)(date, salary, name, type) employees(name, value, amount, date) Task: Retrieve amount from warehouses with value above the SUM(amount) of employees rows sharing the same level. SQL:
SELECT amount FROM warehouses AS whs WHERE value > ( SELECT SUM(amount) FROM employees AS emp WHERE emp.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "employees", "outer_alias": "whs", "inner_alias": "emp", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_05002
train
T2
v3
Schema: warehouses (alias: whs)(type, id, salary, name) requests(id, type, value, status) Task: Retrieve code from warehouses with salary above the SUM(amount) of requests rows sharing the same code. SQL:
SELECT code FROM warehouses AS whs WHERE salary > ( SELECT SUM(amount) FROM requests AS ordr WHERE ordr.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "requests", "outer_alias": "whs", "inner_alias": "ordr", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_05003
train
T2
v2
Schema: requests (alias: ordr)(code, id, level, amount) categories(amount, name, type, level) Task: Find name from requests where a matching record exists in categories with the same type. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = ordr.type );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "name", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_05004
train
T2
v2
Schema: employees (alias: emp)(id, status, date, amount) categories(value, level, name, code) Task: Find code from employees where a matching record exists in categories with the same level. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = emp.level );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "code", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_05005
train
T1
v2
Schema: schedules (alias: schd)(amount, date, status, type) shipments(level, status, id, type) Task: Find amount from schedules where a matching record exists in shipments with the same id. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = schd.id );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "amount", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_05006
train
T2
v3
Schema: sales (alias: sale)(name, amount, date, salary) shipments(value, amount, salary, type) Task: Retrieve amount from sales with value above the MIN(value) of shipments rows sharing the same status. SQL:
SELECT amount FROM sales AS sale WHERE value > ( SELECT MIN(value) FROM shipments AS shp WHERE shp.status = sale.status );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_05007
train
T1
v3
Schema: categories (alias: catg)(id, amount, salary, name) warehouses(amount, type, code, date) Task: Retrieve salary from categories with salary above the SUM(value) of warehouses rows sharing the same code. SQL:
SELECT salary FROM categories AS catg WHERE salary > ( SELECT SUM(value) FROM warehouses AS whs WHERE whs.code = catg.code );
{ "outer_table": "categories", "inner_table": "warehouses", "outer_alias": "catg", "inner_alias": "whs", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_05008
train
T2
v1
Schema: accounts (alias: acct)(id, date, name, code) orders(type, value, salary, level) Task: Retrieve amount from accounts whose status is found in orders rows where level matches the outer record. SQL:
SELECT amount FROM accounts AS acct WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.level = acct.level );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_05009
train
T1
v2
Schema: employees (alias: emp)(date, id, level, amount) departments(code, level, date, salary) Task: Find value from employees where a matching record exists in departments with the same level. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = emp.level );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "value", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_05010
train
T1
v2
Schema: items (alias: lne)(id, name, amount, status) budgets(code, type, name, value) Task: Find id from items where a matching record exists in budgets with the same id. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.id = lne.id );
{ "outer_table": "items", "inner_table": "budgets", "outer_alias": "lne", "inner_alias": "budg", "proj_col": "id", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_05011
train
T2
v3
Schema: regions (alias: rgn)(id, code, status, date) schedules(code, value, status, name) Task: Find code from regions where salary exceeds the average amount from schedules for the same code. SQL:
SELECT code FROM regions AS rgn WHERE salary > ( SELECT SUM(amount) FROM schedules AS schd WHERE schd.code = rgn.code );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_05012
train
T2
v1
Schema: items (alias: lne)(value, amount, status, date) budgets(id, code, date, level) Task: Retrieve salary from items whose id is found in budgets rows where code matches the outer record. SQL:
SELECT salary FROM items AS lne WHERE id IN ( SELECT id FROM budgets AS budg WHERE budg.code = lne.code );
{ "outer_table": "items", "inner_table": "budgets", "outer_alias": "lne", "inner_alias": "budg", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_05013
train
T2
v1
Schema: services (alias: srvc)(value, amount, id, code) products(date, level, value, type) Task: Select salary from services where code exists in products for the same status. SQL:
SELECT salary FROM services AS srvc WHERE code IN ( SELECT code FROM products AS prod WHERE prod.status = srvc.status );
{ "outer_table": "services", "inner_table": "products", "outer_alias": "srvc", "inner_alias": "prod", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_05014
train
T2
v1
Schema: products (alias: prod)(salary, name, status, date) services(id, type, level, code) Task: Find value from products where status appears in services entries with matching id. SQL:
SELECT value FROM products AS prod WHERE status IN ( SELECT status FROM services AS srvc WHERE srvc.id = prod.id );
{ "outer_table": "products", "inner_table": "services", "outer_alias": "prod", "inner_alias": "srvc", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_05015
train
T1
v1
Schema: customers (alias: cust)(date, name, status, code) staff(code, status, type, value) Task: Retrieve value from customers whose code is found in staff rows where code matches the outer record. SQL:
SELECT value FROM customers AS cust WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.code = cust.code );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_05016
train
T1
v2
Schema: employees (alias: emp)(id, value, type, name) regions(status, code, id, date) Task: Retrieve salary from employees that have at least one corresponding entry in regions sharing the same id. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = emp.id );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "salary", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_05017
train
T1
v3
Schema: categories (alias: catg)(id, level, amount, salary) managers(name, value, amount, type) Task: Retrieve name from categories with salary above the MIN(amount) of managers rows sharing the same type. SQL:
SELECT name FROM categories AS catg WHERE salary > ( SELECT MIN(amount) FROM managers AS mgr WHERE mgr.type = catg.type );
{ "outer_table": "categories", "inner_table": "managers", "outer_alias": "catg", "inner_alias": "mgr", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_05018
train
T2
v3
Schema: invoices (alias: inv)(amount, date, salary, type) items(name, value, type, salary) Task: Retrieve id from invoices with amount above the MIN(value) of items rows sharing the same status. SQL:
SELECT id FROM invoices AS inv WHERE amount > ( SELECT MIN(value) FROM items AS lne WHERE lne.status = inv.status );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_05019
train
T1
v3
Schema: services (alias: srvc)(id, status, date, level) employees(name, code, value, level) Task: Find salary from services where amount exceeds the average amount from employees for the same id. SQL:
SELECT salary FROM services AS srvc WHERE amount > ( SELECT COUNT(amount) FROM employees AS emp WHERE emp.id = srvc.id );
{ "outer_table": "services", "inner_table": "employees", "outer_alias": "srvc", "inner_alias": "emp", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_05020
train
T2
v2
Schema: warehouses (alias: whs)(status, salary, type, amount) services(amount, salary, type, level) Task: Find value from warehouses where a matching record exists in services with the same id. SQL:
SELECT value FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "services", "outer_alias": "whs", "inner_alias": "srvc", "proj_col": "value", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_05021
train
T2
v1
Schema: items (alias: lne)(name, date, id, value) departments(level, status, code, type) Task: Select id from items where id exists in departments for the same id. SQL:
SELECT id FROM items AS lne WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.id = lne.id );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_05022
train
T2
v2
Schema: orders (alias: ord)(status, level, amount, type) budgets(status, date, type, id) Task: Retrieve value from orders that have at least one corresponding entry in budgets sharing the same id. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.id = ord.id );
{ "outer_table": "orders", "inner_table": "budgets", "outer_alias": "ord", "inner_alias": "budg", "proj_col": "value", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_05023
train
T1
v1
Schema: orders (alias: ord)(code, value, name, salary) categories(salary, level, id, name) Task: Select value from orders where id exists in categories for the same status. SQL:
SELECT value FROM orders AS ord WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.status = ord.status );
{ "outer_table": "orders", "inner_table": "categories", "outer_alias": "ord", "inner_alias": "catg", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_05024
train
T1
v1
Schema: departments (alias: dept)(value, name, code, salary) shipments(amount, status, id, salary) Task: Retrieve id from departments whose code is found in shipments rows where level matches the outer record. SQL:
SELECT id FROM departments AS dept WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.level = dept.level );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "id", "filter_col": "code", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_05025
train
T1
v1
Schema: staff (alias: empl)(type, amount, date, level) orders(id, value, level, status) Task: Retrieve id from staff whose type is found in orders rows where code matches the outer record. SQL:
SELECT id FROM staff AS empl WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.code = empl.code );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_05026
train
T2
v2
Schema: orders (alias: ord)(salary, id, value, level) shipments(status, id, code, value) Task: Find value from orders where a matching record exists in shipments with the same status. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = ord.status );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "value", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_05027
train
T1
v2
Schema: transactions (alias: txn)(level, status, name, value) orders(value, date, salary, status) Task: Retrieve code from transactions that have at least one corresponding entry in orders sharing the same id. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = txn.id );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "code", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_05028
train
T1
v1
Schema: budgets (alias: budg)(code, name, salary, value) orders(id, amount, level, code) Task: Retrieve id from budgets whose type is found in orders rows where id matches the outer record. SQL:
SELECT id FROM budgets AS budg WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.id = budg.id );
{ "outer_table": "budgets", "inner_table": "orders", "outer_alias": "budg", "inner_alias": "ord", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_05029
train
T2
v2
Schema: services (alias: srvc)(amount, id, salary, type) managers(date, salary, type, value) Task: Retrieve value from services that have at least one corresponding entry in managers sharing the same id. SQL:
SELECT value FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = srvc.id );
{ "outer_table": "services", "inner_table": "managers", "outer_alias": "srvc", "inner_alias": "mgr", "proj_col": "value", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_05030
train
T2
v2
Schema: customers (alias: cust)(name, amount, value, code) orders(type, name, level, id) Task: Retrieve salary from customers that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = cust.level );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "salary", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_05031
train
T1
v1
Schema: services (alias: srvc)(name, status, type, date) staff(level, date, type, id) Task: Find value from services where level appears in staff entries with matching type. SQL:
SELECT value FROM services AS srvc WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.type = srvc.type );
{ "outer_table": "services", "inner_table": "staff", "outer_alias": "srvc", "inner_alias": "empl", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_05032
train
T2
v3
Schema: customers (alias: cust)(level, type, value, id) warehouses(name, type, amount, salary) Task: Find amount from customers where salary exceeds the average value from warehouses for the same level. SQL:
SELECT amount FROM customers AS cust WHERE salary > ( SELECT SUM(value) FROM warehouses AS whs WHERE whs.level = cust.level );
{ "outer_table": "customers", "inner_table": "warehouses", "outer_alias": "cust", "inner_alias": "whs", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_05033
train
T1
v1
Schema: customers (alias: cust)(type, name, value, amount) regions(id, level, amount, value) Task: Find code from customers where id appears in regions entries with matching status. SQL:
SELECT code FROM customers AS cust WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.status = cust.status );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "code", "filter_col": "id", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_05034
train
T1
v1
Schema: invoices (alias: inv)(level, date, value, name) customers(type, name, id, amount) Task: Select salary from invoices where code exists in customers for the same id. SQL:
SELECT salary FROM invoices AS inv WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.id = inv.id );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_05035
train
T1
v2
Schema: sales (alias: sale)(date, level, value, code) orders(amount, id, name, date) Task: Retrieve id from sales that have at least one corresponding entry in orders sharing the same type. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = sale.type );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "id", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_05036
train
T1
v2
Schema: categories (alias: catg)(date, salary, code, name) items(code, date, type, value) Task: Find id from categories where a matching record exists in items with the same id. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.id = catg.id );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "id", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_05037
train
T2
v1
Schema: requests (alias: ordr)(salary, amount, type, id) staff(date, level, value, code) Task: Select value from requests where id exists in staff for the same code. SQL:
SELECT value FROM requests AS ordr WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.code = ordr.code );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_05038
train
T2
v2
Schema: requests (alias: ordr)(type, name, value, code) employees(type, status, date, amount) Task: Find id from requests where a matching record exists in employees with the same code. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = ordr.code );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "id", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_05039
train
T2
v2
Schema: services (alias: srvc)(date, salary, value, level) shipments(amount, level, date, status) Task: Find salary from services where a matching record exists in shipments with the same status. SQL:
SELECT salary FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = srvc.status );
{ "outer_table": "services", "inner_table": "shipments", "outer_alias": "srvc", "inner_alias": "shp", "proj_col": "salary", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_05040
train
T2
v1
Schema: sales (alias: sale)(amount, code, salary, date) transactions(code, level, value, name) Task: Find id from sales where status appears in transactions entries with matching type. SQL:
SELECT id FROM sales AS sale WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.type = sale.type );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_05041
train
T1
v1
Schema: departments (alias: dept)(id, date, name, value) items(type, date, name, code) Task: Select amount from departments where id exists in items for the same type. SQL:
SELECT amount FROM departments AS dept WHERE id IN ( SELECT id FROM items AS lne WHERE lne.type = dept.type );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_05042
train
T1
v3
Schema: items (alias: lne)(type, date, value, code) budgets(type, amount, salary, code) Task: Find salary from items where value exceeds the average value from budgets for the same level. SQL:
SELECT salary FROM items AS lne WHERE value > ( SELECT MAX(value) FROM budgets AS budg WHERE budg.level = lne.level );
{ "outer_table": "items", "inner_table": "budgets", "outer_alias": "lne", "inner_alias": "budg", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_05043
train
T2
v1
Schema: orders (alias: ord)(name, type, level, amount) shipments(id, value, salary, status) Task: Retrieve value from orders whose type is found in shipments rows where id matches the outer record. SQL:
SELECT value FROM orders AS ord WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.id = ord.id );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "value", "filter_col": "type", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_05044
train
T1
v1
Schema: customers (alias: cust)(type, id, value, status) transactions(status, type, value, name) Task: Find code from customers where type appears in transactions entries with matching status. SQL:
SELECT code FROM customers AS cust WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.status = cust.status );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_05045
train
T1
v1
Schema: items (alias: lne)(type, value, amount, date) products(salary, value, date, id) Task: Select name from items where id exists in products for the same type. SQL:
SELECT name FROM items AS lne WHERE id IN ( SELECT id FROM products AS prod WHERE prod.type = lne.type );
{ "outer_table": "items", "inner_table": "products", "outer_alias": "lne", "inner_alias": "prod", "proj_col": "name", "filter_col": "id", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_05046
train
T2
v1
Schema: budgets (alias: budg)(amount, status, value, date) items(status, type, level, value) Task: Select salary from budgets where code exists in items for the same level. SQL:
SELECT salary FROM budgets AS budg WHERE code IN ( SELECT code FROM items AS lne WHERE lne.level = budg.level );
{ "outer_table": "budgets", "inner_table": "items", "outer_alias": "budg", "inner_alias": "lne", "proj_col": "salary", "filter_col": "code", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_05047
train
T2
v3
Schema: customers (alias: cust)(type, level, status, amount) employees(level, type, id, code) Task: Retrieve id from customers with salary above the MAX(value) of employees rows sharing the same level. SQL:
SELECT id FROM customers AS cust WHERE salary > ( SELECT MAX(value) FROM employees AS emp WHERE emp.level = cust.level );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_05048
train
T1
v3
Schema: regions (alias: rgn)(date, level, status, code) accounts(code, name, salary, level) Task: Retrieve salary from regions with salary above the SUM(salary) of accounts rows sharing the same type. SQL:
SELECT salary FROM regions AS rgn WHERE salary > ( SELECT SUM(salary) FROM accounts AS acct WHERE acct.type = rgn.type );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "rgn", "inner_alias": "acct", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_05049
train
T2
v3
Schema: items (alias: lne)(value, type, salary, id) services(level, id, value, salary) Task: Retrieve salary from items with amount above the MIN(salary) of services rows sharing the same status. SQL:
SELECT salary FROM items AS lne WHERE amount > ( SELECT MIN(salary) FROM services AS srvc WHERE srvc.status = lne.status );
{ "outer_table": "items", "inner_table": "services", "outer_alias": "lne", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_05050
train
T2
v3
Schema: managers (alias: mgr)(level, code, name, value) warehouses(type, status, id, value) Task: Find salary from managers where amount exceeds the average value from warehouses for the same code. SQL:
SELECT salary FROM managers AS mgr WHERE amount > ( SELECT SUM(value) FROM warehouses AS whs WHERE whs.code = mgr.code );
{ "outer_table": "managers", "inner_table": "warehouses", "outer_alias": "mgr", "inner_alias": "whs", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_05051
train
T1
v2
Schema: regions (alias: rgn)(name, salary, status, date) staff(id, salary, level, amount) Task: Find id from regions where a matching record exists in staff with the same level. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = rgn.level );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "id", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_05052
train
T2
v1
Schema: orders (alias: ord)(id, amount, value, date) invoices(date, salary, amount, name) Task: Find amount from orders where type appears in invoices entries with matching id. SQL:
SELECT amount FROM orders AS ord WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.id = ord.id );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_05053
train
T1
v2
Schema: requests (alias: ordr)(name, date, value, amount) invoices(name, value, type, status) Task: Find value from requests where a matching record exists in invoices with the same status. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = ordr.status );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "value", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_05054
train
T2
v2
Schema: invoices (alias: inv)(type, salary, amount, value) requests(value, code, amount, name) Task: Retrieve salary from invoices that have at least one corresponding entry in requests sharing the same status. SQL:
SELECT salary FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = inv.status );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "salary", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_05055
train
T1
v2
Schema: sales (alias: sale)(value, name, salary, amount) staff(salary, id, date, type) Task: Find amount from sales where a matching record exists in staff with the same status. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = sale.status );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "amount", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_05056
train
T1
v3
Schema: services (alias: srvc)(amount, code, salary, date) products(code, level, salary, status) Task: Find name from services where salary exceeds the average amount from products for the same level. SQL:
SELECT name FROM services AS srvc WHERE salary > ( SELECT AVG(amount) FROM products AS prod WHERE prod.level = srvc.level );
{ "outer_table": "services", "inner_table": "products", "outer_alias": "srvc", "inner_alias": "prod", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_05057
train
T2
v1
Schema: products (alias: prod)(salary, date, level, code) schedules(code, amount, value, type) Task: Find salary from products where type appears in schedules entries with matching id. SQL:
SELECT salary FROM products AS prod WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.id = prod.id );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "salary", "filter_col": "type", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_05058
train
T1
v3
Schema: accounts (alias: acct)(date, status, amount, id) customers(value, salary, date, type) Task: Find code from accounts where amount exceeds the average salary from customers for the same id. SQL:
SELECT code FROM accounts AS acct WHERE amount > ( SELECT COUNT(salary) FROM customers AS cust WHERE cust.id = acct.id );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_05059
train
T1
v3
Schema: categories (alias: catg)(date, amount, code, value) accounts(name, date, salary, id) Task: Find salary from categories where salary exceeds the average value from accounts for the same type. SQL:
SELECT salary FROM categories AS catg WHERE salary > ( SELECT MIN(value) 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": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_05060
train
T2
v1
Schema: transactions (alias: txn)(id, status, code, salary) services(level, code, date, name) Task: Select salary from transactions where id exists in services for the same id. SQL:
SELECT salary FROM transactions AS txn WHERE id IN ( SELECT id FROM services AS srvc WHERE srvc.id = txn.id );
{ "outer_table": "transactions", "inner_table": "services", "outer_alias": "txn", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_05061
train
T1
v1
Schema: departments (alias: dept)(id, amount, value, salary) transactions(status, id, type, code) Task: Select id from departments where type exists in transactions for the same level. SQL:
SELECT id FROM departments AS dept WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.level = dept.level );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_05062
train
T1
v3
Schema: regions (alias: rgn)(amount, name, id, type) employees(salary, value, amount, type) Task: Retrieve id from regions with salary above the MIN(salary) of employees rows sharing the same code. SQL:
SELECT id FROM regions AS rgn WHERE salary > ( SELECT MIN(salary) FROM employees AS emp WHERE emp.code = rgn.code );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_05063
train
T2
v1
Schema: requests (alias: ordr)(salary, code, id, type) transactions(code, level, id, type) Task: Select amount from requests where level exists in transactions for the same code. SQL:
SELECT amount FROM requests AS ordr WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.code = ordr.code );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_05064
train
T2
v2
Schema: schedules (alias: schd)(value, amount, level, status) budgets(status, code, type, level) Task: Find name from schedules where a matching record exists in budgets with the same status. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.status = schd.status );
{ "outer_table": "schedules", "inner_table": "budgets", "outer_alias": "schd", "inner_alias": "budg", "proj_col": "name", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_05065
train
T2
v3
Schema: managers (alias: mgr)(value, amount, code, date) warehouses(name, level, type, id) Task: Find value from managers where value exceeds the average salary from warehouses for the same code. SQL:
SELECT value FROM managers AS mgr WHERE value > ( SELECT AVG(salary) FROM warehouses AS whs WHERE whs.code = mgr.code );
{ "outer_table": "managers", "inner_table": "warehouses", "outer_alias": "mgr", "inner_alias": "whs", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_05066
train
T1
v1
Schema: staff (alias: empl)(amount, level, salary, value) employees(type, id, amount, level) Task: Retrieve id from staff whose level is found in employees rows where id matches the outer record. SQL:
SELECT id FROM staff AS empl WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.id = empl.id );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_05067
train
T2
v3
Schema: employees (alias: emp)(id, level, type, status) accounts(date, value, id, level) Task: Find salary from employees where amount exceeds the average amount from accounts for the same id. SQL:
SELECT salary FROM employees AS emp WHERE amount > ( SELECT SUM(amount) FROM accounts AS acct WHERE acct.id = emp.id );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_05068
train
T1
v1
Schema: items (alias: lne)(date, code, id, value) managers(type, id, value, salary) Task: Find id from items where code appears in managers entries with matching type. SQL:
SELECT id FROM items AS lne WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.type = lne.type );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "id", "filter_col": "code", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_05069
train
T2
v3
Schema: warehouses (alias: whs)(value, amount, level, date) invoices(status, code, type, date) Task: Retrieve amount from warehouses with amount above the SUM(amount) of invoices rows sharing the same id. SQL:
SELECT amount FROM warehouses AS whs WHERE amount > ( SELECT SUM(amount) FROM invoices AS inv WHERE inv.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "invoices", "outer_alias": "whs", "inner_alias": "inv", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_05070
train
T2
v3
Schema: departments (alias: dept)(type, status, name, value) warehouses(code, date, value, level) Task: Find amount from departments where value exceeds the average salary from warehouses for the same type. SQL:
SELECT amount FROM departments AS dept WHERE value > ( SELECT MAX(salary) FROM warehouses AS whs WHERE whs.type = dept.type );
{ "outer_table": "departments", "inner_table": "warehouses", "outer_alias": "dept", "inner_alias": "whs", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_05071
train
T1
v3
Schema: transactions (alias: txn)(status, code, value, id) invoices(value, level, status, date) Task: Retrieve value from transactions with value above the MIN(amount) of invoices rows sharing the same id. SQL:
SELECT value FROM transactions AS txn WHERE value > ( SELECT MIN(amount) FROM invoices AS inv WHERE inv.id = txn.id );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_05072
train
T1
v1
Schema: regions (alias: rgn)(date, name, id, value) services(name, level, date, type) Task: Find value from regions where id appears in services entries with matching code. SQL:
SELECT value FROM regions AS rgn WHERE id IN ( SELECT id FROM services AS srvc WHERE srvc.code = rgn.code );
{ "outer_table": "regions", "inner_table": "services", "outer_alias": "rgn", "inner_alias": "srvc", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_05073
train
T2
v3
Schema: staff (alias: empl)(type, status, value, salary) products(salary, name, date, value) Task: Find name from staff where salary exceeds the average value from products for the same type. SQL:
SELECT name FROM staff AS empl WHERE salary > ( SELECT COUNT(value) FROM products AS prod WHERE prod.type = empl.type );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_05074
train
T2
v2
Schema: departments (alias: dept)(date, type, name, status) requests(status, value, type, date) Task: Find salary from departments where a matching record exists in requests with the same code. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = dept.code );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "salary", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_05075
train
T1
v1
Schema: sales (alias: sale)(status, name, level, type) transactions(level, date, value, code) Task: Select value from sales where id exists in transactions for the same level. SQL:
SELECT value FROM sales AS sale WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.level = sale.level );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_05076
train
T1
v2
Schema: regions (alias: rgn)(value, level, salary, type) services(status, type, value, amount) 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_05077
train
T2
v1
Schema: orders (alias: ord)(amount, name, date, salary) products(type, value, id, code) Task: Find value from orders where code appears in products entries with matching code. SQL:
SELECT value FROM orders AS ord WHERE code IN ( SELECT code FROM products AS prod WHERE prod.code = ord.code );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_05078
train
T1
v3
Schema: shipments (alias: shp)(id, code, name, status) managers(date, status, amount, type) Task: Find id from shipments where value exceeds the average amount from managers for the same id. SQL:
SELECT id FROM shipments AS shp WHERE value > ( SELECT SUM(amount) FROM managers AS mgr WHERE mgr.id = shp.id );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_05079
train
T2
v3
Schema: items (alias: lne)(status, amount, type, id) budgets(amount, id, value, salary) Task: Find name from items where amount exceeds the average amount from budgets for the same status. SQL:
SELECT name FROM items AS lne WHERE amount > ( SELECT MAX(amount) FROM budgets AS budg WHERE budg.status = lne.status );
{ "outer_table": "items", "inner_table": "budgets", "outer_alias": "lne", "inner_alias": "budg", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_05080
train
T2
v2
Schema: budgets (alias: budg)(amount, salary, level, value) departments(value, date, salary, status) Task: Find salary from budgets where a matching record exists in departments with the same level. SQL:
SELECT salary FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = budg.level );
{ "outer_table": "budgets", "inner_table": "departments", "outer_alias": "budg", "inner_alias": "dept", "proj_col": "salary", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_05081
train
T2
v3
Schema: schedules (alias: schd)(amount, type, level, value) transactions(code, amount, type, id) Task: Find id from schedules where value exceeds the average salary from transactions for the same level. SQL:
SELECT id FROM schedules AS schd WHERE value > ( SELECT AVG(salary) FROM transactions AS txn WHERE txn.level = schd.level );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_05082
train
T2
v3
Schema: accounts (alias: acct)(name, code, type, id) shipments(amount, type, level, salary) Task: Retrieve amount from accounts with salary above the COUNT(salary) of shipments rows sharing the same type. SQL:
SELECT amount FROM accounts AS acct WHERE salary > ( SELECT COUNT(salary) FROM shipments AS shp WHERE shp.type = acct.type );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_05083
train
T1
v2
Schema: requests (alias: ordr)(date, id, type, status) warehouses(amount, type, salary, name) Task: Find amount from requests where a matching record exists in warehouses with the same level. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.level = ordr.level );
{ "outer_table": "requests", "inner_table": "warehouses", "outer_alias": "ordr", "inner_alias": "whs", "proj_col": "amount", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_05084
train
T2
v1
Schema: customers (alias: cust)(status, type, date, level) services(code, id, salary, level) Task: Retrieve value from customers whose id is found in services rows where id matches the outer record. SQL:
SELECT value FROM customers AS cust WHERE id IN ( SELECT id FROM services AS srvc WHERE srvc.id = cust.id );
{ "outer_table": "customers", "inner_table": "services", "outer_alias": "cust", "inner_alias": "srvc", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_05085
train
T1
v1
Schema: shipments (alias: shp)(value, code, type, date) warehouses(date, amount, code, salary) Task: Select salary from shipments where code exists in warehouses for the same level. SQL:
SELECT salary FROM shipments AS shp WHERE code IN ( SELECT code FROM warehouses AS whs WHERE whs.level = shp.level );
{ "outer_table": "shipments", "inner_table": "warehouses", "outer_alias": "shp", "inner_alias": "whs", "proj_col": "salary", "filter_col": "code", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_05086
train
T2
v3
Schema: budgets (alias: budg)(amount, id, date, level) staff(level, value, salary, date) Task: Retrieve amount from budgets with amount above the COUNT(value) of staff rows sharing the same id. SQL:
SELECT amount FROM budgets AS budg WHERE amount > ( SELECT COUNT(value) FROM staff AS empl WHERE empl.id = budg.id );
{ "outer_table": "budgets", "inner_table": "staff", "outer_alias": "budg", "inner_alias": "empl", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_05087
train
T2
v3
Schema: invoices (alias: inv)(amount, name, salary, value) items(salary, name, level, amount) Task: Retrieve amount from invoices with amount above the MAX(value) of items rows sharing the same level. SQL:
SELECT amount FROM invoices AS inv WHERE amount > ( SELECT MAX(value) FROM items AS lne WHERE lne.level = inv.level );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_05088
train
T1
v2
Schema: employees (alias: emp)(code, name, value, amount) budgets(type, id, date, value) Task: Retrieve id from employees that have at least one corresponding entry in budgets sharing the same type. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.type = emp.type );
{ "outer_table": "employees", "inner_table": "budgets", "outer_alias": "emp", "inner_alias": "budg", "proj_col": "id", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_05089
train
T1
v1
Schema: staff (alias: empl)(salary, type, status, value) orders(code, type, level, amount) Task: Find value from staff where code appears in orders entries with matching id. SQL:
SELECT value FROM staff AS empl WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.id = empl.id );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_05090
train
T2
v1
Schema: warehouses (alias: whs)(id, status, code, level) items(code, name, type, value) Task: Retrieve id from warehouses whose level is found in items rows where type matches the outer record. SQL:
SELECT id FROM warehouses AS whs WHERE level IN ( SELECT level FROM items AS lne WHERE lne.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "items", "outer_alias": "whs", "inner_alias": "lne", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_05091
train
T2
v3
Schema: regions (alias: rgn)(amount, name, salary, status) accounts(name, amount, date, id) Task: Retrieve value from regions with value above the AVG(salary) of accounts rows sharing the same type. SQL:
SELECT value FROM regions AS rgn WHERE value > ( SELECT AVG(salary) FROM accounts AS acct WHERE acct.type = rgn.type );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "rgn", "inner_alias": "acct", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_05092
train
T2
v3
Schema: warehouses (alias: whs)(date, id, name, code) schedules(name, value, code, status) Task: Find value from warehouses where amount exceeds the average salary from schedules for the same type. SQL:
SELECT value FROM warehouses AS whs WHERE amount > ( SELECT MAX(salary) FROM schedules AS schd WHERE schd.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "schedules", "outer_alias": "whs", "inner_alias": "schd", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_05093
train
T2
v3
Schema: items (alias: lne)(code, value, status, name) departments(value, date, code, status) Task: Retrieve salary from items with salary above the MAX(value) of departments rows sharing the same code. SQL:
SELECT salary FROM items AS lne WHERE salary > ( SELECT MAX(value) FROM departments AS dept WHERE dept.code = lne.code );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_05094
train
T2
v2
Schema: budgets (alias: budg)(value, level, id, date) invoices(name, status, salary, type) Task: Retrieve amount from budgets that have at least one corresponding entry in invoices sharing the same code. SQL:
SELECT amount FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = budg.code );
{ "outer_table": "budgets", "inner_table": "invoices", "outer_alias": "budg", "inner_alias": "inv", "proj_col": "amount", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_05095
train
T2
v2
Schema: employees (alias: emp)(date, value, code, salary) schedules(id, level, name, amount) Task: Retrieve code from employees that have at least one corresponding entry in schedules sharing the same type. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = emp.type );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "code", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_05096
train
T1
v1
Schema: sales (alias: sale)(value, date, id, status) departments(value, date, type, salary) Task: Find value from sales where level appears in departments entries with matching level. SQL:
SELECT value FROM sales AS sale WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.level = sale.level );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_05097
train
T1
v2
Schema: regions (alias: rgn)(salary, date, level, name) requests(date, level, salary, type) Task: Find value from regions where a matching record exists in requests with the same level. SQL:
SELECT value FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = rgn.level );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "value", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_05098
train
T2
v2
Schema: products (alias: prod)(amount, date, name, type) accounts(date, status, type, amount) Task: Find code from products where a matching record exists in accounts with the same status. SQL:
SELECT code 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": "code", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_05099
train
T1