variant
stringclasses
3 values
prompt
stringlengths
163
237
sql
stringlengths
103
143
metadata
unknown
id
stringlengths
21
21
split
stringclasses
1 value
token_group
stringclasses
2 values
v1
Schema: accounts (alias: acct)(code, status, level, amount) shipments(name, level, code, date) Task: Select amount from accounts where code exists in shipments for the same code. SQL:
SELECT amount FROM accounts AS acct WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.code = acct.code );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_07300
train
T1
v2
Schema: products (alias: prod)(status, amount, id, type) budgets(name, status, id, type) Task: Find name from products where a matching record exists in budgets with the same type. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.type = prod.type );
{ "outer_table": "products", "inner_table": "budgets", "outer_alias": "prod", "inner_alias": "budg", "proj_col": "name", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_07301
train
T1
v3
Schema: invoices (alias: inv)(id, salary, level, status) regions(salary, status, date, id) Task: Retrieve name from invoices with value above the AVG(value) of regions rows sharing the same code. SQL:
SELECT name FROM invoices AS inv WHERE value > ( SELECT AVG(value) FROM regions AS rgn WHERE rgn.code = inv.code );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_07302
train
T1
v3
Schema: invoices (alias: inv)(amount, type, id, code) budgets(amount, code, date, value) Task: Find name from invoices where salary exceeds the average amount from budgets for the same code. SQL:
SELECT name FROM invoices AS inv WHERE salary > ( SELECT MAX(amount) FROM budgets AS budg WHERE budg.code = inv.code );
{ "outer_table": "invoices", "inner_table": "budgets", "outer_alias": "inv", "inner_alias": "budg", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_07303
train
T1
v1
Schema: services (alias: srvc)(salary, name, code, level) employees(name, type, salary, status) Task: Retrieve value from services whose id is found in employees rows where level matches the outer record. SQL:
SELECT value FROM services AS srvc WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.level = srvc.level );
{ "outer_table": "services", "inner_table": "employees", "outer_alias": "srvc", "inner_alias": "emp", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_07304
train
T2
v1
Schema: customers (alias: cust)(salary, level, code, value) categories(amount, type, date, salary) Task: Find salary from customers where code appears in categories entries with matching type. SQL:
SELECT salary FROM customers AS cust WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.type = cust.type );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_07305
train
T1
v1
Schema: orders (alias: ord)(amount, status, salary, name) categories(status, level, amount, id) Task: Select name from orders where id exists in categories for the same level. SQL:
SELECT name FROM orders AS ord WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.level = ord.level );
{ "outer_table": "orders", "inner_table": "categories", "outer_alias": "ord", "inner_alias": "catg", "proj_col": "name", "filter_col": "id", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_07306
train
T1
v3
Schema: orders (alias: ord)(value, status, name, type) departments(name, level, salary, code) Task: Retrieve name from orders with value above the MAX(salary) of departments rows sharing the same type. SQL:
SELECT name FROM orders AS ord WHERE value > ( SELECT MAX(salary) FROM departments AS dept WHERE dept.type = ord.type );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_07307
train
T1
v2
Schema: products (alias: prod)(value, status, id, name) services(amount, value, id, code) Task: Retrieve id from products that have at least one corresponding entry in services sharing the same id. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = prod.id );
{ "outer_table": "products", "inner_table": "services", "outer_alias": "prod", "inner_alias": "srvc", "proj_col": "id", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_07308
train
T1
v3
Schema: managers (alias: mgr)(type, name, level, status) regions(value, name, id, status) Task: Find id from managers where value exceeds the average salary from regions for the same status. SQL:
SELECT id FROM managers AS mgr WHERE value > ( SELECT SUM(salary) FROM regions AS rgn WHERE rgn.status = mgr.status );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_07309
train
T1
v2
Schema: managers (alias: mgr)(type, amount, salary, id) items(type, code, amount, value) Task: Find value from managers where a matching record exists in items with the same status. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = mgr.status );
{ "outer_table": "managers", "inner_table": "items", "outer_alias": "mgr", "inner_alias": "lne", "proj_col": "value", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_07310
train
T1
v2
Schema: shipments (alias: shp)(date, amount, status, name) budgets(code, amount, date, name) Task: Retrieve id from shipments that have at least one corresponding entry in budgets sharing the same type. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.type = shp.type );
{ "outer_table": "shipments", "inner_table": "budgets", "outer_alias": "shp", "inner_alias": "budg", "proj_col": "id", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_07311
train
T2
v2
Schema: sales (alias: sale)(salary, status, level, name) regions(code, value, status, amount) Task: Retrieve id from sales that have at least one corresponding entry in regions sharing the same type. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = sale.type );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "id", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_07312
train
T1
v3
Schema: regions (alias: rgn)(date, amount, level, type) shipments(type, amount, salary, value) Task: Find salary from regions where salary exceeds the average amount from shipments for the same type. SQL:
SELECT salary FROM regions AS rgn WHERE salary > ( SELECT MAX(amount) FROM shipments AS shp WHERE shp.type = rgn.type );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_07313
train
T2
v3
Schema: products (alias: prod)(amount, type, date, level) staff(code, status, name, id) Task: Retrieve value from products with salary above the MIN(salary) of staff rows sharing the same level. SQL:
SELECT value FROM products AS prod WHERE salary > ( SELECT MIN(salary) FROM staff AS empl WHERE empl.level = prod.level );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_07314
train
T1
v1
Schema: products (alias: prod)(id, name, salary, code) regions(type, amount, code, name) Task: Retrieve id from products whose code is found in regions rows where code matches the outer record. SQL:
SELECT id FROM products AS prod WHERE code IN ( SELECT code 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": "code", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_07315
train
T1
v1
Schema: regions (alias: rgn)(type, salary, amount, date) employees(level, code, value, status) Task: Find name from regions where id appears in employees entries with matching id. SQL:
SELECT name FROM regions AS rgn WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.id = rgn.id );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "name", "filter_col": "id", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_07316
train
T2
v3
Schema: customers (alias: cust)(status, amount, value, salary) requests(salary, name, type, status) Task: Find amount from customers where value exceeds the average salary from requests for the same status. SQL:
SELECT amount FROM customers AS cust WHERE value > ( SELECT AVG(salary) FROM requests AS ordr WHERE ordr.status = cust.status );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_07317
train
T1
v3
Schema: items (alias: lne)(status, name, type, level) staff(type, salary, amount, code) Task: Find salary from items where amount exceeds the average value from staff for the same code. SQL:
SELECT salary FROM items AS lne WHERE amount > ( SELECT AVG(value) FROM staff AS empl WHERE empl.code = lne.code );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_07318
train
T2
v3
Schema: staff (alias: empl)(amount, date, status, type) accounts(status, type, date, level) Task: Find code from staff where amount exceeds the average amount from accounts for the same type. SQL:
SELECT code FROM staff AS empl WHERE amount > ( SELECT MAX(amount) FROM accounts AS acct WHERE acct.type = empl.type );
{ "outer_table": "staff", "inner_table": "accounts", "outer_alias": "empl", "inner_alias": "acct", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_07319
train
T2
v1
Schema: accounts (alias: acct)(salary, amount, type, date) managers(id, amount, date, value) Task: Retrieve code from accounts whose id is found in managers rows where status matches the outer record. SQL:
SELECT code FROM accounts AS acct WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.status = acct.status );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "code", "filter_col": "id", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_07320
train
T1
v3
Schema: staff (alias: empl)(id, value, level, date) products(status, type, salary, name) Task: Retrieve id from staff with amount above the MIN(salary) of products rows sharing the same level. SQL:
SELECT id FROM staff AS empl WHERE amount > ( SELECT MIN(salary) FROM products AS prod WHERE prod.level = empl.level );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_07321
train
T2
v3
Schema: accounts (alias: acct)(amount, code, value, type) sales(value, status, date, salary) Task: Retrieve value from accounts with value above the MAX(value) of sales rows sharing the same type. SQL:
SELECT value FROM accounts AS acct WHERE value > ( SELECT MAX(value) FROM sales AS sale WHERE sale.type = acct.type );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_07322
train
T1
v1
Schema: products (alias: prod)(code, value, date, salary) transactions(id, level, salary, status) Task: Select id from products where code exists in transactions for the same status. SQL:
SELECT id FROM products AS prod WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.status = prod.status );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_07323
train
T1
v3
Schema: services (alias: srvc)(value, status, id, code) orders(id, status, type, salary) Task: Find amount from services where amount exceeds the average salary from orders for the same id. SQL:
SELECT amount FROM services AS srvc WHERE amount > ( SELECT AVG(salary) FROM orders AS ord WHERE ord.id = srvc.id );
{ "outer_table": "services", "inner_table": "orders", "outer_alias": "srvc", "inner_alias": "ord", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_07324
train
T2
v3
Schema: invoices (alias: inv)(level, salary, date, status) budgets(salary, code, level, status) Task: Find code from invoices where salary exceeds the average value from budgets for the same id. SQL:
SELECT code FROM invoices AS inv WHERE salary > ( SELECT COUNT(value) FROM budgets AS budg WHERE budg.id = inv.id );
{ "outer_table": "invoices", "inner_table": "budgets", "outer_alias": "inv", "inner_alias": "budg", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_07325
train
T1
v3
Schema: schedules (alias: schd)(type, id, name, status) products(salary, type, value, level) Task: Retrieve id from schedules with amount above the SUM(salary) of products rows sharing the same level. SQL:
SELECT id FROM schedules AS schd WHERE amount > ( SELECT SUM(salary) FROM products AS prod WHERE prod.level = schd.level );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_07326
train
T2
v3
Schema: sales (alias: sale)(name, amount, type, status) budgets(date, code, amount, salary) Task: Retrieve code from sales with salary above the AVG(salary) of budgets rows sharing the same id. SQL:
SELECT code FROM sales AS sale WHERE salary > ( SELECT AVG(salary) FROM budgets AS budg WHERE budg.id = sale.id );
{ "outer_table": "sales", "inner_table": "budgets", "outer_alias": "sale", "inner_alias": "budg", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_07327
train
T1
v2
Schema: transactions (alias: txn)(level, name, value, amount) services(date, amount, value, status) Task: Find amount from transactions where a matching record exists in services with the same status. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.status = txn.status );
{ "outer_table": "transactions", "inner_table": "services", "outer_alias": "txn", "inner_alias": "srvc", "proj_col": "amount", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_07328
train
T1
v3
Schema: requests (alias: ordr)(salary, name, code, type) accounts(amount, value, name, id) Task: Retrieve id from requests with salary above the MIN(amount) of accounts rows sharing the same status. SQL:
SELECT id FROM requests AS ordr WHERE salary > ( SELECT MIN(amount) FROM accounts AS acct WHERE acct.status = ordr.status );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_07329
train
T2
v2
Schema: sales (alias: sale)(id, salary, status, amount) customers(id, status, amount, date) Task: Retrieve id from sales that have at least one corresponding entry in customers sharing the same level. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = sale.level );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "id", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_07330
train
T1
v2
Schema: transactions (alias: txn)(code, level, status, id) requests(type, name, salary, id) Task: Retrieve id from transactions that have at least one corresponding entry in requests sharing the same level. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = txn.level );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "id", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_07331
train
T1
v2
Schema: shipments (alias: shp)(type, level, value, name) regions(status, level, value, type) Task: Retrieve amount from shipments that have at least one corresponding entry in regions sharing the same code. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = shp.code );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "amount", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_07332
train
T2
v1
Schema: categories (alias: catg)(value, code, date, amount) staff(amount, level, id, value) Task: Select value from categories where id exists in staff for the same type. SQL:
SELECT value FROM categories AS catg WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.type = catg.type );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_07333
train
T2
v2
Schema: customers (alias: cust)(status, value, id, amount) accounts(type, value, code, level) Task: Retrieve amount from customers that have at least one corresponding entry in accounts sharing the same code. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = cust.code );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "amount", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_07334
train
T1
v3
Schema: departments (alias: dept)(type, value, level, amount) managers(status, value, amount, code) Task: Retrieve name from departments with salary above the AVG(value) of managers rows sharing the same id. SQL:
SELECT name FROM departments AS dept WHERE salary > ( SELECT AVG(value) FROM managers AS mgr WHERE mgr.id = dept.id );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_07335
train
T1
v2
Schema: warehouses (alias: whs)(status, level, id, value) transactions(level, type, salary, status) Task: Find code from warehouses where a matching record exists in transactions with the same type. SQL:
SELECT code FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "transactions", "outer_alias": "whs", "inner_alias": "txn", "proj_col": "code", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_07336
train
T2
v3
Schema: staff (alias: empl)(level, salary, amount, status) sales(code, salary, value, level) Task: Find id from staff where value exceeds the average amount from sales for the same type. SQL:
SELECT id FROM staff AS empl WHERE value > ( SELECT AVG(amount) FROM sales AS sale WHERE sale.type = empl.type );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_07337
train
T2
v2
Schema: departments (alias: dept)(level, salary, type, name) products(name, level, amount, type) Task: Retrieve name from departments that have at least one corresponding entry in products sharing the same type. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = dept.type );
{ "outer_table": "departments", "inner_table": "products", "outer_alias": "dept", "inner_alias": "prod", "proj_col": "name", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_07338
train
T1
v2
Schema: employees (alias: emp)(amount, type, id, code) orders(amount, level, date, code) Task: Find amount from employees where a matching record exists in orders with the same level. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = emp.level );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "amount", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_07339
train
T1
v1
Schema: shipments (alias: shp)(id, status, date, amount) accounts(status, amount, level, name) Task: Find code from shipments where type appears in accounts entries with matching type. SQL:
SELECT code FROM shipments AS shp WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.type = shp.type );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "code", "filter_col": "type", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_07340
train
T2
v1
Schema: departments (alias: dept)(value, level, date, amount) items(type, status, level, value) Task: Find salary from departments where type appears in items entries with matching code. SQL:
SELECT salary FROM departments AS dept WHERE type IN ( SELECT type FROM items AS lne WHERE lne.code = dept.code );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "salary", "filter_col": "type", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_07341
train
T1
v2
Schema: services (alias: srvc)(date, name, status, value) shipments(level, salary, code, date) Task: Find amount from services where a matching record exists in shipments with the same code. SQL:
SELECT amount FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = srvc.code );
{ "outer_table": "services", "inner_table": "shipments", "outer_alias": "srvc", "inner_alias": "shp", "proj_col": "amount", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_07342
train
T2
v3
Schema: customers (alias: cust)(level, code, type, status) sales(status, salary, value, amount) Task: Retrieve code from customers with amount above the MAX(amount) of sales rows sharing the same level. SQL:
SELECT code FROM customers AS cust WHERE amount > ( SELECT MAX(amount) FROM sales AS sale WHERE sale.level = cust.level );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_07343
train
T1
v3
Schema: requests (alias: ordr)(id, amount, value, status) managers(amount, value, level, code) Task: Retrieve value from requests with salary above the AVG(salary) of managers rows sharing the same code. SQL:
SELECT value FROM requests AS ordr WHERE salary > ( SELECT AVG(salary) FROM managers AS mgr WHERE mgr.code = ordr.code );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_07344
train
T2
v3
Schema: customers (alias: cust)(type, value, salary, status) sales(id, value, level, code) Task: Find amount from customers where salary exceeds the average value from sales for the same type. SQL:
SELECT amount FROM customers AS cust WHERE salary > ( SELECT MAX(value) FROM sales AS sale WHERE sale.type = cust.type );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_07345
train
T1
v1
Schema: accounts (alias: acct)(name, status, date, value) requests(id, type, status, level) Task: Find value from accounts where level appears in requests entries with matching level. SQL:
SELECT value FROM accounts AS acct WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.level = acct.level );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_07346
train
T1
v3
Schema: accounts (alias: acct)(id, status, code, date) items(salary, type, amount, level) Task: Find id from accounts where value exceeds the average value from items for the same code. SQL:
SELECT id FROM accounts AS acct WHERE value > ( SELECT COUNT(value) FROM items AS lne WHERE lne.code = acct.code );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_07347
train
T1
v1
Schema: customers (alias: cust)(id, value, amount, level) regions(id, name, date, status) Task: Retrieve amount from customers whose level is found in regions rows where status matches the outer record. SQL:
SELECT amount FROM customers AS cust WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.status = cust.status );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_07348
train
T1
v1
Schema: customers (alias: cust)(code, status, level, date) transactions(type, value, name, date) Task: Select code from customers where level exists in transactions for the same type. SQL:
SELECT code FROM customers AS cust WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.type = cust.type );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_07349
train
T1
v2
Schema: regions (alias: rgn)(type, id, value, amount) items(level, amount, name, date) Task: Find id from regions where a matching record exists in items with the same code. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = rgn.code );
{ "outer_table": "regions", "inner_table": "items", "outer_alias": "rgn", "inner_alias": "lne", "proj_col": "id", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_07350
train
T2
v1
Schema: schedules (alias: schd)(salary, date, level, name) categories(salary, id, value, name) Task: Find amount from schedules where type appears in categories entries with matching level. SQL:
SELECT amount FROM schedules AS schd WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.level = schd.level );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_07351
train
T2
v3
Schema: items (alias: lne)(value, level, id, salary) accounts(name, type, amount, id) Task: Find code from items where amount exceeds the average amount from accounts for the same code. SQL:
SELECT code FROM items AS lne WHERE amount > ( SELECT MIN(amount) FROM accounts AS acct WHERE acct.code = lne.code );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_07352
train
T2
v1
Schema: accounts (alias: acct)(salary, value, id, amount) regions(name, id, amount, level) Task: Retrieve id from accounts whose level is found in regions rows where level matches the outer record. SQL:
SELECT id FROM accounts AS acct WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.level = acct.level );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_07353
train
T1
v1
Schema: sales (alias: sale)(code, level, status, date) products(status, code, date, id) Task: Retrieve salary from sales whose level is found in products rows where type matches the outer record. SQL:
SELECT salary FROM sales AS sale WHERE level IN ( SELECT level FROM products AS prod WHERE prod.type = sale.type );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "salary", "filter_col": "level", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_07354
train
T1
v2
Schema: warehouses (alias: whs)(name, date, status, code) budgets(type, value, name, amount) Task: Retrieve code from warehouses that have at least one corresponding entry in budgets sharing the same id. SQL:
SELECT code FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "budgets", "outer_alias": "whs", "inner_alias": "budg", "proj_col": "code", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_07355
train
T2
v2
Schema: accounts (alias: acct)(value, code, amount, date) shipments(amount, id, code, status) Task: Retrieve id from accounts that have at least one corresponding entry in shipments sharing the same code. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = acct.code );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "id", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_07356
train
T1
v2
Schema: employees (alias: emp)(amount, value, code, status) shipments(date, name, value, id) Task: Find id from employees where a matching record exists in shipments with the same code. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = emp.code );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "id", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_07357
train
T1
v2
Schema: products (alias: prod)(value, type, amount, name) departments(amount, date, code, status) Task: Retrieve id from products that have at least one corresponding entry in departments sharing the same status. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = prod.status );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "id", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_07358
train
T1
v2
Schema: shipments (alias: shp)(type, name, id, date) employees(date, status, type, id) Task: Find amount from shipments where a matching record exists in employees with the same status. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = shp.status );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "amount", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_07359
train
T2
v2
Schema: invoices (alias: inv)(amount, status, name, value) warehouses(value, id, amount, name) Task: Find code from invoices where a matching record exists in warehouses with the same status. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.status = inv.status );
{ "outer_table": "invoices", "inner_table": "warehouses", "outer_alias": "inv", "inner_alias": "whs", "proj_col": "code", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_07360
train
T1
v2
Schema: orders (alias: ord)(status, name, type, salary) transactions(salary, amount, type, level) Task: Retrieve id from orders that have at least one corresponding entry in transactions sharing the same id. SQL:
SELECT id FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = ord.id );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "id", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_07361
train
T1
v3
Schema: sales (alias: sale)(salary, level, date, type) departments(level, name, amount, value) Task: Retrieve code from sales with value above the MAX(salary) of departments rows sharing the same type. SQL:
SELECT code FROM sales AS sale WHERE value > ( SELECT MAX(salary) FROM departments AS dept WHERE dept.type = sale.type );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_07362
train
T1
v1
Schema: services (alias: srvc)(salary, date, name, type) shipments(type, amount, date, status) Task: Find salary from services where code appears in shipments entries with matching code. SQL:
SELECT salary FROM services AS srvc WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.code = srvc.code );
{ "outer_table": "services", "inner_table": "shipments", "outer_alias": "srvc", "inner_alias": "shp", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_07363
train
T2
v2
Schema: categories (alias: catg)(type, level, status, salary) sales(code, status, name, amount) Task: Retrieve name from categories that have at least one corresponding entry in sales sharing the same id. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = catg.id );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "name", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_07364
train
T2
v1
Schema: warehouses (alias: whs)(value, date, name, level) services(amount, type, value, code) Task: Retrieve value from warehouses whose type is found in services rows where id matches the outer record. SQL:
SELECT value FROM warehouses AS whs WHERE type IN ( SELECT type FROM services AS srvc WHERE srvc.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "services", "outer_alias": "whs", "inner_alias": "srvc", "proj_col": "value", "filter_col": "type", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_07365
train
T2
v1
Schema: customers (alias: cust)(date, type, level, id) regions(salary, level, status, type) Task: Retrieve value from customers whose level is found in regions rows where type matches the outer record. SQL:
SELECT value FROM customers AS cust WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.type = cust.type );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_07366
train
T1
v3
Schema: transactions (alias: txn)(code, level, date, type) managers(status, salary, id, level) Task: Retrieve name from transactions with amount above the COUNT(salary) of managers rows sharing the same id. SQL:
SELECT name FROM transactions AS txn WHERE amount > ( SELECT COUNT(salary) FROM managers AS mgr WHERE mgr.id = txn.id );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_07367
train
T1
v2
Schema: products (alias: prod)(date, id, amount, code) managers(code, amount, status, level) Task: Find value from products where a matching record exists in managers with the same level. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = prod.level );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "value", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_07368
train
T1
v3
Schema: schedules (alias: schd)(date, type, id, salary) accounts(code, value, salary, id) Task: Find name from schedules where value exceeds the average salary from accounts for the same id. SQL:
SELECT name FROM schedules AS schd WHERE value > ( SELECT COUNT(salary) FROM accounts AS acct WHERE acct.id = schd.id );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_07369
train
T2
v2
Schema: invoices (alias: inv)(name, code, id, level) requests(code, date, name, salary) Task: Find name from invoices where a matching record exists in requests with the same code. SQL:
SELECT name FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = inv.code );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "name", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_07370
train
T1
v2
Schema: transactions (alias: txn)(type, date, id, name) accounts(code, status, type, id) Task: Find name from transactions where a matching record exists in accounts with the same level. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = txn.level );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "name", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_07371
train
T1
v2
Schema: services (alias: srvc)(date, value, amount, salary) warehouses(status, level, code, date) Task: Find value from services where a matching record exists in warehouses with the same level. SQL:
SELECT value FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.level = srvc.level );
{ "outer_table": "services", "inner_table": "warehouses", "outer_alias": "srvc", "inner_alias": "whs", "proj_col": "value", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_07372
train
T2
v2
Schema: accounts (alias: acct)(id, type, salary, date) items(amount, level, code, id) Task: Retrieve code from accounts that have at least one corresponding entry in items sharing the same id. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.id = acct.id );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "code", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_07373
train
T1
v2
Schema: managers (alias: mgr)(value, salary, date, name) orders(id, status, amount, salary) Task: Find name from managers where a matching record exists in orders with the same status. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = mgr.status );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "name", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_07374
train
T1
v2
Schema: invoices (alias: inv)(id, level, name, code) requests(status, date, amount, salary) Task: Find name from invoices where a matching record exists in requests with the same level. SQL:
SELECT name FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = inv.level );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "name", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_07375
train
T1
v3
Schema: categories (alias: catg)(amount, status, salary, name) budgets(level, status, code, salary) Task: Find amount from categories where amount exceeds the average salary from budgets for the same status. SQL:
SELECT amount FROM categories AS catg WHERE amount > ( SELECT MAX(salary) FROM budgets AS budg WHERE budg.status = catg.status );
{ "outer_table": "categories", "inner_table": "budgets", "outer_alias": "catg", "inner_alias": "budg", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_07376
train
T2
v3
Schema: items (alias: lne)(amount, code, value, salary) services(amount, name, level, salary) Task: Find code from items where value exceeds the average value from services for the same status. SQL:
SELECT code FROM items AS lne WHERE value > ( SELECT SUM(value) FROM services AS srvc WHERE srvc.status = lne.status );
{ "outer_table": "items", "inner_table": "services", "outer_alias": "lne", "inner_alias": "srvc", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_07377
train
T2
v1
Schema: shipments (alias: shp)(code, name, type, id) warehouses(name, code, amount, salary) Task: Find amount from shipments where code appears in warehouses entries with matching code. SQL:
SELECT amount FROM shipments AS shp WHERE code IN ( SELECT code FROM warehouses AS whs WHERE whs.code = shp.code );
{ "outer_table": "shipments", "inner_table": "warehouses", "outer_alias": "shp", "inner_alias": "whs", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_07378
train
T2
v3
Schema: sales (alias: sale)(date, value, level, code) employees(value, status, id, level) Task: Retrieve id from sales with value above the MAX(salary) of employees rows sharing the same type. SQL:
SELECT id FROM sales AS sale WHERE value > ( SELECT MAX(salary) FROM employees AS emp WHERE emp.type = sale.type );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_07379
train
T1
v1
Schema: warehouses (alias: whs)(date, value, type, code) items(level, type, value, amount) Task: Retrieve value from warehouses whose type is found in items rows where level matches the outer record. SQL:
SELECT value FROM warehouses AS whs WHERE type IN ( SELECT type FROM items AS lne WHERE lne.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "items", "outer_alias": "whs", "inner_alias": "lne", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_07380
train
T2
v3
Schema: invoices (alias: inv)(code, id, date, level) staff(level, salary, status, code) Task: Find code from invoices where amount exceeds the average value from staff for the same type. SQL:
SELECT code FROM invoices AS inv WHERE amount > ( SELECT MIN(value) FROM staff AS empl WHERE empl.type = inv.type );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_07381
train
T1
v2
Schema: services (alias: srvc)(value, id, salary, status) items(salary, value, name, date) Task: Find code from services where a matching record exists in items with the same status. SQL:
SELECT code FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = srvc.status );
{ "outer_table": "services", "inner_table": "items", "outer_alias": "srvc", "inner_alias": "lne", "proj_col": "code", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_07382
train
T2
v1
Schema: requests (alias: ordr)(salary, code, amount, date) categories(id, salary, date, status) Task: Select code from requests where type exists in categories for the same level. SQL:
SELECT code FROM requests AS ordr WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.level = ordr.level );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "code", "filter_col": "type", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_07383
train
T2
v1
Schema: regions (alias: rgn)(salary, code, level, amount) orders(value, level, status, type) Task: Select id from regions where code exists in orders for the same status. SQL:
SELECT id FROM regions AS rgn WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.status = rgn.status );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_07384
train
T2
v2
Schema: regions (alias: rgn)(name, type, status, value) requests(value, code, status, id) Task: Retrieve amount from regions that have at least one corresponding entry in requests sharing the same code. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = rgn.code );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "amount", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_07385
train
T2
v3
Schema: requests (alias: ordr)(salary, name, code, value) customers(salary, level, status, name) Task: Retrieve id from requests with salary above the MAX(salary) of customers rows sharing the same status. SQL:
SELECT id FROM requests AS ordr WHERE salary > ( SELECT MAX(salary) FROM customers AS cust WHERE cust.status = ordr.status );
{ "outer_table": "requests", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_07386
train
T2
v2
Schema: budgets (alias: budg)(value, name, code, date) products(amount, value, salary, type) Task: Retrieve salary from budgets that have at least one corresponding entry in products sharing the same id. SQL:
SELECT salary FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = budg.id );
{ "outer_table": "budgets", "inner_table": "products", "outer_alias": "budg", "inner_alias": "prod", "proj_col": "salary", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_07387
train
T2
v1
Schema: products (alias: prod)(code, date, level, name) accounts(value, date, salary, type) Task: Find name from products where type appears in accounts entries with matching level. SQL:
SELECT name 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": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_07388
train
T1
v3
Schema: requests (alias: ordr)(type, level, amount, id) transactions(status, amount, id, date) Task: Retrieve value from requests with salary above the SUM(salary) of transactions rows sharing the same id. SQL:
SELECT value FROM requests AS ordr WHERE salary > ( SELECT SUM(salary) FROM transactions AS txn WHERE txn.id = ordr.id );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_07389
train
T2
v2
Schema: departments (alias: dept)(id, date, amount, status) services(salary, code, status, name) Task: Retrieve amount from departments that have at least one corresponding entry in services sharing the same status. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.status = dept.status );
{ "outer_table": "departments", "inner_table": "services", "outer_alias": "dept", "inner_alias": "srvc", "proj_col": "amount", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_07390
train
T1
v3
Schema: managers (alias: mgr)(level, value, amount, code) accounts(type, level, name, date) Task: Find value from managers where amount exceeds the average salary from accounts for the same id. SQL:
SELECT value FROM managers AS mgr WHERE amount > ( SELECT MAX(salary) FROM accounts AS acct WHERE acct.id = mgr.id );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_07391
train
T1
v2
Schema: regions (alias: rgn)(salary, name, value, code) schedules(name, id, code, status) Task: Retrieve name from regions that have at least one corresponding entry in schedules sharing the same status. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = rgn.status );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "name", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_07392
train
T2
v2
Schema: accounts (alias: acct)(code, level, value, salary) budgets(level, value, name, date) Task: Find name from accounts where a matching record exists in budgets with the same type. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.type = acct.type );
{ "outer_table": "accounts", "inner_table": "budgets", "outer_alias": "acct", "inner_alias": "budg", "proj_col": "name", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_07393
train
T1
v1
Schema: schedules (alias: schd)(date, type, id, code) invoices(level, value, salary, amount) Task: Find value from schedules where code appears in invoices entries with matching code. SQL:
SELECT value FROM schedules AS schd WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.code = schd.code );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_07394
train
T2
v3
Schema: orders (alias: ord)(code, amount, name, type) shipments(salary, status, id, name) Task: Find code from orders where salary exceeds the average salary from shipments for the same code. SQL:
SELECT code FROM orders AS ord WHERE salary > ( SELECT MAX(salary) FROM shipments AS shp WHERE shp.code = ord.code );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_07395
train
T1
v2
Schema: orders (alias: ord)(value, amount, id, date) departments(salary, level, id, code) Task: Find amount from orders where a matching record exists in departments with the same level. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = ord.level );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "amount", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_07396
train
T1
v2
Schema: staff (alias: empl)(level, name, value, code) categories(level, type, amount, salary) Task: Retrieve value from staff that have at least one corresponding entry in categories sharing the same type. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = empl.type );
{ "outer_table": "staff", "inner_table": "categories", "outer_alias": "empl", "inner_alias": "catg", "proj_col": "value", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_07397
train
T2
v3
Schema: categories (alias: catg)(salary, status, value, level) warehouses(name, amount, type, code) Task: Find amount from categories where amount exceeds the average amount from warehouses for the same code. SQL:
SELECT amount FROM categories AS catg WHERE amount > ( SELECT MIN(amount) FROM warehouses AS whs WHERE whs.code = catg.code );
{ "outer_table": "categories", "inner_table": "warehouses", "outer_alias": "catg", "inner_alias": "whs", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_07398
train
T2
v3
Schema: accounts (alias: acct)(status, name, amount, type) sales(amount, type, id, level) Task: Retrieve name from accounts with salary above the SUM(value) of sales rows sharing the same code. SQL:
SELECT name FROM accounts AS acct WHERE salary > ( SELECT SUM(value) FROM sales AS sale WHERE sale.code = acct.code );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_07399
train
T1