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: items (alias: lne)(value, name, salary, id) employees(name, amount, value, level) Task: Find id from items where salary exceeds the average salary from employees for the same id. SQL:
SELECT id FROM items AS lne WHERE salary > ( SELECT SUM(salary) FROM employees AS emp WHERE emp.id = lne.id );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_03600
train
T2
v1
Schema: services (alias: srvc)(name, value, code, date) regions(salary, type, level, id) Task: Retrieve name from services whose level is found in regions rows where id matches the outer record. SQL:
SELECT name FROM services AS srvc WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.id = srvc.id );
{ "outer_table": "services", "inner_table": "regions", "outer_alias": "srvc", "inner_alias": "rgn", "proj_col": "name", "filter_col": "level", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_03601
train
T2
v3
Schema: items (alias: lne)(level, amount, value, id) invoices(id, type, code, level) Task: Find code from items where amount exceeds the average salary from invoices for the same status. SQL:
SELECT code FROM items AS lne WHERE amount > ( SELECT MAX(salary) FROM invoices AS inv WHERE inv.status = lne.status );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_03602
train
T2
v1
Schema: products (alias: prod)(date, type, level, status) departments(value, date, amount, code) Task: Select id from products where id exists in departments for the same id. SQL:
SELECT id FROM products AS prod WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.id = prod.id );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_03603
train
T1
v2
Schema: regions (alias: rgn)(level, date, status, amount) products(status, name, amount, level) Task: Find amount from regions where a matching record exists in products with the same code. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = rgn.code );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "amount", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_03604
train
T2
v2
Schema: employees (alias: emp)(value, level, type, id) requests(name, id, salary, date) Task: Find value from employees where a matching record exists in requests with the same level. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = emp.level );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "value", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_03605
train
T1
v2
Schema: requests (alias: ordr)(value, amount, date, code) employees(id, value, date, code) Task: Find name from requests where a matching record exists in employees with the same id. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = ordr.id );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "name", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_03606
train
T2
v2
Schema: employees (alias: emp)(id, level, name, type) regions(salary, status, name, code) Task: Retrieve salary from employees that have at least one corresponding entry in regions sharing the same code. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = emp.code );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "salary", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_03607
train
T1
v2
Schema: regions (alias: rgn)(level, id, name, value) invoices(name, type, level, date) Task: Retrieve code from regions that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT code FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = rgn.id );
{ "outer_table": "regions", "inner_table": "invoices", "outer_alias": "rgn", "inner_alias": "inv", "proj_col": "code", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_03608
train
T2
v2
Schema: accounts (alias: acct)(id, value, code, type) categories(code, amount, salary, type) Task: Find name from accounts where a matching record exists in categories with the same status. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = acct.status );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "name", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_03609
train
T1
v1
Schema: transactions (alias: txn)(level, date, salary, status) regions(code, status, level, id) Task: Find name from transactions where type appears in regions entries with matching id. SQL:
SELECT name FROM transactions AS txn WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.id = txn.id );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "name", "filter_col": "type", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_03610
train
T1
v1
Schema: invoices (alias: inv)(salary, id, name, level) departments(name, level, salary, id) Task: Select amount from invoices where type exists in departments for the same id. SQL:
SELECT amount FROM invoices AS inv WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.id = inv.id );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_03611
train
T1
v2
Schema: items (alias: lne)(code, name, amount, date) budgets(status, date, amount, name) Task: Find code from items where a matching record exists in budgets with the same level. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.level = lne.level );
{ "outer_table": "items", "inner_table": "budgets", "outer_alias": "lne", "inner_alias": "budg", "proj_col": "code", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_03612
train
T2
v3
Schema: regions (alias: rgn)(value, salary, amount, id) products(date, level, salary, id) Task: Find value from regions where salary exceeds the average value from products for the same status. SQL:
SELECT value FROM regions AS rgn WHERE salary > ( SELECT MIN(value) FROM products AS prod WHERE prod.status = rgn.status );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_03613
train
T2
v2
Schema: accounts (alias: acct)(value, level, date, status) budgets(id, amount, value, salary) Task: Find name from accounts where a matching record exists in budgets with the same status. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.status = acct.status );
{ "outer_table": "accounts", "inner_table": "budgets", "outer_alias": "acct", "inner_alias": "budg", "proj_col": "name", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_03614
train
T1
v2
Schema: transactions (alias: txn)(name, amount, value, date) requests(salary, type, amount, value) Task: Retrieve salary from transactions that have at least one corresponding entry in requests sharing the same code. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = txn.code );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "salary", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_03615
train
T1
v1
Schema: sales (alias: sale)(amount, date, level, type) categories(amount, id, type, code) Task: Retrieve value from sales whose code is found in categories rows where level matches the outer record. SQL:
SELECT value FROM sales AS sale WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.level = sale.level );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_03616
train
T1
v3
Schema: warehouses (alias: whs)(amount, code, type, level) services(status, id, date, type) Task: Retrieve id from warehouses with salary above the SUM(amount) of services rows sharing the same level. SQL:
SELECT id FROM warehouses AS whs WHERE salary > ( SELECT SUM(amount) FROM services AS srvc WHERE srvc.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "services", "outer_alias": "whs", "inner_alias": "srvc", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_03617
train
T2
v1
Schema: categories (alias: catg)(type, status, value, salary) warehouses(value, salary, id, type) Task: Retrieve value from categories whose id is found in warehouses rows where type matches the outer record. SQL:
SELECT value FROM categories AS catg WHERE id IN ( SELECT id FROM warehouses AS whs WHERE whs.type = catg.type );
{ "outer_table": "categories", "inner_table": "warehouses", "outer_alias": "catg", "inner_alias": "whs", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_03618
train
T2
v2
Schema: managers (alias: mgr)(value, type, id, amount) accounts(id, salary, level, type) Task: Find amount from managers where a matching record exists in accounts with the same type. SQL:
SELECT amount 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": "amount", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_03619
train
T1
v2
Schema: regions (alias: rgn)(status, salary, amount, date) orders(id, amount, salary, code) Task: Retrieve name from regions that have at least one corresponding entry in orders sharing the same status. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = rgn.status );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "name", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_03620
train
T2
v1
Schema: staff (alias: empl)(date, code, name, id) items(type, id, value, salary) Task: Find amount from staff where id appears in items entries with matching type. SQL:
SELECT amount FROM staff AS empl WHERE id IN ( SELECT id FROM items AS lne WHERE lne.type = empl.type );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_03621
train
T2
v2
Schema: customers (alias: cust)(value, name, type, amount) invoices(id, type, name, value) Task: Find value from customers where a matching record exists in invoices with the same type. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = cust.type );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "value", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_03622
train
T1
v3
Schema: staff (alias: empl)(value, salary, id, type) budgets(salary, id, amount, date) Task: Find code from staff where value exceeds the average value from budgets for the same type. SQL:
SELECT code FROM staff AS empl WHERE value > ( SELECT MAX(value) FROM budgets AS budg WHERE budg.type = empl.type );
{ "outer_table": "staff", "inner_table": "budgets", "outer_alias": "empl", "inner_alias": "budg", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_03623
train
T2
v3
Schema: employees (alias: emp)(id, level, amount, type) managers(date, id, code, level) Task: Retrieve name from employees with value above the COUNT(amount) of managers rows sharing the same code. SQL:
SELECT name FROM employees AS emp WHERE value > ( SELECT COUNT(amount) FROM managers AS mgr WHERE mgr.code = emp.code );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_03624
train
T1
v1
Schema: employees (alias: emp)(name, status, level, type) managers(level, id, type, code) Task: Retrieve value from employees whose type is found in managers rows where id matches the outer record. SQL:
SELECT value FROM employees AS emp WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.id = emp.id );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "value", "filter_col": "type", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_03625
train
T1
v2
Schema: staff (alias: empl)(type, id, salary, date) invoices(salary, status, id, amount) Task: Retrieve id from staff that have at least one corresponding entry in invoices sharing the same code. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = empl.code );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "id", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_03626
train
T2
v3
Schema: items (alias: lne)(name, id, status, salary) accounts(level, amount, value, name) Task: Find value from items where salary exceeds the average value from accounts for the same level. SQL:
SELECT value FROM items AS lne WHERE salary > ( SELECT SUM(value) FROM accounts AS acct WHERE acct.level = lne.level );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_03627
train
T2
v1
Schema: regions (alias: rgn)(status, date, value, salary) orders(name, status, value, salary) Task: Find salary from regions where type appears in orders entries with matching id. SQL:
SELECT salary FROM regions AS rgn WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.id = rgn.id );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "salary", "filter_col": "type", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_03628
train
T2
v3
Schema: categories (alias: catg)(salary, type, date, amount) requests(id, date, type, status) Task: Retrieve value from categories with salary above the SUM(amount) of requests rows sharing the same type. SQL:
SELECT value FROM categories AS catg WHERE salary > ( SELECT SUM(amount) FROM requests AS ordr WHERE ordr.type = catg.type );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_03629
train
T2
v1
Schema: categories (alias: catg)(status, name, salary, level) services(date, salary, status, name) Task: Retrieve salary from categories whose status is found in services rows where code matches the outer record. SQL:
SELECT salary FROM categories AS catg WHERE status IN ( SELECT status FROM services AS srvc WHERE srvc.code = catg.code );
{ "outer_table": "categories", "inner_table": "services", "outer_alias": "catg", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_03630
train
T2
v3
Schema: invoices (alias: inv)(value, salary, amount, status) categories(id, salary, code, type) Task: Retrieve name from invoices with value above the COUNT(amount) of categories rows sharing the same id. SQL:
SELECT name FROM invoices AS inv WHERE value > ( SELECT COUNT(amount) FROM categories AS catg WHERE catg.id = inv.id );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_03631
train
T1
v3
Schema: employees (alias: emp)(type, value, date, name) staff(code, amount, status, id) Task: Find value from employees where salary exceeds the average value from staff for the same code. SQL:
SELECT value FROM employees AS emp WHERE salary > ( SELECT SUM(value) FROM staff AS empl WHERE empl.code = emp.code );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_03632
train
T1
v1
Schema: requests (alias: ordr)(value, salary, amount, id) items(name, id, value, date) Task: Select salary from requests where id exists in items for the same code. SQL:
SELECT salary FROM requests AS ordr WHERE id IN ( SELECT id FROM items AS lne WHERE lne.code = ordr.code );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_03633
train
T2
v2
Schema: budgets (alias: budg)(salary, value, name, date) categories(level, date, id, salary) Task: Find salary from budgets where a matching record exists in categories with the same status. SQL:
SELECT salary FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = budg.status );
{ "outer_table": "budgets", "inner_table": "categories", "outer_alias": "budg", "inner_alias": "catg", "proj_col": "salary", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_03634
train
T2
v1
Schema: budgets (alias: budg)(name, code, status, id) managers(date, salary, code, status) Task: Select amount from budgets where status exists in managers for the same code. SQL:
SELECT amount FROM budgets AS budg WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.code = budg.code );
{ "outer_table": "budgets", "inner_table": "managers", "outer_alias": "budg", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "status", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_03635
train
T2
v1
Schema: invoices (alias: inv)(value, salary, id, name) requests(amount, status, salary, code) Task: Select amount from invoices where code exists in requests for the same type. SQL:
SELECT amount FROM invoices AS inv WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.type = inv.type );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_03636
train
T1
v2
Schema: services (alias: srvc)(date, value, id, name) invoices(level, amount, id, status) Task: Find value from services where a matching record exists in invoices with the same code. SQL:
SELECT value FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = srvc.code );
{ "outer_table": "services", "inner_table": "invoices", "outer_alias": "srvc", "inner_alias": "inv", "proj_col": "value", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_03637
train
T2
v2
Schema: managers (alias: mgr)(name, type, level, value) customers(amount, date, status, salary) Task: Retrieve id from managers that have at least one corresponding entry in customers sharing the same status. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = mgr.status );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "id", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_03638
train
T1
v1
Schema: managers (alias: mgr)(id, salary, amount, type) accounts(amount, salary, type, value) Task: Find code from managers where status appears in accounts entries with matching status. SQL:
SELECT code FROM managers AS mgr WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.status = mgr.status );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "code", "filter_col": "status", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_03639
train
T1
v2
Schema: budgets (alias: budg)(level, status, value, type) staff(id, type, level, date) Task: Retrieve value from budgets that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT value FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = budg.status );
{ "outer_table": "budgets", "inner_table": "staff", "outer_alias": "budg", "inner_alias": "empl", "proj_col": "value", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_03640
train
T2
v2
Schema: items (alias: lne)(date, id, salary, type) departments(id, level, type, code) Task: Find name from items where a matching record exists in departments with the same id. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = lne.id );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "name", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_03641
train
T2
v2
Schema: regions (alias: rgn)(status, amount, id, level) requests(type, date, salary, status) Task: Retrieve value from regions that have at least one corresponding entry in requests sharing the same status. SQL:
SELECT value FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = rgn.status );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "value", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_03642
train
T2
v2
Schema: warehouses (alias: whs)(date, amount, type, value) budgets(salary, type, date, value) Task: Retrieve salary from warehouses that have at least one corresponding entry in budgets sharing the same type. SQL:
SELECT salary FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "budgets", "outer_alias": "whs", "inner_alias": "budg", "proj_col": "salary", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_03643
train
T2
v2
Schema: shipments (alias: shp)(id, amount, type, code) products(level, code, value, id) Task: Retrieve code from shipments that have at least one corresponding entry in products sharing the same status. SQL:
SELECT code FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = shp.status );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "code", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_03644
train
T2
v3
Schema: transactions (alias: txn)(level, value, date, name) employees(type, date, name, salary) Task: Find amount from transactions where value exceeds the average salary from employees for the same code. SQL:
SELECT amount FROM transactions AS txn WHERE value > ( SELECT SUM(salary) FROM employees AS emp WHERE emp.code = txn.code );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_03645
train
T1
v2
Schema: orders (alias: ord)(salary, code, amount, value) managers(date, level, id, value) Task: Retrieve amount from orders that have at least one corresponding entry in managers sharing the same status. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = ord.status );
{ "outer_table": "orders", "inner_table": "managers", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "amount", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_03646
train
T1
v2
Schema: products (alias: prod)(level, code, status, amount) orders(date, name, code, status) Task: Find code from products where a matching record exists in orders with the same code. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = prod.code );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "code", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_03647
train
T1
v3
Schema: categories (alias: catg)(amount, name, code, status) staff(date, value, amount, level) Task: Retrieve value from categories with amount above the COUNT(amount) of staff rows sharing the same status. SQL:
SELECT value FROM categories AS catg WHERE amount > ( SELECT COUNT(amount) FROM staff AS empl WHERE empl.status = catg.status );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_03648
train
T2
v1
Schema: staff (alias: empl)(level, value, id, name) products(code, value, status, name) Task: Select amount from staff where id exists in products for the same type. SQL:
SELECT amount FROM staff AS empl WHERE id IN ( SELECT id FROM products AS prod WHERE prod.type = empl.type );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_03649
train
T2
v3
Schema: items (alias: lne)(amount, level, date, id) sales(value, type, code, level) Task: Retrieve id from items with salary above the MAX(amount) of sales rows sharing the same code. SQL:
SELECT id FROM items AS lne WHERE salary > ( SELECT MAX(amount) FROM sales AS sale WHERE sale.code = lne.code );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_03650
train
T2
v1
Schema: orders (alias: ord)(salary, amount, date, code) sales(name, id, value, salary) Task: Find name from orders where type appears in sales entries with matching type. SQL:
SELECT name FROM orders AS ord WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.type = ord.type );
{ "outer_table": "orders", "inner_table": "sales", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "name", "filter_col": "type", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_03651
train
T1
v1
Schema: warehouses (alias: whs)(date, level, code, id) accounts(date, name, id, value) Task: Select name from warehouses where status exists in accounts for the same status. SQL:
SELECT name FROM warehouses AS whs WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "accounts", "outer_alias": "whs", "inner_alias": "acct", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_03652
train
T2
v1
Schema: departments (alias: dept)(amount, id, type, date) requests(amount, value, date, salary) Task: Find value from departments where id appears in requests entries with matching code. SQL:
SELECT value FROM departments AS dept WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.code = dept.code );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_03653
train
T1
v3
Schema: orders (alias: ord)(name, id, salary, amount) budgets(name, type, id, value) Task: Retrieve name from orders with salary above the COUNT(value) of budgets rows sharing the same type. SQL:
SELECT name FROM orders AS ord WHERE salary > ( SELECT COUNT(value) FROM budgets AS budg WHERE budg.type = ord.type );
{ "outer_table": "orders", "inner_table": "budgets", "outer_alias": "ord", "inner_alias": "budg", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_03654
train
T1
v1
Schema: regions (alias: rgn)(amount, name, id, type) managers(value, level, salary, type) Task: Select value from regions where type exists in managers for the same type. SQL:
SELECT value FROM regions AS rgn WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.type = rgn.type );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "value", "filter_col": "type", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_03655
train
T2
v2
Schema: budgets (alias: budg)(salary, value, date, type) transactions(value, level, salary, amount) Task: Find value from budgets where a matching record exists in transactions with the same status. SQL:
SELECT value FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = budg.status );
{ "outer_table": "budgets", "inner_table": "transactions", "outer_alias": "budg", "inner_alias": "txn", "proj_col": "value", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_03656
train
T2
v2
Schema: managers (alias: mgr)(id, level, amount, date) invoices(status, code, salary, value) Task: Find id from managers where a matching record exists in invoices with the same id. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = mgr.id );
{ "outer_table": "managers", "inner_table": "invoices", "outer_alias": "mgr", "inner_alias": "inv", "proj_col": "id", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_03657
train
T1
v3
Schema: orders (alias: ord)(status, id, amount, date) warehouses(name, salary, date, code) Task: Retrieve value from orders with amount above the COUNT(amount) of warehouses rows sharing the same code. SQL:
SELECT value FROM orders AS ord WHERE amount > ( SELECT COUNT(amount) FROM warehouses AS whs WHERE whs.code = ord.code );
{ "outer_table": "orders", "inner_table": "warehouses", "outer_alias": "ord", "inner_alias": "whs", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_03658
train
T1
v2
Schema: accounts (alias: acct)(code, type, status, date) managers(date, id, code, amount) Task: Retrieve value from accounts that have at least one corresponding entry in managers sharing the same status. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = acct.status );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "value", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_03659
train
T1
v1
Schema: sales (alias: sale)(date, salary, id, value) invoices(date, status, code, salary) Task: Select amount from sales where type exists in invoices for the same level. SQL:
SELECT amount FROM sales AS sale WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.level = sale.level );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_03660
train
T1
v2
Schema: invoices (alias: inv)(value, salary, date, name) budgets(code, status, type, id) Task: Find code from invoices where a matching record exists in budgets with the same type. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.type = inv.type );
{ "outer_table": "invoices", "inner_table": "budgets", "outer_alias": "inv", "inner_alias": "budg", "proj_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_03661
train
T1
v2
Schema: budgets (alias: budg)(salary, amount, code, type) shipments(id, name, type, salary) Task: Find code from budgets where a matching record exists in shipments with the same type. SQL:
SELECT code FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = budg.type );
{ "outer_table": "budgets", "inner_table": "shipments", "outer_alias": "budg", "inner_alias": "shp", "proj_col": "code", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_03662
train
T2
v3
Schema: items (alias: lne)(amount, status, code, value) invoices(name, amount, level, status) Task: Retrieve amount from items with amount above the SUM(amount) of invoices rows sharing the same status. SQL:
SELECT amount FROM items AS lne WHERE amount > ( SELECT SUM(amount) FROM invoices AS inv WHERE inv.status = lne.status );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_03663
train
T2
v2
Schema: schedules (alias: schd)(amount, date, type, level) items(date, amount, code, salary) Task: Find amount from schedules where a matching record exists in items with the same code. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = schd.code );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "amount", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_03664
train
T2
v1
Schema: orders (alias: ord)(name, id, code, level) warehouses(status, salary, id, value) Task: Select id from orders where level exists in warehouses for the same id. SQL:
SELECT id FROM orders AS ord WHERE level IN ( SELECT level FROM warehouses AS whs WHERE whs.id = ord.id );
{ "outer_table": "orders", "inner_table": "warehouses", "outer_alias": "ord", "inner_alias": "whs", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_03665
train
T1
v2
Schema: invoices (alias: inv)(value, code, type, status) customers(amount, status, type, code) Task: Retrieve value from invoices that have at least one corresponding entry in customers sharing the same code. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = inv.code );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "value", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_03666
train
T1
v1
Schema: requests (alias: ordr)(salary, id, code, date) customers(type, date, id, level) Task: Find name from requests where id appears in customers entries with matching type. SQL:
SELECT name FROM requests AS ordr WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.type = ordr.type );
{ "outer_table": "requests", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "name", "filter_col": "id", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_03667
train
T2
v1
Schema: sales (alias: sale)(salary, id, amount, level) categories(value, type, status, level) Task: Select name from sales where code exists in categories for the same code. SQL:
SELECT name FROM sales AS sale WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.code = sale.code );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_03668
train
T1
v3
Schema: staff (alias: empl)(salary, id, type, level) budgets(name, level, id, status) Task: Retrieve name from staff with salary above the MAX(value) of budgets rows sharing the same type. SQL:
SELECT name FROM staff AS empl WHERE salary > ( SELECT MAX(value) FROM budgets AS budg WHERE budg.type = empl.type );
{ "outer_table": "staff", "inner_table": "budgets", "outer_alias": "empl", "inner_alias": "budg", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_03669
train
T2
v2
Schema: accounts (alias: acct)(id, status, value, salary) schedules(name, id, salary, type) Task: Find amount from accounts where a matching record exists in schedules with the same id. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = acct.id );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "amount", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_03670
train
T1
v1
Schema: items (alias: lne)(date, type, id, name) shipments(value, type, amount, code) Task: Retrieve code from items whose level is found in shipments rows where status matches the outer record. SQL:
SELECT code FROM items AS lne WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.status = lne.status );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_03671
train
T2
v3
Schema: accounts (alias: acct)(status, type, salary, date) departments(level, id, name, code) Task: Retrieve salary from accounts with amount above the MIN(salary) of departments rows sharing the same id. SQL:
SELECT salary FROM accounts AS acct WHERE amount > ( SELECT MIN(salary) FROM departments AS dept WHERE dept.id = acct.id );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_03672
train
T1
v1
Schema: products (alias: prod)(level, name, value, amount) accounts(type, name, amount, date) Task: Retrieve code from products whose status is found in accounts rows where id matches the outer record. SQL:
SELECT code FROM products AS prod WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.id = prod.id );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_03673
train
T1
v3
Schema: warehouses (alias: whs)(code, name, date, status) orders(amount, name, salary, id) Task: Retrieve salary from warehouses with value above the COUNT(salary) of orders rows sharing the same id. SQL:
SELECT salary FROM warehouses AS whs WHERE value > ( SELECT COUNT(salary) FROM orders AS ord WHERE ord.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "orders", "outer_alias": "whs", "inner_alias": "ord", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_03674
train
T2
v1
Schema: orders (alias: ord)(code, name, id, type) staff(value, level, name, status) Task: Select salary from orders where status exists in staff for the same level. SQL:
SELECT salary FROM orders AS ord WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.level = ord.level );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_03675
train
T1
v3
Schema: shipments (alias: shp)(type, name, status, code) categories(type, id, amount, name) Task: Retrieve id from shipments with salary above the MIN(value) of categories rows sharing the same id. SQL:
SELECT id FROM shipments AS shp WHERE salary > ( SELECT MIN(value) FROM categories AS catg WHERE catg.id = shp.id );
{ "outer_table": "shipments", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "catg", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_03676
train
T2
v3
Schema: shipments (alias: shp)(id, code, level, status) accounts(amount, level, type, date) Task: Find name from shipments where value exceeds the average salary from accounts for the same level. SQL:
SELECT name FROM shipments AS shp WHERE value > ( SELECT AVG(salary) FROM accounts AS acct WHERE acct.level = shp.level );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_03677
train
T2
v1
Schema: regions (alias: rgn)(salary, type, amount, date) shipments(date, name, type, level) Task: Select value from regions where code exists in shipments for the same code. SQL:
SELECT value FROM regions AS rgn WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.code = rgn.code );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_03678
train
T2
v3
Schema: departments (alias: dept)(type, level, code, name) categories(amount, status, code, id) Task: Find value from departments where salary exceeds the average salary from categories for the same level. SQL:
SELECT value FROM departments AS dept WHERE salary > ( SELECT AVG(salary) FROM categories AS catg WHERE catg.level = dept.level );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_03679
train
T1
v1
Schema: warehouses (alias: whs)(salary, status, type, date) shipments(value, status, type, code) Task: Retrieve id from warehouses whose id is found in shipments rows where id matches the outer record. SQL:
SELECT id FROM warehouses AS whs WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "shipments", "outer_alias": "whs", "inner_alias": "shp", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_03680
train
T2
v2
Schema: employees (alias: emp)(id, code, level, amount) categories(level, id, code, value) Task: Retrieve name from employees that have at least one corresponding entry in categories sharing the same status. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = emp.status );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "name", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_03681
train
T1
v2
Schema: services (alias: srvc)(value, name, type, id) requests(status, level, amount, type) Task: Retrieve code from services that have at least one corresponding entry in requests sharing the same status. SQL:
SELECT code FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = srvc.status );
{ "outer_table": "services", "inner_table": "requests", "outer_alias": "srvc", "inner_alias": "ordr", "proj_col": "code", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_03682
train
T2
v1
Schema: budgets (alias: budg)(level, status, value, id) categories(date, code, id, amount) Task: Find name from budgets where code appears in categories entries with matching code. SQL:
SELECT name FROM budgets AS budg WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.code = budg.code );
{ "outer_table": "budgets", "inner_table": "categories", "outer_alias": "budg", "inner_alias": "catg", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_03683
train
T2
v3
Schema: categories (alias: catg)(level, name, value, type) products(date, type, amount, level) Task: Retrieve salary from categories with value above the MIN(salary) of products rows sharing the same level. SQL:
SELECT salary FROM categories AS catg WHERE value > ( SELECT MIN(salary) FROM products AS prod WHERE prod.level = catg.level );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_03684
train
T2
v3
Schema: transactions (alias: txn)(date, level, amount, status) managers(amount, name, code, status) Task: Retrieve amount from transactions with salary above the MIN(salary) of managers rows sharing the same level. SQL:
SELECT amount FROM transactions AS txn WHERE salary > ( SELECT MIN(salary) FROM managers AS mgr WHERE mgr.level = txn.level );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_03685
train
T1
v2
Schema: staff (alias: empl)(salary, status, value, level) transactions(date, name, status, amount) Task: Find salary from staff where a matching record exists in transactions with the same type. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = empl.type );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "salary", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_03686
train
T2
v3
Schema: departments (alias: dept)(name, value, level, amount) transactions(salary, date, name, value) Task: Find amount from departments where value exceeds the average value from transactions for the same level. SQL:
SELECT amount FROM departments AS dept WHERE value > ( SELECT MIN(value) FROM transactions AS txn WHERE txn.level = dept.level );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_03687
train
T1
v1
Schema: staff (alias: empl)(type, amount, code, date) items(value, type, code, name) Task: Find amount from staff where id appears in items entries with matching level. SQL:
SELECT amount FROM staff AS empl WHERE id IN ( SELECT id FROM items AS lne WHERE lne.level = empl.level );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_03688
train
T2
v2
Schema: managers (alias: mgr)(level, name, type, date) services(id, code, status, amount) Task: Retrieve value from managers that have at least one corresponding entry in services sharing the same id. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = mgr.id );
{ "outer_table": "managers", "inner_table": "services", "outer_alias": "mgr", "inner_alias": "srvc", "proj_col": "value", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_03689
train
T1
v2
Schema: orders (alias: ord)(salary, id, name, value) transactions(level, amount, value, id) Task: Find value from orders where a matching record exists in transactions with the same type. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = ord.type );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "value", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_03690
train
T1
v3
Schema: regions (alias: rgn)(value, type, date, name) requests(status, type, value, amount) Task: Retrieve name from regions with amount above the MAX(amount) of requests rows sharing the same level. SQL:
SELECT name FROM regions AS rgn WHERE amount > ( SELECT MAX(amount) FROM requests AS ordr WHERE ordr.level = rgn.level );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_03691
train
T2
v3
Schema: customers (alias: cust)(id, salary, status, amount) accounts(level, salary, amount, value) Task: Retrieve code from customers with value above the MAX(amount) of accounts rows sharing the same type. SQL:
SELECT code FROM customers AS cust WHERE value > ( SELECT MAX(amount) FROM accounts AS acct WHERE acct.type = cust.type );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_03692
train
T1
v2
Schema: transactions (alias: txn)(date, value, code, salary) regions(amount, status, level, date) Task: Find name from transactions where a matching record exists in regions with the same level. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = txn.level );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "name", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_03693
train
T1
v2
Schema: orders (alias: ord)(level, type, status, value) schedules(level, amount, name, status) Task: Retrieve value from orders that have at least one corresponding entry in schedules sharing the same id. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = ord.id );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "value", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_03694
train
T1
v3
Schema: customers (alias: cust)(id, amount, name, status) warehouses(status, value, name, type) Task: Retrieve code from customers with salary above the MIN(amount) of warehouses rows sharing the same level. SQL:
SELECT code FROM customers AS cust WHERE salary > ( SELECT MIN(amount) FROM warehouses AS whs WHERE whs.level = cust.level );
{ "outer_table": "customers", "inner_table": "warehouses", "outer_alias": "cust", "inner_alias": "whs", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_03695
train
T1
v2
Schema: products (alias: prod)(date, level, id, code) orders(name, date, type, id) Task: Find code from products where a matching record exists in orders with the same level. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = prod.level );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "code", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_03696
train
T1
v1
Schema: items (alias: lne)(salary, type, date, value) staff(id, value, salary, level) Task: Select value from items where id exists in staff for the same type. SQL:
SELECT value FROM items AS lne WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.type = lne.type );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_03697
train
T2
v1
Schema: customers (alias: cust)(level, code, type, value) schedules(date, type, status, id) Task: Select value from customers where id exists in schedules for the same code. SQL:
SELECT value FROM customers AS cust WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.code = cust.code );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_03698
train
T1
v2
Schema: sales (alias: sale)(type, code, amount, status) departments(name, status, salary, amount) Task: Retrieve code from sales that have at least one corresponding entry in departments sharing the same id. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = sale.id );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "code", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_03699
train
T1