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: shipments (alias: shp)(id, type, name, date) managers(id, salary, level, name) Task: Retrieve code from shipments that have at least one corresponding entry in managers sharing the same id. SQL:
SELECT code FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = shp.id );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "code", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_09300
train
T2
v1
Schema: customers (alias: cust)(status, value, date, code) services(id, salary, level, type) Task: Retrieve amount from customers whose level is found in services rows where type matches the outer record. SQL:
SELECT amount FROM customers AS cust WHERE level IN ( SELECT level FROM services AS srvc WHERE srvc.type = cust.type );
{ "outer_table": "customers", "inner_table": "services", "outer_alias": "cust", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "level", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_09301
train
T1
v1
Schema: sales (alias: sale)(amount, type, code, salary) accounts(amount, id, date, salary) Task: Retrieve salary from sales whose id is found in accounts rows where code matches the outer record. SQL:
SELECT salary FROM sales AS sale WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.code = sale.code );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_09302
train
T1
v2
Schema: products (alias: prod)(value, type, id, amount) regions(salary, value, amount, name) Task: Retrieve amount from products that have at least one corresponding entry in regions sharing the same status. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = prod.status );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "amount", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_09303
train
T1
v1
Schema: orders (alias: ord)(name, type, value, code) invoices(id, code, salary, level) Task: Find salary from orders where status appears in invoices entries with matching level. SQL:
SELECT salary FROM orders AS ord WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.level = ord.level );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_09304
train
T1
v1
Schema: accounts (alias: acct)(type, level, amount, id) transactions(salary, status, type, value) Task: Find name from accounts where type appears in transactions entries with matching level. SQL:
SELECT name FROM accounts AS acct WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.level = acct.level );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_09305
train
T1
v2
Schema: warehouses (alias: whs)(status, id, salary, date) departments(amount, status, name, level) Task: Find value from warehouses where a matching record exists in departments with the same type. SQL:
SELECT value FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "departments", "outer_alias": "whs", "inner_alias": "dept", "proj_col": "value", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_09306
train
T2
v1
Schema: requests (alias: ordr)(id, name, code, salary) customers(value, salary, amount, date) Task: Find code from requests where code appears in customers entries with matching type. SQL:
SELECT code FROM requests AS ordr WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.type = ordr.type );
{ "outer_table": "requests", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "code", "filter_col": "code", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_09307
train
T2
v3
Schema: budgets (alias: budg)(status, name, value, id) accounts(code, id, level, type) Task: Find value from budgets where value exceeds the average salary from accounts for the same id. SQL:
SELECT value FROM budgets AS budg WHERE value > ( SELECT AVG(salary) FROM accounts AS acct WHERE acct.id = budg.id );
{ "outer_table": "budgets", "inner_table": "accounts", "outer_alias": "budg", "inner_alias": "acct", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_09308
train
T2
v2
Schema: employees (alias: emp)(code, value, name, status) categories(level, value, amount, id) Task: Find id from employees where a matching record exists in categories with the same status. SQL:
SELECT id 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": "id", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_09309
train
T1
v3
Schema: managers (alias: mgr)(value, status, amount, id) transactions(amount, level, status, type) Task: Retrieve amount from managers with amount above the SUM(salary) of transactions rows sharing the same id. SQL:
SELECT amount FROM managers AS mgr WHERE amount > ( SELECT SUM(salary) FROM transactions AS txn WHERE txn.id = mgr.id );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_09310
train
T1
v1
Schema: customers (alias: cust)(salary, status, name, value) budgets(value, id, name, amount) Task: Retrieve amount from customers whose type is found in budgets rows where id matches the outer record. SQL:
SELECT amount FROM customers AS cust WHERE type IN ( SELECT type FROM budgets AS budg WHERE budg.id = cust.id );
{ "outer_table": "customers", "inner_table": "budgets", "outer_alias": "cust", "inner_alias": "budg", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_09311
train
T1
v2
Schema: requests (alias: ordr)(amount, status, value, name) products(type, value, salary, status) Task: Find amount from requests where a matching record exists in products with the same type. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = ordr.type );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "amount", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_09312
train
T2
v1
Schema: invoices (alias: inv)(salary, date, level, type) customers(type, value, level, salary) Task: Select name from invoices where id exists in customers for the same code. SQL:
SELECT name FROM invoices AS inv WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.code = inv.code );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_09313
train
T1
v1
Schema: warehouses (alias: whs)(type, level, code, status) regions(status, name, code, amount) Task: Select id from warehouses where level exists in regions for the same level. SQL:
SELECT id FROM warehouses AS whs WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "regions", "outer_alias": "whs", "inner_alias": "rgn", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_09314
train
T2
v2
Schema: accounts (alias: acct)(value, salary, level, date) products(id, amount, date, salary) Task: Find id from accounts where a matching record exists in products with the same code. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = acct.code );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "id", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_09315
train
T1
v1
Schema: shipments (alias: shp)(level, id, salary, date) budgets(level, amount, type, salary) Task: Find value from shipments where type appears in budgets entries with matching level. SQL:
SELECT value FROM shipments AS shp WHERE type IN ( SELECT type FROM budgets AS budg WHERE budg.level = shp.level );
{ "outer_table": "shipments", "inner_table": "budgets", "outer_alias": "shp", "inner_alias": "budg", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_09316
train
T2
v2
Schema: products (alias: prod)(value, salary, status, type) invoices(value, code, type, level) Task: Retrieve amount from products that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = prod.id );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "amount", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_09317
train
T1
v3
Schema: accounts (alias: acct)(amount, name, code, status) regions(level, name, code, status) Task: Retrieve amount from accounts with value above the MIN(salary) of regions rows sharing the same status. SQL:
SELECT amount FROM accounts AS acct WHERE value > ( SELECT MIN(salary) FROM regions AS rgn WHERE rgn.status = acct.status );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_09318
train
T1
v1
Schema: schedules (alias: schd)(level, amount, type, date) warehouses(status, date, amount, salary) Task: Select value from schedules where level exists in warehouses for the same level. SQL:
SELECT value FROM schedules AS schd WHERE level IN ( SELECT level FROM warehouses AS whs WHERE whs.level = schd.level );
{ "outer_table": "schedules", "inner_table": "warehouses", "outer_alias": "schd", "inner_alias": "whs", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_09319
train
T2
v3
Schema: transactions (alias: txn)(name, status, date, type) customers(code, id, type, status) Task: Find amount from transactions where salary exceeds the average value from customers for the same code. SQL:
SELECT amount FROM transactions AS txn WHERE salary > ( SELECT MAX(value) FROM customers AS cust WHERE cust.code = txn.code );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_09320
train
T1
v3
Schema: regions (alias: rgn)(id, code, name, level) staff(code, value, level, name) Task: Find name from regions where value exceeds the average value from staff for the same type. SQL:
SELECT name FROM regions AS rgn WHERE value > ( SELECT COUNT(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": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_09321
train
T2
v2
Schema: items (alias: lne)(name, amount, salary, status) shipments(amount, name, level, id) Task: Retrieve salary from items that have at least one corresponding entry in shipments sharing the same type. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = lne.type );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "salary", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_09322
train
T2
v1
Schema: staff (alias: empl)(type, value, name, status) categories(id, level, code, name) Task: Find name from staff where id appears in categories entries with matching status. SQL:
SELECT name FROM staff AS empl WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.status = empl.status );
{ "outer_table": "staff", "inner_table": "categories", "outer_alias": "empl", "inner_alias": "catg", "proj_col": "name", "filter_col": "id", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_09323
train
T2
v3
Schema: sales (alias: sale)(level, salary, value, amount) warehouses(amount, level, code, status) Task: Retrieve amount from sales with value above the SUM(salary) of warehouses rows sharing the same status. SQL:
SELECT amount FROM sales AS sale WHERE value > ( SELECT SUM(salary) FROM warehouses AS whs WHERE whs.status = sale.status );
{ "outer_table": "sales", "inner_table": "warehouses", "outer_alias": "sale", "inner_alias": "whs", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_09324
train
T1
v3
Schema: requests (alias: ordr)(amount, name, id, date) schedules(salary, status, id, level) Task: Find code from requests where amount exceeds the average value from schedules for the same type. SQL:
SELECT code FROM requests AS ordr WHERE amount > ( SELECT AVG(value) FROM schedules AS schd WHERE schd.type = ordr.type );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_09325
train
T2
v3
Schema: services (alias: srvc)(type, id, status, name) budgets(date, status, salary, value) Task: Retrieve id from services with value above the AVG(amount) of budgets rows sharing the same code. SQL:
SELECT id FROM services AS srvc WHERE value > ( SELECT AVG(amount) FROM budgets AS budg WHERE budg.code = srvc.code );
{ "outer_table": "services", "inner_table": "budgets", "outer_alias": "srvc", "inner_alias": "budg", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_09326
train
T2
v3
Schema: sales (alias: sale)(type, date, value, salary) regions(value, status, id, amount) Task: Retrieve id from sales with salary above the SUM(amount) of regions rows sharing the same id. SQL:
SELECT id FROM sales AS sale WHERE salary > ( SELECT SUM(amount) FROM regions AS rgn WHERE rgn.id = sale.id );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_09327
train
T1
v2
Schema: staff (alias: empl)(level, type, code, salary) requests(status, level, type, value) Task: Find amount from staff where a matching record exists in requests with the same id. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = empl.id );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "amount", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_09328
train
T2
v3
Schema: regions (alias: rgn)(value, code, id, type) transactions(level, amount, salary, value) Task: Retrieve amount from regions with salary above the MAX(value) of transactions rows sharing the same id. SQL:
SELECT amount FROM regions AS rgn WHERE salary > ( SELECT MAX(value) FROM transactions AS txn WHERE txn.id = rgn.id );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_09329
train
T2
v2
Schema: shipments (alias: shp)(code, salary, value, amount) managers(type, id, salary, level) Task: Find amount from shipments where a matching record exists in managers with the same type. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = shp.type );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "amount", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_09330
train
T2
v3
Schema: departments (alias: dept)(level, value, name, status) accounts(type, name, level, value) Task: Find code from departments where value exceeds the average salary from accounts for the same type. SQL:
SELECT code FROM departments AS dept WHERE value > ( SELECT COUNT(salary) FROM accounts AS acct WHERE acct.type = dept.type );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_09331
train
T1
v3
Schema: accounts (alias: acct)(value, salary, level, type) managers(value, amount, id, level) Task: Retrieve salary from accounts with salary above the MAX(amount) of managers rows sharing the same level. SQL:
SELECT salary FROM accounts AS acct WHERE salary > ( SELECT MAX(amount) FROM managers AS mgr WHERE mgr.level = acct.level );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_09332
train
T1
v1
Schema: requests (alias: ordr)(date, amount, value, status) employees(code, salary, status, amount) Task: Find name from requests where id appears in employees entries with matching code. SQL:
SELECT name FROM requests AS ordr WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.code = ordr.code );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_09333
train
T2
v2
Schema: customers (alias: cust)(code, salary, value, type) services(date, salary, status, code) Task: Find amount from customers where a matching record exists in services with the same code. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.code = cust.code );
{ "outer_table": "customers", "inner_table": "services", "outer_alias": "cust", "inner_alias": "srvc", "proj_col": "amount", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_09334
train
T1
v3
Schema: schedules (alias: schd)(value, status, level, amount) requests(salary, code, id, status) Task: Retrieve id from schedules with value above the AVG(amount) of requests rows sharing the same type. SQL:
SELECT id FROM schedules AS schd WHERE value > ( SELECT AVG(amount) FROM requests AS ordr WHERE ordr.type = schd.type );
{ "outer_table": "schedules", "inner_table": "requests", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_09335
train
T2
v2
Schema: products (alias: prod)(value, amount, date, salary) budgets(status, value, level, date) Task: Retrieve amount from products that have at least one corresponding entry in budgets sharing the same status. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.status = prod.status );
{ "outer_table": "products", "inner_table": "budgets", "outer_alias": "prod", "inner_alias": "budg", "proj_col": "amount", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_09336
train
T1
v2
Schema: customers (alias: cust)(name, salary, level, id) orders(salary, level, date, value) Task: Retrieve amount from customers that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = cust.level );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "amount", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_09337
train
T1
v1
Schema: items (alias: lne)(code, name, amount, date) warehouses(status, level, id, amount) Task: Select salary from items where status exists in warehouses for the same status. SQL:
SELECT salary FROM items AS lne WHERE status IN ( SELECT status FROM warehouses AS whs WHERE whs.status = lne.status );
{ "outer_table": "items", "inner_table": "warehouses", "outer_alias": "lne", "inner_alias": "whs", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_09338
train
T2
v1
Schema: managers (alias: mgr)(type, date, status, level) schedules(level, status, name, date) Task: Select value from managers where level exists in schedules for the same type. SQL:
SELECT value FROM managers AS mgr WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.type = mgr.type );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_09339
train
T1
v1
Schema: products (alias: prod)(salary, amount, name, status) employees(code, status, name, date) Task: Retrieve amount from products whose code is found in employees rows where status matches the outer record. SQL:
SELECT amount FROM products AS prod WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.status = prod.status );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_09340
train
T1
v2
Schema: services (alias: srvc)(amount, status, name, level) transactions(code, amount, type, id) Task: Retrieve id from services that have at least one corresponding entry in transactions sharing the same type. SQL:
SELECT id FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = srvc.type );
{ "outer_table": "services", "inner_table": "transactions", "outer_alias": "srvc", "inner_alias": "txn", "proj_col": "id", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_09341
train
T2
v1
Schema: schedules (alias: schd)(id, status, level, value) sales(name, amount, value, type) Task: Retrieve id from schedules whose level is found in sales rows where type matches the outer record. SQL:
SELECT id FROM schedules AS schd WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.type = schd.type );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_09342
train
T2
v1
Schema: accounts (alias: acct)(name, status, type, value) employees(value, type, status, level) Task: Select id from accounts where type exists in employees for the same code. SQL:
SELECT id FROM accounts AS acct WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.code = acct.code );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_09343
train
T1
v1
Schema: sales (alias: sale)(name, code, status, amount) products(status, code, type, value) Task: Retrieve value from sales whose level is found in products rows where status matches the outer record. SQL:
SELECT value FROM sales AS sale WHERE level IN ( SELECT level FROM products AS prod WHERE prod.status = sale.status );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "value", "filter_col": "level", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_09344
train
T1
v3
Schema: products (alias: prod)(code, status, salary, type) regions(code, name, value, amount) Task: Retrieve id from products with salary above the MIN(amount) of regions rows sharing the same code. SQL:
SELECT id FROM products AS prod WHERE salary > ( SELECT MIN(amount) FROM regions AS rgn WHERE rgn.code = prod.code );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_09345
train
T1
v1
Schema: items (alias: lne)(type, date, amount, name) employees(level, amount, name, id) Task: Find code from items where id appears in employees entries with matching type. SQL:
SELECT code FROM items AS lne WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.type = lne.type );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "code", "filter_col": "id", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_09346
train
T2
v3
Schema: products (alias: prod)(value, amount, code, salary) transactions(level, date, name, code) Task: Find amount from products where salary exceeds the average amount from transactions for the same id. SQL:
SELECT amount FROM products AS prod WHERE salary > ( SELECT COUNT(amount) FROM transactions AS txn WHERE txn.id = prod.id );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_09347
train
T1
v1
Schema: requests (alias: ordr)(code, amount, value, date) staff(salary, amount, name, date) Task: Select code from requests where type exists in staff for the same status. SQL:
SELECT code FROM requests AS ordr WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.status = ordr.status );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_09348
train
T2
v1
Schema: products (alias: prod)(type, value, salary, amount) managers(amount, name, level, salary) Task: Retrieve salary from products whose id is found in managers rows where id matches the outer record. SQL:
SELECT salary FROM products AS prod WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.id = prod.id );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_09349
train
T1
v3
Schema: invoices (alias: inv)(amount, value, level, salary) customers(id, type, date, code) Task: Find code from invoices where salary exceeds the average amount from customers for the same level. SQL:
SELECT code FROM invoices AS inv WHERE salary > ( SELECT MIN(amount) FROM customers AS cust WHERE cust.level = inv.level );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_09350
train
T1
v1
Schema: invoices (alias: inv)(name, amount, value, type) shipments(type, status, amount, code) Task: Retrieve salary from invoices whose level is found in shipments rows where id matches the outer record. SQL:
SELECT salary FROM invoices AS inv WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.id = inv.id );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "salary", "filter_col": "level", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_09351
train
T1
v1
Schema: shipments (alias: shp)(code, name, salary, value) customers(value, date, type, code) Task: Find name from shipments where level appears in customers entries with matching status. SQL:
SELECT name FROM shipments AS shp WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.status = shp.status );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_09352
train
T2
v1
Schema: departments (alias: dept)(amount, type, code, value) staff(status, code, type, date) Task: Retrieve code from departments whose type is found in staff rows where level matches the outer record. SQL:
SELECT code FROM departments AS dept WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.level = dept.level );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "code", "filter_col": "type", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_09353
train
T1
v2
Schema: invoices (alias: inv)(level, value, id, salary) services(name, level, id, date) Task: Find amount from invoices where a matching record exists in services with the same id. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = inv.id );
{ "outer_table": "invoices", "inner_table": "services", "outer_alias": "inv", "inner_alias": "srvc", "proj_col": "amount", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_09354
train
T1
v1
Schema: products (alias: prod)(type, status, date, name) items(amount, level, salary, type) Task: Select salary from products where id exists in items for the same code. SQL:
SELECT salary FROM products AS prod WHERE id IN ( SELECT id FROM items AS lne WHERE lne.code = prod.code );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_09355
train
T1
v2
Schema: staff (alias: empl)(level, name, status, salary) employees(date, amount, status, id) Task: Retrieve name from staff that have at least one corresponding entry in employees sharing the same type. SQL:
SELECT name FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = empl.type );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "name", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_09356
train
T2
v2
Schema: transactions (alias: txn)(id, amount, name, type) employees(level, code, type, date) Task: Retrieve amount from transactions that have at least one corresponding entry in employees sharing the same code. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = txn.code );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "amount", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_09357
train
T1
v1
Schema: shipments (alias: shp)(level, status, type, amount) managers(status, name, type, amount) Task: Select salary from shipments where type exists in managers for the same status. SQL:
SELECT salary FROM shipments AS shp WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.status = shp.status );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "type", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_09358
train
T2
v1
Schema: regions (alias: rgn)(salary, level, status, type) staff(status, value, type, name) Task: Select value from regions where code exists in staff for the same code. SQL:
SELECT value FROM regions AS rgn WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.code = rgn.code );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_09359
train
T2
v1
Schema: transactions (alias: txn)(id, status, date, amount) shipments(id, type, amount, salary) Task: Select id from transactions where status exists in shipments for the same level. SQL:
SELECT id FROM transactions AS txn WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.level = txn.level );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "id", "filter_col": "status", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_09360
train
T1
v1
Schema: categories (alias: catg)(type, status, level, salary) warehouses(value, code, salary, amount) Task: Select code from categories where type exists in warehouses for the same status. SQL:
SELECT code FROM categories AS catg WHERE type IN ( SELECT type FROM warehouses AS whs WHERE whs.status = catg.status );
{ "outer_table": "categories", "inner_table": "warehouses", "outer_alias": "catg", "inner_alias": "whs", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_09361
train
T2
v2
Schema: products (alias: prod)(type, id, code, date) employees(date, level, code, amount) Task: Retrieve id from products that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = prod.status );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "id", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_09362
train
T1
v3
Schema: customers (alias: cust)(name, status, level, code) transactions(amount, code, status, date) Task: Retrieve salary from customers with amount above the SUM(salary) of transactions rows sharing the same code. SQL:
SELECT salary FROM customers AS cust WHERE amount > ( SELECT SUM(salary) FROM transactions AS txn WHERE txn.code = cust.code );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_09363
train
T1
v3
Schema: schedules (alias: schd)(id, value, code, status) staff(amount, level, id, type) Task: Retrieve value from schedules with amount above the AVG(salary) of staff rows sharing the same code. SQL:
SELECT value FROM schedules AS schd WHERE amount > ( SELECT AVG(salary) FROM staff AS empl WHERE empl.code = schd.code );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_09364
train
T2
v2
Schema: shipments (alias: shp)(type, date, value, name) products(id, type, code, date) Task: Retrieve id from shipments that have at least one corresponding entry in products sharing the same type. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = shp.type );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "id", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_09365
train
T2
v2
Schema: managers (alias: mgr)(type, date, status, salary) regions(value, salary, name, amount) Task: Find amount from managers where a matching record exists in regions with the same code. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = mgr.code );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "amount", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_09366
train
T1
v2
Schema: staff (alias: empl)(level, type, date, status) budgets(id, date, type, amount) Task: Retrieve name from staff that have at least one corresponding entry in budgets sharing the same code. SQL:
SELECT name FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.code = empl.code );
{ "outer_table": "staff", "inner_table": "budgets", "outer_alias": "empl", "inner_alias": "budg", "proj_col": "name", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_09367
train
T2
v1
Schema: requests (alias: ordr)(amount, salary, name, id) budgets(id, level, salary, code) Task: Find amount from requests where id appears in budgets entries with matching level. SQL:
SELECT amount FROM requests AS ordr WHERE id IN ( SELECT id FROM budgets AS budg WHERE budg.level = ordr.level );
{ "outer_table": "requests", "inner_table": "budgets", "outer_alias": "ordr", "inner_alias": "budg", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_09368
train
T2
v1
Schema: categories (alias: catg)(value, date, id, status) products(salary, status, name, date) Task: Select name from categories where level exists in products for the same code. SQL:
SELECT name FROM categories AS catg WHERE level IN ( SELECT level FROM products AS prod WHERE prod.code = catg.code );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_09369
train
T2
v1
Schema: warehouses (alias: whs)(code, name, level, status) categories(date, status, id, level) Task: Find amount from warehouses where code appears in categories entries with matching id. SQL:
SELECT amount FROM warehouses AS whs WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "categories", "outer_alias": "whs", "inner_alias": "catg", "proj_col": "amount", "filter_col": "code", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_09370
train
T2
v2
Schema: requests (alias: ordr)(value, status, id, name) warehouses(salary, code, level, value) Task: Retrieve code from requests that have at least one corresponding entry in warehouses sharing the same status. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.status = ordr.status );
{ "outer_table": "requests", "inner_table": "warehouses", "outer_alias": "ordr", "inner_alias": "whs", "proj_col": "code", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_09371
train
T2
v2
Schema: invoices (alias: inv)(name, type, id, status) managers(date, amount, value, code) Task: Retrieve name from invoices that have at least one corresponding entry in managers sharing the same id. SQL:
SELECT name FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = inv.id );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "name", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_09372
train
T1
v2
Schema: regions (alias: rgn)(level, name, value, id) accounts(date, status, value, amount) Task: Find name from regions where a matching record exists in accounts with the same type. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = rgn.type );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "rgn", "inner_alias": "acct", "proj_col": "name", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_09373
train
T2
v3
Schema: managers (alias: mgr)(name, level, code, amount) requests(code, id, salary, status) Task: Retrieve salary from managers with value above the AVG(value) of requests rows sharing the same code. SQL:
SELECT salary FROM managers AS mgr WHERE value > ( SELECT AVG(value) FROM requests AS ordr WHERE ordr.code = mgr.code );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_09374
train
T1
v1
Schema: accounts (alias: acct)(type, level, salary, id) warehouses(name, value, date, type) Task: Find value from accounts where level appears in warehouses entries with matching level. SQL:
SELECT value FROM accounts AS acct WHERE level IN ( SELECT level FROM warehouses AS whs WHERE whs.level = acct.level );
{ "outer_table": "accounts", "inner_table": "warehouses", "outer_alias": "acct", "inner_alias": "whs", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_09375
train
T1
v1
Schema: customers (alias: cust)(id, value, level, date) items(id, level, salary, type) Task: Find id from customers where type appears in items entries with matching type. SQL:
SELECT id FROM customers AS cust WHERE type IN ( SELECT type FROM items AS lne WHERE lne.type = cust.type );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "id", "filter_col": "type", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_09376
train
T1
v2
Schema: customers (alias: cust)(type, status, code, salary) invoices(salary, code, type, value) Task: Retrieve amount from customers that have at least one corresponding entry in invoices sharing the same code. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = cust.code );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "amount", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_09377
train
T1
v3
Schema: schedules (alias: schd)(level, id, code, name) sales(value, salary, type, date) Task: Find code from schedules where salary exceeds the average amount from sales for the same code. SQL:
SELECT code FROM schedules AS schd WHERE salary > ( SELECT MAX(amount) FROM sales AS sale WHERE sale.code = schd.code );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_09378
train
T2
v3
Schema: staff (alias: empl)(value, name, code, status) requests(date, value, code, level) Task: Retrieve amount from staff with value above the MIN(amount) of requests rows sharing the same status. SQL:
SELECT amount FROM staff AS empl WHERE value > ( SELECT MIN(amount) FROM requests AS ordr WHERE ordr.status = empl.status );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_09379
train
T2
v1
Schema: products (alias: prod)(date, status, value, id) accounts(status, type, date, name) Task: Find value from products where type appears in accounts entries with matching level. SQL:
SELECT value FROM products AS prod WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.level = prod.level );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_09380
train
T1
v1
Schema: shipments (alias: shp)(date, value, type, salary) services(name, code, status, id) Task: Retrieve amount from shipments whose type is found in services rows where code matches the outer record. SQL:
SELECT amount FROM shipments AS shp WHERE type IN ( SELECT type FROM services AS srvc WHERE srvc.code = shp.code );
{ "outer_table": "shipments", "inner_table": "services", "outer_alias": "shp", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "type", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_09381
train
T2
v1
Schema: accounts (alias: acct)(name, code, type, value) sales(code, date, amount, name) Task: Find id from accounts where type appears in sales entries with matching status. SQL:
SELECT id FROM accounts AS acct WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.status = acct.status );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "id", "filter_col": "type", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_09382
train
T1
v2
Schema: schedules (alias: schd)(level, date, code, type) items(date, id, type, code) Task: Retrieve code from schedules that have at least one corresponding entry in items sharing the same code. SQL:
SELECT code 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": "code", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_09383
train
T2
v1
Schema: warehouses (alias: whs)(level, code, date, amount) products(value, date, salary, level) Task: Find amount from warehouses where code appears in products entries with matching status. SQL:
SELECT amount FROM warehouses AS whs WHERE code IN ( SELECT code FROM products AS prod WHERE prod.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "products", "outer_alias": "whs", "inner_alias": "prod", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_09384
train
T2
v2
Schema: warehouses (alias: whs)(value, code, id, salary) departments(amount, status, type, value) Task: Find salary from warehouses where a matching record exists in departments with the same id. SQL:
SELECT salary 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": "salary", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_09385
train
T2
v3
Schema: accounts (alias: acct)(value, type, date, salary) staff(amount, name, salary, date) Task: Retrieve amount from accounts with amount above the MAX(amount) of staff rows sharing the same code. SQL:
SELECT amount FROM accounts AS acct WHERE amount > ( SELECT MAX(amount) FROM staff AS empl WHERE empl.code = acct.code );
{ "outer_table": "accounts", "inner_table": "staff", "outer_alias": "acct", "inner_alias": "empl", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_09386
train
T1
v1
Schema: staff (alias: empl)(value, amount, type, level) shipments(date, type, status, level) Task: Retrieve name from staff whose type is found in shipments rows where type matches the outer record. SQL:
SELECT name FROM staff AS empl WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.type = empl.type );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "name", "filter_col": "type", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_09387
train
T2
v2
Schema: shipments (alias: shp)(name, value, code, salary) items(value, status, level, name) Task: Retrieve amount from shipments that have at least one corresponding entry in items sharing the same id. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.id = shp.id );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "amount", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_09388
train
T2
v2
Schema: sales (alias: sale)(status, level, salary, id) transactions(code, name, type, level) Task: Find name from sales where a matching record exists in transactions with the same id. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = sale.id );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "name", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_09389
train
T1
v1
Schema: invoices (alias: inv)(date, name, level, code) warehouses(salary, value, status, level) Task: Find id from invoices where id appears in warehouses entries with matching id. SQL:
SELECT id FROM invoices AS inv WHERE id IN ( SELECT id FROM warehouses AS whs WHERE whs.id = inv.id );
{ "outer_table": "invoices", "inner_table": "warehouses", "outer_alias": "inv", "inner_alias": "whs", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_09390
train
T1
v2
Schema: items (alias: lne)(salary, status, code, id) warehouses(date, status, type, name) Task: Retrieve code from items that have at least one corresponding entry in warehouses sharing the same type. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.type = lne.type );
{ "outer_table": "items", "inner_table": "warehouses", "outer_alias": "lne", "inner_alias": "whs", "proj_col": "code", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_09391
train
T2
v1
Schema: requests (alias: ordr)(level, type, id, date) warehouses(name, amount, level, status) Task: Find value from requests where id appears in warehouses entries with matching level. SQL:
SELECT value FROM requests AS ordr WHERE id IN ( SELECT id FROM warehouses AS whs WHERE whs.level = ordr.level );
{ "outer_table": "requests", "inner_table": "warehouses", "outer_alias": "ordr", "inner_alias": "whs", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_09392
train
T2
v2
Schema: warehouses (alias: whs)(id, value, name, date) transactions(type, amount, value, name) Task: Find id from warehouses where a matching record exists in transactions with the same code. SQL:
SELECT id FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "transactions", "outer_alias": "whs", "inner_alias": "txn", "proj_col": "id", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_09393
train
T2
v3
Schema: orders (alias: ord)(status, name, id, salary) transactions(value, amount, date, salary) Task: Find value from orders where amount exceeds the average salary from transactions for the same type. SQL:
SELECT value FROM orders AS ord WHERE amount > ( SELECT COUNT(salary) FROM transactions AS txn WHERE txn.type = ord.type );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_09394
train
T1
v2
Schema: budgets (alias: budg)(amount, salary, level, name) regions(type, value, date, amount) Task: Retrieve name from budgets that have at least one corresponding entry in regions sharing the same status. SQL:
SELECT name FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = budg.status );
{ "outer_table": "budgets", "inner_table": "regions", "outer_alias": "budg", "inner_alias": "rgn", "proj_col": "name", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_09395
train
T2
v2
Schema: services (alias: srvc)(type, value, level, code) orders(date, id, value, status) Task: Retrieve code from services that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT code FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = srvc.code );
{ "outer_table": "services", "inner_table": "orders", "outer_alias": "srvc", "inner_alias": "ord", "proj_col": "code", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_09396
train
T2
v2
Schema: departments (alias: dept)(name, value, type, amount) customers(type, salary, date, value) Task: Find name from departments where a matching record exists in customers with the same status. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = dept.status );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "name", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_09397
train
T1
v1
Schema: accounts (alias: acct)(level, value, type, amount) requests(level, date, amount, name) Task: Select value from accounts where level exists in requests for the same code. SQL:
SELECT value FROM accounts AS acct WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.code = acct.code );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_09398
train
T1
v1
Schema: warehouses (alias: whs)(salary, amount, level, code) sales(name, id, amount, type) Task: Find salary from warehouses where level appears in sales entries with matching id. SQL:
SELECT salary FROM warehouses AS whs WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "sales", "outer_alias": "whs", "inner_alias": "sale", "proj_col": "salary", "filter_col": "level", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_09399
train
T2