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)(code, amount, type, value) orders(date, amount, code, id) Task: Select code from customers where status exists in orders for the same type. SQL:
SELECT code FROM customers AS cust WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.type = cust.type );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_02100
train
T1
v2
Schema: staff (alias: empl)(name, status, level, date) categories(level, type, name, value) Task: Find value from staff where a matching record exists in categories with the same level. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = empl.level );
{ "outer_table": "staff", "inner_table": "categories", "outer_alias": "empl", "inner_alias": "catg", "proj_col": "value", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_02101
train
T2
v1
Schema: categories (alias: catg)(amount, type, code, salary) accounts(status, amount, code, salary) Task: Retrieve salary from categories whose code is found in accounts rows where level matches the outer record. SQL:
SELECT salary FROM categories AS catg WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.level = catg.level );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "salary", "filter_col": "code", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_02102
train
T2
v3
Schema: transactions (alias: txn)(status, amount, level, date) products(status, code, id, amount) Task: Find amount from transactions where amount exceeds the average amount from products for the same status. SQL:
SELECT amount FROM transactions AS txn WHERE amount > ( SELECT COUNT(amount) FROM products AS prod WHERE prod.status = txn.status );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_02103
train
T1
v1
Schema: products (alias: prod)(name, type, level, value) services(name, type, id, level) Task: Find value from products where type appears in services entries with matching id. SQL:
SELECT value FROM products AS prod WHERE type IN ( SELECT type 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": "type", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_02104
train
T1
v2
Schema: customers (alias: cust)(type, amount, date, status) items(id, salary, status, value) Task: Retrieve amount from customers that have at least one corresponding entry in items sharing the same status. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = cust.status );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "amount", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_02105
train
T1
v3
Schema: services (alias: srvc)(salary, amount, value, status) employees(salary, code, id, type) Task: Find amount from services where salary exceeds the average value from employees for the same type. SQL:
SELECT amount FROM services AS srvc WHERE salary > ( SELECT MAX(value) FROM employees AS emp WHERE emp.type = srvc.type );
{ "outer_table": "services", "inner_table": "employees", "outer_alias": "srvc", "inner_alias": "emp", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_02106
train
T2
v2
Schema: warehouses (alias: whs)(status, type, salary, value) products(level, value, type, status) Task: Retrieve code from warehouses that have at least one corresponding entry in products sharing the same id. SQL:
SELECT code FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "products", "outer_alias": "whs", "inner_alias": "prod", "proj_col": "code", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_02107
train
T2
v1
Schema: accounts (alias: acct)(id, name, amount, status) services(date, level, value, salary) Task: Select value from accounts where status exists in services for the same level. SQL:
SELECT value FROM accounts AS acct WHERE status IN ( SELECT status FROM services AS srvc WHERE srvc.level = acct.level );
{ "outer_table": "accounts", "inner_table": "services", "outer_alias": "acct", "inner_alias": "srvc", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_02108
train
T1
v2
Schema: orders (alias: ord)(status, id, code, date) customers(value, date, amount, level) Task: Find name from orders where a matching record exists in customers with the same id. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = ord.id );
{ "outer_table": "orders", "inner_table": "customers", "outer_alias": "ord", "inner_alias": "cust", "proj_col": "name", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_02109
train
T1
v1
Schema: warehouses (alias: whs)(code, type, name, salary) staff(value, name, status, id) Task: Find value from warehouses where code appears in staff entries with matching code. SQL:
SELECT value FROM warehouses AS whs WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "staff", "outer_alias": "whs", "inner_alias": "empl", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_02110
train
T2
v1
Schema: employees (alias: emp)(name, date, code, id) accounts(value, type, status, name) Task: Select salary from employees where status exists in accounts for the same type. SQL:
SELECT salary FROM employees AS emp WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.type = emp.type );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_02111
train
T1
v1
Schema: shipments (alias: shp)(value, id, level, name) managers(id, status, salary, date) Task: Retrieve salary from shipments whose status is found in managers rows where level matches the outer record. SQL:
SELECT salary FROM shipments AS shp WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.level = shp.level );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_02112
train
T2
v2
Schema: managers (alias: mgr)(level, salary, amount, value) budgets(salary, status, id, name) Task: Find amount from managers where a matching record exists in budgets with the same status. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.status = mgr.status );
{ "outer_table": "managers", "inner_table": "budgets", "outer_alias": "mgr", "inner_alias": "budg", "proj_col": "amount", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_02113
train
T1
v3
Schema: budgets (alias: budg)(date, amount, type, level) accounts(salary, level, code, type) Task: Retrieve name from budgets with salary above the SUM(amount) of accounts rows sharing the same status. SQL:
SELECT name FROM budgets AS budg WHERE salary > ( SELECT SUM(amount) FROM accounts AS acct WHERE acct.status = budg.status );
{ "outer_table": "budgets", "inner_table": "accounts", "outer_alias": "budg", "inner_alias": "acct", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_02114
train
T2
v3
Schema: employees (alias: emp)(level, amount, name, code) staff(status, name, salary, type) Task: Retrieve id from employees with salary above the SUM(salary) of staff rows sharing the same code. SQL:
SELECT id FROM employees AS emp WHERE salary > ( SELECT SUM(salary) FROM staff AS empl WHERE empl.code = emp.code );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_02115
train
T1
v1
Schema: customers (alias: cust)(amount, name, status, type) schedules(name, type, id, code) Task: Find value from customers where code appears in schedules entries with matching type. SQL:
SELECT value FROM customers AS cust WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.type = cust.type );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_02116
train
T1
v3
Schema: managers (alias: mgr)(value, status, level, date) regions(name, status, type, value) Task: Retrieve value from managers with value above the MIN(value) of regions rows sharing the same code. SQL:
SELECT value FROM managers AS mgr WHERE value > ( SELECT MIN(value) FROM regions AS rgn WHERE rgn.code = mgr.code );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_02117
train
T1
v3
Schema: schedules (alias: schd)(date, code, status, salary) managers(value, code, amount, id) Task: Find value from schedules where value exceeds the average value from managers for the same type. SQL:
SELECT value FROM schedules AS schd WHERE value > ( SELECT AVG(value) FROM managers AS mgr WHERE mgr.type = schd.type );
{ "outer_table": "schedules", "inner_table": "managers", "outer_alias": "schd", "inner_alias": "mgr", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_02118
train
T2
v3
Schema: shipments (alias: shp)(status, name, value, level) sales(name, id, level, date) Task: Find id from shipments where amount exceeds the average value from sales for the same code. SQL:
SELECT id FROM shipments AS shp WHERE amount > ( SELECT AVG(value) FROM sales AS sale WHERE sale.code = shp.code );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_02119
train
T2
v1
Schema: budgets (alias: budg)(type, status, amount, code) warehouses(value, id, code, status) Task: Find id from budgets where level appears in warehouses entries with matching id. SQL:
SELECT id FROM budgets AS budg WHERE level IN ( SELECT level FROM warehouses AS whs WHERE whs.id = budg.id );
{ "outer_table": "budgets", "inner_table": "warehouses", "outer_alias": "budg", "inner_alias": "whs", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_02120
train
T2
v2
Schema: categories (alias: catg)(status, code, level, value) warehouses(amount, type, level, name) Task: Find code from categories where a matching record exists in warehouses with the same type. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.type = catg.type );
{ "outer_table": "categories", "inner_table": "warehouses", "outer_alias": "catg", "inner_alias": "whs", "proj_col": "code", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_02121
train
T2
v3
Schema: services (alias: srvc)(type, value, level, salary) sales(status, code, date, name) Task: Find salary from services where salary exceeds the average amount from sales for the same type. SQL:
SELECT salary FROM services AS srvc WHERE salary > ( SELECT MAX(amount) FROM sales AS sale WHERE sale.type = srvc.type );
{ "outer_table": "services", "inner_table": "sales", "outer_alias": "srvc", "inner_alias": "sale", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_02122
train
T2
v2
Schema: services (alias: srvc)(name, status, level, code) employees(value, name, type, status) Task: Retrieve id from services that have at least one corresponding entry in employees sharing the same level. SQL:
SELECT id FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = srvc.level );
{ "outer_table": "services", "inner_table": "employees", "outer_alias": "srvc", "inner_alias": "emp", "proj_col": "id", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_02123
train
T2
v1
Schema: schedules (alias: schd)(date, salary, value, code) staff(value, level, status, code) Task: Select value from schedules where code exists in staff for the same id. SQL:
SELECT value FROM schedules AS schd WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.id = schd.id );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_02124
train
T2
v1
Schema: departments (alias: dept)(salary, value, status, amount) managers(value, salary, level, date) Task: Select value from departments where code exists in managers for the same status. SQL:
SELECT value FROM departments AS dept WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.status = dept.status );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_02125
train
T1
v1
Schema: invoices (alias: inv)(type, value, id, amount) accounts(code, date, level, salary) Task: Find name from invoices where code appears in accounts entries with matching status. SQL:
SELECT name FROM invoices AS inv WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.status = inv.status );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_02126
train
T1
v3
Schema: regions (alias: rgn)(type, date, status, value) schedules(name, date, code, value) Task: Find salary from regions where value exceeds the average salary from schedules for the same status. SQL:
SELECT salary FROM regions AS rgn WHERE value > ( SELECT AVG(salary) FROM schedules AS schd WHERE schd.status = rgn.status );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_02127
train
T2
v3
Schema: regions (alias: rgn)(type, level, value, code) products(name, amount, type, code) Task: Find amount from regions where salary exceeds the average value from products for the same code. SQL:
SELECT amount FROM regions AS rgn WHERE salary > ( SELECT MIN(value) FROM products AS prod WHERE prod.code = rgn.code );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_02128
train
T2
v1
Schema: regions (alias: rgn)(name, date, id, amount) staff(type, date, name, value) Task: Retrieve code from regions whose type is found in staff rows where status matches the outer record. SQL:
SELECT code FROM regions AS rgn WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.status = rgn.status );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_02129
train
T2
v3
Schema: employees (alias: emp)(code, level, name, amount) regions(date, salary, code, status) Task: Find id from employees where value exceeds the average salary from regions for the same type. SQL:
SELECT id FROM employees AS emp WHERE value > ( SELECT MAX(salary) FROM regions AS rgn WHERE rgn.type = emp.type );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_02130
train
T1
v2
Schema: shipments (alias: shp)(salary, value, id, date) services(date, value, amount, name) Task: Retrieve amount from shipments that have at least one corresponding entry in services sharing the same level. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.level = shp.level );
{ "outer_table": "shipments", "inner_table": "services", "outer_alias": "shp", "inner_alias": "srvc", "proj_col": "amount", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_02131
train
T2
v1
Schema: sales (alias: sale)(name, code, salary, value) items(type, date, name, code) Task: Find code from sales where status appears in items entries with matching level. SQL:
SELECT code FROM sales AS sale WHERE status IN ( SELECT status FROM items AS lne WHERE lne.level = sale.level );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_02132
train
T1
v1
Schema: departments (alias: dept)(code, salary, date, type) items(name, date, amount, type) Task: Select name from departments where status exists in items for the same type. SQL:
SELECT name FROM departments AS dept WHERE status IN ( SELECT status FROM items AS lne WHERE lne.type = dept.type );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_02133
train
T1
v3
Schema: sales (alias: sale)(code, name, id, status) services(code, date, id, value) Task: Find code from sales where value exceeds the average value from services for the same status. SQL:
SELECT code FROM sales AS sale WHERE value > ( SELECT MAX(value) FROM services AS srvc WHERE srvc.status = sale.status );
{ "outer_table": "sales", "inner_table": "services", "outer_alias": "sale", "inner_alias": "srvc", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_02134
train
T1
v1
Schema: sales (alias: sale)(amount, status, date, value) orders(salary, name, status, amount) Task: Find name from sales where level appears in orders entries with matching code. SQL:
SELECT name FROM sales AS sale WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.code = sale.code );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_02135
train
T1
v3
Schema: accounts (alias: acct)(id, level, salary, status) schedules(status, amount, name, salary) Task: Retrieve name from accounts with value above the AVG(amount) of schedules rows sharing the same status. SQL:
SELECT name FROM accounts AS acct WHERE value > ( SELECT AVG(amount) FROM schedules AS schd WHERE schd.status = acct.status );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_02136
train
T1
v3
Schema: customers (alias: cust)(name, type, date, id) staff(level, salary, date, type) Task: Retrieve amount from customers with amount above the COUNT(amount) of staff rows sharing the same id. SQL:
SELECT amount FROM customers AS cust WHERE amount > ( SELECT COUNT(amount) FROM staff AS empl WHERE empl.id = cust.id );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_02137
train
T1
v3
Schema: managers (alias: mgr)(type, salary, id, date) departments(date, status, code, salary) Task: Find id from managers where amount exceeds the average amount from departments for the same level. SQL:
SELECT id FROM managers AS mgr WHERE amount > ( SELECT MIN(amount) FROM departments AS dept WHERE dept.level = mgr.level );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_02138
train
T1
v3
Schema: regions (alias: rgn)(level, type, code, value) customers(status, level, id, salary) Task: Find name from regions where value exceeds the average amount from customers for the same level. SQL:
SELECT name FROM regions AS rgn WHERE value > ( SELECT AVG(amount) FROM customers AS cust WHERE cust.level = rgn.level );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_02139
train
T2
v3
Schema: staff (alias: empl)(value, salary, amount, id) customers(amount, type, date, code) Task: Retrieve value from staff with salary above the COUNT(salary) of customers rows sharing the same type. SQL:
SELECT value FROM staff AS empl WHERE salary > ( SELECT COUNT(salary) FROM customers AS cust WHERE cust.type = empl.type );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_02140
train
T2
v2
Schema: items (alias: lne)(code, level, name, salary) shipments(name, code, salary, status) Task: Retrieve amount from items that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = lne.status );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "amount", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_02141
train
T2
v3
Schema: categories (alias: catg)(name, id, code, value) customers(name, value, date, salary) Task: Find amount from categories where value exceeds the average value from customers for the same status. SQL:
SELECT amount FROM categories AS catg WHERE value > ( SELECT COUNT(value) FROM customers AS cust WHERE cust.status = catg.status );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_02142
train
T2
v1
Schema: budgets (alias: budg)(value, status, code, date) products(code, salary, status, value) Task: Retrieve value from budgets whose id is found in products rows where type matches the outer record. SQL:
SELECT value FROM budgets AS budg WHERE id IN ( SELECT id FROM products AS prod WHERE prod.type = budg.type );
{ "outer_table": "budgets", "inner_table": "products", "outer_alias": "budg", "inner_alias": "prod", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_02143
train
T2
v2
Schema: invoices (alias: inv)(date, amount, level, id) categories(id, name, amount, level) Task: Retrieve amount from invoices that have at least one corresponding entry in categories sharing the same id. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = inv.id );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "amount", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_02144
train
T1
v1
Schema: products (alias: prod)(code, amount, name, level) shipments(code, type, level, name) Task: Retrieve id from products whose id is found in shipments rows where code matches the outer record. SQL:
SELECT id FROM products AS prod WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.code = prod.code );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "id", "filter_col": "id", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_02145
train
T1
v1
Schema: warehouses (alias: whs)(amount, salary, name, type) orders(amount, id, code, name) Task: Retrieve id from warehouses whose id is found in orders rows where type matches the outer record. SQL:
SELECT id FROM warehouses AS whs WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "orders", "outer_alias": "whs", "inner_alias": "ord", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_02146
train
T2
v1
Schema: categories (alias: catg)(date, type, amount, value) items(amount, type, id, salary) Task: Select salary from categories where type exists in items for the same type. SQL:
SELECT salary FROM categories AS catg WHERE type IN ( SELECT type FROM items AS lne WHERE lne.type = catg.type );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_02147
train
T2
v1
Schema: sales (alias: sale)(amount, date, code, salary) budgets(salary, code, id, date) Task: Find id from sales where status appears in budgets entries with matching status. SQL:
SELECT id FROM sales AS sale WHERE status IN ( SELECT status FROM budgets AS budg WHERE budg.status = sale.status );
{ "outer_table": "sales", "inner_table": "budgets", "outer_alias": "sale", "inner_alias": "budg", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_02148
train
T1
v1
Schema: products (alias: prod)(code, id, type, level) transactions(date, id, level, type) Task: Select id from products where id exists in transactions for the same code. SQL:
SELECT id FROM products AS prod WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.code = prod.code );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "id", "filter_col": "id", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_02149
train
T1
v1
Schema: staff (alias: empl)(value, salary, date, code) sales(level, status, date, value) Task: Retrieve id from staff whose code is found in sales rows where code matches the outer record. SQL:
SELECT id FROM staff AS empl WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.code = empl.code );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_02150
train
T2
v2
Schema: customers (alias: cust)(id, status, code, salary) departments(amount, type, code, name) Task: Retrieve id from customers that have at least one corresponding entry in departments sharing the same code. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = cust.code );
{ "outer_table": "customers", "inner_table": "departments", "outer_alias": "cust", "inner_alias": "dept", "proj_col": "id", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_02151
train
T1
v1
Schema: accounts (alias: acct)(id, type, level, name) products(type, date, salary, code) Task: Find id from accounts where code appears in products entries with matching status. SQL:
SELECT id FROM accounts AS acct WHERE code IN ( SELECT code FROM products AS prod WHERE prod.status = acct.status );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_02152
train
T1
v2
Schema: employees (alias: emp)(status, salary, amount, level) regions(id, level, salary, value) Task: Find id from employees where a matching record exists in regions with the same status. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = emp.status );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "id", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_02153
train
T1
v1
Schema: customers (alias: cust)(code, type, level, date) schedules(status, level, value, salary) Task: Find name from customers where code appears in schedules entries with matching level. SQL:
SELECT name FROM customers AS cust WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.level = cust.level );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_02154
train
T1
v1
Schema: shipments (alias: shp)(status, name, value, id) schedules(level, salary, value, type) Task: Find amount from shipments where code appears in schedules entries with matching type. SQL:
SELECT amount FROM shipments AS shp WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.type = shp.type );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_02155
train
T2
v3
Schema: invoices (alias: inv)(status, level, date, value) managers(type, code, status, level) Task: Find id from invoices where value exceeds the average value from managers for the same code. SQL:
SELECT id FROM invoices AS inv WHERE value > ( SELECT MIN(value) FROM managers AS mgr WHERE mgr.code = inv.code );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_02156
train
T1
v3
Schema: accounts (alias: acct)(type, name, value, code) staff(value, amount, level, status) Task: Retrieve code from accounts with amount above the AVG(value) of staff rows sharing the same type. SQL:
SELECT code FROM accounts AS acct WHERE amount > ( SELECT AVG(value) FROM staff AS empl WHERE empl.type = acct.type );
{ "outer_table": "accounts", "inner_table": "staff", "outer_alias": "acct", "inner_alias": "empl", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_02157
train
T1
v2
Schema: categories (alias: catg)(id, salary, code, level) shipments(value, type, salary, level) Task: Retrieve amount from categories that have at least one corresponding entry in shipments sharing the same level. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = catg.level );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "catg", "inner_alias": "shp", "proj_col": "amount", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_02158
train
T2
v1
Schema: regions (alias: rgn)(type, salary, amount, code) customers(amount, value, code, salary) Task: Find name from regions where code appears in customers entries with matching type. SQL:
SELECT name FROM regions AS rgn WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.type = rgn.type );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "name", "filter_col": "code", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_02159
train
T2
v1
Schema: items (alias: lne)(amount, code, value, id) invoices(name, type, code, amount) Task: Find value from items where type appears in invoices entries with matching code. SQL:
SELECT value FROM items AS lne WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.code = lne.code );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_02160
train
T2
v1
Schema: invoices (alias: inv)(level, type, salary, id) schedules(amount, value, type, status) Task: Retrieve id from invoices whose id is found in schedules rows where status matches the outer record. SQL:
SELECT id FROM invoices AS inv WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.status = inv.status );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "id", "filter_col": "id", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_02161
train
T1
v2
Schema: transactions (alias: txn)(name, code, salary, id) employees(code, type, salary, status) Task: Retrieve amount from transactions that have at least one corresponding entry in employees sharing the same type. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = txn.type );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "amount", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_02162
train
T1
v2
Schema: orders (alias: ord)(salary, type, name, code) requests(code, level, salary, amount) Task: Retrieve code from orders that have at least one corresponding entry in requests sharing the same code. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = ord.code );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "code", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_02163
train
T1
v3
Schema: warehouses (alias: whs)(date, type, salary, id) departments(status, date, level, name) Task: Retrieve value from warehouses with value above the COUNT(amount) of departments rows sharing the same status. SQL:
SELECT value FROM warehouses AS whs WHERE value > ( SELECT COUNT(amount) FROM departments AS dept WHERE dept.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "departments", "outer_alias": "whs", "inner_alias": "dept", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_02164
train
T2
v1
Schema: employees (alias: emp)(level, date, status, value) orders(id, status, value, name) Task: Find name from employees where id appears in orders entries with matching type. SQL:
SELECT name FROM employees AS emp WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.type = emp.type );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "name", "filter_col": "id", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_02165
train
T1
v1
Schema: requests (alias: ordr)(id, type, code, level) schedules(value, type, name, id) Task: Find name from requests where status appears in schedules entries with matching type. SQL:
SELECT name FROM requests AS ordr WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.type = ordr.type );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_02166
train
T2
v3
Schema: categories (alias: catg)(id, value, code, name) customers(status, code, id, type) Task: Retrieve name from categories with amount above the MIN(amount) of customers rows sharing the same level. SQL:
SELECT name FROM categories AS catg WHERE amount > ( SELECT MIN(amount) FROM customers AS cust WHERE cust.level = catg.level );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_02167
train
T2
v2
Schema: schedules (alias: schd)(salary, date, type, value) employees(salary, level, value, status) Task: Find code from schedules where a matching record exists in employees with the same level. SQL:
SELECT code FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = schd.level );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "code", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_02168
train
T2
v3
Schema: products (alias: prod)(type, name, code, status) warehouses(code, amount, value, status) Task: Find name from products where salary exceeds the average amount from warehouses for the same level. SQL:
SELECT name FROM products AS prod WHERE salary > ( SELECT SUM(amount) FROM warehouses AS whs WHERE whs.level = prod.level );
{ "outer_table": "products", "inner_table": "warehouses", "outer_alias": "prod", "inner_alias": "whs", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_02169
train
T1
v2
Schema: transactions (alias: txn)(level, status, date, amount) regions(value, type, date, status) Task: Find code from transactions where a matching record exists in regions with the same level. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = txn.level );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "code", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_02170
train
T1
v3
Schema: staff (alias: empl)(value, status, level, code) shipments(name, level, code, status) Task: Find salary from staff where salary exceeds the average value from shipments for the same level. SQL:
SELECT salary FROM staff AS empl WHERE salary > ( SELECT MAX(value) FROM shipments AS shp WHERE shp.level = empl.level );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_02171
train
T2
v1
Schema: services (alias: srvc)(level, value, type, code) departments(level, date, amount, code) Task: Select code from services where code exists in departments for the same code. SQL:
SELECT code FROM services AS srvc WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.code = srvc.code );
{ "outer_table": "services", "inner_table": "departments", "outer_alias": "srvc", "inner_alias": "dept", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_02172
train
T2
v3
Schema: schedules (alias: schd)(level, name, type, date) sales(level, salary, date, id) Task: Find code from schedules where value exceeds the average value from sales for the same code. SQL:
SELECT code FROM schedules AS schd WHERE value > ( SELECT SUM(value) FROM sales AS sale WHERE sale.code = schd.code );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_02173
train
T2
v2
Schema: categories (alias: catg)(date, code, value, id) regions(level, name, id, status) Task: Find code from categories where a matching record exists in regions with the same level. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = catg.level );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "code", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_02174
train
T2
v3
Schema: staff (alias: empl)(status, value, type, name) departments(type, date, status, level) Task: Find amount from staff where value exceeds the average salary from departments for the same level. SQL:
SELECT amount FROM staff AS empl WHERE value > ( SELECT MIN(salary) FROM departments AS dept WHERE dept.level = empl.level );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_02175
train
T2
v3
Schema: transactions (alias: txn)(value, level, id, salary) warehouses(value, status, type, code) Task: Find value from transactions where value exceeds the average amount from warehouses for the same level. SQL:
SELECT value FROM transactions AS txn WHERE value > ( SELECT SUM(amount) FROM warehouses AS whs WHERE whs.level = txn.level );
{ "outer_table": "transactions", "inner_table": "warehouses", "outer_alias": "txn", "inner_alias": "whs", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_02176
train
T1
v3
Schema: requests (alias: ordr)(date, code, status, salary) categories(date, code, level, status) Task: Retrieve amount from requests with salary above the SUM(value) of categories rows sharing the same id. SQL:
SELECT amount FROM requests AS ordr WHERE salary > ( SELECT SUM(value) FROM categories AS catg WHERE catg.id = ordr.id );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_02177
train
T2
v2
Schema: requests (alias: ordr)(type, date, name, salary) transactions(code, salary, type, value) Task: Retrieve amount from requests that have at least one corresponding entry in transactions sharing the same code. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = ordr.code );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "amount", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_02178
train
T2
v1
Schema: warehouses (alias: whs)(level, status, value, amount) accounts(status, name, value, code) Task: Find amount from warehouses where id appears in accounts entries with matching type. SQL:
SELECT amount FROM warehouses AS whs WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "accounts", "outer_alias": "whs", "inner_alias": "acct", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_02179
train
T2
v3
Schema: categories (alias: catg)(status, salary, code, id) employees(status, amount, level, code) Task: Find salary from categories where amount exceeds the average salary from employees for the same type. SQL:
SELECT salary FROM categories AS catg WHERE amount > ( SELECT SUM(salary) FROM employees AS emp WHERE emp.type = catg.type );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_02180
train
T2
v3
Schema: regions (alias: rgn)(level, value, id, amount) schedules(date, status, salary, name) Task: Retrieve code from regions with value above the SUM(amount) of schedules rows sharing the same status. SQL:
SELECT code FROM regions AS rgn WHERE value > ( SELECT SUM(amount) FROM schedules AS schd WHERE schd.status = rgn.status );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_02181
train
T2
v3
Schema: products (alias: prod)(type, name, date, value) transactions(type, amount, code, name) Task: Find code from products where value exceeds the average value from transactions for the same status. SQL:
SELECT code FROM products AS prod WHERE value > ( SELECT AVG(value) FROM transactions AS txn WHERE txn.status = prod.status );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_02182
train
T1
v3
Schema: managers (alias: mgr)(id, date, name, salary) departments(status, name, level, type) Task: Find code from managers where salary exceeds the average value from departments for the same level. SQL:
SELECT code FROM managers AS mgr WHERE salary > ( SELECT MIN(value) FROM departments AS dept WHERE dept.level = mgr.level );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_02183
train
T1
v3
Schema: categories (alias: catg)(amount, code, value, salary) employees(level, status, name, code) Task: Retrieve value from categories with salary above the SUM(amount) of employees rows sharing the same type. SQL:
SELECT value FROM categories AS catg WHERE salary > ( SELECT SUM(amount) FROM employees AS emp WHERE emp.type = catg.type );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_02184
train
T2
v3
Schema: services (alias: srvc)(code, name, value, amount) warehouses(code, date, amount, level) Task: Find id from services where value exceeds the average amount from warehouses for the same code. SQL:
SELECT id FROM services AS srvc WHERE value > ( SELECT MIN(amount) FROM warehouses AS whs WHERE whs.code = srvc.code );
{ "outer_table": "services", "inner_table": "warehouses", "outer_alias": "srvc", "inner_alias": "whs", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_02185
train
T2
v1
Schema: transactions (alias: txn)(level, status, name, amount) sales(salary, type, code, amount) Task: Retrieve code from transactions whose status is found in sales rows where status matches the outer record. SQL:
SELECT code FROM transactions AS txn WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.status = txn.status );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "code", "filter_col": "status", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_02186
train
T1
v2
Schema: shipments (alias: shp)(type, level, date, name) invoices(id, level, value, status) Task: Find id from shipments where a matching record exists in invoices with the same level. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = shp.level );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "id", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_02187
train
T2
v2
Schema: staff (alias: empl)(value, status, type, name) employees(salary, type, code, amount) Task: Retrieve id from staff that have at least one corresponding entry in employees sharing the same level. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = empl.level );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "id", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_02188
train
T2
v3
Schema: warehouses (alias: whs)(level, date, name, code) schedules(name, salary, status, amount) Task: Retrieve code from warehouses with amount above the MAX(salary) of schedules rows sharing the same status. SQL:
SELECT code FROM warehouses AS whs WHERE amount > ( SELECT MAX(salary) FROM schedules AS schd WHERE schd.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "schedules", "outer_alias": "whs", "inner_alias": "schd", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_02189
train
T2
v3
Schema: customers (alias: cust)(date, code, status, value) sales(type, level, id, salary) Task: Retrieve salary from customers with amount above the SUM(amount) of sales rows sharing the same type. SQL:
SELECT salary FROM customers AS cust WHERE amount > ( SELECT SUM(amount) FROM sales AS sale WHERE sale.type = cust.type );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_02190
train
T1
v3
Schema: invoices (alias: inv)(name, salary, level, id) departments(level, amount, type, name) Task: Find salary from invoices where salary exceeds the average value from departments for the same code. SQL:
SELECT salary FROM invoices AS inv WHERE salary > ( SELECT MIN(value) FROM departments AS dept WHERE dept.code = inv.code );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_02191
train
T1
v2
Schema: staff (alias: empl)(date, code, name, level) shipments(type, id, level, status) Task: Find salary from staff where a matching record exists in shipments with the same id. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = empl.id );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "salary", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_02192
train
T2
v3
Schema: schedules (alias: schd)(type, id, name, salary) products(type, status, value, amount) Task: Retrieve amount from schedules with value above the SUM(amount) of products rows sharing the same id. SQL:
SELECT amount FROM schedules AS schd WHERE value > ( SELECT SUM(amount) FROM products AS prod WHERE prod.id = schd.id );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_02193
train
T2
v2
Schema: regions (alias: rgn)(name, type, id, value) customers(amount, type, status, id) Task: Retrieve name from regions that have at least one corresponding entry in customers sharing the same status. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = rgn.status );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "name", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_02194
train
T2
v2
Schema: warehouses (alias: whs)(level, type, status, salary) budgets(level, name, amount, type) Task: Retrieve value from warehouses that have at least one corresponding entry in budgets sharing the same id. SQL:
SELECT value FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "budgets", "outer_alias": "whs", "inner_alias": "budg", "proj_col": "value", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_02195
train
T2
v3
Schema: managers (alias: mgr)(level, salary, value, code) customers(salary, name, code, amount) Task: Find amount from managers where amount exceeds the average value from customers for the same id. SQL:
SELECT amount FROM managers AS mgr WHERE amount > ( SELECT COUNT(value) FROM customers AS cust WHERE cust.id = mgr.id );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_02196
train
T1
v1
Schema: sales (alias: sale)(amount, id, value, name) shipments(value, level, date, code) Task: Select value from sales where id exists in shipments for the same code. SQL:
SELECT value FROM sales AS sale WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.code = sale.code );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_02197
train
T1
v2
Schema: invoices (alias: inv)(id, salary, date, amount) services(name, salary, id, status) Task: Find salary from invoices where a matching record exists in services with the same type. SQL:
SELECT salary FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.type = inv.type );
{ "outer_table": "invoices", "inner_table": "services", "outer_alias": "inv", "inner_alias": "srvc", "proj_col": "salary", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_02198
train
T1
v3
Schema: transactions (alias: txn)(name, id, salary, date) employees(amount, status, date, type) Task: Retrieve value from transactions with value above the AVG(salary) of employees rows sharing the same id. SQL:
SELECT value FROM transactions AS txn WHERE value > ( SELECT AVG(salary) FROM employees AS emp WHERE emp.id = txn.id );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_02199
train
T1