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: orders (alias: ord)(level, value, name, id) products(code, date, type, status) Task: Select value from orders where code exists in products for the same id. SQL:
SELECT value FROM orders AS ord WHERE code IN ( SELECT code FROM products AS prod WHERE prod.id = ord.id );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_06300
train
T1
v1
Schema: items (alias: lne)(name, amount, status, date) budgets(name, value, type, level) Task: Select amount from items where type exists in budgets for the same code. SQL:
SELECT amount FROM items AS lne WHERE type IN ( SELECT type FROM budgets AS budg WHERE budg.code = lne.code );
{ "outer_table": "items", "inner_table": "budgets", "outer_alias": "lne", "inner_alias": "budg", "proj_col": "amount", "filter_col": "type", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_06301
train
T2
v1
Schema: products (alias: prod)(salary, value, type, status) sales(id, type, code, date) Task: Select amount from products where status exists in sales for the same code. SQL:
SELECT amount FROM products AS prod WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.code = prod.code );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "amount", "filter_col": "status", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_06302
train
T1
v3
Schema: staff (alias: empl)(name, id, code, amount) items(value, level, code, date) Task: Find amount from staff where amount exceeds the average value from items for the same code. SQL:
SELECT amount FROM staff AS empl WHERE amount > ( SELECT MAX(value) FROM items AS lne WHERE lne.code = empl.code );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_06303
train
T2
v2
Schema: employees (alias: emp)(salary, date, level, code) staff(salary, level, id, name) Task: Find salary from employees where a matching record exists in staff with the same status. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = emp.status );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "salary", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_06304
train
T1
v2
Schema: departments (alias: dept)(type, date, code, name) warehouses(id, status, salary, value) Task: Find value from departments where a matching record exists in warehouses with the same id. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.id = dept.id );
{ "outer_table": "departments", "inner_table": "warehouses", "outer_alias": "dept", "inner_alias": "whs", "proj_col": "value", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_06305
train
T1
v2
Schema: shipments (alias: shp)(value, type, status, salary) warehouses(value, name, date, status) Task: Retrieve id from shipments that have at least one corresponding entry in warehouses sharing the same code. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.code = shp.code );
{ "outer_table": "shipments", "inner_table": "warehouses", "outer_alias": "shp", "inner_alias": "whs", "proj_col": "id", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_06306
train
T2
v1
Schema: warehouses (alias: whs)(type, level, code, date) products(salary, status, id, date) Task: Retrieve value from warehouses whose level is found in products rows where id matches the outer record. SQL:
SELECT value FROM warehouses AS whs WHERE level IN ( SELECT level FROM products AS prod WHERE prod.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "products", "outer_alias": "whs", "inner_alias": "prod", "proj_col": "value", "filter_col": "level", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_06307
train
T2
v2
Schema: accounts (alias: acct)(id, salary, value, name) budgets(level, value, id, salary) Task: Find id from accounts where a matching record exists in budgets with the same status. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.status = acct.status );
{ "outer_table": "accounts", "inner_table": "budgets", "outer_alias": "acct", "inner_alias": "budg", "proj_col": "id", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_06308
train
T1
v3
Schema: customers (alias: cust)(amount, level, value, code) staff(code, salary, type, name) Task: Find name from customers where amount exceeds the average amount from staff for the same type. SQL:
SELECT name FROM customers AS cust WHERE amount > ( SELECT COUNT(amount) FROM staff AS empl WHERE empl.type = cust.type );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_06309
train
T1
v3
Schema: warehouses (alias: whs)(type, code, date, amount) budgets(name, code, value, date) Task: Retrieve salary from warehouses with salary above the MIN(salary) of budgets rows sharing the same type. SQL:
SELECT salary FROM warehouses AS whs WHERE salary > ( SELECT MIN(salary) FROM budgets AS budg WHERE budg.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "budgets", "outer_alias": "whs", "inner_alias": "budg", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_06310
train
T2
v3
Schema: items (alias: lne)(level, code, name, value) customers(amount, value, code, type) Task: Retrieve name from items with amount above the SUM(salary) of customers rows sharing the same code. SQL:
SELECT name FROM items AS lne WHERE amount > ( SELECT SUM(salary) FROM customers AS cust WHERE cust.code = lne.code );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_06311
train
T2
v1
Schema: invoices (alias: inv)(status, name, type, id) sales(type, value, amount, date) Task: Retrieve code from invoices whose status is found in sales rows where code matches the outer record. SQL:
SELECT code FROM invoices AS inv WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.code = inv.code );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "code", "filter_col": "status", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_06312
train
T1
v2
Schema: budgets (alias: budg)(level, date, value, id) shipments(amount, id, code, type) Task: Retrieve amount from budgets that have at least one corresponding entry in shipments sharing the same code. SQL:
SELECT amount FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = budg.code );
{ "outer_table": "budgets", "inner_table": "shipments", "outer_alias": "budg", "inner_alias": "shp", "proj_col": "amount", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_06313
train
T2
v3
Schema: shipments (alias: shp)(id, amount, value, level) employees(id, name, code, amount) Task: Find code from shipments where value exceeds the average value from employees for the same code. SQL:
SELECT code FROM shipments AS shp WHERE value > ( SELECT MIN(value) FROM employees AS emp WHERE emp.code = shp.code );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_06314
train
T2
v1
Schema: transactions (alias: txn)(level, code, amount, status) employees(code, type, amount, id) Task: Find amount from transactions where code appears in employees entries with matching type. SQL:
SELECT amount FROM transactions AS txn WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.type = txn.type );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_06315
train
T1
v3
Schema: orders (alias: ord)(status, date, id, type) customers(amount, level, status, name) Task: Find salary from orders where salary exceeds the average amount from customers for the same status. SQL:
SELECT salary FROM orders AS ord WHERE salary > ( SELECT SUM(amount) FROM customers AS cust WHERE cust.status = ord.status );
{ "outer_table": "orders", "inner_table": "customers", "outer_alias": "ord", "inner_alias": "cust", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_06316
train
T1
v2
Schema: staff (alias: empl)(salary, amount, value, name) shipments(salary, level, status, type) Task: Find amount from staff where a matching record exists in shipments with the same level. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = empl.level );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "amount", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_06317
train
T2
v3
Schema: services (alias: srvc)(date, amount, value, type) staff(name, date, id, salary) Task: Retrieve salary from services with salary above the MIN(value) of staff rows sharing the same id. SQL:
SELECT salary FROM services AS srvc WHERE salary > ( SELECT MIN(value) FROM staff AS empl WHERE empl.id = srvc.id );
{ "outer_table": "services", "inner_table": "staff", "outer_alias": "srvc", "inner_alias": "empl", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_06318
train
T2
v1
Schema: schedules (alias: schd)(amount, level, type, name) services(id, date, code, level) Task: Find name from schedules where id appears in services entries with matching id. SQL:
SELECT name FROM schedules AS schd WHERE id IN ( SELECT id FROM services AS srvc WHERE srvc.id = schd.id );
{ "outer_table": "schedules", "inner_table": "services", "outer_alias": "schd", "inner_alias": "srvc", "proj_col": "name", "filter_col": "id", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_06319
train
T2
v1
Schema: managers (alias: mgr)(code, type, name, date) departments(salary, id, date, code) Task: Retrieve name from managers whose type is found in departments rows where level matches the outer record. SQL:
SELECT name FROM managers AS mgr WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.level = mgr.level );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_06320
train
T1
v3
Schema: requests (alias: ordr)(status, code, level, date) schedules(id, value, name, code) Task: Retrieve id from requests with value above the COUNT(salary) of schedules rows sharing the same id. SQL:
SELECT id FROM requests AS ordr WHERE value > ( SELECT COUNT(salary) FROM schedules AS schd WHERE schd.id = ordr.id );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_06321
train
T2
v2
Schema: staff (alias: empl)(salary, value, code, type) items(name, id, value, status) Task: Retrieve value from staff that have at least one corresponding entry in items sharing the same code. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = empl.code );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "value", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_06322
train
T2
v2
Schema: services (alias: srvc)(name, level, type, id) categories(id, type, amount, status) Task: Find value from services where a matching record exists in categories with the same level. SQL:
SELECT value FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = srvc.level );
{ "outer_table": "services", "inner_table": "categories", "outer_alias": "srvc", "inner_alias": "catg", "proj_col": "value", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_06323
train
T2
v2
Schema: staff (alias: empl)(type, date, value, level) products(name, level, type, code) Task: Find amount from staff where a matching record exists in products with the same level. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = empl.level );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "amount", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_06324
train
T2
v3
Schema: staff (alias: empl)(name, amount, id, type) services(name, level, amount, status) Task: Find id from staff where salary exceeds the average amount from services for the same code. SQL:
SELECT id FROM staff AS empl WHERE salary > ( SELECT MAX(amount) FROM services AS srvc WHERE srvc.code = empl.code );
{ "outer_table": "staff", "inner_table": "services", "outer_alias": "empl", "inner_alias": "srvc", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_06325
train
T2
v3
Schema: transactions (alias: txn)(type, code, id, status) customers(type, id, value, status) Task: Retrieve amount from transactions with amount above the SUM(amount) of customers rows sharing the same status. SQL:
SELECT amount FROM transactions AS txn WHERE amount > ( SELECT SUM(amount) FROM customers AS cust WHERE cust.status = txn.status );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_06326
train
T1
v3
Schema: budgets (alias: budg)(salary, value, date, level) products(date, status, code, value) Task: Find code from budgets where salary exceeds the average value from products for the same level. SQL:
SELECT code FROM budgets AS budg WHERE salary > ( SELECT MAX(value) FROM products AS prod WHERE prod.level = budg.level );
{ "outer_table": "budgets", "inner_table": "products", "outer_alias": "budg", "inner_alias": "prod", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_06327
train
T2
v3
Schema: customers (alias: cust)(amount, value, date, name) orders(value, id, name, code) Task: Find name from customers where value exceeds the average amount from orders for the same level. SQL:
SELECT name FROM customers AS cust WHERE value > ( SELECT MIN(amount) FROM orders AS ord WHERE ord.level = cust.level );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_06328
train
T1
v2
Schema: budgets (alias: budg)(status, salary, id, amount) regions(name, level, date, value) Task: Find salary from budgets where a matching record exists in regions with the same code. SQL:
SELECT salary FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = budg.code );
{ "outer_table": "budgets", "inner_table": "regions", "outer_alias": "budg", "inner_alias": "rgn", "proj_col": "salary", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_06329
train
T2
v1
Schema: sales (alias: sale)(date, amount, value, id) invoices(salary, type, value, id) Task: Find value from sales where id appears in invoices entries with matching level. SQL:
SELECT value FROM sales AS sale WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.level = sale.level );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_06330
train
T1
v2
Schema: requests (alias: ordr)(code, id, status, date) accounts(id, amount, code, name) Task: Find id from requests where a matching record exists in accounts with the same type. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = ordr.type );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "id", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_06331
train
T2
v2
Schema: transactions (alias: txn)(value, code, id, salary) products(amount, id, level, salary) Task: Retrieve code from transactions that have at least one corresponding entry in products sharing the same code. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = txn.code );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "code", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_06332
train
T1
v3
Schema: items (alias: lne)(date, amount, name, salary) budgets(code, id, type, value) Task: Retrieve amount from items with amount above the SUM(salary) of budgets rows sharing the same status. SQL:
SELECT amount FROM items AS lne WHERE amount > ( SELECT SUM(salary) FROM budgets AS budg WHERE budg.status = lne.status );
{ "outer_table": "items", "inner_table": "budgets", "outer_alias": "lne", "inner_alias": "budg", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_06333
train
T2
v3
Schema: departments (alias: dept)(salary, date, status, name) categories(value, level, code, status) Task: Find value from departments where salary exceeds the average value from categories for the same level. SQL:
SELECT value FROM departments AS dept WHERE salary > ( SELECT MIN(value) FROM categories AS catg WHERE catg.level = dept.level );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_06334
train
T1
v2
Schema: services (alias: srvc)(value, level, amount, code) departments(value, status, level, date) Task: Retrieve amount from services that have at least one corresponding entry in departments sharing the same type. SQL:
SELECT amount FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = srvc.type );
{ "outer_table": "services", "inner_table": "departments", "outer_alias": "srvc", "inner_alias": "dept", "proj_col": "amount", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_06335
train
T2
v3
Schema: orders (alias: ord)(type, salary, code, amount) items(date, salary, value, name) Task: Find value from orders where salary exceeds the average salary from items for the same id. SQL:
SELECT value FROM orders AS ord WHERE salary > ( SELECT MIN(salary) FROM items AS lne WHERE lne.id = ord.id );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_06336
train
T1
v1
Schema: regions (alias: rgn)(salary, status, amount, type) shipments(status, salary, name, id) Task: Select salary from regions where id exists in shipments for the same level. SQL:
SELECT salary FROM regions AS rgn WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.level = rgn.level );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "salary", "filter_col": "id", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_06337
train
T2
v2
Schema: customers (alias: cust)(code, type, id, amount) employees(value, salary, level, id) Task: Find salary from customers where a matching record exists in employees with the same level. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = cust.level );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "salary", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_06338
train
T1
v2
Schema: transactions (alias: txn)(date, type, salary, name) schedules(amount, name, level, value) Task: Retrieve code from transactions that have at least one corresponding entry in schedules sharing the same type. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = txn.type );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "code", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_06339
train
T1
v3
Schema: budgets (alias: budg)(value, amount, code, id) staff(salary, status, level, value) Task: Find code from budgets where amount exceeds the average salary from staff for the same type. SQL:
SELECT code FROM budgets AS budg WHERE amount > ( SELECT SUM(salary) FROM staff AS empl WHERE empl.type = budg.type );
{ "outer_table": "budgets", "inner_table": "staff", "outer_alias": "budg", "inner_alias": "empl", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_06340
train
T2
v1
Schema: invoices (alias: inv)(value, level, code, salary) employees(amount, date, level, name) Task: Find code from invoices where code appears in employees entries with matching level. SQL:
SELECT code FROM invoices AS inv WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.level = inv.level );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "code", "filter_col": "code", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_06341
train
T1
v3
Schema: orders (alias: ord)(name, id, salary, code) shipments(code, salary, status, type) Task: Find id from orders where salary exceeds the average amount from shipments for the same level. SQL:
SELECT id FROM orders AS ord WHERE salary > ( SELECT SUM(amount) FROM shipments AS shp WHERE shp.level = ord.level );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_06342
train
T1
v1
Schema: shipments (alias: shp)(status, name, value, level) managers(type, salary, level, name) Task: Retrieve name from shipments whose status is found in managers rows where status matches the outer record. SQL:
SELECT name FROM shipments AS shp WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.status = shp.status );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_06343
train
T2
v1
Schema: sales (alias: sale)(status, code, amount, name) staff(level, status, id, code) Task: Select amount from sales where id exists in staff for the same id. SQL:
SELECT amount FROM sales AS sale WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.id = sale.id );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "amount", "filter_col": "id", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_06344
train
T1
v3
Schema: categories (alias: catg)(type, salary, amount, code) warehouses(type, value, id, status) Task: Find name from categories where salary exceeds the average salary from warehouses for the same status. SQL:
SELECT name FROM categories AS catg WHERE salary > ( SELECT MAX(salary) FROM warehouses AS whs WHERE whs.status = catg.status );
{ "outer_table": "categories", "inner_table": "warehouses", "outer_alias": "catg", "inner_alias": "whs", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_06345
train
T2
v2
Schema: regions (alias: rgn)(type, date, amount, name) employees(id, type, amount, value) Task: Find value from regions where a matching record exists in employees with the same status. SQL:
SELECT value FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = rgn.status );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "value", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_06346
train
T2
v2
Schema: categories (alias: catg)(id, name, code, level) budgets(status, level, salary, id) Task: Retrieve id from categories that have at least one corresponding entry in budgets sharing the same type. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.type = catg.type );
{ "outer_table": "categories", "inner_table": "budgets", "outer_alias": "catg", "inner_alias": "budg", "proj_col": "id", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_06347
train
T2
v1
Schema: items (alias: lne)(amount, code, id, salary) shipments(value, salary, date, amount) Task: Find amount from items where type appears in shipments entries with matching code. SQL:
SELECT amount FROM items AS lne WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.code = lne.code );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "amount", "filter_col": "type", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_06348
train
T2
v1
Schema: warehouses (alias: whs)(name, code, amount, value) shipments(amount, code, name, id) Task: Retrieve name from warehouses whose type is found in shipments rows where code matches the outer record. SQL:
SELECT name FROM warehouses AS whs WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "shipments", "outer_alias": "whs", "inner_alias": "shp", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_06349
train
T2
v2
Schema: regions (alias: rgn)(code, name, status, value) services(name, id, date, type) Task: Find id from regions where a matching record exists in services with the same id. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = rgn.id );
{ "outer_table": "regions", "inner_table": "services", "outer_alias": "rgn", "inner_alias": "srvc", "proj_col": "id", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_06350
train
T2
v2
Schema: regions (alias: rgn)(level, name, amount, value) accounts(id, code, amount, type) Task: Retrieve amount from regions that have at least one corresponding entry in accounts sharing the same code. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = rgn.code );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "rgn", "inner_alias": "acct", "proj_col": "amount", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_06351
train
T2
v1
Schema: departments (alias: dept)(code, salary, level, type) schedules(level, type, name, salary) Task: Retrieve id from departments whose status is found in schedules rows where id matches the outer record. SQL:
SELECT id FROM departments AS dept WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.id = dept.id );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "id", "filter_col": "status", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_06352
train
T1
v2
Schema: items (alias: lne)(value, code, id, status) customers(name, amount, id, value) Task: Find code from items where a matching record exists in customers with the same status. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = lne.status );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "code", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_06353
train
T2
v3
Schema: shipments (alias: shp)(id, value, type, salary) employees(id, name, level, status) Task: Retrieve salary from shipments with amount above the AVG(amount) of employees rows sharing the same id. SQL:
SELECT salary FROM shipments AS shp WHERE amount > ( SELECT AVG(amount) FROM employees AS emp WHERE emp.id = shp.id );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_06354
train
T2
v2
Schema: products (alias: prod)(id, type, status, level) categories(date, value, name, salary) Task: Find salary from products where a matching record exists in categories with the same level. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = prod.level );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "salary", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_06355
train
T1
v1
Schema: orders (alias: ord)(date, status, amount, level) schedules(level, name, value, salary) Task: Find value from orders where status appears in schedules entries with matching code. SQL:
SELECT value FROM orders AS ord WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.code = ord.code );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "value", "filter_col": "status", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_06356
train
T1
v1
Schema: managers (alias: mgr)(id, date, salary, name) items(date, id, level, status) Task: Select name from managers where status exists in items for the same status. SQL:
SELECT name FROM managers AS mgr WHERE status IN ( SELECT status FROM items AS lne WHERE lne.status = mgr.status );
{ "outer_table": "managers", "inner_table": "items", "outer_alias": "mgr", "inner_alias": "lne", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_06357
train
T1
v3
Schema: staff (alias: empl)(value, code, type, level) categories(date, value, name, level) Task: Find salary from staff where value exceeds the average value from categories for the same level. SQL:
SELECT salary FROM staff AS empl WHERE value > ( SELECT SUM(value) FROM categories AS catg WHERE catg.level = empl.level );
{ "outer_table": "staff", "inner_table": "categories", "outer_alias": "empl", "inner_alias": "catg", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_06358
train
T2
v1
Schema: sales (alias: sale)(date, id, amount, name) shipments(amount, name, value, status) Task: Find code from sales where type appears in shipments entries with matching status. SQL:
SELECT code FROM sales AS sale WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.status = sale.status );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "code", "filter_col": "type", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_06359
train
T1
v1
Schema: managers (alias: mgr)(code, salary, value, amount) schedules(type, id, level, code) Task: Find code from managers where status appears in schedules entries with matching id. SQL:
SELECT code FROM managers AS mgr WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.id = mgr.id );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_06360
train
T1
v1
Schema: warehouses (alias: whs)(code, name, type, level) accounts(salary, value, amount, status) Task: Retrieve code from warehouses whose id is found in accounts rows where status matches the outer record. SQL:
SELECT code FROM warehouses AS whs WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "accounts", "outer_alias": "whs", "inner_alias": "acct", "proj_col": "code", "filter_col": "id", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_06361
train
T2
v1
Schema: products (alias: prod)(type, salary, status, amount) items(id, salary, value, date) Task: Find salary from products where status appears in items entries with matching status. SQL:
SELECT salary FROM products AS prod WHERE status IN ( SELECT status FROM items AS lne WHERE lne.status = prod.status );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_06362
train
T1
v3
Schema: employees (alias: emp)(amount, level, type, date) invoices(salary, name, amount, date) Task: Retrieve name from employees with salary above the SUM(salary) of invoices rows sharing the same id. SQL:
SELECT name FROM employees AS emp WHERE salary > ( SELECT SUM(salary) FROM invoices AS inv WHERE inv.id = emp.id );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_06363
train
T1
v1
Schema: budgets (alias: budg)(level, date, value, name) customers(value, date, type, code) Task: Find code from budgets where type appears in customers entries with matching level. SQL:
SELECT code FROM budgets AS budg WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.level = budg.level );
{ "outer_table": "budgets", "inner_table": "customers", "outer_alias": "budg", "inner_alias": "cust", "proj_col": "code", "filter_col": "type", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_06364
train
T2
v2
Schema: invoices (alias: inv)(date, status, salary, name) transactions(code, value, level, id) Task: Find code from invoices where a matching record exists in transactions with the same code. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = inv.code );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "code", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_06365
train
T1
v2
Schema: requests (alias: ordr)(code, amount, value, name) staff(date, name, status, id) Task: Retrieve id from requests that have at least one corresponding entry in staff sharing the same code. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = ordr.code );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "id", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_06366
train
T2
v2
Schema: items (alias: lne)(amount, name, date, value) invoices(status, id, date, code) Task: Retrieve amount from items that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = lne.type );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "amount", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_06367
train
T2
v2
Schema: items (alias: lne)(date, status, name, id) accounts(id, type, code, level) Task: Find salary from items where a matching record exists in accounts with the same type. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = lne.type );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "salary", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_06368
train
T2
v1
Schema: customers (alias: cust)(code, id, value, type) transactions(type, name, code, value) Task: Select amount from customers where type exists in transactions for the same id. SQL:
SELECT amount FROM customers AS cust WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.id = cust.id );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_06369
train
T1
v1
Schema: sales (alias: sale)(amount, name, type, code) products(salary, value, level, status) Task: Find value from sales where type appears in products entries with matching status. SQL:
SELECT value FROM sales AS sale WHERE type IN ( SELECT type 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": "type", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_06370
train
T1
v1
Schema: customers (alias: cust)(name, level, value, amount) products(status, name, date, type) Task: Find name from customers where level appears in products entries with matching type. SQL:
SELECT name FROM customers AS cust WHERE level IN ( SELECT level FROM products AS prod WHERE prod.type = cust.type );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_06371
train
T1
v1
Schema: requests (alias: ordr)(amount, name, level, id) employees(code, amount, type, value) Task: Select id from requests where type exists in employees for the same code. SQL:
SELECT id FROM requests AS ordr WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.code = ordr.code );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_06372
train
T2
v2
Schema: orders (alias: ord)(name, value, salary, code) regions(id, name, status, code) Task: Find salary from orders where a matching record exists in regions with the same code. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = ord.code );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "salary", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_06373
train
T1
v2
Schema: shipments (alias: shp)(status, id, type, name) transactions(salary, date, amount, level) Task: Retrieve salary from shipments that have at least one corresponding entry in transactions sharing the same status. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = shp.status );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "salary", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_06374
train
T2
v1
Schema: managers (alias: mgr)(status, level, value, type) customers(value, type, name, date) Task: Select name from managers where type exists in customers for the same id. SQL:
SELECT name FROM managers AS mgr WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.id = mgr.id );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "name", "filter_col": "type", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_06375
train
T1
v2
Schema: shipments (alias: shp)(name, date, type, value) employees(amount, level, type, salary) Task: Retrieve salary from shipments that have at least one corresponding entry in employees sharing the same level. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = shp.level );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "salary", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_06376
train
T2
v2
Schema: customers (alias: cust)(status, id, salary, value) schedules(salary, value, level, amount) Task: Find amount from customers where a matching record exists in schedules with the same status. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = cust.status );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "amount", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_06377
train
T1
v3
Schema: departments (alias: dept)(type, status, value, amount) categories(level, name, status, id) Task: Find code from departments where value exceeds the average salary from categories for the same id. SQL:
SELECT code FROM departments AS dept WHERE value > ( SELECT COUNT(salary) FROM categories AS catg WHERE catg.id = dept.id );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_06378
train
T1
v1
Schema: products (alias: prod)(amount, status, id, value) managers(level, id, value, amount) Task: Find id from products where type appears in managers entries with matching level. SQL:
SELECT id FROM products AS prod WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.level = prod.level );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_06379
train
T1
v1
Schema: customers (alias: cust)(date, id, type, name) accounts(name, code, level, type) Task: Retrieve amount from customers whose level is found in accounts rows where level matches the outer record. SQL:
SELECT amount FROM customers AS cust WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.level = cust.level );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "amount", "filter_col": "level", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_06380
train
T1
v2
Schema: sales (alias: sale)(name, id, type, date) regions(type, name, code, id) Task: Find amount from sales where a matching record exists in regions with the same id. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = sale.id );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "amount", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_06381
train
T1
v2
Schema: managers (alias: mgr)(amount, code, status, type) transactions(status, salary, code, value) Task: Find amount from managers where a matching record exists in transactions with the same status. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = mgr.status );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "amount", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_06382
train
T1
v2
Schema: shipments (alias: shp)(status, value, type, date) managers(salary, level, status, name) Task: Retrieve amount from shipments that have at least one corresponding entry in managers sharing the same level. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = shp.level );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "amount", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_06383
train
T2
v2
Schema: departments (alias: dept)(value, amount, level, salary) requests(code, amount, name, type) Task: Find value from departments where a matching record exists in requests with the same status. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = dept.status );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "value", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_06384
train
T1
v3
Schema: shipments (alias: shp)(id, value, code, date) products(status, value, amount, name) Task: Find amount from shipments where salary exceeds the average salary from products for the same status. SQL:
SELECT amount FROM shipments AS shp WHERE salary > ( SELECT COUNT(salary) FROM products AS prod WHERE prod.status = shp.status );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_06385
train
T2
v2
Schema: budgets (alias: budg)(level, status, type, name) sales(id, amount, level, status) Task: Find id from budgets where a matching record exists in sales with the same code. SQL:
SELECT id FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = budg.code );
{ "outer_table": "budgets", "inner_table": "sales", "outer_alias": "budg", "inner_alias": "sale", "proj_col": "id", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_06386
train
T2
v2
Schema: services (alias: srvc)(level, salary, type, status) sales(status, date, type, salary) Task: Retrieve name from services that have at least one corresponding entry in sales sharing the same level. SQL:
SELECT name FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = srvc.level );
{ "outer_table": "services", "inner_table": "sales", "outer_alias": "srvc", "inner_alias": "sale", "proj_col": "name", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_06387
train
T2
v3
Schema: budgets (alias: budg)(id, value, name, type) customers(level, value, amount, type) Task: Find name from budgets where salary exceeds the average salary from customers for the same code. SQL:
SELECT name FROM budgets AS budg WHERE salary > ( SELECT MIN(salary) FROM customers AS cust WHERE cust.code = budg.code );
{ "outer_table": "budgets", "inner_table": "customers", "outer_alias": "budg", "inner_alias": "cust", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_06388
train
T2
v1
Schema: orders (alias: ord)(level, type, salary, date) invoices(level, salary, amount, type) Task: Select amount from orders where status exists in invoices for the same level. SQL:
SELECT amount 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": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_06389
train
T1
v3
Schema: customers (alias: cust)(date, value, status, level) requests(amount, code, status, type) Task: Find id from customers where amount exceeds the average salary from requests for the same type. SQL:
SELECT id FROM customers AS cust WHERE amount > ( SELECT MIN(salary) FROM requests AS ordr WHERE ordr.type = cust.type );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_06390
train
T1
v3
Schema: employees (alias: emp)(name, salary, level, id) budgets(name, status, level, value) Task: Find id from employees where salary exceeds the average value from budgets for the same code. SQL:
SELECT id FROM employees AS emp WHERE salary > ( SELECT COUNT(value) FROM budgets AS budg WHERE budg.code = emp.code );
{ "outer_table": "employees", "inner_table": "budgets", "outer_alias": "emp", "inner_alias": "budg", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_06391
train
T1
v2
Schema: departments (alias: dept)(id, level, code, amount) requests(value, name, code, amount) Task: Find amount from departments where a matching record exists in requests with the same status. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = dept.status );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "amount", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_06392
train
T1
v3
Schema: schedules (alias: schd)(code, date, value, type) staff(date, value, id, name) Task: Find name from schedules where value exceeds the average salary from staff for the same level. SQL:
SELECT name FROM schedules AS schd WHERE value > ( SELECT AVG(salary) FROM staff AS empl WHERE empl.level = schd.level );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_06393
train
T2
v3
Schema: customers (alias: cust)(level, date, amount, type) transactions(type, status, level, name) Task: Find salary from customers where salary exceeds the average value from transactions for the same level. SQL:
SELECT salary FROM customers AS cust WHERE salary > ( SELECT MAX(value) FROM transactions AS txn WHERE txn.level = cust.level );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_06394
train
T1
v2
Schema: items (alias: lne)(id, type, code, name) departments(id, code, amount, date) Task: Find id from items where a matching record exists in departments with the same status. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = lne.status );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "id", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_06395
train
T2
v2
Schema: transactions (alias: txn)(status, level, code, salary) products(date, level, salary, type) Task: Retrieve value from transactions that have at least one corresponding entry in products sharing the same code. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = txn.code );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "value", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_06396
train
T1
v2
Schema: managers (alias: mgr)(code, salary, level, name) transactions(amount, salary, type, date) Task: Find name from managers where a matching record exists in transactions with the same status. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = mgr.status );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "name", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_06397
train
T1
v3
Schema: regions (alias: rgn)(level, salary, name, id) transactions(code, salary, status, name) Task: Retrieve salary from regions with amount above the AVG(amount) of transactions rows sharing the same id. SQL:
SELECT salary FROM regions AS rgn WHERE amount > ( SELECT AVG(amount) FROM transactions AS txn WHERE txn.id = rgn.id );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_06398
train
T2
v3
Schema: departments (alias: dept)(status, level, code, value) managers(date, level, code, status) Task: Retrieve id from departments with salary above the MAX(amount) of managers rows sharing the same type. SQL:
SELECT id FROM departments AS dept WHERE salary > ( SELECT MAX(amount) FROM managers AS mgr WHERE mgr.type = dept.type );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_06399
train
T1