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: regions (alias: rgn)(name, id, date, type) employees(status, level, id, code) Task: Retrieve value from regions whose id is found in employees rows where type matches the outer record. SQL:
SELECT value FROM regions AS rgn WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.type = rgn.type );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_05100
train
T2
v3
Schema: categories (alias: catg)(type, value, name, status) customers(type, code, status, name) Task: Find name from categories where value exceeds the average salary from customers for the same status. SQL:
SELECT name FROM categories AS catg WHERE value > ( SELECT COUNT(salary) FROM customers AS cust WHERE cust.status = catg.status );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_05101
train
T2
v2
Schema: regions (alias: rgn)(date, status, value, salary) customers(amount, salary, status, id) Task: Retrieve value from regions that have at least one corresponding entry in customers sharing the same level. SQL:
SELECT value FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = rgn.level );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "value", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_05102
train
T2
v1
Schema: employees (alias: emp)(name, code, id, level) services(name, status, code, level) Task: Select id from employees where level exists in services for the same type. SQL:
SELECT id FROM employees AS emp WHERE level IN ( SELECT level FROM services AS srvc WHERE srvc.type = emp.type );
{ "outer_table": "employees", "inner_table": "services", "outer_alias": "emp", "inner_alias": "srvc", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_05103
train
T1
v2
Schema: categories (alias: catg)(id, name, value, status) schedules(level, value, salary, code) Task: Find id from categories where a matching record exists in schedules with the same status. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = catg.status );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "id", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_05104
train
T2
v2
Schema: sales (alias: sale)(name, status, type, amount) warehouses(status, amount, id, date) Task: Find salary from sales where a matching record exists in warehouses with the same type. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.type = sale.type );
{ "outer_table": "sales", "inner_table": "warehouses", "outer_alias": "sale", "inner_alias": "whs", "proj_col": "salary", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_05105
train
T1
v3
Schema: categories (alias: catg)(type, level, date, name) invoices(amount, level, type, date) Task: Find value from categories where amount exceeds the average amount from invoices for the same code. SQL:
SELECT value FROM categories AS catg WHERE amount > ( SELECT COUNT(amount) FROM invoices AS inv WHERE inv.code = catg.code );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_05106
train
T2
v1
Schema: items (alias: lne)(value, code, level, amount) sales(salary, value, code, amount) Task: Select salary from items where code exists in sales for the same type. SQL:
SELECT salary FROM items AS lne WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.type = lne.type );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_05107
train
T2
v1
Schema: orders (alias: ord)(amount, status, id, code) items(status, name, salary, type) Task: Select code from orders where status exists in items for the same code. SQL:
SELECT code FROM orders AS ord WHERE status IN ( SELECT status FROM items AS lne WHERE lne.code = ord.code );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "code", "filter_col": "status", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_05108
train
T1
v3
Schema: shipments (alias: shp)(value, date, salary, code) managers(code, level, type, amount) Task: Retrieve name from shipments with salary above the SUM(amount) of managers rows sharing the same level. SQL:
SELECT name FROM shipments AS shp WHERE salary > ( SELECT SUM(amount) FROM managers AS mgr WHERE mgr.level = shp.level );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_05109
train
T2
v2
Schema: managers (alias: mgr)(date, salary, amount, type) services(status, code, level, name) Task: Retrieve salary from managers that have at least one corresponding entry in services sharing the same status. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.status = mgr.status );
{ "outer_table": "managers", "inner_table": "services", "outer_alias": "mgr", "inner_alias": "srvc", "proj_col": "salary", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_05110
train
T1
v3
Schema: managers (alias: mgr)(type, date, salary, status) shipments(amount, code, name, type) Task: Find salary from managers where amount exceeds the average amount from shipments for the same code. SQL:
SELECT salary FROM managers AS mgr WHERE amount > ( SELECT SUM(amount) FROM shipments AS shp WHERE shp.code = mgr.code );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_05111
train
T1
v3
Schema: transactions (alias: txn)(date, id, status, level) requests(status, value, salary, date) Task: Retrieve amount from transactions with value above the AVG(value) of requests rows sharing the same status. SQL:
SELECT amount FROM transactions AS txn WHERE value > ( SELECT AVG(value) FROM requests AS ordr WHERE ordr.status = txn.status );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_05112
train
T1
v1
Schema: employees (alias: emp)(code, salary, date, value) invoices(salary, code, value, amount) Task: Retrieve code from employees whose code is found in invoices rows where level matches the outer record. SQL:
SELECT code FROM employees AS emp WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.level = emp.level );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "code", "filter_col": "code", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_05113
train
T1
v2
Schema: categories (alias: catg)(status, level, code, id) employees(amount, code, name, value) Task: Find salary from categories where a matching record exists in employees with the same code. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = catg.code );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "salary", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_05114
train
T2
v1
Schema: shipments (alias: shp)(name, salary, value, type) invoices(id, level, value, type) Task: Select name from shipments where status exists in invoices for the same code. SQL:
SELECT name FROM shipments AS shp WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.code = shp.code );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_05115
train
T2
v3
Schema: categories (alias: catg)(type, amount, name, date) employees(type, id, salary, name) Task: Retrieve salary from categories with value above the MIN(salary) of employees rows sharing the same id. SQL:
SELECT salary FROM categories AS catg WHERE value > ( SELECT MIN(salary) FROM employees AS emp WHERE emp.id = catg.id );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_05116
train
T2
v2
Schema: staff (alias: empl)(value, type, status, level) services(id, type, value, salary) Task: Find code from staff where a matching record exists in services with the same id. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = empl.id );
{ "outer_table": "staff", "inner_table": "services", "outer_alias": "empl", "inner_alias": "srvc", "proj_col": "code", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_05117
train
T2
v2
Schema: warehouses (alias: whs)(code, date, type, salary) categories(status, id, level, salary) Task: Retrieve id from warehouses that have at least one corresponding entry in categories sharing the same type. SQL:
SELECT id FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "categories", "outer_alias": "whs", "inner_alias": "catg", "proj_col": "id", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_05118
train
T2
v3
Schema: sales (alias: sale)(code, name, value, status) budgets(salary, amount, type, name) Task: Retrieve code from sales with salary above the AVG(value) of budgets rows sharing the same type. SQL:
SELECT code FROM sales AS sale WHERE salary > ( SELECT AVG(value) FROM budgets AS budg WHERE budg.type = sale.type );
{ "outer_table": "sales", "inner_table": "budgets", "outer_alias": "sale", "inner_alias": "budg", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_05119
train
T1
v1
Schema: services (alias: srvc)(amount, level, value, name) employees(value, level, type, status) Task: Find name from services where status appears in employees entries with matching type. SQL:
SELECT name FROM services AS srvc WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.type = srvc.type );
{ "outer_table": "services", "inner_table": "employees", "outer_alias": "srvc", "inner_alias": "emp", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_05120
train
T2
v1
Schema: categories (alias: catg)(id, code, value, name) budgets(amount, salary, code, date) Task: Retrieve value from categories whose id is found in budgets rows where code matches the outer record. SQL:
SELECT value FROM categories AS catg WHERE id IN ( SELECT id FROM budgets AS budg WHERE budg.code = catg.code );
{ "outer_table": "categories", "inner_table": "budgets", "outer_alias": "catg", "inner_alias": "budg", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_05121
train
T2
v3
Schema: categories (alias: catg)(date, id, code, type) regions(type, amount, level, status) Task: Retrieve name from categories with salary above the AVG(value) of regions rows sharing the same level. SQL:
SELECT name FROM categories AS catg WHERE salary > ( SELECT AVG(value) FROM regions AS rgn WHERE rgn.level = catg.level );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_05122
train
T2
v2
Schema: invoices (alias: inv)(value, status, salary, type) departments(status, name, salary, type) Task: Retrieve name from invoices that have at least one corresponding entry in departments sharing the same level. SQL:
SELECT name FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = inv.level );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "name", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_05123
train
T1
v3
Schema: warehouses (alias: whs)(amount, type, name, code) products(amount, type, status, level) Task: Find code from warehouses where value exceeds the average value from products for the same code. SQL:
SELECT code FROM warehouses AS whs WHERE value > ( SELECT MAX(value) FROM products AS prod WHERE prod.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "products", "outer_alias": "whs", "inner_alias": "prod", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_05124
train
T2
v1
Schema: sales (alias: sale)(salary, type, code, level) schedules(salary, date, level, type) Task: Retrieve id from sales whose status is found in schedules rows where level matches the outer record. SQL:
SELECT id FROM sales AS sale WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.level = sale.level );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "id", "filter_col": "status", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_05125
train
T1
v1
Schema: employees (alias: emp)(type, date, amount, salary) warehouses(code, status, type, id) Task: Select amount from employees where type exists in warehouses for the same code. SQL:
SELECT amount FROM employees AS emp WHERE type IN ( SELECT type FROM warehouses AS whs WHERE whs.code = emp.code );
{ "outer_table": "employees", "inner_table": "warehouses", "outer_alias": "emp", "inner_alias": "whs", "proj_col": "amount", "filter_col": "type", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_05126
train
T1
v2
Schema: invoices (alias: inv)(code, id, amount, date) customers(salary, name, amount, level) Task: Find amount from invoices where a matching record exists in customers with the same id. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = inv.id );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "amount", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_05127
train
T1
v1
Schema: employees (alias: emp)(salary, status, level, amount) services(level, id, name, code) Task: Find code from employees where type appears in services entries with matching type. SQL:
SELECT code FROM employees AS emp WHERE type IN ( SELECT type FROM services AS srvc WHERE srvc.type = emp.type );
{ "outer_table": "employees", "inner_table": "services", "outer_alias": "emp", "inner_alias": "srvc", "proj_col": "code", "filter_col": "type", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_05128
train
T1
v1
Schema: staff (alias: empl)(type, id, value, name) requests(value, date, name, id) Task: Select id from staff where status exists in requests for the same status. SQL:
SELECT id FROM staff AS empl WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.status = empl.status );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_05129
train
T2
v3
Schema: managers (alias: mgr)(date, name, value, amount) budgets(name, status, type, date) Task: Find name from managers where salary exceeds the average value from budgets for the same code. SQL:
SELECT name FROM managers AS mgr WHERE salary > ( SELECT MIN(value) FROM budgets AS budg WHERE budg.code = mgr.code );
{ "outer_table": "managers", "inner_table": "budgets", "outer_alias": "mgr", "inner_alias": "budg", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_05130
train
T1
v1
Schema: services (alias: srvc)(type, code, amount, status) accounts(level, status, code, value) Task: Retrieve value from services whose type is found in accounts rows where status matches the outer record. SQL:
SELECT value FROM services AS srvc WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.status = srvc.status );
{ "outer_table": "services", "inner_table": "accounts", "outer_alias": "srvc", "inner_alias": "acct", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_05131
train
T2
v1
Schema: accounts (alias: acct)(amount, status, name, value) products(id, name, amount, code) Task: Select code from accounts where type exists in products for the same id. SQL:
SELECT code FROM accounts AS acct WHERE type IN ( SELECT type FROM products AS prod WHERE prod.id = acct.id );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "code", "filter_col": "type", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_05132
train
T1
v2
Schema: requests (alias: ordr)(level, id, amount, salary) sales(value, level, amount, type) Task: Retrieve amount from requests that have at least one corresponding entry in sales sharing the same status. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = ordr.status );
{ "outer_table": "requests", "inner_table": "sales", "outer_alias": "ordr", "inner_alias": "sale", "proj_col": "amount", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_05133
train
T2
v3
Schema: customers (alias: cust)(type, value, amount, date) staff(date, level, salary, name) Task: Retrieve value from customers with salary above the AVG(salary) of staff rows sharing the same id. SQL:
SELECT value FROM customers AS cust WHERE salary > ( SELECT AVG(salary) FROM staff AS empl WHERE empl.id = cust.id );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_05134
train
T1
v3
Schema: regions (alias: rgn)(value, date, level, code) customers(id, amount, value, level) Task: Retrieve salary from regions with value above the AVG(amount) of customers rows sharing the same type. SQL:
SELECT salary FROM regions AS rgn WHERE value > ( SELECT AVG(amount) FROM customers AS cust WHERE cust.type = rgn.type );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_05135
train
T2
v1
Schema: requests (alias: ordr)(name, type, date, code) employees(status, level, date, salary) Task: Select salary from requests where status exists in employees for the same type. SQL:
SELECT salary FROM requests AS ordr WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.type = ordr.type );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_05136
train
T2
v2
Schema: services (alias: srvc)(code, amount, salary, type) transactions(name, date, id, status) Task: Find value from services where a matching record exists in transactions with the same status. SQL:
SELECT value FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = srvc.status );
{ "outer_table": "services", "inner_table": "transactions", "outer_alias": "srvc", "inner_alias": "txn", "proj_col": "value", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_05137
train
T2
v1
Schema: categories (alias: catg)(amount, name, date, level) customers(value, amount, id, salary) Task: Retrieve salary from categories whose status is found in customers rows where id matches the outer record. SQL:
SELECT salary FROM categories AS catg WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.id = catg.id );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "salary", "filter_col": "status", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_05138
train
T2
v2
Schema: accounts (alias: acct)(level, status, name, amount) shipments(name, salary, date, id) Task: Find code from accounts where a matching record exists in shipments with the same level. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = acct.level );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "code", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_05139
train
T1
v3
Schema: invoices (alias: inv)(id, code, level, name) departments(name, salary, amount, type) Task: Find value from invoices where value exceeds the average value from departments for the same id. SQL:
SELECT value FROM invoices AS inv WHERE value > ( SELECT MAX(value) FROM departments AS dept WHERE dept.id = inv.id );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_05140
train
T1
v3
Schema: orders (alias: ord)(id, value, amount, level) categories(salary, type, code, status) Task: Retrieve value from orders with salary above the MAX(salary) of categories rows sharing the same code. SQL:
SELECT value FROM orders AS ord WHERE salary > ( SELECT MAX(salary) FROM categories AS catg WHERE catg.code = ord.code );
{ "outer_table": "orders", "inner_table": "categories", "outer_alias": "ord", "inner_alias": "catg", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_05141
train
T1
v3
Schema: regions (alias: rgn)(code, value, id, level) departments(name, amount, level, id) Task: Find name from regions where value exceeds the average value from departments for the same level. SQL:
SELECT name FROM regions AS rgn WHERE value > ( SELECT MAX(value) FROM departments AS dept WHERE dept.level = rgn.level );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_05142
train
T2
v3
Schema: departments (alias: dept)(date, value, salary, amount) services(code, name, level, status) Task: Find code from departments where salary exceeds the average salary from services for the same type. SQL:
SELECT code FROM departments AS dept WHERE salary > ( SELECT MAX(salary) FROM services AS srvc WHERE srvc.type = dept.type );
{ "outer_table": "departments", "inner_table": "services", "outer_alias": "dept", "inner_alias": "srvc", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_05143
train
T1
v3
Schema: warehouses (alias: whs)(name, id, date, value) accounts(type, id, status, amount) Task: Find salary from warehouses where amount exceeds the average salary from accounts for the same status. SQL:
SELECT salary FROM warehouses AS whs WHERE amount > ( SELECT MAX(salary) FROM accounts AS acct WHERE acct.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "accounts", "outer_alias": "whs", "inner_alias": "acct", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_05144
train
T2
v2
Schema: shipments (alias: shp)(value, amount, date, level) sales(name, id, code, type) Task: Find value from shipments where a matching record exists in sales with the same level. SQL:
SELECT value FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = shp.level );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "value", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_05145
train
T2
v1
Schema: orders (alias: ord)(value, salary, id, date) schedules(type, name, code, value) Task: Select name from orders where type exists in schedules for the same type. SQL:
SELECT name FROM orders AS ord WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.type = ord.type );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "name", "filter_col": "type", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_05146
train
T1
v1
Schema: accounts (alias: acct)(type, date, id, code) requests(status, amount, name, type) Task: Retrieve amount from accounts whose id is found in requests rows where status matches the outer record. SQL:
SELECT amount FROM accounts AS acct WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.status = acct.status );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_05147
train
T1
v3
Schema: shipments (alias: shp)(level, status, salary, amount) categories(amount, type, value, salary) Task: Find value from shipments where amount exceeds the average salary from categories for the same id. SQL:
SELECT value FROM shipments AS shp WHERE amount > ( SELECT SUM(salary) FROM categories AS catg WHERE catg.id = shp.id );
{ "outer_table": "shipments", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "catg", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_05148
train
T2
v3
Schema: categories (alias: catg)(salary, value, status, id) services(status, type, value, salary) Task: Retrieve code from categories with salary above the COUNT(amount) of services rows sharing the same id. SQL:
SELECT code FROM categories AS catg WHERE salary > ( SELECT COUNT(amount) FROM services AS srvc WHERE srvc.id = catg.id );
{ "outer_table": "categories", "inner_table": "services", "outer_alias": "catg", "inner_alias": "srvc", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_05149
train
T2
v1
Schema: accounts (alias: acct)(id, salary, status, type) schedules(status, name, salary, amount) Task: Find value from accounts where code appears in schedules entries with matching id. SQL:
SELECT value FROM accounts AS acct WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.id = acct.id );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_05150
train
T1
v2
Schema: warehouses (alias: whs)(level, amount, status, salary) managers(type, salary, level, name) Task: Find salary from warehouses where a matching record exists in managers with the same code. SQL:
SELECT salary FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "managers", "outer_alias": "whs", "inner_alias": "mgr", "proj_col": "salary", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_05151
train
T2
v2
Schema: items (alias: lne)(value, level, code, status) sales(date, name, id, value) Task: Retrieve amount from items that have at least one corresponding entry in sales sharing the same type. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = lne.type );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "amount", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_05152
train
T2
v2
Schema: sales (alias: sale)(code, status, date, type) items(id, date, salary, value) Task: Retrieve id from sales that have at least one corresponding entry in items sharing the same level. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.level = sale.level );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "id", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_05153
train
T1
v2
Schema: staff (alias: empl)(amount, level, value, id) orders(type, salary, id, amount) Task: Retrieve value from staff that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = empl.code );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "value", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_05154
train
T2
v2
Schema: categories (alias: catg)(date, status, name, type) regions(name, date, code, value) Task: Find code from categories where a matching record exists in regions with the same code. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = catg.code );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "code", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_05155
train
T2
v3
Schema: shipments (alias: shp)(name, id, status, type) invoices(code, id, value, level) Task: Find salary from shipments where value exceeds the average salary from invoices for the same type. SQL:
SELECT salary FROM shipments AS shp WHERE value > ( SELECT AVG(salary) FROM invoices AS inv WHERE inv.type = shp.type );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_05156
train
T2
v3
Schema: employees (alias: emp)(code, name, salary, amount) regions(code, type, id, level) Task: Find code from employees where value exceeds the average value from regions for the same status. SQL:
SELECT code FROM employees AS emp WHERE value > ( SELECT MIN(value) FROM regions AS rgn WHERE rgn.status = emp.status );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_05157
train
T1
v3
Schema: accounts (alias: acct)(name, date, id, salary) regions(value, id, status, salary) Task: Find id from accounts where value exceeds the average amount from regions for the same id. SQL:
SELECT id FROM accounts AS acct WHERE value > ( SELECT COUNT(amount) FROM regions AS rgn WHERE rgn.id = acct.id );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_05158
train
T1
v1
Schema: sales (alias: sale)(value, salary, amount, date) services(status, amount, id, salary) Task: Retrieve code from sales whose status is found in services rows where code matches the outer record. SQL:
SELECT code FROM sales AS sale WHERE status IN ( SELECT status FROM services AS srvc WHERE srvc.code = sale.code );
{ "outer_table": "sales", "inner_table": "services", "outer_alias": "sale", "inner_alias": "srvc", "proj_col": "code", "filter_col": "status", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_05159
train
T1
v3
Schema: transactions (alias: txn)(value, id, level, date) warehouses(date, amount, name, salary) Task: Retrieve salary from transactions with amount above the SUM(amount) of warehouses rows sharing the same type. SQL:
SELECT salary FROM transactions AS txn WHERE amount > ( SELECT SUM(amount) FROM warehouses AS whs WHERE whs.type = txn.type );
{ "outer_table": "transactions", "inner_table": "warehouses", "outer_alias": "txn", "inner_alias": "whs", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_05160
train
T1
v1
Schema: departments (alias: dept)(name, id, value, code) categories(amount, value, salary, name) Task: Find value from departments where level appears in categories entries with matching code. SQL:
SELECT value FROM departments AS dept WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.code = dept.code );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_05161
train
T1
v1
Schema: requests (alias: ordr)(salary, type, name, value) products(code, name, value, salary) Task: Retrieve name from requests whose level is found in products rows where type matches the outer record. SQL:
SELECT name FROM requests AS ordr WHERE level IN ( SELECT level FROM products AS prod WHERE prod.type = ordr.type );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_05162
train
T2
v1
Schema: departments (alias: dept)(id, value, salary, date) transactions(type, salary, value, amount) Task: Find value from departments where level appears in transactions entries with matching level. SQL:
SELECT value FROM departments AS dept WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.level = dept.level );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_05163
train
T1
v2
Schema: orders (alias: ord)(code, id, type, date) transactions(id, status, date, name) Task: Retrieve value from orders that have at least one corresponding entry in transactions sharing the same code. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = ord.code );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "value", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_05164
train
T1
v3
Schema: requests (alias: ordr)(amount, id, salary, type) regions(value, salary, code, level) Task: Retrieve amount from requests with value above the SUM(amount) of regions rows sharing the same type. SQL:
SELECT amount FROM requests AS ordr WHERE value > ( SELECT SUM(amount) FROM regions AS rgn WHERE rgn.type = ordr.type );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_05165
train
T2
v3
Schema: sales (alias: sale)(type, value, salary, status) invoices(id, status, date, code) Task: Find code from sales where salary exceeds the average salary from invoices for the same level. SQL:
SELECT code FROM sales AS sale WHERE salary > ( SELECT COUNT(salary) FROM invoices AS inv WHERE inv.level = sale.level );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_05166
train
T1
v2
Schema: budgets (alias: budg)(status, type, level, date) invoices(value, code, level, id) Task: Find salary from budgets where a matching record exists in invoices with the same id. SQL:
SELECT salary FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = budg.id );
{ "outer_table": "budgets", "inner_table": "invoices", "outer_alias": "budg", "inner_alias": "inv", "proj_col": "salary", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_05167
train
T2
v2
Schema: budgets (alias: budg)(value, type, amount, status) managers(type, name, date, amount) Task: Retrieve code from budgets that have at least one corresponding entry in managers sharing the same type. SQL:
SELECT code FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = budg.type );
{ "outer_table": "budgets", "inner_table": "managers", "outer_alias": "budg", "inner_alias": "mgr", "proj_col": "code", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_05168
train
T2
v3
Schema: managers (alias: mgr)(level, name, date, id) schedules(type, date, level, name) Task: Find id from managers where salary exceeds the average amount from schedules for the same code. SQL:
SELECT id FROM managers AS mgr WHERE salary > ( SELECT MIN(amount) FROM schedules AS schd WHERE schd.code = mgr.code );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_05169
train
T1
v3
Schema: employees (alias: emp)(id, date, amount, code) budgets(value, status, id, code) Task: Retrieve amount from employees with value above the SUM(value) of budgets rows sharing the same type. SQL:
SELECT amount FROM employees AS emp WHERE value > ( SELECT SUM(value) FROM budgets AS budg WHERE budg.type = emp.type );
{ "outer_table": "employees", "inner_table": "budgets", "outer_alias": "emp", "inner_alias": "budg", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_05170
train
T1
v2
Schema: regions (alias: rgn)(value, code, amount, date) shipments(date, level, name, amount) Task: Retrieve id from regions that have at least one corresponding entry in shipments sharing the same level. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = rgn.level );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "id", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_05171
train
T2
v3
Schema: products (alias: prod)(amount, level, value, salary) shipments(amount, date, value, id) Task: Retrieve code from products with value above the AVG(amount) of shipments rows sharing the same type. SQL:
SELECT code FROM products AS prod WHERE value > ( SELECT AVG(amount) FROM shipments AS shp WHERE shp.type = prod.type );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_05172
train
T1
v2
Schema: requests (alias: ordr)(salary, level, id, amount) schedules(date, code, id, level) Task: Retrieve id from requests that have at least one corresponding entry in schedules sharing the same code. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = ordr.code );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "id", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_05173
train
T2
v1
Schema: products (alias: prod)(id, status, salary, type) employees(amount, id, salary, status) Task: Find value from products where level appears in employees entries with matching id. SQL:
SELECT value FROM products AS prod WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.id = prod.id );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "value", "filter_col": "level", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_05174
train
T1
v1
Schema: products (alias: prod)(name, status, type, value) employees(value, type, salary, id) Task: Find amount from products where status appears in employees entries with matching level. SQL:
SELECT amount FROM products AS prod WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.level = prod.level );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_05175
train
T1
v2
Schema: orders (alias: ord)(code, date, status, salary) services(status, value, date, level) Task: Find salary from orders where a matching record exists in services with the same status. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.status = ord.status );
{ "outer_table": "orders", "inner_table": "services", "outer_alias": "ord", "inner_alias": "srvc", "proj_col": "salary", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_05176
train
T1
v2
Schema: items (alias: lne)(level, id, type, status) accounts(amount, code, id, value) Task: Find name from items where a matching record exists in accounts with the same type. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = lne.type );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "name", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_05177
train
T2
v2
Schema: requests (alias: ordr)(date, amount, status, type) sales(status, date, level, type) Task: Find code from requests where a matching record exists in sales with the same id. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = ordr.id );
{ "outer_table": "requests", "inner_table": "sales", "outer_alias": "ordr", "inner_alias": "sale", "proj_col": "code", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_05178
train
T2
v2
Schema: regions (alias: rgn)(date, code, salary, name) invoices(type, date, name, level) Task: Find name from regions where a matching record exists in invoices with the same id. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = rgn.id );
{ "outer_table": "regions", "inner_table": "invoices", "outer_alias": "rgn", "inner_alias": "inv", "proj_col": "name", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_05179
train
T2
v3
Schema: shipments (alias: shp)(code, name, value, salary) requests(salary, level, id, status) Task: Retrieve amount from shipments with value above the MAX(amount) of requests rows sharing the same status. SQL:
SELECT amount FROM shipments AS shp WHERE value > ( SELECT MAX(amount) FROM requests AS ordr WHERE ordr.status = shp.status );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_05180
train
T2
v1
Schema: requests (alias: ordr)(id, value, type, level) orders(level, date, type, amount) Task: Select id from requests where level exists in orders for the same level. SQL:
SELECT id FROM requests AS ordr WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.level = ordr.level );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_05181
train
T2
v3
Schema: sales (alias: sale)(status, amount, level, code) shipments(code, id, amount, type) Task: Find salary from sales where amount exceeds the average salary from shipments for the same status. SQL:
SELECT salary FROM sales AS sale WHERE amount > ( SELECT SUM(salary) FROM shipments AS shp WHERE shp.status = sale.status );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_05182
train
T1
v1
Schema: warehouses (alias: whs)(name, code, type, date) items(name, type, id, salary) Task: Find value from warehouses where id appears in items entries with matching code. SQL:
SELECT value FROM warehouses AS whs WHERE id IN ( SELECT id FROM items AS lne WHERE lne.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "items", "outer_alias": "whs", "inner_alias": "lne", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_05183
train
T2
v2
Schema: shipments (alias: shp)(level, type, status, salary) managers(name, date, type, amount) Task: Retrieve salary from shipments that have at least one corresponding entry in managers sharing the same code. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = shp.code );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "salary", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_05184
train
T2
v2
Schema: schedules (alias: schd)(amount, value, type, name) customers(name, date, id, type) Task: Retrieve salary from schedules that have at least one corresponding entry in customers sharing the same type. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = schd.type );
{ "outer_table": "schedules", "inner_table": "customers", "outer_alias": "schd", "inner_alias": "cust", "proj_col": "salary", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_05185
train
T2
v3
Schema: staff (alias: empl)(level, value, name, amount) regions(code, level, id, date) Task: Find value from staff where salary exceeds the average value from regions for the same id. SQL:
SELECT value FROM staff AS empl WHERE salary > ( SELECT AVG(value) FROM regions AS rgn WHERE rgn.id = empl.id );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_05186
train
T2
v2
Schema: accounts (alias: acct)(level, id, name, date) budgets(id, salary, level, value) Task: Find salary from accounts where a matching record exists in budgets with the same level. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.level = acct.level );
{ "outer_table": "accounts", "inner_table": "budgets", "outer_alias": "acct", "inner_alias": "budg", "proj_col": "salary", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_05187
train
T1
v3
Schema: staff (alias: empl)(amount, salary, value, date) departments(type, name, salary, status) Task: Retrieve code from staff with salary above the SUM(value) of departments rows sharing the same id. SQL:
SELECT code FROM staff AS empl WHERE salary > ( SELECT SUM(value) FROM departments AS dept WHERE dept.id = empl.id );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_05188
train
T2
v1
Schema: transactions (alias: txn)(id, name, type, salary) managers(type, date, salary, name) Task: Retrieve amount from transactions whose code is found in managers rows where code matches the outer record. SQL:
SELECT amount FROM transactions AS txn WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.code = txn.code );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_05189
train
T1
v2
Schema: transactions (alias: txn)(status, level, id, date) warehouses(name, status, level, type) Task: Retrieve amount from transactions that have at least one corresponding entry in warehouses sharing the same type. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.type = txn.type );
{ "outer_table": "transactions", "inner_table": "warehouses", "outer_alias": "txn", "inner_alias": "whs", "proj_col": "amount", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_05190
train
T1
v3
Schema: products (alias: prod)(amount, level, id, name) managers(date, salary, status, value) Task: Retrieve id from products with value above the MIN(amount) of managers rows sharing the same type. SQL:
SELECT id FROM products AS prod WHERE value > ( SELECT MIN(amount) FROM managers AS mgr WHERE mgr.type = prod.type );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_05191
train
T1
v2
Schema: invoices (alias: inv)(salary, status, value, date) departments(level, name, value, type) Task: Find code from invoices where a matching record exists in departments with the same type. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = inv.type );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_05192
train
T1
v3
Schema: employees (alias: emp)(date, type, salary, name) shipments(level, date, name, type) Task: Find salary from employees where salary exceeds the average amount from shipments for the same status. SQL:
SELECT salary FROM employees AS emp WHERE salary > ( SELECT MAX(amount) FROM shipments AS shp WHERE shp.status = emp.status );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_05193
train
T1
v1
Schema: invoices (alias: inv)(value, id, type, level) staff(type, name, salary, amount) Task: Retrieve id from invoices whose level is found in staff rows where code matches the outer record. SQL:
SELECT id FROM invoices AS inv WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.code = inv.code );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_05194
train
T1
v1
Schema: items (alias: lne)(status, date, amount, value) orders(level, amount, name, id) Task: Retrieve name from items whose level is found in orders rows where type matches the outer record. SQL:
SELECT name FROM items AS lne WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.type = lne.type );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_05195
train
T2
v2
Schema: schedules (alias: schd)(salary, level, type, id) accounts(id, type, status, amount) Task: Find id from schedules where a matching record exists in accounts with the same id. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = schd.id );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "id", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_05196
train
T2
v3
Schema: warehouses (alias: whs)(name, id, amount, date) requests(level, salary, status, code) Task: Retrieve salary from warehouses with salary above the MIN(amount) of requests rows sharing the same status. SQL:
SELECT salary FROM warehouses AS whs WHERE salary > ( SELECT MIN(amount) FROM requests AS ordr WHERE ordr.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "requests", "outer_alias": "whs", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_05197
train
T2
v1
Schema: categories (alias: catg)(level, date, name, status) budgets(id, name, type, date) Task: Retrieve value from categories whose id is found in budgets rows where level matches the outer record. SQL:
SELECT value FROM categories AS catg WHERE id IN ( SELECT id FROM budgets AS budg WHERE budg.level = catg.level );
{ "outer_table": "categories", "inner_table": "budgets", "outer_alias": "catg", "inner_alias": "budg", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_05198
train
T2
v2
Schema: requests (alias: ordr)(status, type, value, salary) invoices(level, date, id, code) Task: Find name from requests where a matching record exists in invoices with the same level. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = ordr.level );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "name", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_05199
train
T2