variant
stringclasses
3 values
prompt
stringlengths
163
237
sql
stringlengths
103
143
metadata
unknown
id
stringlengths
21
21
split
stringclasses
1 value
token_group
stringclasses
2 values
v1
Schema: regions (alias: rgn)(status, value, code, id) items(date, name, level, value) Task: Retrieve value from regions whose status is found in items rows where id matches the outer record. SQL:
SELECT value FROM regions AS rgn WHERE status IN ( SELECT status FROM items AS lne WHERE lne.id = rgn.id );
{ "outer_table": "regions", "inner_table": "items", "outer_alias": "rgn", "inner_alias": "lne", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_08800
train
T2
v2
Schema: services (alias: srvc)(date, code, value, type) accounts(salary, code, name, level) Task: Retrieve amount from services that have at least one corresponding entry in accounts sharing the same code. SQL:
SELECT amount FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = srvc.code );
{ "outer_table": "services", "inner_table": "accounts", "outer_alias": "srvc", "inner_alias": "acct", "proj_col": "amount", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_08801
train
T2
v2
Schema: managers (alias: mgr)(type, amount, status, date) budgets(level, id, salary, code) Task: Find value from managers where a matching record exists in budgets with the same code. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.code = mgr.code );
{ "outer_table": "managers", "inner_table": "budgets", "outer_alias": "mgr", "inner_alias": "budg", "proj_col": "value", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_08802
train
T1
v3
Schema: categories (alias: catg)(level, name, status, type) staff(code, date, amount, status) Task: Retrieve amount from categories with salary above the SUM(amount) of staff rows sharing the same type. SQL:
SELECT amount FROM categories AS catg WHERE salary > ( SELECT SUM(amount) FROM staff AS empl WHERE empl.type = catg.type );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_08803
train
T2
v3
Schema: budgets (alias: budg)(value, id, name, date) accounts(code, amount, value, salary) Task: Find name from budgets where value exceeds the average amount from accounts for the same type. SQL:
SELECT name FROM budgets AS budg WHERE value > ( SELECT SUM(amount) FROM accounts AS acct WHERE acct.type = budg.type );
{ "outer_table": "budgets", "inner_table": "accounts", "outer_alias": "budg", "inner_alias": "acct", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_08804
train
T2
v3
Schema: transactions (alias: txn)(salary, status, date, name) budgets(type, value, salary, id) Task: Find value from transactions where amount exceeds the average salary from budgets for the same id. SQL:
SELECT value FROM transactions AS txn WHERE amount > ( SELECT SUM(salary) FROM budgets AS budg WHERE budg.id = txn.id );
{ "outer_table": "transactions", "inner_table": "budgets", "outer_alias": "txn", "inner_alias": "budg", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_08805
train
T1
v1
Schema: invoices (alias: inv)(amount, type, salary, code) shipments(salary, type, level, code) Task: Retrieve name from invoices whose type is found in shipments rows where code matches the outer record. SQL:
SELECT name FROM invoices AS inv WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.code = inv.code );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_08806
train
T1
v1
Schema: invoices (alias: inv)(name, salary, type, value) regions(name, id, level, amount) Task: Retrieve id from invoices whose level is found in regions rows where status matches the outer record. SQL:
SELECT id FROM invoices AS inv WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.status = inv.status );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_08807
train
T1
v2
Schema: sales (alias: sale)(salary, name, type, value) shipments(code, status, salary, level) Task: Retrieve name from sales that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = sale.status );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "name", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_08808
train
T1
v1
Schema: items (alias: lne)(type, salary, amount, id) departments(salary, level, date, type) Task: Find code from items where code appears in departments entries with matching status. SQL:
SELECT code FROM items AS lne WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.status = lne.status );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "code", "filter_col": "code", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_08809
train
T2
v2
Schema: managers (alias: mgr)(code, amount, level, id) regions(level, amount, value, status) Task: Retrieve id from managers that have at least one corresponding entry in regions sharing the same id. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = mgr.id );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "id", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_08810
train
T1
v1
Schema: sales (alias: sale)(name, salary, status, date) staff(level, code, amount, value) Task: Find id from sales where id appears in staff entries with matching type. SQL:
SELECT id FROM sales AS sale WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.type = sale.type );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_08811
train
T1
v3
Schema: departments (alias: dept)(salary, id, value, name) orders(code, status, salary, type) Task: Find code from departments where amount exceeds the average amount from orders for the same status. SQL:
SELECT code FROM departments AS dept WHERE amount > ( SELECT MIN(amount) FROM orders AS ord WHERE ord.status = dept.status );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_08812
train
T1
v3
Schema: accounts (alias: acct)(id, code, salary, name) requests(name, type, value, amount) Task: Retrieve name from accounts with amount above the MIN(salary) of requests rows sharing the same type. SQL:
SELECT name FROM accounts AS acct WHERE amount > ( SELECT MIN(salary) FROM requests AS ordr WHERE ordr.type = acct.type );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_08813
train
T1
v1
Schema: departments (alias: dept)(id, name, code, status) managers(date, type, value, level) Task: Retrieve amount from departments whose status is found in managers rows where type matches the outer record. SQL:
SELECT amount FROM departments AS dept WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.type = dept.type );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "status", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_08814
train
T1
v2
Schema: items (alias: lne)(status, amount, type, code) warehouses(name, date, salary, code) Task: Find id from items where a matching record exists in warehouses with the same status. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.status = lne.status );
{ "outer_table": "items", "inner_table": "warehouses", "outer_alias": "lne", "inner_alias": "whs", "proj_col": "id", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_08815
train
T2
v2
Schema: requests (alias: ordr)(id, amount, value, date) products(salary, level, code, type) Task: Find value from requests where a matching record exists in products with the same level. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = ordr.level );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "value", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_08816
train
T2
v3
Schema: warehouses (alias: whs)(date, salary, status, amount) regions(code, type, amount, name) Task: Find amount from warehouses where value exceeds the average salary from regions for the same status. SQL:
SELECT amount FROM warehouses AS whs WHERE value > ( SELECT COUNT(salary) FROM regions AS rgn WHERE rgn.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "regions", "outer_alias": "whs", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_08817
train
T2
v3
Schema: products (alias: prod)(amount, level, code, id) shipments(type, status, level, code) Task: Retrieve code from products with amount above the AVG(value) of shipments rows sharing the same level. SQL:
SELECT code FROM products AS prod WHERE amount > ( SELECT AVG(value) FROM shipments AS shp WHERE shp.level = prod.level );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_08818
train
T1
v3
Schema: shipments (alias: shp)(salary, type, value, level) warehouses(name, type, status, level) Task: Retrieve salary from shipments with amount above the MAX(salary) of warehouses rows sharing the same level. SQL:
SELECT salary FROM shipments AS shp WHERE amount > ( SELECT MAX(salary) FROM warehouses AS whs WHERE whs.level = shp.level );
{ "outer_table": "shipments", "inner_table": "warehouses", "outer_alias": "shp", "inner_alias": "whs", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_08819
train
T2
v2
Schema: staff (alias: empl)(type, name, code, value) products(code, salary, type, amount) Task: Retrieve name from staff that have at least one corresponding entry in products sharing the same type. SQL:
SELECT name FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = empl.type );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "name", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_08820
train
T2
v3
Schema: invoices (alias: inv)(name, salary, amount, id) regions(name, value, code, type) Task: Retrieve code from invoices with amount above the MIN(amount) of regions rows sharing the same level. SQL:
SELECT code FROM invoices AS inv WHERE amount > ( SELECT MIN(amount) FROM regions AS rgn WHERE rgn.level = inv.level );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_08821
train
T1
v2
Schema: budgets (alias: budg)(status, type, id, amount) shipments(amount, value, code, id) Task: Find name from budgets where a matching record exists in shipments with the same status. SQL:
SELECT name FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = budg.status );
{ "outer_table": "budgets", "inner_table": "shipments", "outer_alias": "budg", "inner_alias": "shp", "proj_col": "name", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_08822
train
T2
v2
Schema: regions (alias: rgn)(date, salary, status, amount) sales(status, salary, type, code) Task: Retrieve code from regions that have at least one corresponding entry in sales sharing the same type. SQL:
SELECT code FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = rgn.type );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "code", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_08823
train
T2
v2
Schema: transactions (alias: txn)(level, name, id, salary) products(value, type, status, code) Task: Find code from transactions where a matching record exists in products with the same id. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = txn.id );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "code", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_08824
train
T1
v1
Schema: employees (alias: emp)(salary, id, amount, value) shipments(status, code, name, amount) Task: Retrieve salary from employees whose status is found in shipments rows where code matches the outer record. SQL:
SELECT salary FROM employees AS emp WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.code = emp.code );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_08825
train
T1
v3
Schema: accounts (alias: acct)(type, name, id, level) managers(date, id, value, code) Task: Find name from accounts where amount exceeds the average value from managers for the same code. SQL:
SELECT name FROM accounts AS acct WHERE amount > ( SELECT COUNT(value) FROM managers AS mgr WHERE mgr.code = acct.code );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_08826
train
T1
v1
Schema: items (alias: lne)(name, date, amount, code) requests(name, amount, salary, value) Task: Select salary from items where status exists in requests for the same id. SQL:
SELECT salary FROM items AS lne WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.id = lne.id );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "status", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_08827
train
T2
v3
Schema: schedules (alias: schd)(salary, amount, status, type) shipments(salary, value, code, type) Task: Find salary from schedules where salary exceeds the average salary from shipments for the same level. SQL:
SELECT salary FROM schedules AS schd WHERE salary > ( SELECT COUNT(salary) FROM shipments AS shp WHERE shp.level = schd.level );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_08828
train
T2
v2
Schema: schedules (alias: schd)(value, type, code, date) accounts(date, name, status, salary) Task: Retrieve name from schedules that have at least one corresponding entry in accounts sharing the same id. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = schd.id );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "name", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_08829
train
T2
v3
Schema: schedules (alias: schd)(status, id, amount, level) customers(status, name, code, type) Task: Retrieve name from schedules with salary above the MIN(amount) of customers rows sharing the same status. SQL:
SELECT name FROM schedules AS schd WHERE salary > ( SELECT MIN(amount) FROM customers AS cust WHERE cust.status = schd.status );
{ "outer_table": "schedules", "inner_table": "customers", "outer_alias": "schd", "inner_alias": "cust", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_08830
train
T2
v1
Schema: staff (alias: empl)(date, level, status, name) shipments(value, salary, type, level) Task: Retrieve value from staff whose id is found in shipments rows where id matches the outer record. SQL:
SELECT value FROM staff AS empl WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.id = empl.id );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_08831
train
T2
v1
Schema: warehouses (alias: whs)(type, code, status, salary) sales(name, salary, code, amount) Task: Retrieve id from warehouses whose type is found in sales rows where type matches the outer record. SQL:
SELECT id FROM warehouses AS whs WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "sales", "outer_alias": "whs", "inner_alias": "sale", "proj_col": "id", "filter_col": "type", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_08832
train
T2
v2
Schema: transactions (alias: txn)(code, name, salary, type) regions(name, value, status, level) Task: Retrieve amount from transactions that have at least one corresponding entry in regions sharing the same type. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = txn.type );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "amount", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_08833
train
T1
v1
Schema: transactions (alias: txn)(date, value, status, type) staff(amount, name, value, id) Task: Retrieve salary from transactions whose status is found in staff rows where level matches the outer record. SQL:
SELECT salary FROM transactions AS txn WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.level = txn.level );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_08834
train
T1
v2
Schema: budgets (alias: budg)(amount, level, date, value) shipments(value, salary, date, amount) Task: Find value from budgets where a matching record exists in shipments with the same status. SQL:
SELECT value FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = budg.status );
{ "outer_table": "budgets", "inner_table": "shipments", "outer_alias": "budg", "inner_alias": "shp", "proj_col": "value", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_08835
train
T2
v1
Schema: shipments (alias: shp)(date, type, name, amount) staff(level, value, code, status) Task: Select id from shipments where code exists in staff for the same type. SQL:
SELECT id FROM shipments AS shp WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.type = shp.type );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "id", "filter_col": "code", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_08836
train
T2
v1
Schema: warehouses (alias: whs)(value, name, amount, type) accounts(status, amount, date, level) Task: Retrieve amount from warehouses whose level is found in accounts rows where code matches the outer record. SQL:
SELECT amount FROM warehouses AS whs WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "accounts", "outer_alias": "whs", "inner_alias": "acct", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_08837
train
T2
v2
Schema: departments (alias: dept)(id, amount, salary, status) items(salary, type, value, id) Task: Find value from departments where a matching record exists in items with the same status. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = dept.status );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "value", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_08838
train
T1
v3
Schema: managers (alias: mgr)(value, type, id, date) sales(value, id, amount, status) Task: Find code from managers where amount exceeds the average amount from sales for the same status. SQL:
SELECT code FROM managers AS mgr WHERE amount > ( SELECT MIN(amount) FROM sales AS sale WHERE sale.status = mgr.status );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_08839
train
T1
v3
Schema: staff (alias: empl)(status, date, amount, type) departments(salary, id, date, amount) Task: Retrieve name from staff with value above the AVG(amount) of departments rows sharing the same level. SQL:
SELECT name FROM staff AS empl WHERE value > ( SELECT AVG(amount) FROM departments AS dept WHERE dept.level = empl.level );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_08840
train
T2
v3
Schema: shipments (alias: shp)(salary, type, code, name) accounts(type, salary, id, status) Task: Find salary from shipments where amount exceeds the average value from accounts for the same status. SQL:
SELECT salary FROM shipments AS shp WHERE amount > ( SELECT MAX(value) FROM accounts AS acct WHERE acct.status = shp.status );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_08841
train
T2
v3
Schema: staff (alias: empl)(amount, level, id, date) orders(code, name, salary, date) Task: Retrieve value from staff with value above the COUNT(salary) of orders rows sharing the same id. SQL:
SELECT value FROM staff AS empl WHERE value > ( SELECT COUNT(salary) FROM orders AS ord WHERE ord.id = empl.id );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_08842
train
T2
v2
Schema: budgets (alias: budg)(level, salary, id, value) transactions(salary, code, id, status) Task: Find name from budgets where a matching record exists in transactions with the same type. SQL:
SELECT name FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = budg.type );
{ "outer_table": "budgets", "inner_table": "transactions", "outer_alias": "budg", "inner_alias": "txn", "proj_col": "name", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_08843
train
T2
v3
Schema: managers (alias: mgr)(salary, date, name, amount) employees(name, code, value, date) Task: Retrieve value from managers with salary above the AVG(salary) of employees rows sharing the same status. SQL:
SELECT value FROM managers AS mgr WHERE salary > ( SELECT AVG(salary) FROM employees AS emp WHERE emp.status = mgr.status );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_08844
train
T1
v3
Schema: customers (alias: cust)(type, level, date, value) invoices(type, salary, id, name) Task: Find value from customers where salary exceeds the average amount from invoices for the same code. SQL:
SELECT value FROM customers AS cust WHERE salary > ( SELECT MAX(amount) FROM invoices AS inv WHERE inv.code = cust.code );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_08845
train
T1
v2
Schema: managers (alias: mgr)(type, code, value, level) employees(date, value, name, amount) Task: Find salary from managers where a matching record exists in employees with the same type. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = mgr.type );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "salary", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_08846
train
T1
v2
Schema: managers (alias: mgr)(amount, value, level, salary) sales(value, date, amount, level) Task: Find amount from managers where a matching record exists in sales with the same code. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = mgr.code );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "amount", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_08847
train
T1
v3
Schema: schedules (alias: schd)(salary, value, amount, code) warehouses(id, salary, date, value) Task: Find code from schedules where salary exceeds the average salary from warehouses for the same status. SQL:
SELECT code FROM schedules AS schd WHERE salary > ( SELECT MIN(salary) FROM warehouses AS whs WHERE whs.status = schd.status );
{ "outer_table": "schedules", "inner_table": "warehouses", "outer_alias": "schd", "inner_alias": "whs", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_08848
train
T2
v2
Schema: invoices (alias: inv)(name, value, id, code) services(status, amount, type, date) Task: Find id from invoices where a matching record exists in services with the same level. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.level = inv.level );
{ "outer_table": "invoices", "inner_table": "services", "outer_alias": "inv", "inner_alias": "srvc", "proj_col": "id", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_08849
train
T1
v1
Schema: warehouses (alias: whs)(id, salary, name, code) regions(code, id, value, status) Task: Retrieve name from warehouses whose status is found in regions rows where type matches the outer record. SQL:
SELECT name FROM warehouses AS whs WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "regions", "outer_alias": "whs", "inner_alias": "rgn", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_08850
train
T2
v3
Schema: managers (alias: mgr)(amount, type, value, salary) budgets(type, salary, amount, level) Task: Find value from managers where amount exceeds the average salary from budgets for the same code. SQL:
SELECT value FROM managers AS mgr WHERE amount > ( SELECT SUM(salary) FROM budgets AS budg WHERE budg.code = mgr.code );
{ "outer_table": "managers", "inner_table": "budgets", "outer_alias": "mgr", "inner_alias": "budg", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_08851
train
T1
v2
Schema: transactions (alias: txn)(salary, name, level, type) managers(name, date, value, status) Task: Find name from transactions where a matching record exists in managers with the same id. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = txn.id );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "name", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_08852
train
T1
v1
Schema: staff (alias: empl)(amount, status, level, type) budgets(code, level, type, status) Task: Select value from staff where type exists in budgets for the same level. SQL:
SELECT value FROM staff AS empl WHERE type IN ( SELECT type FROM budgets AS budg WHERE budg.level = empl.level );
{ "outer_table": "staff", "inner_table": "budgets", "outer_alias": "empl", "inner_alias": "budg", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_08853
train
T2
v1
Schema: departments (alias: dept)(id, value, amount, type) accounts(status, level, code, value) Task: Retrieve salary from departments whose type is found in accounts rows where code matches the outer record. SQL:
SELECT salary FROM departments AS dept WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.code = dept.code );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "salary", "filter_col": "type", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_08854
train
T1
v3
Schema: departments (alias: dept)(status, code, value, id) customers(date, id, status, amount) Task: Retrieve value from departments with amount above the AVG(salary) of customers rows sharing the same code. SQL:
SELECT value FROM departments AS dept WHERE amount > ( SELECT AVG(salary) FROM customers AS cust WHERE cust.code = dept.code );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_08855
train
T1
v3
Schema: departments (alias: dept)(salary, value, id, amount) items(status, level, code, value) Task: Retrieve amount from departments with amount above the SUM(salary) of items rows sharing the same id. SQL:
SELECT amount FROM departments AS dept WHERE amount > ( SELECT SUM(salary) FROM items AS lne WHERE lne.id = dept.id );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_08856
train
T1
v3
Schema: accounts (alias: acct)(id, level, type, value) transactions(date, amount, salary, id) Task: Find id from accounts where salary exceeds the average salary from transactions for the same level. SQL:
SELECT id FROM accounts AS acct WHERE salary > ( SELECT SUM(salary) FROM transactions AS txn WHERE txn.level = acct.level );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_08857
train
T1
v2
Schema: orders (alias: ord)(level, value, name, id) sales(level, code, id, salary) Task: Find code from orders where a matching record exists in sales with the same code. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = ord.code );
{ "outer_table": "orders", "inner_table": "sales", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "code", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_08858
train
T1
v3
Schema: staff (alias: empl)(amount, status, name, date) requests(id, type, code, salary) Task: Find id from staff where value exceeds the average amount from requests for the same level. SQL:
SELECT id FROM staff AS empl WHERE value > ( SELECT SUM(amount) FROM requests AS ordr WHERE ordr.level = empl.level );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_08859
train
T2
v3
Schema: departments (alias: dept)(status, code, amount, id) employees(name, value, status, date) Task: Find salary from departments where salary exceeds the average salary from employees for the same id. SQL:
SELECT salary FROM departments AS dept WHERE salary > ( SELECT COUNT(salary) FROM employees AS emp WHERE emp.id = dept.id );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_08860
train
T1
v2
Schema: staff (alias: empl)(level, status, code, name) services(status, id, code, amount) Task: Retrieve salary from staff that have at least one corresponding entry in services sharing the same status. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.status = empl.status );
{ "outer_table": "staff", "inner_table": "services", "outer_alias": "empl", "inner_alias": "srvc", "proj_col": "salary", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_08861
train
T2
v2
Schema: sales (alias: sale)(date, level, id, name) requests(date, level, salary, value) Task: Retrieve code from sales that have at least one corresponding entry in requests sharing the same status. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = sale.status );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "code", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_08862
train
T1
v2
Schema: invoices (alias: inv)(name, status, date, value) sales(date, id, status, level) Task: Find salary from invoices where a matching record exists in sales with the same type. SQL:
SELECT salary FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = inv.type );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "salary", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_08863
train
T1
v2
Schema: products (alias: prod)(code, salary, id, status) shipments(code, id, value, date) Task: Find salary from products where a matching record exists in shipments with the same id. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = prod.id );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "salary", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_08864
train
T1
v2
Schema: products (alias: prod)(name, status, date, type) items(code, amount, salary, value) Task: Find code from products where a matching record exists in items with the same status. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = prod.status );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "code", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_08865
train
T1
v3
Schema: managers (alias: mgr)(status, name, value, amount) transactions(value, salary, amount, id) Task: Retrieve code from managers with amount above the MAX(salary) of transactions rows sharing the same status. SQL:
SELECT code FROM managers AS mgr WHERE amount > ( SELECT MAX(salary) FROM transactions AS txn WHERE txn.status = mgr.status );
{ "outer_table": "managers", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_08866
train
T1
v2
Schema: orders (alias: ord)(status, id, level, salary) warehouses(level, amount, type, date) Task: Retrieve amount from orders that have at least one corresponding entry in warehouses sharing the same type. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.type = ord.type );
{ "outer_table": "orders", "inner_table": "warehouses", "outer_alias": "ord", "inner_alias": "whs", "proj_col": "amount", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_08867
train
T1
v3
Schema: warehouses (alias: whs)(id, salary, type, status) schedules(value, date, level, type) Task: Find id from warehouses where value exceeds the average value from schedules for the same code. SQL:
SELECT id FROM warehouses AS whs WHERE value > ( SELECT MAX(value) FROM schedules AS schd WHERE schd.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "schedules", "outer_alias": "whs", "inner_alias": "schd", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_08868
train
T2
v2
Schema: sales (alias: sale)(status, id, code, salary) customers(type, amount, status, date) Task: Retrieve salary from sales that have at least one corresponding entry in customers sharing the same id. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = sale.id );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "salary", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_08869
train
T1
v3
Schema: products (alias: prod)(id, type, date, name) warehouses(amount, code, date, level) Task: Find code from products where value exceeds the average value from warehouses for the same status. SQL:
SELECT code FROM products AS prod WHERE value > ( SELECT SUM(value) FROM warehouses AS whs WHERE whs.status = prod.status );
{ "outer_table": "products", "inner_table": "warehouses", "outer_alias": "prod", "inner_alias": "whs", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_08870
train
T1
v2
Schema: customers (alias: cust)(name, value, status, date) staff(type, amount, value, name) Task: Find name from customers where a matching record exists in staff with the same code. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = cust.code );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "name", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_08871
train
T1
v3
Schema: categories (alias: catg)(status, level, amount, id) regions(date, code, type, name) Task: Find id from categories where amount exceeds the average value from regions for the same id. SQL:
SELECT id FROM categories AS catg WHERE amount > ( SELECT MAX(value) FROM regions AS rgn WHERE rgn.id = catg.id );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_08872
train
T2
v3
Schema: warehouses (alias: whs)(level, salary, code, value) managers(date, status, salary, id) Task: Find value from warehouses where value exceeds the average salary from managers for the same type. SQL:
SELECT value FROM warehouses AS whs WHERE value > ( SELECT AVG(salary) FROM managers AS mgr WHERE mgr.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "managers", "outer_alias": "whs", "inner_alias": "mgr", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_08873
train
T2
v2
Schema: transactions (alias: txn)(amount, level, date, type) schedules(date, value, name, amount) Task: Retrieve code from transactions that have at least one corresponding entry in schedules sharing the same type. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = txn.type );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "code", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_08874
train
T1
v2
Schema: sales (alias: sale)(type, level, id, code) items(id, date, value, amount) Task: Find value from sales where a matching record exists in items with the same type. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = sale.type );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "value", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_08875
train
T1
v1
Schema: departments (alias: dept)(value, type, date, status) sales(date, code, salary, id) Task: Select value from departments where id exists in sales for the same level. SQL:
SELECT value FROM departments AS dept WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.level = dept.level );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_08876
train
T1
v3
Schema: budgets (alias: budg)(status, amount, salary, level) requests(status, level, type, value) Task: Find code from budgets where salary exceeds the average amount from requests for the same level. SQL:
SELECT code FROM budgets AS budg WHERE salary > ( SELECT MAX(amount) FROM requests AS ordr WHERE ordr.level = budg.level );
{ "outer_table": "budgets", "inner_table": "requests", "outer_alias": "budg", "inner_alias": "ordr", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_08877
train
T2
v3
Schema: employees (alias: emp)(status, date, amount, type) departments(name, code, value, status) Task: Retrieve name from employees with amount above the AVG(salary) of departments rows sharing the same id. SQL:
SELECT name FROM employees AS emp WHERE amount > ( SELECT AVG(salary) FROM departments AS dept WHERE dept.id = emp.id );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_08878
train
T1
v1
Schema: accounts (alias: acct)(id, level, value, date) staff(amount, value, id, name) Task: Retrieve amount from accounts whose level is found in staff rows where status matches the outer record. SQL:
SELECT amount FROM accounts AS acct WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.status = acct.status );
{ "outer_table": "accounts", "inner_table": "staff", "outer_alias": "acct", "inner_alias": "empl", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_08879
train
T1
v3
Schema: requests (alias: ordr)(salary, amount, name, status) items(salary, id, amount, value) Task: Find salary from requests where amount exceeds the average value from items for the same id. SQL:
SELECT salary FROM requests AS ordr WHERE amount > ( SELECT SUM(value) FROM items AS lne WHERE lne.id = ordr.id );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_08880
train
T2
v3
Schema: transactions (alias: txn)(name, id, amount, date) warehouses(name, salary, amount, type) Task: Find value from transactions where salary exceeds the average amount from warehouses for the same code. SQL:
SELECT value FROM transactions AS txn WHERE salary > ( SELECT MIN(amount) FROM warehouses AS whs WHERE whs.code = txn.code );
{ "outer_table": "transactions", "inner_table": "warehouses", "outer_alias": "txn", "inner_alias": "whs", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_08881
train
T1
v2
Schema: schedules (alias: schd)(salary, code, id, type) departments(code, type, amount, date) Task: Find code from schedules where a matching record exists in departments with the same level. SQL:
SELECT code FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = schd.level );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "code", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_08882
train
T2
v3
Schema: products (alias: prod)(name, status, salary, value) requests(salary, name, code, type) Task: Retrieve salary from products with amount above the COUNT(value) of requests rows sharing the same code. SQL:
SELECT salary FROM products AS prod WHERE amount > ( SELECT COUNT(value) FROM requests AS ordr WHERE ordr.code = prod.code );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_08883
train
T1
v1
Schema: regions (alias: rgn)(id, code, date, name) sales(type, name, id, value) Task: Select name from regions where type exists in sales for the same code. SQL:
SELECT name FROM regions AS rgn WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.code = rgn.code );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_08884
train
T2
v1
Schema: invoices (alias: inv)(value, amount, date, status) items(amount, date, name, id) Task: Select name from invoices where status exists in items for the same code. SQL:
SELECT name FROM invoices AS inv WHERE status IN ( SELECT status FROM items AS lne WHERE lne.code = inv.code );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_08885
train
T1
v3
Schema: staff (alias: empl)(value, code, date, amount) managers(salary, date, name, code) Task: Retrieve name from staff with salary above the MAX(amount) of managers rows sharing the same level. SQL:
SELECT name FROM staff AS empl WHERE salary > ( SELECT MAX(amount) FROM managers AS mgr WHERE mgr.level = empl.level );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_08886
train
T2
v1
Schema: shipments (alias: shp)(amount, salary, name, level) categories(type, amount, code, salary) Task: Select amount from shipments where status exists in categories for the same status. SQL:
SELECT amount FROM shipments AS shp WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.status = shp.status );
{ "outer_table": "shipments", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "catg", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_08887
train
T2
v1
Schema: departments (alias: dept)(date, salary, id, status) budgets(type, salary, code, value) Task: Find code from departments where level appears in budgets entries with matching id. SQL:
SELECT code FROM departments AS dept WHERE level IN ( SELECT level FROM budgets AS budg WHERE budg.id = dept.id );
{ "outer_table": "departments", "inner_table": "budgets", "outer_alias": "dept", "inner_alias": "budg", "proj_col": "code", "filter_col": "level", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_08888
train
T1
v3
Schema: staff (alias: empl)(amount, value, date, salary) customers(amount, status, name, value) Task: Retrieve id from staff with salary above the MIN(salary) of customers rows sharing the same type. SQL:
SELECT id FROM staff AS empl WHERE salary > ( SELECT MIN(salary) FROM customers AS cust WHERE cust.type = empl.type );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_08889
train
T2
v1
Schema: managers (alias: mgr)(code, level, id, value) products(amount, code, level, status) Task: Retrieve name from managers whose level is found in products rows where level matches the outer record. SQL:
SELECT name FROM managers AS mgr WHERE level IN ( SELECT level FROM products AS prod WHERE prod.level = mgr.level );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_08890
train
T1
v3
Schema: services (alias: srvc)(id, salary, status, level) transactions(code, date, status, amount) Task: Find amount from services where amount exceeds the average amount from transactions for the same type. SQL:
SELECT amount FROM services AS srvc WHERE amount > ( SELECT COUNT(amount) FROM transactions AS txn WHERE txn.type = srvc.type );
{ "outer_table": "services", "inner_table": "transactions", "outer_alias": "srvc", "inner_alias": "txn", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_08891
train
T2
v1
Schema: schedules (alias: schd)(date, status, code, amount) regions(value, status, type, date) Task: Find amount from schedules where id appears in regions entries with matching status. SQL:
SELECT amount FROM schedules AS schd WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.status = schd.status );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_08892
train
T2
v2
Schema: regions (alias: rgn)(type, code, salary, status) schedules(code, amount, name, salary) Task: Find amount from regions where a matching record exists in schedules with the same id. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = rgn.id );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "amount", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_08893
train
T2
v2
Schema: orders (alias: ord)(type, date, amount, salary) employees(id, level, value, amount) Task: Retrieve amount from orders that have at least one corresponding entry in employees sharing the same type. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = ord.type );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "amount", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_08894
train
T1
v3
Schema: departments (alias: dept)(name, level, date, code) invoices(status, amount, code, name) Task: Find code from departments where amount exceeds the average salary from invoices for the same code. SQL:
SELECT code FROM departments AS dept WHERE amount > ( SELECT MIN(salary) FROM invoices AS inv WHERE inv.code = dept.code );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_08895
train
T1
v2
Schema: services (alias: srvc)(type, value, id, level) employees(id, amount, salary, name) Task: Find amount from services where a matching record exists in employees with the same id. SQL:
SELECT amount FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = srvc.id );
{ "outer_table": "services", "inner_table": "employees", "outer_alias": "srvc", "inner_alias": "emp", "proj_col": "amount", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_08896
train
T2
v2
Schema: schedules (alias: schd)(id, type, status, salary) departments(salary, code, name, status) Task: Retrieve amount from schedules that have at least one corresponding entry in departments sharing the same type. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = schd.type );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "amount", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_08897
train
T2
v2
Schema: departments (alias: dept)(status, id, code, level) orders(amount, name, value, type) Task: Retrieve code from departments that have at least one corresponding entry in orders sharing the same type. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = dept.type );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "code", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_08898
train
T1
v3
Schema: employees (alias: emp)(value, name, date, id) services(type, salary, code, date) Task: Find id from employees where amount exceeds the average value from services for the same id. SQL:
SELECT id FROM employees AS emp WHERE amount > ( SELECT MIN(value) FROM services AS srvc WHERE srvc.id = emp.id );
{ "outer_table": "employees", "inner_table": "services", "outer_alias": "emp", "inner_alias": "srvc", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_08899
train
T1