variant
stringclasses
3 values
prompt
stringlengths
163
237
sql
stringlengths
103
143
metadata
unknown
id
stringlengths
21
21
split
stringclasses
1 value
token_group
stringclasses
2 values
v3
Schema: items (alias: lne)(status, salary, name, value) shipments(status, date, id, code) Task: Retrieve amount from items with amount above the MAX(value) of shipments rows sharing the same id. SQL:
SELECT amount FROM items AS lne WHERE amount > ( SELECT MAX(value) FROM shipments AS shp WHERE shp.id = lne.id );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_04300
train
T2
v3
Schema: customers (alias: cust)(level, code, id, name) accounts(id, status, level, code) Task: Find amount from customers where amount exceeds the average value from accounts for the same type. SQL:
SELECT amount FROM customers AS cust WHERE amount > ( SELECT MAX(value) FROM accounts AS acct WHERE acct.type = cust.type );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_04301
train
T1
v2
Schema: sales (alias: sale)(date, id, status, level) managers(salary, amount, name, status) Task: Retrieve amount from sales that have at least one corresponding entry in managers sharing the same level. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = sale.level );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "amount", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_04302
train
T1
v2
Schema: categories (alias: catg)(salary, status, date, level) products(name, salary, date, code) Task: Find amount from categories where a matching record exists in products with the same id. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = catg.id );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "amount", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_04303
train
T2
v2
Schema: customers (alias: cust)(value, name, salary, type) items(value, name, amount, level) Task: Find code from customers where a matching record exists in items with the same level. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.level = cust.level );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "code", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_04304
train
T1
v3
Schema: sales (alias: sale)(id, amount, level, status) staff(amount, level, type, status) Task: Retrieve name from sales with amount above the MIN(amount) of staff rows sharing the same type. SQL:
SELECT name FROM sales AS sale WHERE amount > ( SELECT MIN(amount) FROM staff AS empl WHERE empl.type = sale.type );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_04305
train
T1
v1
Schema: requests (alias: ordr)(level, amount, value, name) managers(value, salary, id, code) Task: Find id from requests where code appears in managers entries with matching code. SQL:
SELECT id FROM requests AS ordr WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.code = ordr.code );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_04306
train
T2
v3
Schema: shipments (alias: shp)(amount, id, name, date) customers(value, code, name, id) Task: Find id from shipments where amount exceeds the average salary from customers for the same type. SQL:
SELECT id FROM shipments AS shp WHERE amount > ( SELECT COUNT(salary) FROM customers AS cust WHERE cust.type = shp.type );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_04307
train
T2
v1
Schema: regions (alias: rgn)(type, level, id, code) categories(amount, value, type, status) Task: Select name from regions where id exists in categories for the same code. SQL:
SELECT name FROM regions AS rgn WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.code = rgn.code );
{ "outer_table": "regions", "inner_table": "categories", "outer_alias": "rgn", "inner_alias": "catg", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_04308
train
T2
v2
Schema: customers (alias: cust)(name, date, code, amount) departments(level, name, code, value) Task: Retrieve amount from customers that have at least one corresponding entry in departments sharing the same level. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = cust.level );
{ "outer_table": "customers", "inner_table": "departments", "outer_alias": "cust", "inner_alias": "dept", "proj_col": "amount", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_04309
train
T1
v3
Schema: items (alias: lne)(amount, date, name, value) regions(id, salary, code, type) Task: Retrieve name from items with value above the SUM(amount) of regions rows sharing the same type. SQL:
SELECT name FROM items AS lne WHERE value > ( SELECT SUM(amount) FROM regions AS rgn WHERE rgn.type = lne.type );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_04310
train
T2
v2
Schema: employees (alias: emp)(id, value, level, salary) sales(name, amount, date, code) Task: Retrieve name from employees that have at least one corresponding entry in sales sharing the same id. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = emp.id );
{ "outer_table": "employees", "inner_table": "sales", "outer_alias": "emp", "inner_alias": "sale", "proj_col": "name", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_04311
train
T1
v3
Schema: categories (alias: catg)(level, amount, status, salary) schedules(id, name, amount, salary) Task: Retrieve value from categories with amount above the AVG(amount) of schedules rows sharing the same level. SQL:
SELECT value FROM categories AS catg WHERE amount > ( SELECT AVG(amount) FROM schedules AS schd WHERE schd.level = catg.level );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_04312
train
T2
v3
Schema: categories (alias: catg)(value, level, date, type) managers(type, status, salary, value) Task: Find code from categories where amount exceeds the average value from managers for the same level. SQL:
SELECT code FROM categories AS catg WHERE amount > ( SELECT SUM(value) FROM managers AS mgr WHERE mgr.level = catg.level );
{ "outer_table": "categories", "inner_table": "managers", "outer_alias": "catg", "inner_alias": "mgr", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_04313
train
T2
v1
Schema: sales (alias: sale)(id, status, salary, code) requests(amount, value, date, type) Task: Retrieve value from sales whose type is found in requests rows where code matches the outer record. SQL:
SELECT value FROM sales AS sale WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.code = sale.code );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_04314
train
T1
v2
Schema: items (alias: lne)(salary, level, amount, status) invoices(date, id, value, name) Task: Retrieve amount from items that have at least one corresponding entry in invoices sharing the same status. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = lne.status );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "amount", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_04315
train
T2
v2
Schema: staff (alias: empl)(id, salary, type, value) invoices(type, name, status, salary) Task: Find code from staff where a matching record exists in invoices with the same code. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = empl.code );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "code", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_04316
train
T2
v2
Schema: warehouses (alias: whs)(code, level, status, type) departments(level, value, name, status) Task: Find code from warehouses where a matching record exists in departments with the same status. SQL:
SELECT code FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "departments", "outer_alias": "whs", "inner_alias": "dept", "proj_col": "code", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_04317
train
T2
v2
Schema: managers (alias: mgr)(status, amount, level, code) customers(amount, id, code, type) Task: Find amount from managers where a matching record exists in customers with the same type. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = mgr.type );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "amount", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_04318
train
T1
v2
Schema: managers (alias: mgr)(status, value, level, amount) invoices(value, code, id, date) Task: Find amount from managers where a matching record exists in invoices with the same type. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = mgr.type );
{ "outer_table": "managers", "inner_table": "invoices", "outer_alias": "mgr", "inner_alias": "inv", "proj_col": "amount", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_04319
train
T1
v3
Schema: products (alias: prod)(salary, id, code, date) invoices(date, level, code, value) Task: Retrieve salary from products with salary above the AVG(salary) of invoices rows sharing the same status. SQL:
SELECT salary FROM products AS prod WHERE salary > ( SELECT AVG(salary) FROM invoices AS inv WHERE inv.status = prod.status );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_04320
train
T1
v1
Schema: employees (alias: emp)(amount, code, salary, name) categories(amount, type, id, value) Task: Retrieve code from employees whose level is found in categories rows where level matches the outer record. SQL:
SELECT code FROM employees AS emp WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.level = emp.level );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "code", "filter_col": "level", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_04321
train
T1
v3
Schema: warehouses (alias: whs)(name, status, type, amount) schedules(type, salary, level, name) Task: Retrieve id from warehouses with salary above the SUM(value) of schedules rows sharing the same id. SQL:
SELECT id FROM warehouses AS whs WHERE salary > ( SELECT SUM(value) FROM schedules AS schd WHERE schd.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "schedules", "outer_alias": "whs", "inner_alias": "schd", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_04322
train
T2
v1
Schema: customers (alias: cust)(value, type, amount, name) services(salary, name, type, code) Task: Retrieve amount from customers whose level is found in services rows where type matches the outer record. SQL:
SELECT amount FROM customers AS cust WHERE level IN ( SELECT level FROM services AS srvc WHERE srvc.type = cust.type );
{ "outer_table": "customers", "inner_table": "services", "outer_alias": "cust", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "level", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_04323
train
T1
v2
Schema: categories (alias: catg)(id, value, type, date) transactions(level, amount, name, value) Task: Retrieve code from categories that have at least one corresponding entry in transactions sharing the same code. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = catg.code );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "code", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_04324
train
T2
v2
Schema: budgets (alias: budg)(status, level, date, type) invoices(name, amount, salary, status) Task: Retrieve value from budgets that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT value FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = budg.id );
{ "outer_table": "budgets", "inner_table": "invoices", "outer_alias": "budg", "inner_alias": "inv", "proj_col": "value", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_04325
train
T2
v2
Schema: departments (alias: dept)(status, salary, date, value) services(code, type, date, amount) Task: Retrieve id from departments that have at least one corresponding entry in services sharing the same code. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.code = dept.code );
{ "outer_table": "departments", "inner_table": "services", "outer_alias": "dept", "inner_alias": "srvc", "proj_col": "id", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_04326
train
T1
v1
Schema: departments (alias: dept)(level, type, amount, salary) schedules(date, type, salary, id) Task: Retrieve value from departments whose level is found in schedules rows where type matches the outer record. SQL:
SELECT value FROM departments AS dept WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.type = dept.type );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_04327
train
T1
v3
Schema: warehouses (alias: whs)(level, date, name, type) transactions(level, status, code, salary) Task: Retrieve value from warehouses with value above the MAX(value) of transactions rows sharing the same code. SQL:
SELECT value FROM warehouses AS whs WHERE value > ( SELECT MAX(value) FROM transactions AS txn WHERE txn.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "transactions", "outer_alias": "whs", "inner_alias": "txn", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_04328
train
T2
v1
Schema: staff (alias: empl)(code, id, date, name) services(type, salary, date, name) Task: Select name from staff where type exists in services for the same type. SQL:
SELECT name FROM staff AS empl WHERE type IN ( SELECT type FROM services AS srvc WHERE srvc.type = empl.type );
{ "outer_table": "staff", "inner_table": "services", "outer_alias": "empl", "inner_alias": "srvc", "proj_col": "name", "filter_col": "type", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_04329
train
T2
v1
Schema: managers (alias: mgr)(value, level, id, date) accounts(value, id, type, code) Task: Find code from managers where code appears in accounts entries with matching code. SQL:
SELECT code FROM managers AS mgr WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.code = mgr.code );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_04330
train
T1
v1
Schema: items (alias: lne)(value, status, amount, id) sales(level, status, salary, amount) Task: Find amount from items where level appears in sales entries with matching status. SQL:
SELECT amount FROM items AS lne WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.status = lne.status );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_04331
train
T2
v1
Schema: categories (alias: catg)(salary, amount, value, name) transactions(status, value, name, id) Task: Find value from categories where status appears in transactions entries with matching status. SQL:
SELECT value FROM categories AS catg WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.status = catg.status );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_04332
train
T2
v1
Schema: categories (alias: catg)(value, code, date, level) requests(level, status, value, amount) Task: Select amount from categories where type exists in requests for the same type. SQL:
SELECT amount FROM categories AS catg WHERE type IN ( SELECT type FROM requests AS ordr WHERE ordr.type = catg.type );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_04333
train
T2
v2
Schema: warehouses (alias: whs)(value, type, date, status) services(code, status, type, id) Task: Find value from warehouses where a matching record exists in services with the same level. SQL:
SELECT value FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "services", "outer_alias": "whs", "inner_alias": "srvc", "proj_col": "value", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_04334
train
T2
v3
Schema: departments (alias: dept)(name, value, id, level) transactions(type, id, status, salary) Task: Find code from departments where amount exceeds the average value from transactions for the same id. SQL:
SELECT code FROM departments AS dept WHERE amount > ( SELECT SUM(value) FROM transactions AS txn WHERE txn.id = dept.id );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_04335
train
T1
v3
Schema: categories (alias: catg)(date, amount, name, code) departments(status, name, value, date) Task: Find name from categories where amount exceeds the average amount from departments for the same level. SQL:
SELECT name FROM categories AS catg WHERE amount > ( SELECT AVG(amount) FROM departments AS dept WHERE dept.level = catg.level );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_04336
train
T2
v3
Schema: products (alias: prod)(status, value, level, id) orders(status, value, salary, name) Task: Retrieve amount from products with salary above the MIN(amount) of orders rows sharing the same id. SQL:
SELECT amount FROM products AS prod WHERE salary > ( SELECT MIN(amount) FROM orders AS ord WHERE ord.id = prod.id );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_04337
train
T1
v1
Schema: customers (alias: cust)(date, name, id, code) shipments(date, id, code, amount) Task: Find code from customers where status appears in shipments entries with matching status. SQL:
SELECT code FROM customers AS cust WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.status = cust.status );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "code", "filter_col": "status", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_04338
train
T1
v1
Schema: staff (alias: empl)(id, code, salary, amount) items(type, name, amount, date) Task: Find amount from staff where type appears in items entries with matching id. SQL:
SELECT amount FROM staff AS empl WHERE type IN ( SELECT type FROM items AS lne WHERE lne.id = empl.id );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_04339
train
T2
v2
Schema: invoices (alias: inv)(type, name, salary, amount) managers(salary, status, id, code) Task: Retrieve value from invoices that have at least one corresponding entry in managers sharing the same type. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = inv.type );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "value", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_04340
train
T1
v1
Schema: budgets (alias: budg)(level, date, id, value) invoices(code, id, status, type) Task: Select name from budgets where code exists in invoices for the same type. SQL:
SELECT name FROM budgets AS budg WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.type = budg.type );
{ "outer_table": "budgets", "inner_table": "invoices", "outer_alias": "budg", "inner_alias": "inv", "proj_col": "name", "filter_col": "code", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_04341
train
T2
v2
Schema: warehouses (alias: whs)(status, date, code, salary) categories(amount, id, code, date) Task: Retrieve code from warehouses that have at least one corresponding entry in categories sharing the same status. SQL:
SELECT code FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "categories", "outer_alias": "whs", "inner_alias": "catg", "proj_col": "code", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_04342
train
T2
v3
Schema: services (alias: srvc)(level, status, date, code) requests(code, value, amount, name) Task: Find value from services where value exceeds the average value from requests for the same id. SQL:
SELECT value FROM services AS srvc WHERE value > ( SELECT COUNT(value) FROM requests AS ordr WHERE ordr.id = srvc.id );
{ "outer_table": "services", "inner_table": "requests", "outer_alias": "srvc", "inner_alias": "ordr", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_04343
train
T2
v2
Schema: employees (alias: emp)(level, code, salary, id) services(date, salary, amount, status) Task: Find id from employees where a matching record exists in services with the same type. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.type = emp.type );
{ "outer_table": "employees", "inner_table": "services", "outer_alias": "emp", "inner_alias": "srvc", "proj_col": "id", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_04344
train
T1
v3
Schema: invoices (alias: inv)(id, type, status, value) categories(salary, type, id, value) Task: Find value from invoices where value exceeds the average amount from categories for the same id. SQL:
SELECT value FROM invoices AS inv WHERE value > ( SELECT MAX(amount) FROM categories AS catg WHERE catg.id = inv.id );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_04345
train
T1
v2
Schema: orders (alias: ord)(date, value, code, level) staff(date, type, code, value) Task: Find code from orders where a matching record exists in staff with the same level. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = ord.level );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "code", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_04346
train
T1
v3
Schema: transactions (alias: txn)(level, type, salary, id) items(value, id, level, status) Task: Find value from transactions where amount exceeds the average amount from items for the same id. SQL:
SELECT value FROM transactions AS txn WHERE amount > ( SELECT AVG(amount) FROM items AS lne WHERE lne.id = txn.id );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_04347
train
T1
v3
Schema: categories (alias: catg)(level, type, name, salary) accounts(value, name, date, status) Task: Retrieve value from categories with value above the SUM(salary) of accounts rows sharing the same code. SQL:
SELECT value FROM categories AS catg WHERE value > ( SELECT SUM(salary) FROM accounts AS acct WHERE acct.code = catg.code );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_04348
train
T2
v2
Schema: regions (alias: rgn)(amount, type, value, name) transactions(type, id, level, code) Task: Retrieve amount from regions that have at least one corresponding entry in transactions sharing the same status. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = rgn.status );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "amount", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_04349
train
T2
v2
Schema: transactions (alias: txn)(code, date, value, name) shipments(level, type, code, date) Task: Retrieve name from transactions that have at least one corresponding entry in shipments sharing the same code. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = txn.code );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "name", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_04350
train
T1
v1
Schema: customers (alias: cust)(type, level, name, amount) invoices(code, value, name, id) Task: Retrieve salary from customers whose status is found in invoices rows where code matches the outer record. SQL:
SELECT salary FROM customers AS cust WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.code = cust.code );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_04351
train
T1
v3
Schema: categories (alias: catg)(salary, name, amount, date) customers(date, code, name, id) Task: Find value from categories where amount exceeds the average amount from customers for the same status. SQL:
SELECT value FROM categories AS catg WHERE amount > ( SELECT AVG(amount) FROM customers AS cust WHERE cust.status = catg.status );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_04352
train
T2
v1
Schema: products (alias: prod)(level, salary, type, id) budgets(id, name, date, level) Task: Find name from products where id appears in budgets entries with matching id. SQL:
SELECT name FROM products AS prod WHERE id IN ( SELECT id FROM budgets AS budg WHERE budg.id = prod.id );
{ "outer_table": "products", "inner_table": "budgets", "outer_alias": "prod", "inner_alias": "budg", "proj_col": "name", "filter_col": "id", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_04353
train
T1
v3
Schema: accounts (alias: acct)(status, code, id, name) orders(id, name, amount, date) Task: Retrieve salary from accounts with value above the MIN(salary) of orders rows sharing the same id. SQL:
SELECT salary FROM accounts AS acct WHERE value > ( SELECT MIN(salary) FROM orders AS ord WHERE ord.id = acct.id );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_04354
train
T1
v3
Schema: services (alias: srvc)(type, value, date, amount) transactions(value, id, type, code) Task: Retrieve id from services with amount above the MIN(salary) of transactions rows sharing the same level. SQL:
SELECT id FROM services AS srvc WHERE amount > ( SELECT MIN(salary) FROM transactions AS txn WHERE txn.level = srvc.level );
{ "outer_table": "services", "inner_table": "transactions", "outer_alias": "srvc", "inner_alias": "txn", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_04355
train
T2
v3
Schema: items (alias: lne)(level, date, amount, salary) staff(value, salary, type, status) Task: Find id from items where amount exceeds the average value from staff for the same level. SQL:
SELECT id FROM items AS lne WHERE amount > ( SELECT SUM(value) FROM staff AS empl WHERE empl.level = lne.level );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_04356
train
T2
v3
Schema: items (alias: lne)(code, type, status, amount) products(id, name, code, amount) Task: Retrieve value from items with value above the SUM(amount) of products rows sharing the same code. SQL:
SELECT value FROM items AS lne WHERE value > ( SELECT SUM(amount) FROM products AS prod WHERE prod.code = lne.code );
{ "outer_table": "items", "inner_table": "products", "outer_alias": "lne", "inner_alias": "prod", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_04357
train
T2
v3
Schema: invoices (alias: inv)(type, id, name, date) schedules(amount, level, status, date) Task: Retrieve name from invoices with value above the MIN(salary) of schedules rows sharing the same level. SQL:
SELECT name FROM invoices AS inv WHERE value > ( SELECT MIN(salary) FROM schedules AS schd WHERE schd.level = inv.level );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_04358
train
T1
v1
Schema: categories (alias: catg)(value, name, date, salary) schedules(status, id, value, code) Task: Retrieve id from categories whose id is found in schedules rows where id matches the outer record. SQL:
SELECT id FROM categories AS catg WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.id = catg.id );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_04359
train
T2
v1
Schema: requests (alias: ordr)(salary, type, status, code) accounts(level, type, status, code) Task: Retrieve value from requests whose id is found in accounts rows where type matches the outer record. SQL:
SELECT value FROM requests AS ordr WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.type = ordr.type );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_04360
train
T2
v2
Schema: requests (alias: ordr)(value, salary, code, level) schedules(name, code, level, salary) Task: Retrieve value from requests that have at least one corresponding entry in schedules sharing the same level. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = ordr.level );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "value", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_04361
train
T2
v3
Schema: requests (alias: ordr)(name, value, salary, date) employees(code, status, date, salary) Task: Retrieve id from requests with amount above the COUNT(value) of employees rows sharing the same type. SQL:
SELECT id FROM requests AS ordr WHERE amount > ( SELECT COUNT(value) FROM employees AS emp WHERE emp.type = ordr.type );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_04362
train
T2
v3
Schema: services (alias: srvc)(id, value, level, date) transactions(level, date, id, amount) Task: Find value from services where value exceeds the average salary from transactions for the same id. SQL:
SELECT value FROM services AS srvc WHERE value > ( SELECT COUNT(salary) FROM transactions AS txn WHERE txn.id = srvc.id );
{ "outer_table": "services", "inner_table": "transactions", "outer_alias": "srvc", "inner_alias": "txn", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_04363
train
T2
v1
Schema: shipments (alias: shp)(code, value, name, level) sales(type, value, status, code) Task: Retrieve value from shipments whose type is found in sales rows where status matches the outer record. SQL:
SELECT value FROM shipments AS shp WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.status = shp.status );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_04364
train
T2
v1
Schema: products (alias: prod)(id, name, code, type) budgets(code, value, amount, level) Task: Select salary from products where type exists in budgets for the same type. SQL:
SELECT salary FROM products AS prod WHERE type IN ( SELECT type FROM budgets AS budg WHERE budg.type = prod.type );
{ "outer_table": "products", "inner_table": "budgets", "outer_alias": "prod", "inner_alias": "budg", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_04365
train
T1
v2
Schema: services (alias: srvc)(date, status, value, type) budgets(id, name, date, type) Task: Find salary from services where a matching record exists in budgets with the same type. SQL:
SELECT salary FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.type = srvc.type );
{ "outer_table": "services", "inner_table": "budgets", "outer_alias": "srvc", "inner_alias": "budg", "proj_col": "salary", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_04366
train
T2
v2
Schema: products (alias: prod)(type, date, code, name) staff(id, date, code, salary) Task: Retrieve id from products that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = prod.status );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "id", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_04367
train
T1
v2
Schema: shipments (alias: shp)(salary, code, value, name) services(status, id, amount, date) Task: Retrieve name from shipments that have at least one corresponding entry in services sharing the same level. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.level = shp.level );
{ "outer_table": "shipments", "inner_table": "services", "outer_alias": "shp", "inner_alias": "srvc", "proj_col": "name", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_04368
train
T2
v3
Schema: budgets (alias: budg)(amount, salary, code, type) staff(level, code, salary, amount) Task: Retrieve salary from budgets with amount above the SUM(amount) of staff rows sharing the same type. SQL:
SELECT salary FROM budgets AS budg WHERE amount > ( SELECT SUM(amount) FROM staff AS empl WHERE empl.type = budg.type );
{ "outer_table": "budgets", "inner_table": "staff", "outer_alias": "budg", "inner_alias": "empl", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_04369
train
T2
v1
Schema: requests (alias: ordr)(status, code, type, id) transactions(date, salary, code, value) Task: Retrieve salary from requests whose code is found in transactions rows where code matches the outer record. SQL:
SELECT salary FROM requests AS ordr WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.code = ordr.code );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_04370
train
T2
v2
Schema: orders (alias: ord)(name, level, salary, value) categories(code, status, type, date) Task: Find id from orders where a matching record exists in categories with the same level. SQL:
SELECT id FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = ord.level );
{ "outer_table": "orders", "inner_table": "categories", "outer_alias": "ord", "inner_alias": "catg", "proj_col": "id", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_04371
train
T1
v2
Schema: invoices (alias: inv)(type, value, date, id) regions(name, salary, date, status) Task: Retrieve salary from invoices that have at least one corresponding entry in regions sharing the same status. SQL:
SELECT salary FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = inv.status );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "salary", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_04372
train
T1
v1
Schema: warehouses (alias: whs)(name, id, level, salary) shipments(code, amount, id, level) Task: Retrieve value from warehouses whose code is found in shipments rows where status matches the outer record. SQL:
SELECT value FROM warehouses AS whs WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "shipments", "outer_alias": "whs", "inner_alias": "shp", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_04373
train
T2
v2
Schema: orders (alias: ord)(type, date, code, value) requests(name, status, amount, salary) Task: Retrieve code from orders that have at least one corresponding entry in requests sharing the same code. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = ord.code );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "code", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_04374
train
T1
v3
Schema: transactions (alias: txn)(code, salary, type, status) shipments(salary, name, id, date) Task: Retrieve id from transactions with amount above the AVG(amount) of shipments rows sharing the same type. SQL:
SELECT id FROM transactions AS txn WHERE amount > ( SELECT AVG(amount) FROM shipments AS shp WHERE shp.type = txn.type );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_04375
train
T1
v3
Schema: services (alias: srvc)(date, id, salary, name) departments(date, salary, name, amount) Task: Retrieve amount from services with amount above the MIN(value) of departments rows sharing the same id. SQL:
SELECT amount FROM services AS srvc WHERE amount > ( SELECT MIN(value) FROM departments AS dept WHERE dept.id = srvc.id );
{ "outer_table": "services", "inner_table": "departments", "outer_alias": "srvc", "inner_alias": "dept", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_04376
train
T2
v2
Schema: orders (alias: ord)(amount, salary, value, date) requests(id, value, status, level) Task: Retrieve id from orders that have at least one corresponding entry in requests sharing the same code. SQL:
SELECT id FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = ord.code );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "id", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_04377
train
T1
v1
Schema: customers (alias: cust)(salary, status, name, code) requests(status, name, value, code) Task: Select amount from customers where level exists in requests for the same id. SQL:
SELECT amount FROM customers AS cust WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.id = cust.id );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_04378
train
T1
v3
Schema: regions (alias: rgn)(value, salary, amount, type) transactions(code, status, salary, type) Task: Find value from regions where value exceeds the average value from transactions for the same level. SQL:
SELECT value FROM regions AS rgn WHERE value > ( SELECT MIN(value) FROM transactions AS txn WHERE txn.level = rgn.level );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_04379
train
T2
v3
Schema: staff (alias: empl)(level, salary, type, name) sales(amount, id, code, name) Task: Retrieve code from staff with value above the MAX(salary) of sales rows sharing the same code. SQL:
SELECT code FROM staff AS empl WHERE value > ( SELECT MAX(salary) FROM sales AS sale WHERE sale.code = empl.code );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_04380
train
T2
v3
Schema: services (alias: srvc)(level, date, code, type) employees(name, id, type, amount) Task: Find code from services where value exceeds the average value from employees for the same status. SQL:
SELECT code FROM services AS srvc WHERE value > ( SELECT COUNT(value) FROM employees AS emp WHERE emp.status = srvc.status );
{ "outer_table": "services", "inner_table": "employees", "outer_alias": "srvc", "inner_alias": "emp", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_04381
train
T2
v1
Schema: departments (alias: dept)(status, name, id, type) regions(status, name, amount, code) Task: Find salary from departments where id appears in regions entries with matching code. SQL:
SELECT salary FROM departments AS dept WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.code = dept.code );
{ "outer_table": "departments", "inner_table": "regions", "outer_alias": "dept", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_04382
train
T1
v2
Schema: customers (alias: cust)(value, date, code, id) orders(value, salary, date, amount) Task: Find id from customers where a matching record exists in orders with the same level. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = cust.level );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "id", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_04383
train
T1
v3
Schema: schedules (alias: schd)(value, status, code, name) budgets(value, level, salary, amount) Task: Find value from schedules where amount exceeds the average value from budgets for the same code. SQL:
SELECT value FROM schedules AS schd WHERE amount > ( SELECT SUM(value) FROM budgets AS budg WHERE budg.code = schd.code );
{ "outer_table": "schedules", "inner_table": "budgets", "outer_alias": "schd", "inner_alias": "budg", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_04384
train
T2
v1
Schema: warehouses (alias: whs)(value, amount, name, id) regions(status, type, level, salary) Task: Find id from warehouses where code appears in regions entries with matching level. SQL:
SELECT id FROM warehouses AS whs WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "regions", "outer_alias": "whs", "inner_alias": "rgn", "proj_col": "id", "filter_col": "code", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_04385
train
T2
v2
Schema: transactions (alias: txn)(level, code, value, id) schedules(amount, name, type, status) Task: Retrieve value from transactions that have at least one corresponding entry in schedules sharing the same id. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = txn.id );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "value", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_04386
train
T1
v3
Schema: employees (alias: emp)(name, type, id, code) shipments(name, amount, salary, value) Task: Find name from employees where salary exceeds the average amount from shipments for the same status. SQL:
SELECT name FROM employees AS emp WHERE salary > ( SELECT SUM(amount) FROM shipments AS shp WHERE shp.status = emp.status );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_04387
train
T1
v2
Schema: invoices (alias: inv)(date, status, code, salary) departments(date, id, salary, amount) Task: Retrieve value from invoices that have at least one corresponding entry in departments sharing the same type. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = inv.type );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "value", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_04388
train
T1
v2
Schema: employees (alias: emp)(level, type, code, salary) transactions(code, date, id, amount) Task: Retrieve code from employees that have at least one corresponding entry in transactions sharing the same code. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = emp.code );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "code", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_04389
train
T1
v1
Schema: customers (alias: cust)(type, status, id, name) managers(date, code, value, amount) Task: Select salary from customers where id exists in managers for the same status. SQL:
SELECT salary FROM customers AS cust WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.status = cust.status );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_04390
train
T1
v3
Schema: items (alias: lne)(name, type, salary, date) shipments(date, id, status, level) Task: Retrieve salary from items with value above the MIN(value) of shipments rows sharing the same status. SQL:
SELECT salary FROM items AS lne WHERE value > ( SELECT MIN(value) FROM shipments AS shp WHERE shp.status = lne.status );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_04391
train
T2
v2
Schema: managers (alias: mgr)(status, salary, name, date) warehouses(date, id, name, salary) Task: Retrieve amount from managers that have at least one corresponding entry in warehouses sharing the same status. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.status = mgr.status );
{ "outer_table": "managers", "inner_table": "warehouses", "outer_alias": "mgr", "inner_alias": "whs", "proj_col": "amount", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_04392
train
T1
v3
Schema: products (alias: prod)(value, date, type, id) managers(value, status, name, code) Task: Find salary from products where salary exceeds the average value from managers for the same code. SQL:
SELECT salary FROM products AS prod WHERE salary > ( SELECT MAX(value) FROM managers AS mgr WHERE mgr.code = prod.code );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_04393
train
T1
v3
Schema: transactions (alias: txn)(id, code, name, value) budgets(status, value, level, date) Task: Find salary from transactions where amount exceeds the average amount from budgets for the same code. SQL:
SELECT salary FROM transactions AS txn WHERE amount > ( SELECT AVG(amount) FROM budgets AS budg WHERE budg.code = txn.code );
{ "outer_table": "transactions", "inner_table": "budgets", "outer_alias": "txn", "inner_alias": "budg", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_04394
train
T1
v2
Schema: warehouses (alias: whs)(value, code, date, status) orders(value, status, level, id) Task: Retrieve code from warehouses that have at least one corresponding entry in orders sharing the same status. SQL:
SELECT code FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "orders", "outer_alias": "whs", "inner_alias": "ord", "proj_col": "code", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_04395
train
T2
v3
Schema: items (alias: lne)(status, id, date, value) managers(level, name, status, id) Task: Find amount from items where salary exceeds the average salary from managers for the same code. SQL:
SELECT amount FROM items AS lne WHERE salary > ( SELECT MAX(salary) FROM managers AS mgr WHERE mgr.code = lne.code );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_04396
train
T2
v2
Schema: budgets (alias: budg)(type, id, level, code) warehouses(status, level, type, name) Task: Find name from budgets where a matching record exists in warehouses with the same status. SQL:
SELECT name FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.status = budg.status );
{ "outer_table": "budgets", "inner_table": "warehouses", "outer_alias": "budg", "inner_alias": "whs", "proj_col": "name", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_04397
train
T2
v1
Schema: warehouses (alias: whs)(amount, value, code, date) shipments(value, salary, id, amount) Task: Find amount from warehouses where code appears in shipments entries with matching id. SQL:
SELECT amount FROM warehouses AS whs WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "shipments", "outer_alias": "whs", "inner_alias": "shp", "proj_col": "amount", "filter_col": "code", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_04398
train
T2
v1
Schema: transactions (alias: txn)(status, date, salary, value) categories(amount, salary, value, status) Task: Retrieve amount from transactions whose level is found in categories rows where id matches the outer record. SQL:
SELECT amount FROM transactions AS txn WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.id = txn.id );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_04399
train
T1