variant
stringclasses
3 values
prompt
stringlengths
163
237
sql
stringlengths
103
143
metadata
unknown
id
stringlengths
21
21
split
stringclasses
1 value
token_group
stringclasses
2 values
v2
Schema: employees (alias: emp)(amount, level, type, date) categories(status, value, id, type) Task: Find amount from employees where a matching record exists in categories with the same type. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = emp.type );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "amount", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_03300
train
T1
v1
Schema: staff (alias: empl)(id, date, amount, code) orders(name, amount, status, level) Task: Find value from staff where status appears in orders entries with matching type. SQL:
SELECT value FROM staff AS empl WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.type = empl.type );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "value", "filter_col": "status", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_03301
train
T2
v1
Schema: regions (alias: rgn)(level, name, salary, type) services(name, level, type, amount) Task: Select value from regions where code exists in services for the same code. SQL:
SELECT value FROM regions AS rgn WHERE code IN ( SELECT code FROM services AS srvc WHERE srvc.code = rgn.code );
{ "outer_table": "regions", "inner_table": "services", "outer_alias": "rgn", "inner_alias": "srvc", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_03302
train
T2
v3
Schema: products (alias: prod)(status, code, value, date) sales(name, level, date, id) Task: Find value from products where salary exceeds the average amount from sales for the same id. SQL:
SELECT value FROM products AS prod WHERE salary > ( SELECT MIN(amount) FROM sales AS sale WHERE sale.id = prod.id );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_03303
train
T1
v3
Schema: staff (alias: empl)(level, salary, id, name) managers(id, amount, name, code) Task: Find salary from staff where amount exceeds the average salary from managers for the same status. SQL:
SELECT salary FROM staff AS empl WHERE amount > ( SELECT SUM(salary) FROM managers AS mgr WHERE mgr.status = empl.status );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_03304
train
T2
v1
Schema: budgets (alias: budg)(status, type, amount, id) services(name, salary, code, id) Task: Find name from budgets where level appears in services entries with matching type. SQL:
SELECT name FROM budgets AS budg WHERE level IN ( SELECT level FROM services AS srvc WHERE srvc.type = budg.type );
{ "outer_table": "budgets", "inner_table": "services", "outer_alias": "budg", "inner_alias": "srvc", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_03305
train
T2
v1
Schema: departments (alias: dept)(date, amount, type, id) orders(status, amount, code, salary) Task: Find code from departments where status appears in orders entries with matching id. SQL:
SELECT code FROM departments AS dept WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.id = dept.id );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_03306
train
T1
v3
Schema: sales (alias: sale)(salary, date, name, type) requests(value, date, code, type) Task: Find code from sales where salary exceeds the average value from requests for the same status. SQL:
SELECT code FROM sales AS sale WHERE salary > ( SELECT COUNT(value) FROM requests AS ordr WHERE ordr.status = sale.status );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_03307
train
T1
v2
Schema: items (alias: lne)(status, type, amount, value) departments(amount, status, salary, type) Task: Find amount from items where a matching record exists in departments with the same id. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = lne.id );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "amount", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_03308
train
T2
v2
Schema: employees (alias: emp)(value, name, date, id) warehouses(id, amount, date, type) Task: Find name from employees where a matching record exists in warehouses with the same status. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.status = emp.status );
{ "outer_table": "employees", "inner_table": "warehouses", "outer_alias": "emp", "inner_alias": "whs", "proj_col": "name", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_03309
train
T1
v2
Schema: employees (alias: emp)(date, value, id, amount) orders(id, type, value, date) Task: Find code from employees where a matching record exists in orders with the same type. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = emp.type );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "code", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_03310
train
T1
v1
Schema: employees (alias: emp)(name, amount, date, code) sales(date, type, code, level) Task: Find id from employees where status appears in sales entries with matching status. SQL:
SELECT id FROM employees AS emp WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.status = emp.status );
{ "outer_table": "employees", "inner_table": "sales", "outer_alias": "emp", "inner_alias": "sale", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_03311
train
T1
v1
Schema: categories (alias: catg)(salary, amount, level, date) employees(value, date, salary, level) Task: Retrieve value from categories whose status is found in employees rows where id matches the outer record. SQL:
SELECT value FROM categories AS catg WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.id = catg.id );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_03312
train
T2
v1
Schema: managers (alias: mgr)(salary, level, value, date) staff(name, code, amount, salary) Task: Find amount from managers where code appears in staff entries with matching id. SQL:
SELECT amount FROM managers AS mgr WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.id = mgr.id );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "amount", "filter_col": "code", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_03313
train
T1
v3
Schema: budgets (alias: budg)(value, type, status, amount) services(type, value, name, level) Task: Retrieve salary from budgets with amount above the MIN(value) of services rows sharing the same status. SQL:
SELECT salary FROM budgets AS budg WHERE amount > ( SELECT MIN(value) FROM services AS srvc WHERE srvc.status = budg.status );
{ "outer_table": "budgets", "inner_table": "services", "outer_alias": "budg", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_03314
train
T2
v2
Schema: categories (alias: catg)(name, id, value, salary) items(date, level, salary, status) Task: Find id from categories where a matching record exists in items with the same id. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.id = catg.id );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "id", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_03315
train
T2
v3
Schema: regions (alias: rgn)(status, salary, type, code) categories(level, date, salary, name) Task: Retrieve salary from regions with amount above the MAX(salary) of categories rows sharing the same code. SQL:
SELECT salary FROM regions AS rgn WHERE amount > ( SELECT MAX(salary) FROM categories AS catg WHERE catg.code = rgn.code );
{ "outer_table": "regions", "inner_table": "categories", "outer_alias": "rgn", "inner_alias": "catg", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_03316
train
T2
v1
Schema: invoices (alias: inv)(name, value, amount, level) accounts(type, salary, status, date) Task: Select value from invoices where id exists in accounts for the same id. SQL:
SELECT value FROM invoices AS inv WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.id = inv.id );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_03317
train
T1
v3
Schema: sales (alias: sale)(status, salary, name, id) invoices(id, amount, value, status) Task: Retrieve code from sales with amount above the SUM(value) of invoices rows sharing the same code. SQL:
SELECT code FROM sales AS sale WHERE amount > ( SELECT SUM(value) FROM invoices AS inv WHERE inv.code = sale.code );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_03318
train
T1
v2
Schema: requests (alias: ordr)(date, salary, amount, name) employees(status, amount, level, code) Task: Retrieve value from requests that have at least one corresponding entry in employees sharing the same level. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = ordr.level );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "value", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_03319
train
T2
v1
Schema: services (alias: srvc)(id, status, value, code) items(id, value, level, amount) Task: Find id from services where level appears in items entries with matching code. SQL:
SELECT id FROM services AS srvc WHERE level IN ( SELECT level FROM items AS lne WHERE lne.code = srvc.code );
{ "outer_table": "services", "inner_table": "items", "outer_alias": "srvc", "inner_alias": "lne", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_03320
train
T2
v1
Schema: items (alias: lne)(code, level, date, salary) shipments(name, value, id, salary) Task: Select salary from items where level exists in shipments for the same level. SQL:
SELECT salary FROM items AS lne WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.level = lne.level );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "salary", "filter_col": "level", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_03321
train
T2
v2
Schema: products (alias: prod)(salary, date, name, amount) employees(type, value, id, name) Task: Retrieve id from products that have at least one corresponding entry in employees sharing the same id. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = prod.id );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "id", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_03322
train
T1
v3
Schema: invoices (alias: inv)(type, status, value, level) sales(value, amount, level, type) Task: Retrieve name from invoices with value above the AVG(salary) of sales rows sharing the same status. SQL:
SELECT name FROM invoices AS inv WHERE value > ( SELECT AVG(salary) FROM sales AS sale WHERE sale.status = inv.status );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_03323
train
T1
v1
Schema: customers (alias: cust)(name, salary, date, id) requests(type, salary, id, date) Task: Retrieve name from customers whose status is found in requests rows where level matches the outer record. SQL:
SELECT name FROM customers AS cust WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.level = cust.level );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_03324
train
T1
v3
Schema: warehouses (alias: whs)(level, amount, code, name) items(level, id, type, code) Task: Find salary from warehouses where value exceeds the average salary from items for the same status. SQL:
SELECT salary FROM warehouses AS whs WHERE value > ( SELECT COUNT(salary) FROM items AS lne WHERE lne.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "items", "outer_alias": "whs", "inner_alias": "lne", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_03325
train
T2
v1
Schema: budgets (alias: budg)(id, level, value, code) managers(id, name, salary, status) Task: Find id from budgets where type appears in managers entries with matching id. SQL:
SELECT id FROM budgets AS budg WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.id = budg.id );
{ "outer_table": "budgets", "inner_table": "managers", "outer_alias": "budg", "inner_alias": "mgr", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_03326
train
T2
v1
Schema: budgets (alias: budg)(name, code, salary, level) invoices(id, status, name, value) Task: Select code from budgets where status exists in invoices for the same type. SQL:
SELECT code FROM budgets AS budg WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.type = budg.type );
{ "outer_table": "budgets", "inner_table": "invoices", "outer_alias": "budg", "inner_alias": "inv", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_03327
train
T2
v3
Schema: items (alias: lne)(value, salary, level, status) services(value, level, salary, status) Task: Retrieve code from items with amount above the COUNT(value) of services rows sharing the same id. SQL:
SELECT code FROM items AS lne WHERE amount > ( SELECT COUNT(value) FROM services AS srvc WHERE srvc.id = lne.id );
{ "outer_table": "items", "inner_table": "services", "outer_alias": "lne", "inner_alias": "srvc", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_03328
train
T2
v3
Schema: requests (alias: ordr)(amount, status, code, salary) budgets(level, salary, status, type) Task: Find salary from requests where salary exceeds the average value from budgets for the same type. SQL:
SELECT salary FROM requests AS ordr WHERE salary > ( SELECT SUM(value) FROM budgets AS budg WHERE budg.type = ordr.type );
{ "outer_table": "requests", "inner_table": "budgets", "outer_alias": "ordr", "inner_alias": "budg", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_03329
train
T2
v3
Schema: departments (alias: dept)(name, level, id, status) staff(amount, status, type, salary) Task: Find value from departments where salary exceeds the average value from staff for the same type. SQL:
SELECT value FROM departments AS dept WHERE salary > ( SELECT MIN(value) FROM staff AS empl WHERE empl.type = dept.type );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_03330
train
T1
v3
Schema: transactions (alias: txn)(code, level, status, type) accounts(id, amount, level, name) Task: Retrieve code from transactions with amount above the SUM(amount) of accounts rows sharing the same code. SQL:
SELECT code FROM transactions AS txn WHERE amount > ( SELECT SUM(amount) FROM accounts AS acct WHERE acct.code = txn.code );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_03331
train
T1
v3
Schema: customers (alias: cust)(status, name, type, code) regions(code, level, value, salary) Task: Find name from customers where amount exceeds the average amount from regions for the same level. SQL:
SELECT name FROM customers AS cust WHERE amount > ( SELECT AVG(amount) FROM regions AS rgn WHERE rgn.level = cust.level );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_03332
train
T1
v2
Schema: staff (alias: empl)(level, code, status, salary) managers(salary, name, level, type) Task: Retrieve id from staff that have at least one corresponding entry in managers sharing the same level. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = empl.level );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "id", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_03333
train
T2
v3
Schema: departments (alias: dept)(name, status, id, salary) invoices(id, status, name, value) Task: Find value from departments where salary exceeds the average salary from invoices for the same type. SQL:
SELECT value FROM departments AS dept WHERE salary > ( SELECT SUM(salary) FROM invoices AS inv WHERE inv.type = dept.type );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_03334
train
T1
v2
Schema: categories (alias: catg)(value, id, code, salary) regions(salary, code, name, amount) Task: Find name from categories where a matching record exists in regions with the same code. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = catg.code );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "name", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_03335
train
T2
v1
Schema: transactions (alias: txn)(code, name, amount, value) services(level, amount, value, code) Task: Find salary from transactions where id appears in services entries with matching level. SQL:
SELECT salary FROM transactions AS txn WHERE id IN ( SELECT id FROM services AS srvc WHERE srvc.level = txn.level );
{ "outer_table": "transactions", "inner_table": "services", "outer_alias": "txn", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "id", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_03336
train
T1
v1
Schema: sales (alias: sale)(name, amount, code, value) invoices(amount, level, date, status) Task: Retrieve value from sales whose code is found in invoices rows where code matches the outer record. SQL:
SELECT value FROM sales AS sale WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.code = sale.code );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_03337
train
T1
v2
Schema: regions (alias: rgn)(date, level, id, value) sales(amount, date, level, type) Task: Retrieve name from regions that have at least one corresponding entry in sales sharing the same level. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = rgn.level );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "name", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_03338
train
T2
v1
Schema: employees (alias: emp)(value, name, date, id) staff(type, id, date, value) Task: Retrieve name from employees whose id is found in staff rows where level matches the outer record. SQL:
SELECT name FROM employees AS emp WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.level = emp.level );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "name", "filter_col": "id", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_03339
train
T1
v3
Schema: warehouses (alias: whs)(amount, level, value, id) orders(date, id, status, name) Task: Retrieve name from warehouses with value above the AVG(salary) of orders rows sharing the same type. SQL:
SELECT name FROM warehouses AS whs WHERE value > ( SELECT AVG(salary) FROM orders AS ord WHERE ord.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "orders", "outer_alias": "whs", "inner_alias": "ord", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_03340
train
T2
v3
Schema: regions (alias: rgn)(level, date, amount, name) warehouses(id, date, value, type) Task: Retrieve value from regions with value above the COUNT(salary) of warehouses rows sharing the same code. SQL:
SELECT value FROM regions AS rgn WHERE value > ( SELECT COUNT(salary) FROM warehouses AS whs WHERE whs.code = rgn.code );
{ "outer_table": "regions", "inner_table": "warehouses", "outer_alias": "rgn", "inner_alias": "whs", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_03341
train
T2
v2
Schema: budgets (alias: budg)(code, date, level, name) sales(date, value, status, amount) Task: Retrieve code from budgets that have at least one corresponding entry in sales sharing the same type. SQL:
SELECT code FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = budg.type );
{ "outer_table": "budgets", "inner_table": "sales", "outer_alias": "budg", "inner_alias": "sale", "proj_col": "code", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_03342
train
T2
v2
Schema: invoices (alias: inv)(level, salary, name, code) staff(name, type, status, amount) Task: Find name from invoices where a matching record exists in staff with the same level. SQL:
SELECT name FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = inv.level );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "name", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_03343
train
T1
v3
Schema: transactions (alias: txn)(type, status, salary, value) regions(value, name, type, code) Task: Find salary from transactions where value exceeds the average amount from regions for the same code. SQL:
SELECT salary FROM transactions AS txn WHERE value > ( SELECT SUM(amount) FROM regions AS rgn WHERE rgn.code = txn.code );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_03344
train
T1
v2
Schema: invoices (alias: inv)(value, code, type, name) items(value, type, code, date) Task: Retrieve code from invoices that have at least one corresponding entry in items sharing the same type. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = inv.type );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "code", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_03345
train
T1
v1
Schema: orders (alias: ord)(value, amount, salary, id) customers(name, date, id, type) Task: Select amount from orders where code exists in customers for the same status. SQL:
SELECT amount FROM orders AS ord WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.status = ord.status );
{ "outer_table": "orders", "inner_table": "customers", "outer_alias": "ord", "inner_alias": "cust", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_03346
train
T1
v3
Schema: orders (alias: ord)(date, type, code, name) requests(code, level, date, type) Task: Retrieve salary from orders with salary above the AVG(salary) of requests rows sharing the same type. SQL:
SELECT salary FROM orders AS ord WHERE salary > ( SELECT AVG(salary) FROM requests AS ordr WHERE ordr.type = ord.type );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_03347
train
T1
v1
Schema: warehouses (alias: whs)(amount, status, code, date) transactions(name, value, salary, date) Task: Retrieve code from warehouses whose id is found in transactions rows where code matches the outer record. SQL:
SELECT code FROM warehouses AS whs WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "transactions", "outer_alias": "whs", "inner_alias": "txn", "proj_col": "code", "filter_col": "id", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_03348
train
T2
v1
Schema: customers (alias: cust)(name, date, type, salary) staff(date, amount, level, type) Task: Select id from customers where code exists in staff for the same status. SQL:
SELECT id FROM customers AS cust WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.status = cust.status );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_03349
train
T1
v3
Schema: sales (alias: sale)(date, status, salary, amount) warehouses(value, status, name, level) Task: Retrieve salary from sales with salary above the MIN(salary) of warehouses rows sharing the same status. SQL:
SELECT salary FROM sales AS sale WHERE salary > ( SELECT MIN(salary) FROM warehouses AS whs WHERE whs.status = sale.status );
{ "outer_table": "sales", "inner_table": "warehouses", "outer_alias": "sale", "inner_alias": "whs", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_03350
train
T1
v3
Schema: invoices (alias: inv)(id, code, status, salary) categories(status, code, id, type) Task: Retrieve id from invoices with value above the SUM(value) of categories rows sharing the same code. SQL:
SELECT id FROM invoices AS inv WHERE value > ( SELECT SUM(value) FROM categories AS catg WHERE catg.code = inv.code );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_03351
train
T1
v3
Schema: invoices (alias: inv)(status, name, date, amount) products(value, type, code, salary) Task: Retrieve code from invoices with salary above the MIN(amount) of products rows sharing the same level. SQL:
SELECT code FROM invoices AS inv WHERE salary > ( SELECT MIN(amount) FROM products AS prod WHERE prod.level = inv.level );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_03352
train
T1
v3
Schema: transactions (alias: txn)(amount, status, date, type) requests(name, date, salary, amount) Task: Find amount from transactions where amount exceeds the average salary from requests for the same level. SQL:
SELECT amount FROM transactions AS txn WHERE amount > ( SELECT MIN(salary) FROM requests AS ordr WHERE ordr.level = txn.level );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_03353
train
T1
v2
Schema: invoices (alias: inv)(type, id, code, status) categories(amount, id, salary, value) Task: Retrieve salary from invoices that have at least one corresponding entry in categories sharing the same type. SQL:
SELECT salary FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = inv.type );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "salary", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_03354
train
T1
v2
Schema: departments (alias: dept)(status, id, salary, date) orders(value, name, type, date) Task: Find code from departments where a matching record exists in orders with the same code. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = dept.code );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "code", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_03355
train
T1
v2
Schema: employees (alias: emp)(type, name, level, status) accounts(code, id, amount, date) Task: Find code from employees where a matching record exists in accounts with the same id. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = emp.id );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "code", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_03356
train
T1
v3
Schema: warehouses (alias: whs)(level, type, name, id) schedules(name, value, salary, code) Task: Retrieve amount from warehouses with value above the MIN(salary) of schedules rows sharing the same id. SQL:
SELECT amount FROM warehouses AS whs WHERE value > ( SELECT MIN(salary) FROM schedules AS schd WHERE schd.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "schedules", "outer_alias": "whs", "inner_alias": "schd", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_03357
train
T2
v3
Schema: customers (alias: cust)(name, code, salary, status) sales(name, id, amount, salary) Task: Find salary from customers where amount exceeds the average value from sales for the same id. SQL:
SELECT salary FROM customers AS cust WHERE amount > ( SELECT AVG(value) FROM sales AS sale WHERE sale.id = cust.id );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_03358
train
T1
v3
Schema: transactions (alias: txn)(name, status, code, type) warehouses(date, amount, status, value) Task: Find amount from transactions where value exceeds the average salary from warehouses for the same code. SQL:
SELECT amount FROM transactions AS txn WHERE value > ( SELECT COUNT(salary) FROM warehouses AS whs WHERE whs.code = txn.code );
{ "outer_table": "transactions", "inner_table": "warehouses", "outer_alias": "txn", "inner_alias": "whs", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_03359
train
T1
v3
Schema: staff (alias: empl)(code, level, salary, status) transactions(status, value, level, date) Task: Find id from staff where salary exceeds the average salary from transactions for the same level. SQL:
SELECT id FROM staff AS empl WHERE salary > ( SELECT AVG(salary) FROM transactions AS txn WHERE txn.level = empl.level );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_03360
train
T2
v1
Schema: sales (alias: sale)(status, name, id, amount) regions(type, salary, id, amount) Task: Select amount from sales where type exists in regions for the same status. SQL:
SELECT amount FROM sales AS sale WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.status = sale.status );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_03361
train
T1
v3
Schema: products (alias: prod)(status, salary, level, type) staff(type, value, code, salary) Task: Find code from products where salary exceeds the average amount from staff for the same type. SQL:
SELECT code FROM products AS prod WHERE salary > ( SELECT AVG(amount) FROM staff AS empl WHERE empl.type = prod.type );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_03362
train
T1
v1
Schema: products (alias: prod)(amount, id, name, level) budgets(status, type, name, code) Task: Select value from products where code exists in budgets for the same code. SQL:
SELECT value FROM products AS prod WHERE code IN ( SELECT code FROM budgets AS budg WHERE budg.code = prod.code );
{ "outer_table": "products", "inner_table": "budgets", "outer_alias": "prod", "inner_alias": "budg", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_03363
train
T1
v1
Schema: budgets (alias: budg)(salary, name, id, code) schedules(code, name, id, type) Task: Select id from budgets where id exists in schedules for the same level. SQL:
SELECT id FROM budgets AS budg WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.level = budg.level );
{ "outer_table": "budgets", "inner_table": "schedules", "outer_alias": "budg", "inner_alias": "schd", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_03364
train
T2
v2
Schema: invoices (alias: inv)(value, name, date, code) shipments(level, value, status, date) Task: Retrieve name from invoices that have at least one corresponding entry in shipments sharing the same type. SQL:
SELECT name FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = inv.type );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "name", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_03365
train
T1
v3
Schema: categories (alias: catg)(value, status, level, date) products(date, code, level, salary) Task: Retrieve name from categories with salary above the COUNT(amount) of products rows sharing the same code. SQL:
SELECT name FROM categories AS catg WHERE salary > ( SELECT COUNT(amount) FROM products AS prod WHERE prod.code = catg.code );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_03366
train
T2
v3
Schema: categories (alias: catg)(code, value, date, status) departments(level, date, amount, name) Task: Retrieve name from categories with salary above the MIN(salary) of departments rows sharing the same code. SQL:
SELECT name FROM categories AS catg WHERE salary > ( SELECT MIN(salary) FROM departments AS dept WHERE dept.code = catg.code );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_03367
train
T2
v2
Schema: transactions (alias: txn)(type, value, salary, level) customers(name, level, salary, date) Task: Retrieve salary from transactions that have at least one corresponding entry in customers sharing the same status. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = txn.status );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "salary", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_03368
train
T1
v3
Schema: shipments (alias: shp)(date, id, amount, name) schedules(type, amount, id, status) Task: Retrieve id from shipments with salary above the AVG(value) of schedules rows sharing the same status. SQL:
SELECT id FROM shipments AS shp WHERE salary > ( SELECT AVG(value) FROM schedules AS schd WHERE schd.status = shp.status );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_03369
train
T2
v1
Schema: items (alias: lne)(amount, name, code, salary) regions(amount, status, type, name) Task: Find code from items where level appears in regions entries with matching code. SQL:
SELECT code FROM items AS lne WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.code = lne.code );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_03370
train
T2
v2
Schema: employees (alias: emp)(amount, salary, type, level) warehouses(name, amount, status, id) Task: Retrieve salary from employees that have at least one corresponding entry in warehouses sharing the same type. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.type = emp.type );
{ "outer_table": "employees", "inner_table": "warehouses", "outer_alias": "emp", "inner_alias": "whs", "proj_col": "salary", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_03371
train
T1
v1
Schema: items (alias: lne)(status, value, type, amount) orders(date, code, amount, name) Task: Find code from items where id appears in orders entries with matching status. SQL:
SELECT code FROM items AS lne WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.status = lne.status );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "code", "filter_col": "id", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_03372
train
T2
v3
Schema: requests (alias: ordr)(code, id, value, status) warehouses(value, level, amount, name) Task: Find code from requests where salary exceeds the average salary from warehouses for the same id. SQL:
SELECT code FROM requests AS ordr WHERE salary > ( SELECT SUM(salary) FROM warehouses AS whs WHERE whs.id = ordr.id );
{ "outer_table": "requests", "inner_table": "warehouses", "outer_alias": "ordr", "inner_alias": "whs", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_03373
train
T2
v3
Schema: managers (alias: mgr)(salary, amount, status, name) requests(value, level, name, code) Task: Find id from managers where salary exceeds the average salary from requests for the same type. SQL:
SELECT id FROM managers AS mgr WHERE salary > ( SELECT AVG(salary) FROM requests AS ordr WHERE ordr.type = mgr.type );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_03374
train
T1
v3
Schema: departments (alias: dept)(status, date, code, name) employees(value, salary, level, amount) Task: Retrieve name from departments with salary above the AVG(salary) of employees rows sharing the same status. SQL:
SELECT name FROM departments AS dept WHERE salary > ( SELECT AVG(salary) FROM employees AS emp WHERE emp.status = dept.status );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_03375
train
T1
v2
Schema: shipments (alias: shp)(value, id, code, date) orders(name, amount, date, id) Task: Retrieve name from shipments that have at least one corresponding entry in orders sharing the same status. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = shp.status );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "name", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_03376
train
T2
v3
Schema: items (alias: lne)(type, salary, id, date) products(amount, code, date, salary) Task: Find value from items where salary exceeds the average amount from products for the same code. SQL:
SELECT value FROM items AS lne WHERE salary > ( SELECT AVG(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": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_03377
train
T2
v2
Schema: warehouses (alias: whs)(value, salary, code, status) accounts(code, amount, level, value) Task: Retrieve id from warehouses that have at least one corresponding entry in accounts sharing the same status. SQL:
SELECT id FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "accounts", "outer_alias": "whs", "inner_alias": "acct", "proj_col": "id", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_03378
train
T2
v2
Schema: services (alias: srvc)(date, id, level, status) categories(status, level, salary, date) Task: Retrieve value from services that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT value FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = srvc.code );
{ "outer_table": "services", "inner_table": "categories", "outer_alias": "srvc", "inner_alias": "catg", "proj_col": "value", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_03379
train
T2
v2
Schema: orders (alias: ord)(type, code, name, level) regions(type, id, value, level) Task: Retrieve amount from orders that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = ord.level );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "amount", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_03380
train
T1
v3
Schema: items (alias: lne)(id, level, type, date) orders(date, name, level, code) Task: Find value from items where amount exceeds the average amount from orders for the same type. SQL:
SELECT value FROM items AS lne WHERE amount > ( SELECT SUM(amount) FROM orders AS ord WHERE ord.type = lne.type );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_03381
train
T2
v3
Schema: categories (alias: catg)(name, amount, type, code) staff(id, name, level, type) Task: Find id from categories where value exceeds the average amount from staff for the same type. SQL:
SELECT id FROM categories AS catg WHERE value > ( SELECT COUNT(amount) FROM staff AS empl WHERE empl.type = catg.type );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_03382
train
T2
v3
Schema: budgets (alias: budg)(salary, date, value, type) accounts(name, code, level, status) Task: Retrieve value from budgets with amount above the AVG(salary) of accounts rows sharing the same status. SQL:
SELECT value FROM budgets AS budg WHERE amount > ( SELECT AVG(salary) FROM accounts AS acct WHERE acct.status = budg.status );
{ "outer_table": "budgets", "inner_table": "accounts", "outer_alias": "budg", "inner_alias": "acct", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_03383
train
T2
v3
Schema: products (alias: prod)(value, date, id, salary) employees(date, value, status, id) Task: Find value from products where value exceeds the average value from employees for the same type. SQL:
SELECT value FROM products AS prod WHERE value > ( SELECT MAX(value) FROM employees AS emp WHERE emp.type = prod.type );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_03384
train
T1
v3
Schema: accounts (alias: acct)(date, status, id, value) items(type, id, level, salary) Task: Find code from accounts where value exceeds the average salary from items for the same code. SQL:
SELECT code FROM accounts AS acct WHERE value > ( SELECT SUM(salary) FROM items AS lne WHERE lne.code = acct.code );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_03385
train
T1
v2
Schema: items (alias: lne)(type, code, level, amount) orders(amount, status, name, code) Task: Retrieve amount from items that have at least one corresponding entry in orders sharing the same type. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = lne.type );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "amount", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_03386
train
T2
v3
Schema: items (alias: lne)(status, name, id, date) transactions(id, date, value, type) Task: Find value from items where value exceeds the average salary from transactions for the same level. SQL:
SELECT value FROM items AS lne WHERE value > ( SELECT AVG(salary) FROM transactions AS txn WHERE txn.level = lne.level );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_03387
train
T2
v1
Schema: departments (alias: dept)(date, code, id, level) customers(id, salary, value, date) Task: Retrieve id from departments whose type is found in customers rows where level matches the outer record. SQL:
SELECT id FROM departments AS dept WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.level = dept.level );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_03388
train
T1
v1
Schema: invoices (alias: inv)(date, value, type, code) accounts(name, salary, date, level) Task: Select value from invoices where level exists in accounts for the same code. SQL:
SELECT value FROM invoices AS inv WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.code = inv.code );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_03389
train
T1
v2
Schema: categories (alias: catg)(type, salary, level, status) schedules(value, level, id, code) Task: Find amount from categories where a matching record exists in schedules with the same status. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = catg.status );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "amount", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_03390
train
T2
v1
Schema: categories (alias: catg)(code, date, value, level) invoices(amount, level, date, id) Task: Retrieve name from categories whose id is found in invoices rows where code matches the outer record. SQL:
SELECT name FROM categories AS catg WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.code = catg.code );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_03391
train
T2
v3
Schema: schedules (alias: schd)(date, value, name, code) invoices(amount, status, level, value) Task: Find id from schedules where amount exceeds the average value from invoices for the same type. SQL:
SELECT id FROM schedules AS schd WHERE amount > ( SELECT AVG(value) FROM invoices AS inv WHERE inv.type = schd.type );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_03392
train
T2
v3
Schema: regions (alias: rgn)(id, amount, name, status) schedules(amount, level, status, value) Task: Retrieve code from regions with value above the SUM(value) of schedules rows sharing the same code. SQL:
SELECT code FROM regions AS rgn WHERE value > ( SELECT SUM(value) FROM schedules AS schd WHERE schd.code = rgn.code );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_03393
train
T2
v1
Schema: invoices (alias: inv)(code, salary, level, status) regions(date, status, code, level) Task: Find amount from invoices where code appears in regions entries with matching level. SQL:
SELECT amount FROM invoices AS inv WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.level = inv.level );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_03394
train
T1
v1
Schema: items (alias: lne)(status, id, date, salary) departments(name, id, value, amount) Task: Retrieve value from items whose type is found in departments rows where status matches the outer record. SQL:
SELECT value FROM items AS lne WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.status = lne.status );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_03395
train
T2
v1
Schema: shipments (alias: shp)(amount, status, salary, code) schedules(amount, date, name, status) Task: Select amount from shipments where type exists in schedules for the same status. SQL:
SELECT amount FROM shipments AS shp WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.status = shp.status );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_03396
train
T2
v3
Schema: sales (alias: sale)(salary, date, id, name) transactions(level, status, amount, name) Task: Find value from sales where value exceeds the average salary from transactions for the same status. SQL:
SELECT value FROM sales AS sale WHERE value > ( SELECT AVG(salary) FROM transactions AS txn WHERE txn.status = sale.status );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_03397
train
T1
v1
Schema: managers (alias: mgr)(status, amount, salary, name) items(type, level, value, salary) Task: Select value from managers where code exists in items for the same type. SQL:
SELECT value FROM managers AS mgr WHERE code IN ( SELECT code FROM items AS lne WHERE lne.type = mgr.type );
{ "outer_table": "managers", "inner_table": "items", "outer_alias": "mgr", "inner_alias": "lne", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_03398
train
T1
v1
Schema: sales (alias: sale)(value, type, id, salary) items(name, level, amount, value) Task: Retrieve value from sales whose level is found in items rows where level matches the outer record. SQL:
SELECT value FROM sales AS sale WHERE level IN ( SELECT level FROM items AS lne WHERE lne.level = sale.level );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_03399
train
T1