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
v2
Schema: transactions (alias: txn)(type, id, level, salary) departments(level, status, name, date) Task: Find code from transactions where a matching record exists in departments with the same type. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = txn.type );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "code", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_04400
train
T1
v1
Schema: categories (alias: catg)(id, code, salary, amount) budgets(salary, level, value, id) Task: Select salary from categories where id exists in budgets for the same type. SQL:
SELECT salary FROM categories AS catg WHERE id IN ( SELECT id FROM budgets AS budg WHERE budg.type = catg.type );
{ "outer_table": "categories", "inner_table": "budgets", "outer_alias": "catg", "inner_alias": "budg", "proj_col": "salary", "filter_col": "id", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_04401
train
T2
v3
Schema: regions (alias: rgn)(level, salary, value, date) services(salary, name, status, level) Task: Retrieve salary from regions with value above the SUM(amount) of services rows sharing the same status. SQL:
SELECT salary FROM regions AS rgn WHERE value > ( SELECT SUM(amount) FROM services AS srvc WHERE srvc.status = rgn.status );
{ "outer_table": "regions", "inner_table": "services", "outer_alias": "rgn", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_04402
train
T2
v1
Schema: accounts (alias: acct)(salary, code, id, status) departments(date, salary, value, code) Task: Select name from accounts where id exists in departments for the same type. SQL:
SELECT name FROM accounts AS acct WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.type = acct.type );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "name", "filter_col": "id", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_04403
train
T1
v2
Schema: invoices (alias: inv)(id, level, salary, date) regions(type, value, level, code) Task: Retrieve amount from invoices that have at least one corresponding entry in regions sharing the same type. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = inv.type );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "amount", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_04404
train
T1
v2
Schema: categories (alias: catg)(salary, name, status, amount) products(type, salary, id, code) Task: Find amount from categories where a matching record exists in products with the same id. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = catg.id );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "amount", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_04405
train
T2
v1
Schema: sales (alias: sale)(date, amount, code, name) items(salary, date, code, name) Task: Retrieve code from sales whose level is found in items rows where id matches the outer record. SQL:
SELECT code FROM sales AS sale WHERE level IN ( SELECT level FROM items AS lne WHERE lne.id = sale.id );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "code", "filter_col": "level", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_04406
train
T1
v2
Schema: shipments (alias: shp)(amount, id, salary, name) requests(date, salary, amount, code) Task: Find id from shipments where a matching record exists in requests with the same id. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = shp.id );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "id", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_04407
train
T2
v3
Schema: transactions (alias: txn)(type, amount, code, id) schedules(amount, code, type, date) Task: Find code from transactions where salary exceeds the average salary from schedules for the same level. SQL:
SELECT code FROM transactions AS txn WHERE salary > ( SELECT AVG(salary) FROM schedules AS schd WHERE schd.level = txn.level );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_04408
train
T1
v2
Schema: items (alias: lne)(level, name, code, id) products(code, level, value, id) Task: Retrieve code from items that have at least one corresponding entry in products sharing the same id. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = lne.id );
{ "outer_table": "items", "inner_table": "products", "outer_alias": "lne", "inner_alias": "prod", "proj_col": "code", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_04409
train
T2
v3
Schema: services (alias: srvc)(value, id, level, type) requests(value, level, id, date) Task: Find id from services where salary exceeds the average salary from requests for the same status. SQL:
SELECT id FROM services AS srvc WHERE salary > ( SELECT COUNT(salary) FROM requests AS ordr WHERE ordr.status = srvc.status );
{ "outer_table": "services", "inner_table": "requests", "outer_alias": "srvc", "inner_alias": "ordr", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_04410
train
T2
v3
Schema: customers (alias: cust)(code, amount, status, type) staff(value, name, type, amount) Task: Retrieve value from customers with amount above the SUM(amount) of staff rows sharing the same id. SQL:
SELECT value FROM customers AS cust WHERE amount > ( SELECT SUM(amount) FROM staff AS empl WHERE empl.id = cust.id );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_04411
train
T1
v3
Schema: orders (alias: ord)(amount, name, salary, type) accounts(level, salary, date, amount) Task: Find value from orders where amount exceeds the average salary from accounts for the same code. SQL:
SELECT value FROM orders AS ord WHERE amount > ( SELECT MIN(salary) FROM accounts AS acct WHERE acct.code = ord.code );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_04412
train
T1
v3
Schema: categories (alias: catg)(salary, id, status, code) items(type, status, level, amount) Task: Find salary from categories where amount exceeds the average salary from items for the same type. SQL:
SELECT salary FROM categories AS catg WHERE amount > ( SELECT AVG(salary) FROM items AS lne WHERE lne.type = catg.type );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_04413
train
T2
v2
Schema: items (alias: lne)(name, date, salary, code) customers(date, status, code, name) Task: Find name from items where a matching record exists in customers with the same type. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = lne.type );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "name", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_04414
train
T2
v3
Schema: staff (alias: empl)(id, value, level, date) orders(code, value, type, amount) Task: Retrieve name from staff with value above the MIN(salary) of orders rows sharing the same code. SQL:
SELECT name FROM staff AS empl WHERE value > ( SELECT MIN(salary) FROM orders AS ord WHERE ord.code = empl.code );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_04415
train
T2
v2
Schema: transactions (alias: txn)(amount, type, code, date) services(name, level, code, id) Task: Find id from transactions where a matching record exists in services with the same type. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.type = txn.type );
{ "outer_table": "transactions", "inner_table": "services", "outer_alias": "txn", "inner_alias": "srvc", "proj_col": "id", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_04416
train
T1
v1
Schema: managers (alias: mgr)(date, id, amount, type) budgets(value, name, type, date) Task: Select amount from managers where id exists in budgets for the same id. SQL:
SELECT amount FROM managers AS mgr WHERE id IN ( SELECT id FROM budgets AS budg WHERE budg.id = mgr.id );
{ "outer_table": "managers", "inner_table": "budgets", "outer_alias": "mgr", "inner_alias": "budg", "proj_col": "amount", "filter_col": "id", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_04417
train
T1
v1
Schema: employees (alias: emp)(id, amount, date, salary) staff(id, amount, value, status) Task: Retrieve id from employees whose id is found in staff rows where id matches the outer record. SQL:
SELECT id FROM employees AS emp WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.id = emp.id );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_04418
train
T1
v3
Schema: products (alias: prod)(value, level, id, status) transactions(type, salary, amount, level) Task: Find id from products where value exceeds the average amount from transactions for the same type. SQL:
SELECT id FROM products AS prod WHERE value > ( SELECT MIN(amount) FROM transactions AS txn WHERE txn.type = prod.type );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_04419
train
T1
v3
Schema: orders (alias: ord)(value, type, amount, date) shipments(salary, amount, level, date) Task: Find code from orders where value exceeds the average amount from shipments for the same id. SQL:
SELECT code FROM orders AS ord WHERE value > ( SELECT MIN(amount) FROM shipments AS shp WHERE shp.id = ord.id );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_04420
train
T1
v3
Schema: warehouses (alias: whs)(type, status, code, amount) categories(date, name, value, amount) Task: Retrieve salary from warehouses with value above the AVG(value) of categories rows sharing the same status. SQL:
SELECT salary FROM warehouses AS whs WHERE value > ( SELECT AVG(value) FROM categories AS catg WHERE catg.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "categories", "outer_alias": "whs", "inner_alias": "catg", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_04421
train
T2
v1
Schema: sales (alias: sale)(level, amount, type, salary) shipments(status, name, date, id) Task: Retrieve salary from sales whose code is found in shipments rows where code matches the outer record. SQL:
SELECT salary FROM sales AS sale WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.code = sale.code );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_04422
train
T1
v3
Schema: sales (alias: sale)(name, id, status, date) employees(id, date, amount, value) Task: Retrieve salary from sales with salary above the AVG(value) of employees rows sharing the same type. SQL:
SELECT salary FROM sales AS sale WHERE salary > ( SELECT AVG(value) FROM employees AS emp WHERE emp.type = sale.type );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_04423
train
T1
v3
Schema: regions (alias: rgn)(level, id, type, amount) sales(code, level, amount, id) Task: Find code from regions where value exceeds the average amount from sales for the same level. SQL:
SELECT code FROM regions AS rgn WHERE value > ( SELECT AVG(amount) FROM sales AS sale WHERE sale.level = rgn.level );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_04424
train
T2
v2
Schema: employees (alias: emp)(type, level, id, name) shipments(type, date, id, level) Task: Retrieve name from employees that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = emp.status );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "name", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_04425
train
T1
v1
Schema: shipments (alias: shp)(name, status, type, date) items(date, value, name, amount) Task: Find name from shipments where level appears in items entries with matching id. SQL:
SELECT name FROM shipments AS shp WHERE level IN ( SELECT level FROM items AS lne WHERE lne.id = shp.id );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "name", "filter_col": "level", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_04426
train
T2
v1
Schema: items (alias: lne)(amount, salary, name, code) managers(status, id, name, date) Task: Retrieve salary from items whose level is found in managers rows where type matches the outer record. SQL:
SELECT salary FROM items AS lne WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.type = lne.type );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "level", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_04427
train
T2
v2
Schema: products (alias: prod)(code, date, name, amount) sales(amount, name, code, status) Task: Find salary from products where a matching record exists in sales with the same level. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = prod.level );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "salary", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_04428
train
T1
v1
Schema: customers (alias: cust)(status, code, amount, value) invoices(value, level, code, date) Task: Find value from customers where type appears in invoices entries with matching level. SQL:
SELECT value FROM customers AS cust WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.level = cust.level );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_04429
train
T1
v2
Schema: regions (alias: rgn)(name, id, level, date) services(status, code, name, salary) Task: Find amount from regions where a matching record exists in services with the same id. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = rgn.id );
{ "outer_table": "regions", "inner_table": "services", "outer_alias": "rgn", "inner_alias": "srvc", "proj_col": "amount", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_04430
train
T2
v1
Schema: requests (alias: ordr)(name, code, date, id) customers(level, name, status, amount) Task: Find name from requests where level appears in customers entries with matching code. SQL:
SELECT name FROM requests AS ordr WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.code = ordr.code );
{ "outer_table": "requests", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_04431
train
T2
v3
Schema: invoices (alias: inv)(amount, date, level, name) schedules(value, code, amount, level) Task: Find id from invoices where value exceeds the average salary from schedules for the same level. SQL:
SELECT id FROM invoices AS inv WHERE value > ( SELECT COUNT(salary) FROM schedules AS schd WHERE schd.level = inv.level );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_04432
train
T1
v3
Schema: transactions (alias: txn)(date, type, amount, salary) invoices(id, code, level, date) Task: Find id from transactions where value exceeds the average value from invoices for the same code. SQL:
SELECT id FROM transactions AS txn WHERE value > ( SELECT AVG(value) FROM invoices AS inv WHERE inv.code = txn.code );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_04433
train
T1
v3
Schema: invoices (alias: inv)(value, id, type, code) shipments(value, type, name, amount) Task: Find code from invoices where value exceeds the average salary from shipments for the same id. SQL:
SELECT code FROM invoices AS inv WHERE value > ( SELECT MAX(salary) FROM shipments AS shp WHERE shp.id = inv.id );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_04434
train
T1
v3
Schema: items (alias: lne)(code, amount, level, date) sales(date, status, amount, type) Task: Retrieve amount from items with value above the MAX(amount) of sales rows sharing the same type. SQL:
SELECT amount FROM items AS lne WHERE value > ( SELECT MAX(amount) FROM sales AS sale WHERE sale.type = lne.type );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_04435
train
T2
v3
Schema: products (alias: prod)(code, id, status, value) warehouses(status, salary, id, value) Task: Find name from products where value exceeds the average value from warehouses for the same id. SQL:
SELECT name FROM products AS prod WHERE value > ( SELECT AVG(value) FROM warehouses AS whs WHERE whs.id = prod.id );
{ "outer_table": "products", "inner_table": "warehouses", "outer_alias": "prod", "inner_alias": "whs", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_04436
train
T1
v2
Schema: budgets (alias: budg)(status, name, salary, level) warehouses(status, level, value, id) Task: Retrieve value from budgets that have at least one corresponding entry in warehouses sharing the same id. SQL:
SELECT value FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.id = budg.id );
{ "outer_table": "budgets", "inner_table": "warehouses", "outer_alias": "budg", "inner_alias": "whs", "proj_col": "value", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_04437
train
T2
v1
Schema: invoices (alias: inv)(type, salary, value, name) managers(value, date, code, level) Task: Select salary from invoices where code exists in managers for the same type. SQL:
SELECT salary FROM invoices AS inv WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.type = inv.type );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_04438
train
T1
v2
Schema: transactions (alias: txn)(type, name, code, value) sales(type, status, id, date) Task: Find salary from transactions where a matching record exists in sales with the same type. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = txn.type );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "salary", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_04439
train
T1
v1
Schema: shipments (alias: shp)(status, type, id, value) requests(status, code, value, type) Task: Find salary from shipments where status appears in requests entries with matching status. SQL:
SELECT salary FROM shipments AS shp WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.status = shp.status );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_04440
train
T2
v1
Schema: employees (alias: emp)(value, status, salary, type) warehouses(type, id, level, code) Task: Find salary from employees where id appears in warehouses entries with matching code. SQL:
SELECT salary FROM employees AS emp WHERE id IN ( SELECT id FROM warehouses AS whs WHERE whs.code = emp.code );
{ "outer_table": "employees", "inner_table": "warehouses", "outer_alias": "emp", "inner_alias": "whs", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_04441
train
T1
v1
Schema: invoices (alias: inv)(type, name, value, date) products(name, level, type, code) Task: Select salary from invoices where id exists in products for the same id. SQL:
SELECT salary FROM invoices AS inv WHERE id IN ( SELECT id FROM products AS prod WHERE prod.id = inv.id );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_04442
train
T1
v2
Schema: warehouses (alias: whs)(amount, salary, level, value) invoices(code, id, name, type) Task: Find value from warehouses where a matching record exists in invoices with the same code. SQL:
SELECT value FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "invoices", "outer_alias": "whs", "inner_alias": "inv", "proj_col": "value", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_04443
train
T2
v3
Schema: departments (alias: dept)(name, status, amount, code) products(id, name, value, date) Task: Retrieve value from departments with salary above the MAX(salary) of products rows sharing the same level. SQL:
SELECT value FROM departments AS dept WHERE salary > ( SELECT MAX(salary) FROM products AS prod WHERE prod.level = dept.level );
{ "outer_table": "departments", "inner_table": "products", "outer_alias": "dept", "inner_alias": "prod", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_04444
train
T1
v2
Schema: categories (alias: catg)(code, status, date, amount) products(name, code, level, status) Task: Retrieve name from categories that have at least one corresponding entry in products sharing the same type. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = catg.type );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "name", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_04445
train
T2
v1
Schema: products (alias: prod)(name, amount, salary, type) transactions(date, level, amount, id) Task: Find amount from products where status appears in transactions entries with matching type. SQL:
SELECT amount FROM products AS prod WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.type = prod.type );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "amount", "filter_col": "status", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_04446
train
T1
v2
Schema: shipments (alias: shp)(value, level, status, salary) services(value, status, date, amount) Task: Retrieve value from shipments that have at least one corresponding entry in services sharing the same id. SQL:
SELECT value FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = shp.id );
{ "outer_table": "shipments", "inner_table": "services", "outer_alias": "shp", "inner_alias": "srvc", "proj_col": "value", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_04447
train
T2
v3
Schema: items (alias: lne)(level, date, status, name) sales(type, value, date, status) Task: Retrieve code from items with amount above the SUM(value) of sales rows sharing the same status. SQL:
SELECT code FROM items AS lne WHERE amount > ( SELECT SUM(value) FROM sales AS sale WHERE sale.status = lne.status );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_04448
train
T2
v3
Schema: regions (alias: rgn)(level, id, salary, value) staff(code, status, name, date) Task: Retrieve name from regions with amount above the MIN(value) of staff rows sharing the same type. SQL:
SELECT name FROM regions AS rgn WHERE amount > ( SELECT MIN(value) FROM staff AS empl WHERE empl.type = rgn.type );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_04449
train
T2
v1
Schema: managers (alias: mgr)(value, status, salary, type) sales(type, id, level, status) Task: Retrieve salary from managers whose id is found in sales rows where level matches the outer record. SQL:
SELECT salary FROM managers AS mgr WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.level = mgr.level );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "salary", "filter_col": "id", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_04450
train
T1
v3
Schema: sales (alias: sale)(code, salary, date, type) customers(id, value, salary, type) Task: Retrieve salary from sales with value above the SUM(salary) of customers rows sharing the same id. SQL:
SELECT salary FROM sales AS sale WHERE value > ( SELECT SUM(salary) FROM customers AS cust WHERE cust.id = sale.id );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_04451
train
T1
v1
Schema: transactions (alias: txn)(type, code, salary, value) services(salary, value, type, status) Task: Find name from transactions where level appears in services entries with matching id. SQL:
SELECT name FROM transactions AS txn WHERE level IN ( SELECT level FROM services AS srvc WHERE srvc.id = txn.id );
{ "outer_table": "transactions", "inner_table": "services", "outer_alias": "txn", "inner_alias": "srvc", "proj_col": "name", "filter_col": "level", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_04452
train
T1
v1
Schema: products (alias: prod)(date, salary, type, level) managers(status, salary, id, level) Task: Select name from products where status exists in managers for the same id. SQL:
SELECT name FROM products AS prod WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.id = prod.id );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_04453
train
T1
v1
Schema: staff (alias: empl)(date, status, salary, name) transactions(level, salary, value, code) Task: Select value from staff where id exists in transactions for the same type. SQL:
SELECT value FROM staff AS empl WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.type = empl.type );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_04454
train
T2
v3
Schema: products (alias: prod)(amount, name, id, level) managers(salary, status, type, amount) Task: Retrieve id from products with amount above the SUM(amount) of managers rows sharing the same type. SQL:
SELECT id FROM products AS prod WHERE amount > ( SELECT SUM(amount) FROM managers AS mgr WHERE mgr.type = prod.type );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_04455
train
T1
v1
Schema: sales (alias: sale)(type, code, value, id) invoices(amount, value, code, date) Task: Retrieve amount from sales whose type is found in invoices rows where type matches the outer record. SQL:
SELECT amount FROM sales AS sale WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.type = sale.type );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_04456
train
T1
v3
Schema: managers (alias: mgr)(id, amount, salary, status) items(status, salary, date, name) Task: Find amount from managers where amount exceeds the average amount from items for the same id. SQL:
SELECT amount FROM managers AS mgr WHERE amount > ( SELECT COUNT(amount) FROM items AS lne WHERE lne.id = mgr.id );
{ "outer_table": "managers", "inner_table": "items", "outer_alias": "mgr", "inner_alias": "lne", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_04457
train
T1
v2
Schema: departments (alias: dept)(salary, name, code, amount) requests(id, date, salary, amount) Task: Retrieve salary from departments that have at least one corresponding entry in requests sharing the same level. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = dept.level );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "salary", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_04458
train
T1
v1
Schema: categories (alias: catg)(date, level, type, id) budgets(amount, type, date, value) Task: Select value from categories where level exists in budgets for the same id. SQL:
SELECT value FROM categories AS catg WHERE level IN ( SELECT level FROM budgets AS budg WHERE budg.id = catg.id );
{ "outer_table": "categories", "inner_table": "budgets", "outer_alias": "catg", "inner_alias": "budg", "proj_col": "value", "filter_col": "level", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_04459
train
T2
v2
Schema: orders (alias: ord)(salary, amount, code, type) accounts(code, status, date, type) Task: Retrieve value from orders that have at least one corresponding entry in accounts sharing the same id. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = ord.id );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "value", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_04460
train
T1
v1
Schema: accounts (alias: acct)(status, amount, level, type) employees(type, name, date, value) Task: Retrieve amount from accounts whose code is found in employees rows where status matches the outer record. SQL:
SELECT amount FROM accounts AS acct WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.status = acct.status );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_04461
train
T1
v2
Schema: employees (alias: emp)(name, id, date, type) managers(level, name, code, id) Task: Retrieve salary from employees that have at least one corresponding entry in managers sharing the same status. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = emp.status );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "salary", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_04462
train
T1
v2
Schema: staff (alias: empl)(name, level, type, amount) categories(code, id, status, level) Task: Find value from staff where a matching record exists in categories with the same level. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = empl.level );
{ "outer_table": "staff", "inner_table": "categories", "outer_alias": "empl", "inner_alias": "catg", "proj_col": "value", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_04463
train
T2
v1
Schema: schedules (alias: schd)(name, level, date, id) orders(level, date, code, salary) Task: Select value from schedules where status exists in orders for the same level. SQL:
SELECT value FROM schedules AS schd WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.level = schd.level );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_04464
train
T2
v2
Schema: schedules (alias: schd)(salary, status, level, id) shipments(date, level, amount, status) Task: Retrieve id from schedules that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = schd.id );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "id", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_04465
train
T2
v2
Schema: services (alias: srvc)(amount, status, name, type) employees(salary, date, status, id) Task: Retrieve code from services that have at least one corresponding entry in employees sharing the same code. SQL:
SELECT code FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = srvc.code );
{ "outer_table": "services", "inner_table": "employees", "outer_alias": "srvc", "inner_alias": "emp", "proj_col": "code", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_04466
train
T2
v2
Schema: orders (alias: ord)(date, id, amount, code) shipments(status, date, code, value) Task: Find id from orders where a matching record exists in shipments with the same type. SQL:
SELECT id FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = ord.type );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "id", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_04467
train
T1
v2
Schema: products (alias: prod)(value, status, type, id) invoices(code, salary, date, type) Task: Retrieve code from products that have at least one corresponding entry in invoices sharing the same level. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = prod.level );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "code", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_04468
train
T1
v2
Schema: warehouses (alias: whs)(code, salary, status, type) products(level, amount, value, salary) Task: Retrieve salary from warehouses that have at least one corresponding entry in products sharing the same id. SQL:
SELECT salary FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "products", "outer_alias": "whs", "inner_alias": "prod", "proj_col": "salary", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_04469
train
T2
v3
Schema: products (alias: prod)(code, value, amount, status) staff(type, code, level, salary) Task: Retrieve value from products with amount above the MAX(amount) of staff rows sharing the same code. SQL:
SELECT value FROM products AS prod WHERE amount > ( SELECT MAX(amount) FROM staff AS empl WHERE empl.code = prod.code );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_04470
train
T1
v3
Schema: transactions (alias: txn)(name, code, amount, date) budgets(level, date, status, salary) Task: Retrieve id from transactions with value above the MIN(value) of budgets rows sharing the same status. SQL:
SELECT id FROM transactions AS txn WHERE value > ( SELECT MIN(value) FROM budgets AS budg WHERE budg.status = txn.status );
{ "outer_table": "transactions", "inner_table": "budgets", "outer_alias": "txn", "inner_alias": "budg", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_04471
train
T1
v2
Schema: departments (alias: dept)(value, salary, id, type) regions(status, salary, level, date) Task: Retrieve amount from departments that have at least one corresponding entry in regions sharing the same type. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = dept.type );
{ "outer_table": "departments", "inner_table": "regions", "outer_alias": "dept", "inner_alias": "rgn", "proj_col": "amount", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_04472
train
T1
v1
Schema: managers (alias: mgr)(value, date, type, id) requests(code, salary, name, status) Task: Select code from managers where type exists in requests for the same level. SQL:
SELECT code FROM managers AS mgr WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.level = mgr.level );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "code", "filter_col": "type", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_04473
train
T1
v3
Schema: customers (alias: cust)(code, value, level, date) invoices(id, name, code, date) Task: Find code from customers where salary exceeds the average value from invoices for the same type. SQL:
SELECT code FROM customers AS cust WHERE salary > ( SELECT SUM(value) FROM invoices AS inv WHERE inv.type = cust.type );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_04474
train
T1
v1
Schema: budgets (alias: budg)(name, date, type, status) schedules(level, value, type, salary) Task: Retrieve id from budgets whose status is found in schedules rows where id matches the outer record. SQL:
SELECT id FROM budgets AS budg WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.id = budg.id );
{ "outer_table": "budgets", "inner_table": "schedules", "outer_alias": "budg", "inner_alias": "schd", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_04475
train
T2
v2
Schema: invoices (alias: inv)(date, type, salary, level) departments(type, name, date, salary) Task: Find amount from invoices where a matching record exists in departments with the same code. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = inv.code );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "amount", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_04476
train
T1
v3
Schema: employees (alias: emp)(value, id, name, status) accounts(status, name, code, date) Task: Retrieve name from employees with amount above the COUNT(amount) of accounts rows sharing the same id. SQL:
SELECT name FROM employees AS emp WHERE amount > ( SELECT COUNT(amount) FROM accounts AS acct WHERE acct.id = emp.id );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_04477
train
T1
v2
Schema: budgets (alias: budg)(salary, status, amount, date) employees(amount, date, status, code) Task: Find id from budgets where a matching record exists in employees with the same type. SQL:
SELECT id FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = budg.type );
{ "outer_table": "budgets", "inner_table": "employees", "outer_alias": "budg", "inner_alias": "emp", "proj_col": "id", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_04478
train
T2
v2
Schema: regions (alias: rgn)(status, level, id, type) managers(name, type, salary, status) Task: Find code from regions where a matching record exists in managers with the same type. SQL:
SELECT code FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = rgn.type );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "code", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_04479
train
T2
v3
Schema: departments (alias: dept)(name, id, type, level) customers(status, code, value, name) Task: Retrieve name from departments with value above the AVG(value) of customers rows sharing the same level. SQL:
SELECT name FROM departments AS dept WHERE value > ( SELECT AVG(value) FROM customers AS cust WHERE cust.level = dept.level );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_04480
train
T1
v1
Schema: orders (alias: ord)(code, name, type, status) categories(salary, name, level, date) Task: Find name from orders where code appears in categories entries with matching status. SQL:
SELECT name FROM orders AS ord WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.status = ord.status );
{ "outer_table": "orders", "inner_table": "categories", "outer_alias": "ord", "inner_alias": "catg", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_04481
train
T1
v3
Schema: services (alias: srvc)(date, amount, code, value) regions(type, date, value, name) Task: Find id from services where amount exceeds the average amount from regions for the same level. SQL:
SELECT id FROM services AS srvc WHERE amount > ( SELECT MIN(amount) FROM regions AS rgn WHERE rgn.level = srvc.level );
{ "outer_table": "services", "inner_table": "regions", "outer_alias": "srvc", "inner_alias": "rgn", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_04482
train
T2
v2
Schema: transactions (alias: txn)(type, value, id, amount) managers(name, level, id, value) Task: Find value from transactions where a matching record exists in managers with the same level. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = txn.level );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "value", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_04483
train
T1
v2
Schema: services (alias: srvc)(salary, level, date, type) accounts(date, salary, level, id) Task: Find code from services where a matching record exists in accounts with the same type. SQL:
SELECT code FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = srvc.type );
{ "outer_table": "services", "inner_table": "accounts", "outer_alias": "srvc", "inner_alias": "acct", "proj_col": "code", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_04484
train
T2
v3
Schema: invoices (alias: inv)(id, type, value, amount) schedules(status, date, name, salary) Task: Retrieve salary from invoices with salary above the MAX(value) of schedules rows sharing the same id. SQL:
SELECT salary FROM invoices AS inv WHERE salary > ( SELECT MAX(value) FROM schedules AS schd WHERE schd.id = inv.id );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_04485
train
T1
v2
Schema: schedules (alias: schd)(level, salary, value, type) orders(type, value, date, id) Task: Retrieve name from schedules that have at least one corresponding entry in orders sharing the same status. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = schd.status );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "name", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_04486
train
T2
v2
Schema: schedules (alias: schd)(name, level, code, salary) items(amount, id, type, status) Task: Retrieve id from schedules that have at least one corresponding entry in items sharing the same code. SQL:
SELECT id 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": "id", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_04487
train
T2
v3
Schema: items (alias: lne)(type, amount, level, id) requests(status, id, level, name) Task: Find code from items where amount exceeds the average salary from requests for the same status. SQL:
SELECT code FROM items AS lne WHERE amount > ( SELECT MIN(salary) FROM requests AS ordr WHERE ordr.status = lne.status );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_04488
train
T2
v1
Schema: sales (alias: sale)(amount, code, date, salary) invoices(code, name, date, type) Task: Select salary from sales where type exists in invoices for the same code. SQL:
SELECT salary FROM sales AS sale WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.code = sale.code );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "salary", "filter_col": "type", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_04489
train
T1
v2
Schema: staff (alias: empl)(name, status, id, level) categories(amount, date, level, name) Task: Find salary from staff where a matching record exists in categories with the same code. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = empl.code );
{ "outer_table": "staff", "inner_table": "categories", "outer_alias": "empl", "inner_alias": "catg", "proj_col": "salary", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_04490
train
T2
v1
Schema: accounts (alias: acct)(value, type, amount, salary) budgets(salary, value, date, status) Task: Find salary from accounts where code appears in budgets entries with matching id. SQL:
SELECT salary FROM accounts AS acct WHERE code IN ( SELECT code FROM budgets AS budg WHERE budg.id = acct.id );
{ "outer_table": "accounts", "inner_table": "budgets", "outer_alias": "acct", "inner_alias": "budg", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_04491
train
T1
v2
Schema: employees (alias: emp)(salary, level, value, status) products(date, level, name, salary) Task: Find value from employees where a matching record exists in products with the same id. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = emp.id );
{ "outer_table": "employees", "inner_table": "products", "outer_alias": "emp", "inner_alias": "prod", "proj_col": "value", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_04492
train
T1
v2
Schema: schedules (alias: schd)(amount, code, name, salary) requests(amount, type, name, level) Task: Find amount from schedules where a matching record exists in requests with the same status. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = schd.status );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "amount", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_04493
train
T2
v1
Schema: categories (alias: catg)(level, salary, value, id) warehouses(type, date, id, status) Task: Retrieve name from categories whose code is found in warehouses rows where status matches the outer record. SQL:
SELECT name FROM categories AS catg WHERE code IN ( SELECT code FROM warehouses AS whs WHERE whs.status = catg.status );
{ "outer_table": "categories", "inner_table": "warehouses", "outer_alias": "catg", "inner_alias": "whs", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_04494
train
T2
v1
Schema: transactions (alias: txn)(level, type, date, id) items(amount, level, value, date) Task: Retrieve code from transactions whose type is found in items rows where level matches the outer record. SQL:
SELECT code FROM transactions AS txn WHERE type IN ( SELECT type FROM items AS lne WHERE lne.level = txn.level );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "code", "filter_col": "type", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_04495
train
T1
v1
Schema: departments (alias: dept)(name, salary, level, code) services(name, salary, id, amount) Task: Select amount from departments where type exists in services for the same type. SQL:
SELECT amount FROM departments AS dept WHERE type IN ( SELECT type FROM services AS srvc WHERE srvc.type = dept.type );
{ "outer_table": "departments", "inner_table": "services", "outer_alias": "dept", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_04496
train
T1
v1
Schema: customers (alias: cust)(amount, level, date, id) budgets(status, amount, type, value) Task: Find amount from customers where type appears in budgets entries with matching level. SQL:
SELECT amount FROM customers AS cust WHERE type IN ( SELECT type FROM budgets AS budg WHERE budg.level = cust.level );
{ "outer_table": "customers", "inner_table": "budgets", "outer_alias": "cust", "inner_alias": "budg", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_04497
train
T1
v3
Schema: items (alias: lne)(value, date, level, id) shipments(amount, value, name, code) Task: Find name from items where amount exceeds the average salary from shipments for the same level. SQL:
SELECT name FROM items AS lne WHERE amount > ( SELECT COUNT(salary) FROM shipments AS shp WHERE shp.level = lne.level );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_04498
train
T2
v2
Schema: warehouses (alias: whs)(salary, name, status, code) departments(date, status, amount, type) Task: Retrieve id from warehouses that have at least one corresponding entry in departments sharing the same id. SQL:
SELECT id FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "departments", "outer_alias": "whs", "inner_alias": "dept", "proj_col": "id", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_04499
train
T2