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: categories (alias: catg)(date, name, amount, salary) staff(value, id, code, name) Task: Select code from categories where id exists in staff for the same id. SQL:
SELECT code FROM categories AS catg WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.id = catg.id );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "code", "filter_col": "id", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_07400
train
T2
v1
Schema: invoices (alias: inv)(value, name, status, level) accounts(status, date, level, type) Task: Retrieve id from invoices whose level is found in accounts rows where status matches the outer record. SQL:
SELECT id FROM invoices AS inv WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.status = inv.status );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_07401
train
T1
v2
Schema: invoices (alias: inv)(level, name, status, value) sales(level, salary, date, status) Task: Find salary from invoices where a matching record exists in sales with the same type. SQL:
SELECT salary FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = inv.type );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "salary", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_07402
train
T1
v1
Schema: customers (alias: cust)(salary, amount, date, id) employees(amount, name, value, level) Task: Select amount from customers where id exists in employees for the same status. SQL:
SELECT amount FROM customers AS cust WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.status = cust.status );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_07403
train
T1
v3
Schema: sales (alias: sale)(code, id, level, status) budgets(level, id, value, salary) Task: Retrieve id from sales with salary above the COUNT(salary) of budgets rows sharing the same level. SQL:
SELECT id FROM sales AS sale WHERE salary > ( SELECT COUNT(salary) FROM budgets AS budg WHERE budg.level = sale.level );
{ "outer_table": "sales", "inner_table": "budgets", "outer_alias": "sale", "inner_alias": "budg", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_07404
train
T1
v2
Schema: regions (alias: rgn)(date, level, status, amount) departments(date, id, level, name) Task: Find amount from regions where a matching record exists in departments with the same level. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = rgn.level );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "amount", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_07405
train
T2
v3
Schema: budgets (alias: budg)(type, amount, status, value) sales(type, level, id, status) Task: Retrieve id from budgets with amount above the AVG(salary) of sales rows sharing the same level. SQL:
SELECT id FROM budgets AS budg WHERE amount > ( SELECT AVG(salary) FROM sales AS sale WHERE sale.level = budg.level );
{ "outer_table": "budgets", "inner_table": "sales", "outer_alias": "budg", "inner_alias": "sale", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_07406
train
T2
v1
Schema: staff (alias: empl)(code, status, date, value) departments(name, level, value, date) Task: Select value from staff where type exists in departments for the same code. SQL:
SELECT value FROM staff AS empl WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.code = empl.code );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_07407
train
T2
v2
Schema: items (alias: lne)(code, type, level, salary) accounts(code, level, type, salary) Task: Find name from items where a matching record exists in accounts with the same id. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = lne.id );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "name", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_07408
train
T2
v2
Schema: requests (alias: ordr)(date, value, id, amount) items(amount, type, value, status) Task: Find name from requests where a matching record exists in items with the same code. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = ordr.code );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "name", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_07409
train
T2
v2
Schema: staff (alias: empl)(level, value, date, amount) budgets(type, id, date, value) Task: Find id from staff where a matching record exists in budgets with the same level. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.level = empl.level );
{ "outer_table": "staff", "inner_table": "budgets", "outer_alias": "empl", "inner_alias": "budg", "proj_col": "id", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_07410
train
T2
v3
Schema: staff (alias: empl)(id, level, date, status) warehouses(amount, id, status, date) Task: Find code from staff where value exceeds the average salary from warehouses for the same level. SQL:
SELECT code FROM staff AS empl WHERE value > ( SELECT MIN(salary) FROM warehouses AS whs WHERE whs.level = empl.level );
{ "outer_table": "staff", "inner_table": "warehouses", "outer_alias": "empl", "inner_alias": "whs", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_07411
train
T2
v2
Schema: departments (alias: dept)(value, status, date, salary) requests(code, value, salary, name) Task: Retrieve amount from departments that have at least one corresponding entry in requests sharing the same type. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = dept.type );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "amount", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_07412
train
T1
v3
Schema: staff (alias: empl)(salary, status, name, date) items(amount, date, value, id) Task: Retrieve code from staff with value above the SUM(value) of items rows sharing the same code. SQL:
SELECT code FROM staff AS empl WHERE value > ( SELECT SUM(value) FROM items AS lne WHERE lne.code = empl.code );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_07413
train
T2
v1
Schema: customers (alias: cust)(code, id, amount, type) schedules(level, status, id, value) Task: Find name from customers where status appears in schedules entries with matching level. SQL:
SELECT name FROM customers AS cust WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.level = cust.level );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_07414
train
T1
v2
Schema: regions (alias: rgn)(code, name, date, type) sales(type, code, salary, id) Task: Retrieve value from regions that have at least one corresponding entry in sales sharing the same level. SQL:
SELECT value FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = rgn.level );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "value", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_07415
train
T2
v1
Schema: managers (alias: mgr)(code, salary, value, status) regions(code, name, type, id) Task: Select salary from managers where type exists in regions for the same code. SQL:
SELECT salary FROM managers AS mgr WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.code = mgr.code );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "type", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_07416
train
T1
v3
Schema: budgets (alias: budg)(salary, id, value, level) warehouses(value, status, code, salary) Task: Find name from budgets where salary exceeds the average value from warehouses for the same status. SQL:
SELECT name FROM budgets AS budg WHERE salary > ( SELECT MAX(value) FROM warehouses AS whs WHERE whs.status = budg.status );
{ "outer_table": "budgets", "inner_table": "warehouses", "outer_alias": "budg", "inner_alias": "whs", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_07417
train
T2
v3
Schema: schedules (alias: schd)(value, status, amount, code) departments(value, amount, level, name) Task: Find name from schedules where amount exceeds the average amount from departments for the same id. SQL:
SELECT name FROM schedules AS schd WHERE amount > ( SELECT AVG(amount) FROM departments AS dept WHERE dept.id = schd.id );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_07418
train
T2
v1
Schema: warehouses (alias: whs)(date, id, name, type) budgets(amount, date, value, id) Task: Retrieve amount from warehouses whose status is found in budgets rows where id matches the outer record. SQL:
SELECT amount FROM warehouses AS whs WHERE status IN ( SELECT status FROM budgets AS budg WHERE budg.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "budgets", "outer_alias": "whs", "inner_alias": "budg", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_07419
train
T2
v3
Schema: orders (alias: ord)(level, amount, type, name) employees(value, level, salary, status) Task: Find id from orders where value exceeds the average salary from employees for the same code. SQL:
SELECT id FROM orders AS ord WHERE value > ( SELECT MIN(salary) FROM employees AS emp WHERE emp.code = ord.code );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_07420
train
T1
v2
Schema: orders (alias: ord)(name, date, status, level) warehouses(level, status, name, code) Task: Find name from orders where a matching record exists in warehouses with the same id. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.id = ord.id );
{ "outer_table": "orders", "inner_table": "warehouses", "outer_alias": "ord", "inner_alias": "whs", "proj_col": "name", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_07421
train
T1
v1
Schema: requests (alias: ordr)(amount, level, value, type) managers(value, level, name, code) Task: Find id from requests where status appears in managers entries with matching code. SQL:
SELECT id FROM requests AS ordr WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.code = ordr.code );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_07422
train
T2
v3
Schema: items (alias: lne)(date, type, value, code) invoices(level, salary, value, amount) Task: Retrieve id from items with amount above the SUM(salary) of invoices rows sharing the same status. SQL:
SELECT id FROM items AS lne WHERE amount > ( SELECT SUM(salary) FROM invoices AS inv WHERE inv.status = lne.status );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_07423
train
T2
v2
Schema: requests (alias: ordr)(name, date, code, amount) staff(salary, level, date, id) Task: Retrieve value from requests that have at least one corresponding entry in staff sharing the same level. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = ordr.level );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "value", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_07424
train
T2
v3
Schema: transactions (alias: txn)(amount, id, status, salary) invoices(id, status, level, code) Task: Retrieve amount from transactions with salary above the SUM(amount) of invoices rows sharing the same type. SQL:
SELECT amount FROM transactions AS txn WHERE salary > ( SELECT SUM(amount) FROM invoices AS inv WHERE inv.type = txn.type );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_07425
train
T1
v3
Schema: departments (alias: dept)(amount, value, type, date) warehouses(name, id, code, date) Task: Find name from departments where amount exceeds the average value from warehouses for the same level. SQL:
SELECT name FROM departments AS dept WHERE amount > ( SELECT MAX(value) FROM warehouses AS whs WHERE whs.level = dept.level );
{ "outer_table": "departments", "inner_table": "warehouses", "outer_alias": "dept", "inner_alias": "whs", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_07426
train
T1
v3
Schema: customers (alias: cust)(name, level, salary, status) schedules(name, status, id, code) Task: Retrieve id from customers with salary above the AVG(value) of schedules rows sharing the same id. SQL:
SELECT id FROM customers AS cust WHERE salary > ( SELECT AVG(value) FROM schedules AS schd WHERE schd.id = cust.id );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_07427
train
T1
v2
Schema: staff (alias: empl)(amount, code, salary, level) categories(name, id, salary, date) Task: Find salary from staff where a matching record exists in categories with the same status. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = empl.status );
{ "outer_table": "staff", "inner_table": "categories", "outer_alias": "empl", "inner_alias": "catg", "proj_col": "salary", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_07428
train
T2
v1
Schema: orders (alias: ord)(name, amount, value, id) invoices(amount, name, level, salary) Task: Find name from orders where id appears in invoices entries with matching status. SQL:
SELECT name FROM orders AS ord WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.status = ord.status );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "name", "filter_col": "id", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_07429
train
T1
v3
Schema: requests (alias: ordr)(status, type, value, name) services(amount, value, salary, type) Task: Find id from requests where salary exceeds the average value from services for the same id. SQL:
SELECT id FROM requests AS ordr WHERE salary > ( SELECT AVG(value) FROM services AS srvc WHERE srvc.id = ordr.id );
{ "outer_table": "requests", "inner_table": "services", "outer_alias": "ordr", "inner_alias": "srvc", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_07430
train
T2
v2
Schema: accounts (alias: acct)(amount, code, date, status) warehouses(amount, date, salary, type) Task: Find amount from accounts where a matching record exists in warehouses with the same code. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.code = acct.code );
{ "outer_table": "accounts", "inner_table": "warehouses", "outer_alias": "acct", "inner_alias": "whs", "proj_col": "amount", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_07431
train
T1
v2
Schema: categories (alias: catg)(level, type, code, salary) departments(level, name, date, salary) Task: Find name from categories where a matching record exists in departments with the same type. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = catg.type );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "name", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_07432
train
T2
v3
Schema: shipments (alias: shp)(salary, date, level, code) managers(name, value, level, amount) Task: Find salary from shipments where salary exceeds the average amount from managers for the same level. SQL:
SELECT salary FROM shipments AS shp WHERE salary > ( SELECT COUNT(amount) FROM managers AS mgr WHERE mgr.level = shp.level );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_07433
train
T2
v2
Schema: categories (alias: catg)(salary, status, name, amount) schedules(id, value, code, amount) Task: Find name from categories where a matching record exists in schedules with the same status. SQL:
SELECT name 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": "name", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_07434
train
T2
v2
Schema: items (alias: lne)(value, type, salary, date) sales(amount, level, id, date) Task: Retrieve id from items that have at least one corresponding entry in sales sharing the same type. SQL:
SELECT id 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": "id", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_07435
train
T2
v1
Schema: employees (alias: emp)(name, salary, amount, type) schedules(date, id, level, code) Task: Retrieve name from employees whose status is found in schedules rows where status matches the outer record. SQL:
SELECT name FROM employees AS emp WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.status = emp.status );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_07436
train
T1
v3
Schema: categories (alias: catg)(name, value, level, type) invoices(status, id, name, type) Task: Find name from categories where amount exceeds the average value from invoices for the same level. SQL:
SELECT name FROM categories AS catg WHERE amount > ( SELECT AVG(value) FROM invoices AS inv WHERE inv.level = catg.level );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_07437
train
T2
v2
Schema: budgets (alias: budg)(date, amount, type, name) departments(salary, type, amount, id) Task: Retrieve id from budgets that have at least one corresponding entry in departments sharing the same code. SQL:
SELECT id FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = budg.code );
{ "outer_table": "budgets", "inner_table": "departments", "outer_alias": "budg", "inner_alias": "dept", "proj_col": "id", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_07438
train
T2
v2
Schema: employees (alias: emp)(level, status, salary, amount) customers(date, code, name, value) Task: Find id from employees where a matching record exists in customers with the same level. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = emp.level );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "id", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_07439
train
T1
v2
Schema: products (alias: prod)(name, level, value, code) services(type, value, name, status) Task: Retrieve value from products that have at least one corresponding entry in services sharing the same id. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = prod.id );
{ "outer_table": "products", "inner_table": "services", "outer_alias": "prod", "inner_alias": "srvc", "proj_col": "value", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_07440
train
T1
v3
Schema: categories (alias: catg)(name, value, id, level) staff(amount, salary, value, level) Task: Retrieve salary from categories with value above the SUM(amount) of staff rows sharing the same code. SQL:
SELECT salary FROM categories AS catg WHERE value > ( SELECT SUM(amount) FROM staff AS empl WHERE empl.code = catg.code );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_07441
train
T2
v2
Schema: invoices (alias: inv)(level, code, salary, date) orders(status, name, amount, salary) Task: Retrieve amount from invoices that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = inv.level );
{ "outer_table": "invoices", "inner_table": "orders", "outer_alias": "inv", "inner_alias": "ord", "proj_col": "amount", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_07442
train
T1
v1
Schema: employees (alias: emp)(level, id, date, salary) schedules(id, level, value, name) Task: Find value from employees where status appears in schedules entries with matching level. SQL:
SELECT value FROM employees AS emp WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.level = emp.level );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_07443
train
T1
v3
Schema: budgets (alias: budg)(value, status, type, date) sales(value, level, status, amount) Task: Retrieve salary from budgets with salary above the MAX(value) of sales rows sharing the same status. SQL:
SELECT salary FROM budgets AS budg WHERE salary > ( SELECT MAX(value) FROM sales AS sale WHERE sale.status = budg.status );
{ "outer_table": "budgets", "inner_table": "sales", "outer_alias": "budg", "inner_alias": "sale", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_07444
train
T2
v1
Schema: shipments (alias: shp)(type, id, status, level) services(status, salary, amount, type) Task: Select id from shipments where status exists in services for the same status. SQL:
SELECT id FROM shipments AS shp WHERE status IN ( SELECT status FROM services AS srvc WHERE srvc.status = shp.status );
{ "outer_table": "shipments", "inner_table": "services", "outer_alias": "shp", "inner_alias": "srvc", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_07445
train
T2
v1
Schema: items (alias: lne)(value, id, status, salary) requests(level, name, id, status) Task: Select id from items where type exists in requests for the same level. SQL:
SELECT id FROM items AS lne WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.level = lne.level );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_07446
train
T2
v3
Schema: staff (alias: empl)(amount, id, name, status) warehouses(amount, value, name, status) Task: Retrieve code from staff with value above the MIN(value) of warehouses rows sharing the same id. SQL:
SELECT code FROM staff AS empl WHERE value > ( SELECT MIN(value) FROM warehouses AS whs WHERE whs.id = empl.id );
{ "outer_table": "staff", "inner_table": "warehouses", "outer_alias": "empl", "inner_alias": "whs", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_07447
train
T2
v2
Schema: categories (alias: catg)(value, code, amount, id) transactions(status, type, amount, date) Task: Find amount from categories where a matching record exists in transactions with the same type. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = catg.type );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "amount", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_07448
train
T2
v1
Schema: customers (alias: cust)(level, date, code, status) managers(amount, type, status, code) Task: Find value from customers where status appears in managers entries with matching level. SQL:
SELECT value FROM customers AS cust WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.level = cust.level );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_07449
train
T1
v3
Schema: customers (alias: cust)(code, type, status, value) managers(amount, id, code, salary) Task: Find code from customers where salary exceeds the average value from managers for the same level. SQL:
SELECT code FROM customers AS cust WHERE salary > ( SELECT MAX(value) FROM managers AS mgr WHERE mgr.level = cust.level );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_07450
train
T1
v3
Schema: warehouses (alias: whs)(status, id, salary, date) regions(date, value, level, salary) Task: Find amount from warehouses where value exceeds the average value from regions for the same code. SQL:
SELECT amount FROM warehouses AS whs WHERE value > ( SELECT MIN(value) FROM regions AS rgn WHERE rgn.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "regions", "outer_alias": "whs", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_07451
train
T2
v1
Schema: items (alias: lne)(name, type, level, code) shipments(name, id, code, salary) Task: Select value from items where code exists in shipments for the same level. SQL:
SELECT value FROM items AS lne WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.level = lne.level );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_07452
train
T2
v1
Schema: customers (alias: cust)(code, level, name, type) managers(name, date, status, salary) Task: Retrieve amount from customers whose level is found in managers rows where status matches the outer record. SQL:
SELECT amount FROM customers AS cust WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.status = cust.status );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_07453
train
T1
v3
Schema: departments (alias: dept)(amount, name, type, id) transactions(code, type, date, level) Task: Retrieve name from departments with salary above the COUNT(value) of transactions rows sharing the same level. SQL:
SELECT name FROM departments AS dept WHERE salary > ( SELECT COUNT(value) FROM transactions AS txn WHERE txn.level = dept.level );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_07454
train
T1
v1
Schema: staff (alias: empl)(date, type, name, code) warehouses(name, id, type, value) Task: Find salary from staff where id appears in warehouses entries with matching id. SQL:
SELECT salary FROM staff AS empl WHERE id IN ( SELECT id FROM warehouses AS whs WHERE whs.id = empl.id );
{ "outer_table": "staff", "inner_table": "warehouses", "outer_alias": "empl", "inner_alias": "whs", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_07455
train
T2
v1
Schema: customers (alias: cust)(status, level, salary, code) sales(code, id, amount, level) Task: Retrieve id from customers whose level is found in sales rows where level matches the outer record. SQL:
SELECT id FROM customers AS cust WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.level = cust.level );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_07456
train
T1
v2
Schema: requests (alias: ordr)(amount, value, name, id) shipments(date, value, amount, status) Task: Retrieve value from requests that have at least one corresponding entry in shipments sharing the same type. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = ordr.type );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "value", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_07457
train
T2
v1
Schema: services (alias: srvc)(salary, level, code, type) budgets(name, id, salary, level) Task: Select value from services where type exists in budgets for the same level. SQL:
SELECT value FROM services AS srvc WHERE type IN ( SELECT type FROM budgets AS budg WHERE budg.level = srvc.level );
{ "outer_table": "services", "inner_table": "budgets", "outer_alias": "srvc", "inner_alias": "budg", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_07458
train
T2
v1
Schema: managers (alias: mgr)(salary, code, date, status) budgets(salary, amount, level, name) Task: Retrieve name from managers whose status is found in budgets rows where status matches the outer record. SQL:
SELECT name FROM managers AS mgr WHERE status IN ( SELECT status FROM budgets AS budg WHERE budg.status = mgr.status );
{ "outer_table": "managers", "inner_table": "budgets", "outer_alias": "mgr", "inner_alias": "budg", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_07459
train
T1
v2
Schema: schedules (alias: schd)(amount, name, id, level) services(name, date, value, salary) Task: Retrieve salary from schedules that have at least one corresponding entry in services sharing the same level. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.level = schd.level );
{ "outer_table": "schedules", "inner_table": "services", "outer_alias": "schd", "inner_alias": "srvc", "proj_col": "salary", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_07460
train
T2
v2
Schema: products (alias: prod)(code, name, status, id) schedules(code, value, amount, type) Task: Retrieve id from products that have at least one corresponding entry in schedules sharing the same status. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = prod.status );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "id", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_07461
train
T1
v1
Schema: products (alias: prod)(amount, date, salary, id) warehouses(date, amount, level, type) Task: Retrieve amount from products whose code is found in warehouses rows where status matches the outer record. SQL:
SELECT amount FROM products AS prod WHERE code IN ( SELECT code FROM warehouses AS whs WHERE whs.status = prod.status );
{ "outer_table": "products", "inner_table": "warehouses", "outer_alias": "prod", "inner_alias": "whs", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_07462
train
T1
v1
Schema: categories (alias: catg)(status, id, code, salary) accounts(code, type, id, name) Task: Retrieve name from categories whose status is found in accounts rows where level matches the outer record. SQL:
SELECT name FROM categories AS catg WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.level = catg.level );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_07463
train
T2
v2
Schema: departments (alias: dept)(id, type, date, level) schedules(name, type, salary, level) Task: Find amount from departments where a matching record exists in schedules with the same type. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = dept.type );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "amount", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_07464
train
T1
v3
Schema: services (alias: srvc)(id, name, type, amount) managers(amount, name, date, value) Task: Retrieve value from services with salary above the MAX(salary) of managers rows sharing the same code. SQL:
SELECT value FROM services AS srvc WHERE salary > ( SELECT MAX(salary) FROM managers AS mgr WHERE mgr.code = srvc.code );
{ "outer_table": "services", "inner_table": "managers", "outer_alias": "srvc", "inner_alias": "mgr", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_07465
train
T2
v3
Schema: customers (alias: cust)(date, level, value, name) items(name, value, status, amount) Task: Find amount from customers where value exceeds the average salary from items for the same status. SQL:
SELECT amount FROM customers AS cust WHERE value > ( SELECT AVG(salary) FROM items AS lne WHERE lne.status = cust.status );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_07466
train
T1
v3
Schema: employees (alias: emp)(type, status, level, name) budgets(code, date, salary, type) Task: Retrieve name from employees with salary above the MIN(salary) of budgets rows sharing the same id. SQL:
SELECT name FROM employees AS emp WHERE salary > ( SELECT MIN(salary) FROM budgets AS budg WHERE budg.id = emp.id );
{ "outer_table": "employees", "inner_table": "budgets", "outer_alias": "emp", "inner_alias": "budg", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_07467
train
T1
v3
Schema: managers (alias: mgr)(salary, amount, name, date) sales(type, salary, status, name) Task: Retrieve name from managers with salary above the AVG(value) of sales rows sharing the same id. SQL:
SELECT name FROM managers AS mgr WHERE salary > ( SELECT AVG(value) FROM sales AS sale WHERE sale.id = mgr.id );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_07468
train
T1
v2
Schema: orders (alias: ord)(id, date, code, salary) invoices(date, type, amount, level) Task: Retrieve id from orders that have at least one corresponding entry in invoices sharing the same level. SQL:
SELECT id FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = ord.level );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "id", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_07469
train
T1
v1
Schema: managers (alias: mgr)(salary, type, amount, level) sales(id, name, level, value) Task: Find id from managers where level appears in sales entries with matching level. SQL:
SELECT id FROM managers AS mgr WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.level = mgr.level );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_07470
train
T1
v3
Schema: categories (alias: catg)(level, code, name, amount) shipments(id, amount, status, value) Task: Retrieve name from categories with value above the SUM(amount) of shipments rows sharing the same type. SQL:
SELECT name FROM categories AS catg WHERE value > ( SELECT SUM(amount) FROM shipments AS shp WHERE shp.type = catg.type );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "catg", "inner_alias": "shp", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_07471
train
T2
v1
Schema: budgets (alias: budg)(level, type, name, status) customers(level, type, name, amount) Task: Select name from budgets where code exists in customers for the same level. SQL:
SELECT name FROM budgets AS budg WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.level = budg.level );
{ "outer_table": "budgets", "inner_table": "customers", "outer_alias": "budg", "inner_alias": "cust", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_07472
train
T2
v1
Schema: shipments (alias: shp)(name, value, status, date) orders(level, status, date, type) Task: Select amount from shipments where type exists in orders for the same level. SQL:
SELECT amount FROM shipments AS shp WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.level = shp.level );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_07473
train
T2
v3
Schema: requests (alias: ordr)(level, salary, code, value) accounts(code, date, value, id) Task: Retrieve salary from requests with amount above the MIN(value) of accounts rows sharing the same id. SQL:
SELECT salary FROM requests AS ordr WHERE amount > ( SELECT MIN(value) FROM accounts AS acct WHERE acct.id = ordr.id );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_07474
train
T2
v1
Schema: schedules (alias: schd)(value, code, name, date) shipments(value, level, name, code) Task: Find id from schedules where id appears in shipments entries with matching code. SQL:
SELECT id FROM schedules AS schd WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.code = schd.code );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "id", "filter_col": "id", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_07475
train
T2
v3
Schema: warehouses (alias: whs)(value, date, id, salary) managers(name, date, amount, salary) Task: Retrieve amount from warehouses with salary above the MAX(amount) of managers rows sharing the same type. SQL:
SELECT amount FROM warehouses AS whs WHERE salary > ( SELECT MAX(amount) FROM managers AS mgr WHERE mgr.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "managers", "outer_alias": "whs", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_07476
train
T2
v2
Schema: categories (alias: catg)(salary, status, code, value) sales(salary, id, name, amount) Task: Retrieve value from categories that have at least one corresponding entry in sales sharing the same type. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = catg.type );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "value", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_07477
train
T2
v2
Schema: warehouses (alias: whs)(id, type, amount, date) services(id, level, name, date) Task: Retrieve name from warehouses that have at least one corresponding entry in services sharing the same id. SQL:
SELECT name FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "services", "outer_alias": "whs", "inner_alias": "srvc", "proj_col": "name", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_07478
train
T2
v2
Schema: customers (alias: cust)(code, status, level, salary) products(name, id, status, amount) Task: Find id from customers where a matching record exists in products with the same type. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = cust.type );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "id", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_07479
train
T1
v2
Schema: warehouses (alias: whs)(amount, level, code, id) transactions(status, type, code, salary) Task: Retrieve value from warehouses that have at least one corresponding entry in transactions sharing the same status. SQL:
SELECT value FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "transactions", "outer_alias": "whs", "inner_alias": "txn", "proj_col": "value", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_07480
train
T2
v3
Schema: customers (alias: cust)(status, date, level, id) regions(value, amount, salary, name) Task: Retrieve id from customers with value above the AVG(amount) of regions rows sharing the same id. SQL:
SELECT id FROM customers AS cust WHERE value > ( SELECT AVG(amount) FROM regions AS rgn WHERE rgn.id = cust.id );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_07481
train
T1
v1
Schema: transactions (alias: txn)(code, id, salary, amount) budgets(amount, id, code, name) Task: Select code from transactions where type exists in budgets for the same status. SQL:
SELECT code FROM transactions AS txn WHERE type IN ( SELECT type FROM budgets AS budg WHERE budg.status = txn.status );
{ "outer_table": "transactions", "inner_table": "budgets", "outer_alias": "txn", "inner_alias": "budg", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_07482
train
T1
v3
Schema: accounts (alias: acct)(status, date, amount, level) transactions(id, type, amount, salary) Task: Find salary from accounts where value exceeds the average value from transactions for the same type. SQL:
SELECT salary FROM accounts AS acct WHERE value > ( SELECT COUNT(value) FROM transactions AS txn WHERE txn.type = acct.type );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_07483
train
T1
v1
Schema: employees (alias: emp)(status, code, salary, level) warehouses(code, value, name, type) Task: Retrieve value from employees whose id is found in warehouses rows where status matches the outer record. SQL:
SELECT value FROM employees AS emp WHERE id IN ( SELECT id FROM warehouses AS whs WHERE whs.status = emp.status );
{ "outer_table": "employees", "inner_table": "warehouses", "outer_alias": "emp", "inner_alias": "whs", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_07484
train
T1
v3
Schema: employees (alias: emp)(level, amount, value, type) shipments(amount, status, code, name) Task: Find code from employees where amount exceeds the average amount from shipments for the same level. SQL:
SELECT code FROM employees AS emp WHERE amount > ( SELECT AVG(amount) FROM shipments AS shp WHERE shp.level = emp.level );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_07485
train
T1
v2
Schema: accounts (alias: acct)(name, level, id, amount) customers(type, code, level, value) Task: Find value from accounts where a matching record exists in customers with the same code. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = acct.code );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "value", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_07486
train
T1
v3
Schema: regions (alias: rgn)(date, status, code, id) accounts(value, id, name, date) Task: Find salary from regions where value exceeds the average value from accounts for the same type. SQL:
SELECT salary FROM regions AS rgn WHERE value > ( SELECT AVG(value) FROM accounts AS acct WHERE acct.type = rgn.type );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "rgn", "inner_alias": "acct", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_07487
train
T2
v3
Schema: services (alias: srvc)(date, level, amount, type) accounts(id, status, value, salary) Task: Find code from services where amount exceeds the average value from accounts for the same type. SQL:
SELECT code 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": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_07488
train
T2
v1
Schema: schedules (alias: schd)(code, type, status, date) departments(value, date, type, amount) Task: Select id from schedules where status exists in departments for the same status. SQL:
SELECT id FROM schedules AS schd WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.status = schd.status );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_07489
train
T2
v3
Schema: services (alias: srvc)(status, code, level, type) invoices(id, date, salary, amount) Task: Find code from services where amount exceeds the average salary from invoices for the same code. SQL:
SELECT code FROM services AS srvc WHERE amount > ( SELECT AVG(salary) FROM invoices AS inv WHERE inv.code = srvc.code );
{ "outer_table": "services", "inner_table": "invoices", "outer_alias": "srvc", "inner_alias": "inv", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_07490
train
T2
v2
Schema: requests (alias: ordr)(amount, value, code, type) managers(value, level, amount, id) Task: Find code from requests where a matching record exists in managers with the same code. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = ordr.code );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "code", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_07491
train
T2
v1
Schema: products (alias: prod)(amount, level, code, status) schedules(id, amount, level, value) Task: Find name from products where level appears in schedules entries with matching id. SQL:
SELECT name FROM products AS prod WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.id = prod.id );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "name", "filter_col": "level", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_07492
train
T1
v3
Schema: accounts (alias: acct)(salary, amount, type, id) budgets(id, code, name, type) Task: Retrieve amount from accounts with amount above the SUM(salary) of budgets rows sharing the same id. SQL:
SELECT amount FROM accounts AS acct WHERE amount > ( SELECT SUM(salary) FROM budgets AS budg WHERE budg.id = acct.id );
{ "outer_table": "accounts", "inner_table": "budgets", "outer_alias": "acct", "inner_alias": "budg", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_07493
train
T1
v1
Schema: sales (alias: sale)(value, level, salary, status) invoices(amount, type, salary, id) Task: Retrieve name from sales whose level is found in invoices rows where type matches the outer record. SQL:
SELECT name FROM sales AS sale WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.type = sale.type );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_07494
train
T1
v1
Schema: sales (alias: sale)(salary, name, status, date) warehouses(date, code, name, salary) Task: Find id from sales where type appears in warehouses entries with matching level. SQL:
SELECT id FROM sales AS sale WHERE type IN ( SELECT type FROM warehouses AS whs WHERE whs.level = sale.level );
{ "outer_table": "sales", "inner_table": "warehouses", "outer_alias": "sale", "inner_alias": "whs", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_07495
train
T1
v1
Schema: categories (alias: catg)(type, name, date, value) accounts(level, status, name, value) Task: Find id from categories where level appears in accounts entries with matching id. SQL:
SELECT id FROM categories AS catg WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.id = catg.id );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_07496
train
T2
v2
Schema: customers (alias: cust)(status, id, salary, code) accounts(date, type, value, name) Task: Retrieve salary from customers that have at least one corresponding entry in accounts sharing the same code. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = cust.code );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "salary", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_07497
train
T1
v2
Schema: managers (alias: mgr)(status, type, level, value) employees(value, code, name, level) Task: Retrieve id from managers that have at least one corresponding entry in employees sharing the same type. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = mgr.type );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "id", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_07498
train
T1
v2
Schema: categories (alias: catg)(date, level, type, value) budgets(salary, code, type, id) Task: Find salary from categories where a matching record exists in budgets with the same code. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.code = catg.code );
{ "outer_table": "categories", "inner_table": "budgets", "outer_alias": "catg", "inner_alias": "budg", "proj_col": "salary", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_07499
train
T2