variant
stringclasses
3 values
prompt
stringlengths
163
237
sql
stringlengths
103
143
metadata
unknown
id
stringlengths
21
21
split
stringclasses
1 value
token_group
stringclasses
2 values
v3
Schema: invoices (alias: inv)(salary, value, level, status) accounts(status, value, level, code) Task: Find id from invoices where value exceeds the average value from accounts for the same code. SQL:
SELECT id FROM invoices AS inv WHERE value > ( SELECT COUNT(value) FROM accounts AS acct WHERE acct.code = inv.code );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_11400
train
T1
v3
Schema: categories (alias: catg)(value, id, code, status) products(date, value, code, level) Task: Retrieve name from categories with value above the AVG(value) of products rows sharing the same id. SQL:
SELECT name FROM categories AS catg WHERE value > ( SELECT AVG(value) FROM products AS prod WHERE prod.id = catg.id );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_11401
train
T2
v3
Schema: regions (alias: rgn)(name, code, id, type) invoices(type, amount, value, code) Task: Find name from regions where value exceeds the average amount from invoices for the same id. SQL:
SELECT name FROM regions AS rgn WHERE value > ( SELECT MIN(amount) FROM invoices AS inv WHERE inv.id = rgn.id );
{ "outer_table": "regions", "inner_table": "invoices", "outer_alias": "rgn", "inner_alias": "inv", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_11402
train
T2
v3
Schema: customers (alias: cust)(salary, type, id, value) employees(date, level, value, amount) Task: Find name from customers where amount exceeds the average value from employees for the same level. SQL:
SELECT name FROM customers AS cust WHERE amount > ( SELECT SUM(value) FROM employees AS emp WHERE emp.level = cust.level );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_11403
train
T1
v1
Schema: invoices (alias: inv)(name, type, date, code) shipments(value, salary, status, type) Task: Find amount from invoices where level appears in shipments entries with matching code. SQL:
SELECT amount FROM invoices AS inv WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.code = inv.code );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_11404
train
T1
v3
Schema: employees (alias: emp)(id, amount, salary, status) items(status, id, name, level) Task: Retrieve amount from employees with amount above the MIN(value) of items rows sharing the same id. SQL:
SELECT amount FROM employees AS emp WHERE amount > ( SELECT MIN(value) FROM items AS lne WHERE lne.id = emp.id );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_11405
train
T1
v1
Schema: orders (alias: ord)(salary, status, name, value) warehouses(code, date, id, value) Task: Retrieve name from orders whose status is found in warehouses rows where code matches the outer record. SQL:
SELECT name FROM orders AS ord WHERE status IN ( SELECT status FROM warehouses AS whs WHERE whs.code = ord.code );
{ "outer_table": "orders", "inner_table": "warehouses", "outer_alias": "ord", "inner_alias": "whs", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_11406
train
T1
v2
Schema: products (alias: prod)(code, id, salary, level) customers(salary, value, id, type) Task: Find salary from products where a matching record exists in customers with the same type. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = prod.type );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "salary", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_11407
train
T1
v1
Schema: customers (alias: cust)(type, id, value, date) requests(level, salary, status, value) Task: Find id from customers where level appears in requests entries with matching code. SQL:
SELECT id FROM customers AS cust WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.code = cust.code );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_11408
train
T1
v2
Schema: accounts (alias: acct)(value, type, salary, id) regions(amount, type, status, id) Task: Find amount from accounts where a matching record exists in regions with the same status. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = acct.status );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "amount", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_11409
train
T1
v2
Schema: schedules (alias: schd)(name, salary, type, date) managers(salary, level, date, name) Task: Retrieve code from schedules that have at least one corresponding entry in managers sharing the same type. SQL:
SELECT code FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = schd.type );
{ "outer_table": "schedules", "inner_table": "managers", "outer_alias": "schd", "inner_alias": "mgr", "proj_col": "code", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_11410
train
T2
v2
Schema: customers (alias: cust)(name, code, level, type) employees(level, date, status, amount) Task: Retrieve code from customers that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = cust.status );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "code", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_11411
train
T1
v2
Schema: transactions (alias: txn)(level, type, code, name) orders(id, name, value, level) Task: Retrieve value from transactions that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = txn.code );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "value", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_11412
train
T1
v1
Schema: sales (alias: sale)(status, name, type, level) schedules(id, amount, date, code) Task: Find id from sales where type appears in schedules entries with matching id. SQL:
SELECT id FROM sales AS sale WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.id = sale.id );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_11413
train
T1
v3
Schema: categories (alias: catg)(status, type, id, date) customers(id, level, date, name) Task: Find id from categories where amount exceeds the average amount from customers for the same status. SQL:
SELECT id FROM categories AS catg WHERE amount > ( SELECT AVG(amount) FROM customers AS cust WHERE cust.status = catg.status );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_11414
train
T2
v1
Schema: budgets (alias: budg)(type, level, salary, name) requests(code, level, id, date) Task: Select salary from budgets where id exists in requests for the same id. SQL:
SELECT salary FROM budgets AS budg WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.id = budg.id );
{ "outer_table": "budgets", "inner_table": "requests", "outer_alias": "budg", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_11415
train
T2
v1
Schema: schedules (alias: schd)(status, code, amount, id) products(salary, type, value, amount) Task: Retrieve salary from schedules whose type is found in products rows where type matches the outer record. SQL:
SELECT salary FROM schedules AS schd WHERE type IN ( SELECT type FROM products AS prod WHERE prod.type = schd.type );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_11416
train
T2
v1
Schema: staff (alias: empl)(value, id, level, name) products(name, code, date, id) Task: Find amount from staff where level appears in products entries with matching level. SQL:
SELECT amount FROM staff AS empl WHERE level IN ( SELECT level FROM products AS prod WHERE prod.level = empl.level );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "amount", "filter_col": "level", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_11417
train
T2
v3
Schema: departments (alias: dept)(id, level, status, value) categories(amount, name, type, code) Task: Retrieve code from departments with salary above the SUM(salary) of categories rows sharing the same level. SQL:
SELECT code FROM departments AS dept WHERE salary > ( SELECT SUM(salary) FROM categories AS catg WHERE catg.level = dept.level );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_11418
train
T1
v1
Schema: transactions (alias: txn)(salary, type, status, id) invoices(date, salary, value, amount) Task: Find salary from transactions where type appears in invoices entries with matching code. SQL:
SELECT salary FROM transactions AS txn WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.code = txn.code );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "salary", "filter_col": "type", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_11419
train
T1
v3
Schema: budgets (alias: budg)(status, type, name, code) departments(value, name, amount, type) Task: Find code from budgets where value exceeds the average value from departments for the same type. SQL:
SELECT code FROM budgets AS budg WHERE value > ( SELECT MIN(value) FROM departments AS dept WHERE dept.type = budg.type );
{ "outer_table": "budgets", "inner_table": "departments", "outer_alias": "budg", "inner_alias": "dept", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_11420
train
T2
v2
Schema: orders (alias: ord)(id, salary, date, level) schedules(name, status, salary, date) Task: Retrieve amount from orders that have at least one corresponding entry in schedules sharing the same level. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = ord.level );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "amount", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_11421
train
T1
v3
Schema: regions (alias: rgn)(date, type, level, code) warehouses(level, status, type, value) Task: Retrieve value from regions with value above the MIN(salary) of warehouses rows sharing the same code. SQL:
SELECT value FROM regions AS rgn WHERE value > ( SELECT MIN(salary) FROM warehouses AS whs WHERE whs.code = rgn.code );
{ "outer_table": "regions", "inner_table": "warehouses", "outer_alias": "rgn", "inner_alias": "whs", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_11422
train
T2
v3
Schema: items (alias: lne)(code, name, value, date) categories(status, level, code, name) Task: Find amount from items where amount exceeds the average amount from categories for the same status. SQL:
SELECT amount FROM items AS lne WHERE amount > ( SELECT AVG(amount) FROM categories AS catg WHERE catg.status = lne.status );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_11423
train
T2
v3
Schema: products (alias: prod)(status, code, name, date) accounts(salary, date, id, amount) Task: Retrieve id from products with salary above the SUM(amount) of accounts rows sharing the same code. SQL:
SELECT id FROM products AS prod WHERE salary > ( SELECT SUM(amount) FROM accounts AS acct WHERE acct.code = prod.code );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_11424
train
T1
v2
Schema: schedules (alias: schd)(id, level, name, salary) regions(type, level, date, name) Task: Retrieve value from schedules that have at least one corresponding entry in regions sharing the same id. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = schd.id );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "value", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_11425
train
T2
v1
Schema: regions (alias: rgn)(value, amount, salary, level) budgets(status, type, value, salary) Task: Find salary from regions where id appears in budgets entries with matching id. SQL:
SELECT salary FROM regions AS rgn WHERE id IN ( SELECT id FROM budgets AS budg WHERE budg.id = rgn.id );
{ "outer_table": "regions", "inner_table": "budgets", "outer_alias": "rgn", "inner_alias": "budg", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_11426
train
T2
v1
Schema: regions (alias: rgn)(date, salary, name, code) items(type, name, id, date) Task: Find value from regions where code appears in items entries with matching level. SQL:
SELECT value FROM regions AS rgn WHERE code IN ( SELECT code FROM items AS lne WHERE lne.level = rgn.level );
{ "outer_table": "regions", "inner_table": "items", "outer_alias": "rgn", "inner_alias": "lne", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_11427
train
T2
v3
Schema: regions (alias: rgn)(status, salary, name, amount) customers(status, amount, date, value) Task: Retrieve salary from regions with value above the SUM(salary) of customers rows sharing the same status. SQL:
SELECT salary FROM regions AS rgn WHERE value > ( SELECT SUM(salary) FROM customers AS cust WHERE cust.status = rgn.status );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_11428
train
T2
v3
Schema: accounts (alias: acct)(type, amount, status, salary) services(name, status, code, value) Task: Retrieve id from accounts with amount above the COUNT(value) of services rows sharing the same id. SQL:
SELECT id FROM accounts AS acct WHERE amount > ( SELECT COUNT(value) FROM services AS srvc WHERE srvc.id = acct.id );
{ "outer_table": "accounts", "inner_table": "services", "outer_alias": "acct", "inner_alias": "srvc", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_11429
train
T1
v3
Schema: budgets (alias: budg)(code, date, id, amount) transactions(name, date, code, id) Task: Retrieve id from budgets with salary above the COUNT(amount) of transactions rows sharing the same id. SQL:
SELECT id FROM budgets AS budg WHERE salary > ( SELECT COUNT(amount) FROM transactions AS txn WHERE txn.id = budg.id );
{ "outer_table": "budgets", "inner_table": "transactions", "outer_alias": "budg", "inner_alias": "txn", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_11430
train
T2
v2
Schema: categories (alias: catg)(code, type, name, salary) budgets(date, value, id, status) Task: Find amount from categories where a matching record exists in budgets with the same level. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.level = catg.level );
{ "outer_table": "categories", "inner_table": "budgets", "outer_alias": "catg", "inner_alias": "budg", "proj_col": "amount", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_11431
train
T2
v3
Schema: requests (alias: ordr)(value, id, amount, date) shipments(value, salary, id, level) Task: Retrieve salary from requests with value above the AVG(value) of shipments rows sharing the same id. SQL:
SELECT salary FROM requests AS ordr WHERE value > ( SELECT AVG(value) FROM shipments AS shp WHERE shp.id = ordr.id );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_11432
train
T2
v3
Schema: warehouses (alias: whs)(status, id, code, value) sales(amount, value, type, salary) Task: Retrieve code from warehouses with amount above the AVG(salary) of sales rows sharing the same level. SQL:
SELECT code FROM warehouses AS whs WHERE amount > ( SELECT AVG(salary) FROM sales AS sale WHERE sale.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "sales", "outer_alias": "whs", "inner_alias": "sale", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_11433
train
T2
v3
Schema: products (alias: prod)(date, code, level, name) transactions(salary, date, status, id) Task: Find amount from products where amount exceeds the average salary from transactions for the same code. SQL:
SELECT amount FROM products AS prod WHERE amount > ( SELECT MIN(salary) FROM transactions AS txn WHERE txn.code = prod.code );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_11434
train
T1
v3
Schema: departments (alias: dept)(date, type, name, code) shipments(status, id, name, date) Task: Retrieve id from departments with value above the MAX(salary) of shipments rows sharing the same type. SQL:
SELECT id FROM departments AS dept WHERE value > ( SELECT MAX(salary) FROM shipments AS shp WHERE shp.type = dept.type );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_11435
train
T1
v1
Schema: accounts (alias: acct)(amount, type, salary, level) regions(id, salary, status, name) Task: Retrieve id from accounts whose level is found in regions rows where type matches the outer record. SQL:
SELECT id FROM accounts AS acct WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.type = acct.type );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_11436
train
T1
v1
Schema: employees (alias: emp)(name, value, type, status) invoices(code, type, level, amount) Task: Find code from employees where level appears in invoices entries with matching type. SQL:
SELECT code FROM employees AS emp WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.type = emp.type );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_11437
train
T1
v3
Schema: staff (alias: empl)(name, status, code, level) transactions(name, status, id, salary) Task: Find value from staff where amount exceeds the average salary from transactions for the same level. SQL:
SELECT value FROM staff AS empl WHERE amount > ( SELECT SUM(salary) FROM transactions AS txn WHERE txn.level = empl.level );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_11438
train
T2
v1
Schema: warehouses (alias: whs)(date, code, level, id) customers(date, name, salary, status) Task: Retrieve id from warehouses whose type is found in customers rows where status matches the outer record. SQL:
SELECT id FROM warehouses AS whs WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "customers", "outer_alias": "whs", "inner_alias": "cust", "proj_col": "id", "filter_col": "type", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_11439
train
T2
v1
Schema: accounts (alias: acct)(date, status, name, salary) customers(date, id, code, amount) Task: Select name from accounts where level exists in customers for the same code. SQL:
SELECT name FROM accounts AS acct WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.code = acct.code );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_11440
train
T1
v2
Schema: requests (alias: ordr)(id, value, status, salary) regions(salary, code, date, status) Task: Retrieve code from requests that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = ordr.level );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "code", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_11441
train
T2
v3
Schema: categories (alias: catg)(name, date, type, amount) staff(name, id, salary, status) Task: Retrieve amount from categories with salary above the AVG(salary) of staff rows sharing the same id. SQL:
SELECT amount FROM categories AS catg WHERE salary > ( SELECT AVG(salary) FROM staff AS empl WHERE empl.id = catg.id );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_11442
train
T2
v3
Schema: orders (alias: ord)(salary, code, id, date) employees(level, amount, type, date) Task: Find salary from orders where value exceeds the average amount from employees for the same id. SQL:
SELECT salary FROM orders AS ord WHERE value > ( SELECT MAX(amount) FROM employees AS emp WHERE emp.id = ord.id );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_11443
train
T1
v2
Schema: schedules (alias: schd)(salary, code, level, value) categories(amount, salary, code, level) Task: Retrieve value from schedules that have at least one corresponding entry in categories sharing the same id. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = schd.id );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "value", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_11444
train
T2
v2
Schema: shipments (alias: shp)(code, name, status, level) regions(value, level, id, salary) Task: Find salary from shipments where a matching record exists in regions with the same id. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = shp.id );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "salary", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_11445
train
T2
v1
Schema: schedules (alias: schd)(id, date, salary, type) orders(level, value, amount, status) Task: Find code from schedules where level appears in orders entries with matching type. SQL:
SELECT code FROM schedules AS schd WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.type = schd.type );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_11446
train
T2
v2
Schema: warehouses (alias: whs)(level, status, amount, date) sales(amount, code, name, date) Task: Retrieve code from warehouses that have at least one corresponding entry in sales sharing the same code. SQL:
SELECT code FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "sales", "outer_alias": "whs", "inner_alias": "sale", "proj_col": "code", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_11447
train
T2
v1
Schema: products (alias: prod)(name, status, salary, id) staff(id, type, salary, level) Task: Retrieve value from products whose level is found in staff rows where status matches the outer record. SQL:
SELECT value FROM products AS prod WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.status = prod.status );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "value", "filter_col": "level", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_11448
train
T1
v2
Schema: managers (alias: mgr)(level, name, amount, status) accounts(value, type, level, amount) Task: Retrieve salary from managers that have at least one corresponding entry in accounts sharing the same type. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = mgr.type );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "salary", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_11449
train
T1
v1
Schema: requests (alias: ordr)(id, level, salary, date) regions(code, status, amount, salary) Task: Retrieve code from requests whose code is found in regions rows where id matches the outer record. SQL:
SELECT code FROM requests AS ordr WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.id = ordr.id );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_11450
train
T2
v1
Schema: accounts (alias: acct)(code, level, id, date) categories(salary, amount, status, id) Task: Find name from accounts where status appears in categories entries with matching level. SQL:
SELECT name FROM accounts AS acct WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.level = acct.level );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_11451
train
T1
v1
Schema: services (alias: srvc)(status, code, id, name) regions(status, name, date, level) Task: Select name from services where id exists in regions for the same status. SQL:
SELECT name FROM services AS srvc WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.status = srvc.status );
{ "outer_table": "services", "inner_table": "regions", "outer_alias": "srvc", "inner_alias": "rgn", "proj_col": "name", "filter_col": "id", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_11452
train
T2
v3
Schema: shipments (alias: shp)(status, level, date, value) orders(level, id, status, salary) Task: Retrieve salary from shipments with value above the SUM(amount) of orders rows sharing the same status. SQL:
SELECT salary FROM shipments AS shp WHERE value > ( SELECT SUM(amount) FROM orders AS ord WHERE ord.status = shp.status );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_11453
train
T2
v3
Schema: accounts (alias: acct)(code, id, type, name) regions(level, code, id, status) Task: Retrieve id from accounts with salary above the AVG(amount) of regions rows sharing the same level. SQL:
SELECT id FROM accounts AS acct WHERE salary > ( SELECT AVG(amount) FROM regions AS rgn WHERE rgn.level = acct.level );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_11454
train
T1
v1
Schema: warehouses (alias: whs)(level, date, value, salary) products(code, value, name, amount) Task: Select amount from warehouses where type exists in products for the same status. SQL:
SELECT amount FROM warehouses AS whs WHERE type IN ( SELECT type FROM products AS prod WHERE prod.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "products", "outer_alias": "whs", "inner_alias": "prod", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_11455
train
T2
v1
Schema: schedules (alias: schd)(name, level, date, value) accounts(salary, type, name, status) Task: Select value from schedules where type exists in accounts for the same status. SQL:
SELECT value FROM schedules AS schd WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.status = schd.status );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_11456
train
T2
v2
Schema: accounts (alias: acct)(salary, id, status, code) invoices(status, code, date, level) Task: Retrieve amount from accounts that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = acct.type );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "amount", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_11457
train
T1
v3
Schema: items (alias: lne)(code, date, type, level) sales(status, name, type, level) Task: Find code from items where value exceeds the average amount from sales for the same type. SQL:
SELECT code FROM items AS lne WHERE value > ( SELECT SUM(amount) FROM sales AS sale WHERE sale.type = lne.type );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_11458
train
T2
v1
Schema: accounts (alias: acct)(id, salary, status, amount) budgets(id, salary, value, amount) Task: Select id from accounts where level exists in budgets for the same level. SQL:
SELECT id FROM accounts AS acct WHERE level IN ( SELECT level FROM budgets AS budg WHERE budg.level = acct.level );
{ "outer_table": "accounts", "inner_table": "budgets", "outer_alias": "acct", "inner_alias": "budg", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_11459
train
T1
v2
Schema: managers (alias: mgr)(level, type, salary, code) accounts(salary, code, value, date) Task: Find name from managers where a matching record exists in accounts with the same type. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = mgr.type );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "name", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_11460
train
T1
v2
Schema: services (alias: srvc)(level, status, amount, code) departments(date, id, amount, code) Task: Find salary from services where a matching record exists in departments with the same code. SQL:
SELECT salary FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = srvc.code );
{ "outer_table": "services", "inner_table": "departments", "outer_alias": "srvc", "inner_alias": "dept", "proj_col": "salary", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_11461
train
T2
v2
Schema: accounts (alias: acct)(status, date, name, amount) staff(code, salary, level, date) Task: Find id from accounts where a matching record exists in staff with the same code. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = acct.code );
{ "outer_table": "accounts", "inner_table": "staff", "outer_alias": "acct", "inner_alias": "empl", "proj_col": "id", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_11462
train
T1
v1
Schema: budgets (alias: budg)(id, status, value, level) invoices(status, date, code, id) Task: Retrieve value from budgets whose level is found in invoices rows where id matches the outer record. SQL:
SELECT value FROM budgets AS budg WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.id = budg.id );
{ "outer_table": "budgets", "inner_table": "invoices", "outer_alias": "budg", "inner_alias": "inv", "proj_col": "value", "filter_col": "level", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_11463
train
T2
v1
Schema: sales (alias: sale)(type, date, level, amount) transactions(value, level, id, salary) Task: Retrieve id from sales whose status is found in transactions rows where type matches the outer record. SQL:
SELECT id FROM sales AS sale WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.type = sale.type );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_11464
train
T1
v1
Schema: schedules (alias: schd)(value, name, type, level) employees(amount, status, type, salary) Task: Find name from schedules where status appears in employees entries with matching id. SQL:
SELECT name FROM schedules AS schd WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.id = schd.id );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_11465
train
T2
v3
Schema: invoices (alias: inv)(status, name, amount, value) regions(id, type, code, level) Task: Find amount from invoices where value exceeds the average value from regions for the same type. SQL:
SELECT amount FROM invoices AS inv WHERE value > ( SELECT COUNT(value) FROM regions AS rgn WHERE rgn.type = inv.type );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_11466
train
T1
v3
Schema: warehouses (alias: whs)(level, status, name, code) products(level, type, amount, code) Task: Retrieve value from warehouses with salary above the COUNT(value) of products rows sharing the same status. SQL:
SELECT value FROM warehouses AS whs WHERE salary > ( SELECT COUNT(value) FROM products AS prod WHERE prod.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "products", "outer_alias": "whs", "inner_alias": "prod", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_11467
train
T2
v3
Schema: sales (alias: sale)(value, code, status, salary) shipments(amount, date, value, id) Task: Find id from sales where amount exceeds the average amount from shipments for the same level. SQL:
SELECT id FROM sales AS sale WHERE amount > ( SELECT COUNT(amount) FROM shipments AS shp WHERE shp.level = sale.level );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_11468
train
T1
v2
Schema: products (alias: prod)(type, id, date, salary) warehouses(type, date, id, name) Task: Retrieve id from products that have at least one corresponding entry in warehouses sharing the same level. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.level = prod.level );
{ "outer_table": "products", "inner_table": "warehouses", "outer_alias": "prod", "inner_alias": "whs", "proj_col": "id", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_11469
train
T1
v1
Schema: schedules (alias: schd)(code, status, amount, id) requests(date, type, code, salary) Task: Retrieve amount from schedules whose id is found in requests rows where level matches the outer record. SQL:
SELECT amount FROM schedules AS schd WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.level = schd.level );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_11470
train
T2
v3
Schema: schedules (alias: schd)(name, salary, status, amount) regions(code, id, date, value) Task: Retrieve name from schedules with amount above the AVG(salary) of regions rows sharing the same level. SQL:
SELECT name FROM schedules AS schd WHERE amount > ( SELECT AVG(salary) FROM regions AS rgn WHERE rgn.level = schd.level );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_11471
train
T2
v3
Schema: staff (alias: empl)(level, name, code, status) invoices(id, status, name, salary) Task: Retrieve code from staff with value above the AVG(value) of invoices rows sharing the same type. SQL:
SELECT code FROM staff AS empl WHERE value > ( SELECT AVG(value) FROM invoices AS inv WHERE inv.type = empl.type );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_11472
train
T2
v1
Schema: staff (alias: empl)(name, date, level, code) orders(amount, value, level, date) Task: Find value from staff where code appears in orders entries with matching code. SQL:
SELECT value FROM staff AS empl WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.code = empl.code );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_11473
train
T2
v1
Schema: employees (alias: emp)(status, value, salary, date) staff(salary, value, level, code) Task: Select value from employees where type exists in staff for the same status. SQL:
SELECT value FROM employees AS emp WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.status = emp.status );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_11474
train
T1
v3
Schema: warehouses (alias: whs)(id, amount, value, status) regions(type, status, value, date) Task: Retrieve code from warehouses with value above the COUNT(salary) of regions rows sharing the same level. SQL:
SELECT code FROM warehouses AS whs WHERE value > ( SELECT COUNT(salary) FROM regions AS rgn WHERE rgn.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "regions", "outer_alias": "whs", "inner_alias": "rgn", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_11475
train
T2
v1
Schema: invoices (alias: inv)(value, level, status, type) requests(level, value, type, id) Task: Find amount from invoices where id appears in requests entries with matching code. SQL:
SELECT amount FROM invoices AS inv WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.code = inv.code );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_11476
train
T1
v3
Schema: customers (alias: cust)(type, salary, value, date) managers(id, level, date, name) Task: Find value from customers where salary exceeds the average amount from managers for the same status. SQL:
SELECT value FROM customers AS cust WHERE salary > ( SELECT COUNT(amount) FROM managers AS mgr WHERE mgr.status = cust.status );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_11477
train
T1
v1
Schema: products (alias: prod)(status, date, salary, amount) accounts(id, level, value, type) Task: Select amount from products where type exists in accounts for the same id. SQL:
SELECT amount FROM products AS prod WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.id = prod.id );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_11478
train
T1
v3
Schema: requests (alias: ordr)(code, amount, type, salary) orders(value, level, status, name) Task: Find name from requests where value exceeds the average value from orders for the same status. SQL:
SELECT name FROM requests AS ordr WHERE value > ( SELECT COUNT(value) FROM orders AS ord WHERE ord.status = ordr.status );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_11479
train
T2
v2
Schema: shipments (alias: shp)(name, value, type, code) schedules(type, id, status, value) Task: Retrieve amount from shipments that have at least one corresponding entry in schedules sharing the same id. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = shp.id );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "amount", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_11480
train
T2
v1
Schema: managers (alias: mgr)(amount, id, status, type) budgets(salary, id, level, date) Task: Select code from managers where type exists in budgets for the same status. SQL:
SELECT code FROM managers AS mgr WHERE type IN ( SELECT type FROM budgets AS budg WHERE budg.status = mgr.status );
{ "outer_table": "managers", "inner_table": "budgets", "outer_alias": "mgr", "inner_alias": "budg", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_11481
train
T1
v3
Schema: items (alias: lne)(id, status, value, date) requests(salary, value, id, type) Task: Retrieve value from items with salary above the MAX(salary) of requests rows sharing the same type. SQL:
SELECT value FROM items AS lne WHERE salary > ( SELECT MAX(salary) FROM requests AS ordr WHERE ordr.type = lne.type );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_11482
train
T2
v2
Schema: categories (alias: catg)(salary, code, value, date) services(name, code, id, date) Task: Find amount from categories where a matching record exists in services with the same id. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = catg.id );
{ "outer_table": "categories", "inner_table": "services", "outer_alias": "catg", "inner_alias": "srvc", "proj_col": "amount", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_11483
train
T2
v3
Schema: warehouses (alias: whs)(id, salary, amount, name) schedules(date, name, value, salary) Task: Retrieve amount from warehouses with salary above the COUNT(value) of schedules rows sharing the same code. SQL:
SELECT amount FROM warehouses AS whs WHERE salary > ( SELECT COUNT(value) FROM schedules AS schd WHERE schd.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "schedules", "outer_alias": "whs", "inner_alias": "schd", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_11484
train
T2
v2
Schema: accounts (alias: acct)(type, id, date, amount) requests(id, name, type, status) Task: Find amount from accounts where a matching record exists in requests with the same type. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = acct.type );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "amount", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_11485
train
T1
v2
Schema: sales (alias: sale)(level, type, salary, value) schedules(status, type, salary, amount) Task: Retrieve id from sales that have at least one corresponding entry in schedules sharing the same id. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = sale.id );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "id", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_11486
train
T1
v3
Schema: warehouses (alias: whs)(amount, id, level, name) orders(date, salary, code, status) Task: Retrieve code from warehouses with value above the MAX(amount) of orders rows sharing the same status. SQL:
SELECT code FROM warehouses AS whs WHERE value > ( SELECT MAX(amount) FROM orders AS ord WHERE ord.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "orders", "outer_alias": "whs", "inner_alias": "ord", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_11487
train
T2
v1
Schema: categories (alias: catg)(date, level, salary, name) sales(code, status, value, id) Task: Retrieve name from categories whose code is found in sales rows where id matches the outer record. SQL:
SELECT name FROM categories AS catg WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.id = catg.id );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_11488
train
T2
v3
Schema: transactions (alias: txn)(date, value, name, amount) invoices(id, status, salary, type) Task: Find id from transactions where value exceeds the average salary from invoices for the same code. SQL:
SELECT id FROM transactions AS txn WHERE value > ( SELECT COUNT(salary) FROM invoices AS inv WHERE inv.code = txn.code );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_11489
train
T1
v1
Schema: invoices (alias: inv)(value, amount, level, name) shipments(value, amount, code, status) Task: Retrieve amount from invoices whose level is found in shipments rows where status matches the outer record. SQL:
SELECT amount FROM invoices AS inv WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.status = inv.status );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_11490
train
T1
v1
Schema: departments (alias: dept)(value, level, status, name) customers(date, code, salary, name) Task: Select id from departments where id exists in customers for the same level. SQL:
SELECT id FROM departments AS dept WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.level = dept.level );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_11491
train
T1
v3
Schema: requests (alias: ordr)(value, level, id, type) budgets(status, id, date, amount) Task: Retrieve name from requests with amount above the MIN(amount) of budgets rows sharing the same status. SQL:
SELECT name FROM requests AS ordr WHERE amount > ( SELECT MIN(amount) FROM budgets AS budg WHERE budg.status = ordr.status );
{ "outer_table": "requests", "inner_table": "budgets", "outer_alias": "ordr", "inner_alias": "budg", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_11492
train
T2
v3
Schema: orders (alias: ord)(code, value, amount, date) sales(name, value, salary, date) Task: Find id from orders where value exceeds the average amount from sales for the same level. SQL:
SELECT id FROM orders AS ord WHERE value > ( SELECT AVG(amount) FROM sales AS sale WHERE sale.level = ord.level );
{ "outer_table": "orders", "inner_table": "sales", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_11493
train
T1
v1
Schema: departments (alias: dept)(type, level, salary, value) regions(code, salary, amount, status) Task: Retrieve id from departments whose level is found in regions rows where level matches the outer record. SQL:
SELECT id FROM departments AS dept WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.level = dept.level );
{ "outer_table": "departments", "inner_table": "regions", "outer_alias": "dept", "inner_alias": "rgn", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_11494
train
T1
v1
Schema: managers (alias: mgr)(type, code, date, value) employees(id, level, date, status) Task: Find salary from managers where type appears in employees entries with matching code. SQL:
SELECT salary FROM managers AS mgr WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.code = mgr.code );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "salary", "filter_col": "type", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_11495
train
T1
v3
Schema: employees (alias: emp)(status, id, level, value) transactions(salary, value, type, level) Task: Find salary from employees where salary exceeds the average value from transactions for the same level. SQL:
SELECT salary FROM employees AS emp WHERE salary > ( SELECT SUM(value) FROM transactions AS txn WHERE txn.level = emp.level );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_11496
train
T1
v1
Schema: sales (alias: sale)(date, name, value, level) products(date, value, name, salary) Task: Select value from sales where id exists in products for the same status. SQL:
SELECT value FROM sales AS sale WHERE id IN ( SELECT id FROM products AS prod WHERE prod.status = sale.status );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_11497
train
T1
v3
Schema: services (alias: srvc)(level, date, code, name) accounts(level, date, name, code) Task: Find value from services where amount exceeds the average value from accounts for the same type. SQL:
SELECT value FROM services AS srvc WHERE amount > ( SELECT MIN(value) FROM accounts AS acct WHERE acct.type = srvc.type );
{ "outer_table": "services", "inner_table": "accounts", "outer_alias": "srvc", "inner_alias": "acct", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_11498
train
T2
v2
Schema: schedules (alias: schd)(date, salary, level, type) regions(id, status, name, code) Task: Retrieve id from schedules that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = schd.level );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "id", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_11499
train
T2