variant
stringclasses
3 values
prompt
stringlengths
163
237
sql
stringlengths
103
143
metadata
unknown
id
stringlengths
21
21
split
stringclasses
1 value
token_group
stringclasses
2 values
v3
Schema: budgets (alias: budg)(name, amount, value, salary) items(code, name, salary, amount) Task: Find id from budgets where salary exceeds the average salary from items for the same id. SQL:
SELECT id FROM budgets AS budg WHERE salary > ( SELECT MIN(salary) FROM items AS lne WHERE lne.id = budg.id );
{ "outer_table": "budgets", "inner_table": "items", "outer_alias": "budg", "inner_alias": "lne", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_04700
train
T2
v2
Schema: transactions (alias: txn)(status, amount, level, code) sales(salary, level, status, amount) Task: Find amount from transactions where a matching record exists in sales with the same level. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = txn.level );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "amount", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_04701
train
T1
v2
Schema: budgets (alias: budg)(value, salary, type, name) sales(name, value, status, id) Task: Find id from budgets where a matching record exists in sales with the same type. SQL:
SELECT id 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": "id", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_04702
train
T2
v2
Schema: requests (alias: ordr)(salary, status, code, id) items(type, id, salary, code) Task: Find value from requests where a matching record exists in items with the same status. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = ordr.status );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "value", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_04703
train
T2
v1
Schema: transactions (alias: txn)(status, date, salary, level) products(value, name, status, amount) Task: Retrieve code from transactions whose id is found in products rows where id matches the outer record. SQL:
SELECT code FROM transactions AS txn WHERE id IN ( SELECT id FROM products AS prod WHERE prod.id = txn.id );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "code", "filter_col": "id", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_04704
train
T1
v1
Schema: requests (alias: ordr)(name, value, amount, date) services(salary, amount, value, status) Task: Find value from requests where type appears in services entries with matching status. SQL:
SELECT value FROM requests AS ordr WHERE type IN ( SELECT type FROM services AS srvc WHERE srvc.status = ordr.status );
{ "outer_table": "requests", "inner_table": "services", "outer_alias": "ordr", "inner_alias": "srvc", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_04705
train
T2
v2
Schema: invoices (alias: inv)(name, value, code, date) managers(name, code, status, type) Task: Retrieve value from invoices that have at least one corresponding entry in managers sharing the same id. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = inv.id );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "value", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_04706
train
T1
v1
Schema: employees (alias: emp)(date, value, type, amount) invoices(status, id, type, value) Task: Find salary from employees where type appears in invoices entries with matching level. SQL:
SELECT salary FROM employees AS emp WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.level = emp.level );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "salary", "filter_col": "type", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_04707
train
T1
v2
Schema: managers (alias: mgr)(level, value, salary, code) shipments(type, date, level, value) Task: Retrieve salary from managers that have at least one corresponding entry in shipments sharing the same code. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = mgr.code );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "salary", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_04708
train
T1
v3
Schema: categories (alias: catg)(code, amount, date, name) employees(type, name, value, amount) Task: Retrieve id from categories with value above the SUM(salary) of employees rows sharing the same type. SQL:
SELECT id FROM categories AS catg WHERE value > ( SELECT SUM(salary) FROM employees AS emp WHERE emp.type = catg.type );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_04709
train
T2
v3
Schema: managers (alias: mgr)(amount, status, value, name) shipments(type, code, name, level) Task: Find salary from managers where salary exceeds the average salary from shipments for the same code. SQL:
SELECT salary FROM managers AS mgr WHERE salary > ( SELECT MAX(salary) FROM shipments AS shp WHERE shp.code = mgr.code );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_04710
train
T1
v2
Schema: items (alias: lne)(level, date, value, id) requests(status, amount, id, date) Task: Retrieve amount from items that have at least one corresponding entry in requests sharing the same status. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = lne.status );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "amount", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_04711
train
T2
v3
Schema: schedules (alias: schd)(level, code, date, value) departments(level, type, value, status) Task: Retrieve id from schedules with amount above the COUNT(value) of departments rows sharing the same status. SQL:
SELECT id FROM schedules AS schd WHERE amount > ( SELECT COUNT(value) FROM departments AS dept WHERE dept.status = schd.status );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_04712
train
T2
v3
Schema: managers (alias: mgr)(date, code, value, id) staff(amount, type, id, code) Task: Find amount from managers where value exceeds the average value from staff for the same id. SQL:
SELECT amount FROM managers AS mgr WHERE value > ( SELECT MIN(value) 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": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_04713
train
T1
v1
Schema: invoices (alias: inv)(name, salary, level, code) staff(value, status, code, type) Task: Retrieve code from invoices whose level is found in staff rows where type matches the outer record. SQL:
SELECT code FROM invoices AS inv WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.type = inv.type );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_04714
train
T1
v2
Schema: regions (alias: rgn)(salary, code, status, date) invoices(code, salary, date, level) Task: Find salary from regions where a matching record exists in invoices with the same status. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = rgn.status );
{ "outer_table": "regions", "inner_table": "invoices", "outer_alias": "rgn", "inner_alias": "inv", "proj_col": "salary", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_04715
train
T2
v3
Schema: invoices (alias: inv)(status, id, value, name) employees(level, type, status, amount) Task: Retrieve value from invoices with amount above the COUNT(value) of employees rows sharing the same id. SQL:
SELECT value FROM invoices AS inv WHERE amount > ( SELECT COUNT(value) FROM employees AS emp WHERE emp.id = inv.id );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_04716
train
T1
v1
Schema: invoices (alias: inv)(value, name, date, amount) managers(name, salary, status, value) Task: Retrieve amount from invoices whose id is found in managers rows where id matches the outer record. SQL:
SELECT amount FROM invoices AS inv WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.id = inv.id );
{ "outer_table": "invoices", "inner_table": "managers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "id", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_04717
train
T1
v1
Schema: requests (alias: ordr)(name, level, amount, date) categories(salary, name, id, amount) Task: Retrieve code from requests whose status is found in categories rows where id matches the outer record. SQL:
SELECT code FROM requests AS ordr WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.id = ordr.id );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_04718
train
T2
v2
Schema: shipments (alias: shp)(level, status, amount, code) invoices(salary, status, level, name) Task: Find id from shipments where a matching record exists in invoices with the same level. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = shp.level );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "id", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_04719
train
T2
v2
Schema: employees (alias: emp)(name, amount, date, type) budgets(type, salary, amount, level) Task: Find code from employees where a matching record exists in budgets with the same status. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.status = emp.status );
{ "outer_table": "employees", "inner_table": "budgets", "outer_alias": "emp", "inner_alias": "budg", "proj_col": "code", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_04720
train
T1
v2
Schema: budgets (alias: budg)(type, status, code, id) requests(value, level, code, name) Task: Find salary from budgets where a matching record exists in requests with the same id. SQL:
SELECT salary FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = budg.id );
{ "outer_table": "budgets", "inner_table": "requests", "outer_alias": "budg", "inner_alias": "ordr", "proj_col": "salary", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_04721
train
T2
v2
Schema: budgets (alias: budg)(code, status, value, salary) categories(id, amount, date, level) Task: Retrieve name from budgets that have at least one corresponding entry in categories sharing the same id. SQL:
SELECT name FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = budg.id );
{ "outer_table": "budgets", "inner_table": "categories", "outer_alias": "budg", "inner_alias": "catg", "proj_col": "name", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_04722
train
T2
v3
Schema: departments (alias: dept)(id, salary, type, code) sales(id, level, salary, date) Task: Retrieve value from departments with amount above the MIN(amount) of sales rows sharing the same type. SQL:
SELECT value FROM departments AS dept WHERE amount > ( SELECT MIN(amount) FROM sales AS sale WHERE sale.type = dept.type );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_04723
train
T1
v1
Schema: transactions (alias: txn)(value, name, status, code) regions(value, id, level, amount) Task: Retrieve code from transactions whose code is found in regions rows where status matches the outer record. SQL:
SELECT code FROM transactions AS txn WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.status = txn.status );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "code", "filter_col": "code", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_04724
train
T1
v1
Schema: shipments (alias: shp)(value, id, salary, name) items(level, code, date, id) Task: Find value from shipments where code appears in items entries with matching status. SQL:
SELECT value FROM shipments AS shp WHERE code IN ( SELECT code FROM items AS lne WHERE lne.status = shp.status );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_04725
train
T2
v2
Schema: services (alias: srvc)(status, salary, id, date) shipments(value, amount, name, status) Task: Retrieve value from services that have at least one corresponding entry in shipments sharing the same code. SQL:
SELECT value FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = srvc.code );
{ "outer_table": "services", "inner_table": "shipments", "outer_alias": "srvc", "inner_alias": "shp", "proj_col": "value", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_04726
train
T2
v2
Schema: managers (alias: mgr)(value, salary, status, amount) orders(level, status, type, code) Task: Find salary from managers where a matching record exists in orders with the same type. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = mgr.type );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "salary", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_04727
train
T1
v2
Schema: warehouses (alias: whs)(type, salary, value, date) sales(code, salary, type, status) Task: Retrieve amount from warehouses that have at least one corresponding entry in sales sharing the same status. SQL:
SELECT amount FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "sales", "outer_alias": "whs", "inner_alias": "sale", "proj_col": "amount", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_04728
train
T2
v1
Schema: orders (alias: ord)(value, name, date, code) invoices(name, status, code, id) Task: Select amount from orders where level exists in invoices for the same level. SQL:
SELECT amount FROM orders AS ord WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.level = ord.level );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "amount", "filter_col": "level", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_04729
train
T1
v1
Schema: items (alias: lne)(date, status, code, value) schedules(amount, value, level, id) Task: Select value from items where type exists in schedules for the same code. SQL:
SELECT value FROM items AS lne WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.code = lne.code );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_04730
train
T2
v3
Schema: requests (alias: ordr)(salary, id, type, code) services(type, salary, amount, value) Task: Find code from requests where amount exceeds the average value from services for the same id. SQL:
SELECT code FROM requests AS ordr WHERE amount > ( SELECT MAX(value) FROM services AS srvc WHERE srvc.id = ordr.id );
{ "outer_table": "requests", "inner_table": "services", "outer_alias": "ordr", "inner_alias": "srvc", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_04731
train
T2
v1
Schema: schedules (alias: schd)(id, code, value, salary) invoices(code, salary, date, level) Task: Find amount from schedules where id appears in invoices entries with matching type. SQL:
SELECT amount FROM schedules AS schd WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.type = schd.type );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_04732
train
T2
v1
Schema: orders (alias: ord)(status, id, code, level) staff(value, code, salary, type) Task: Find name from orders where id appears in staff entries with matching type. SQL:
SELECT name FROM orders AS ord WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.type = ord.type );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "name", "filter_col": "id", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_04733
train
T1
v3
Schema: orders (alias: ord)(type, status, id, name) schedules(type, value, status, date) Task: Find amount from orders where amount exceeds the average value from schedules for the same type. SQL:
SELECT amount FROM orders AS ord WHERE amount > ( SELECT SUM(value) FROM schedules AS schd WHERE schd.type = ord.type );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_04734
train
T1
v3
Schema: products (alias: prod)(type, name, salary, date) transactions(name, salary, code, date) Task: Retrieve code from products with salary above the MAX(salary) of transactions rows sharing the same id. SQL:
SELECT code FROM products AS prod WHERE salary > ( SELECT MAX(salary) FROM transactions AS txn WHERE txn.id = prod.id );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_04735
train
T1
v1
Schema: schedules (alias: schd)(value, amount, code, salary) budgets(value, date, type, status) Task: Select id from schedules where code exists in budgets for the same status. SQL:
SELECT id FROM schedules AS schd WHERE code IN ( SELECT code FROM budgets AS budg WHERE budg.status = schd.status );
{ "outer_table": "schedules", "inner_table": "budgets", "outer_alias": "schd", "inner_alias": "budg", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_04736
train
T2
v3
Schema: departments (alias: dept)(status, value, code, level) staff(level, id, status, amount) Task: Retrieve value from departments with value above the MAX(salary) of staff rows sharing the same code. SQL:
SELECT value FROM departments AS dept WHERE value > ( SELECT MAX(salary) FROM staff AS empl WHERE empl.code = dept.code );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_04737
train
T1
v1
Schema: shipments (alias: shp)(type, level, id, value) sales(status, level, salary, date) Task: Select salary from shipments where id exists in sales for the same id. SQL:
SELECT salary FROM shipments AS shp WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.id = shp.id );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_04738
train
T2
v1
Schema: regions (alias: rgn)(level, code, id, name) products(name, code, level, salary) Task: Find salary from regions where status appears in products entries with matching type. SQL:
SELECT salary FROM regions AS rgn WHERE status IN ( SELECT status FROM products AS prod WHERE prod.type = rgn.type );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_04739
train
T2
v3
Schema: sales (alias: sale)(type, level, code, salary) products(code, type, value, salary) Task: Find amount from sales where value exceeds the average salary from products for the same level. SQL:
SELECT amount FROM sales AS sale WHERE value > ( SELECT MAX(salary) FROM products AS prod WHERE prod.level = sale.level );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_04740
train
T1
v3
Schema: categories (alias: catg)(salary, amount, id, date) orders(salary, name, amount, code) Task: Retrieve name from categories with value above the AVG(salary) of orders rows sharing the same type. SQL:
SELECT name FROM categories AS catg WHERE value > ( SELECT AVG(salary) FROM orders AS ord WHERE ord.type = catg.type );
{ "outer_table": "categories", "inner_table": "orders", "outer_alias": "catg", "inner_alias": "ord", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_04741
train
T2
v1
Schema: employees (alias: emp)(level, type, amount, name) schedules(id, amount, value, type) Task: Find salary from employees where level appears in schedules entries with matching code. SQL:
SELECT salary FROM employees AS emp WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.code = emp.code );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "salary", "filter_col": "level", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_04742
train
T1
v3
Schema: sales (alias: sale)(type, level, id, code) regions(type, salary, value, amount) Task: Retrieve amount from sales with amount above the AVG(salary) of regions rows sharing the same level. SQL:
SELECT amount FROM sales AS sale WHERE amount > ( SELECT AVG(salary) FROM regions AS rgn WHERE rgn.level = sale.level );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_04743
train
T1
v1
Schema: shipments (alias: shp)(id, status, amount, type) services(code, name, date, status) Task: Select amount from shipments where status exists in services for the same type. SQL:
SELECT amount FROM shipments AS shp WHERE status IN ( SELECT status FROM services AS srvc WHERE srvc.type = shp.type );
{ "outer_table": "shipments", "inner_table": "services", "outer_alias": "shp", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "status", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_04744
train
T2
v3
Schema: employees (alias: emp)(id, status, date, level) orders(amount, salary, name, level) Task: Find code from employees where amount exceeds the average salary from orders for the same code. SQL:
SELECT code FROM employees AS emp WHERE amount > ( SELECT SUM(salary) FROM orders AS ord WHERE ord.code = emp.code );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_04745
train
T1
v3
Schema: requests (alias: ordr)(value, name, id, code) products(amount, id, value, date) Task: Retrieve salary from requests with salary above the COUNT(amount) of products rows sharing the same status. SQL:
SELECT salary FROM requests AS ordr WHERE salary > ( SELECT COUNT(amount) FROM products AS prod WHERE prod.status = ordr.status );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_04746
train
T2
v1
Schema: items (alias: lne)(id, amount, status, code) managers(value, name, salary, date) Task: Retrieve value from items whose type is found in managers rows where level matches the outer record. SQL:
SELECT value FROM items AS lne WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.level = lne.level );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_04747
train
T2
v1
Schema: invoices (alias: inv)(value, date, salary, level) transactions(amount, value, code, id) Task: Select amount from invoices where status exists in transactions for the same code. SQL:
SELECT amount FROM invoices AS inv WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.code = inv.code );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "amount", "filter_col": "status", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_04748
train
T1
v2
Schema: customers (alias: cust)(id, date, value, level) schedules(code, name, date, salary) Task: Retrieve id from customers that have at least one corresponding entry in schedules sharing the same level. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = cust.level );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "id", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_04749
train
T1
v2
Schema: managers (alias: mgr)(amount, name, level, date) departments(id, status, level, type) Task: Retrieve code from managers that have at least one corresponding entry in departments sharing the same type. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = mgr.type );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "code", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_04750
train
T1
v3
Schema: budgets (alias: budg)(id, status, date, code) departments(status, date, salary, level) Task: Find salary from budgets where amount exceeds the average value from departments for the same type. SQL:
SELECT salary FROM budgets AS budg WHERE amount > ( SELECT MAX(value) FROM departments AS dept WHERE dept.type = budg.type );
{ "outer_table": "budgets", "inner_table": "departments", "outer_alias": "budg", "inner_alias": "dept", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_04751
train
T2
v1
Schema: budgets (alias: budg)(amount, name, salary, status) customers(id, salary, amount, status) Task: Find value from budgets where code appears in customers entries with matching level. SQL:
SELECT value FROM budgets AS budg WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.level = budg.level );
{ "outer_table": "budgets", "inner_table": "customers", "outer_alias": "budg", "inner_alias": "cust", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_04752
train
T2
v1
Schema: invoices (alias: inv)(type, status, name, amount) accounts(level, amount, status, code) Task: Find salary from invoices where id appears in accounts entries with matching status. SQL:
SELECT salary FROM invoices AS inv WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.status = inv.status );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_04753
train
T1
v3
Schema: warehouses (alias: whs)(salary, name, date, id) sales(date, type, level, amount) Task: Find code from warehouses where salary exceeds the average amount from sales for the same status. SQL:
SELECT code FROM warehouses AS whs WHERE salary > ( SELECT MIN(amount) FROM sales AS sale WHERE sale.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "sales", "outer_alias": "whs", "inner_alias": "sale", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_04754
train
T2
v2
Schema: accounts (alias: acct)(status, code, id, type) categories(id, status, date, code) Task: Retrieve amount from accounts that have at least one corresponding entry in categories sharing the same id. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = acct.id );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "amount", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_04755
train
T1
v3
Schema: managers (alias: mgr)(value, code, type, name) accounts(date, status, salary, amount) Task: Retrieve id from managers with value above the AVG(value) of accounts rows sharing the same type. SQL:
SELECT id FROM managers AS mgr WHERE value > ( SELECT AVG(value) FROM accounts AS acct WHERE acct.type = mgr.type );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_04756
train
T1
v1
Schema: departments (alias: dept)(type, code, salary, level) warehouses(id, code, name, date) Task: Select name from departments where id exists in warehouses for the same status. SQL:
SELECT name FROM departments AS dept WHERE id IN ( SELECT id FROM warehouses AS whs WHERE whs.status = dept.status );
{ "outer_table": "departments", "inner_table": "warehouses", "outer_alias": "dept", "inner_alias": "whs", "proj_col": "name", "filter_col": "id", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_04757
train
T1
v2
Schema: staff (alias: empl)(value, date, status, level) sales(type, id, value, amount) Task: Retrieve salary from staff that have at least one corresponding entry in sales sharing the same id. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = empl.id );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "salary", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_04758
train
T2
v1
Schema: staff (alias: empl)(amount, salary, name, level) sales(level, date, amount, name) Task: Retrieve name from staff whose status is found in sales rows where level matches the outer record. SQL:
SELECT name FROM staff AS empl WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.level = empl.level );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_04759
train
T2
v1
Schema: categories (alias: catg)(value, id, level, name) warehouses(status, id, type, date) Task: Select id from categories where status exists in warehouses for the same level. SQL:
SELECT id FROM categories AS catg WHERE status IN ( SELECT status FROM warehouses AS whs WHERE whs.level = catg.level );
{ "outer_table": "categories", "inner_table": "warehouses", "outer_alias": "catg", "inner_alias": "whs", "proj_col": "id", "filter_col": "status", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_04760
train
T2
v1
Schema: items (alias: lne)(level, value, id, name) categories(name, code, date, id) Task: Retrieve salary from items whose code is found in categories rows where status matches the outer record. SQL:
SELECT salary FROM items AS lne WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.status = lne.status );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_04761
train
T2
v2
Schema: warehouses (alias: whs)(amount, status, salary, id) departments(name, level, salary, code) Task: Retrieve code from warehouses that have at least one corresponding entry in departments sharing the same level. SQL:
SELECT code FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "departments", "outer_alias": "whs", "inner_alias": "dept", "proj_col": "code", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_04762
train
T2
v2
Schema: accounts (alias: acct)(date, type, id, level) customers(status, code, id, date) Task: Retrieve salary from accounts that have at least one corresponding entry in customers sharing the same status. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = acct.status );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "salary", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_04763
train
T1
v2
Schema: customers (alias: cust)(date, type, status, value) managers(type, level, value, id) Task: Retrieve value from customers that have at least one corresponding entry in managers sharing the same level. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = cust.level );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "value", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_04764
train
T1
v3
Schema: departments (alias: dept)(salary, value, amount, id) warehouses(name, id, date, status) Task: Find value from departments where salary exceeds the average salary from warehouses for the same type. SQL:
SELECT value FROM departments AS dept WHERE salary > ( SELECT MAX(salary) FROM warehouses AS whs WHERE whs.type = dept.type );
{ "outer_table": "departments", "inner_table": "warehouses", "outer_alias": "dept", "inner_alias": "whs", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_04765
train
T1
v3
Schema: warehouses (alias: whs)(id, level, value, date) schedules(level, type, code, value) Task: Find salary from warehouses where salary exceeds the average value from schedules for the same type. SQL:
SELECT salary FROM warehouses AS whs WHERE salary > ( SELECT AVG(value) FROM schedules AS schd WHERE schd.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "schedules", "outer_alias": "whs", "inner_alias": "schd", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_04766
train
T2
v2
Schema: budgets (alias: budg)(date, amount, salary, value) employees(status, id, name, type) Task: Find salary from budgets where a matching record exists in employees with the same code. SQL:
SELECT salary FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = budg.code );
{ "outer_table": "budgets", "inner_table": "employees", "outer_alias": "budg", "inner_alias": "emp", "proj_col": "salary", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_04767
train
T2
v2
Schema: services (alias: srvc)(id, name, salary, level) orders(value, name, id, code) Task: Retrieve name from services that have at least one corresponding entry in orders sharing the same type. SQL:
SELECT name FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = srvc.type );
{ "outer_table": "services", "inner_table": "orders", "outer_alias": "srvc", "inner_alias": "ord", "proj_col": "name", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_04768
train
T2
v3
Schema: departments (alias: dept)(date, value, salary, status) schedules(level, id, status, type) Task: Retrieve salary from departments with salary above the MIN(value) of schedules rows sharing the same id. SQL:
SELECT salary FROM departments AS dept WHERE salary > ( SELECT MIN(value) FROM schedules AS schd WHERE schd.id = dept.id );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_04769
train
T1
v2
Schema: departments (alias: dept)(amount, value, salary, name) transactions(date, salary, name, amount) Task: Find name from departments where a matching record exists in transactions with the same code. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = dept.code );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "name", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_04770
train
T1
v3
Schema: requests (alias: ordr)(level, id, status, code) schedules(level, name, status, date) Task: Retrieve code from requests with amount above the SUM(amount) of schedules rows sharing the same status. SQL:
SELECT code FROM requests AS ordr WHERE amount > ( SELECT SUM(amount) FROM schedules AS schd WHERE schd.status = ordr.status );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_04771
train
T2
v3
Schema: sales (alias: sale)(amount, salary, level, type) budgets(code, id, type, date) Task: Find id from sales where salary exceeds the average value from budgets for the same id. SQL:
SELECT id FROM sales AS sale WHERE salary > ( SELECT COUNT(value) FROM budgets AS budg WHERE budg.id = sale.id );
{ "outer_table": "sales", "inner_table": "budgets", "outer_alias": "sale", "inner_alias": "budg", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_04772
train
T1
v3
Schema: staff (alias: empl)(name, code, status, value) requests(amount, salary, date, id) Task: Find salary from staff where value exceeds the average value from requests for the same id. SQL:
SELECT salary FROM staff AS empl WHERE value > ( SELECT SUM(value) FROM requests AS ordr WHERE ordr.id = empl.id );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_04773
train
T2
v1
Schema: managers (alias: mgr)(value, salary, id, code) employees(type, amount, status, salary) Task: Retrieve code from managers whose id is found in employees rows where level matches the outer record. SQL:
SELECT code FROM managers AS mgr WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.level = mgr.level );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "code", "filter_col": "id", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_04774
train
T1
v3
Schema: customers (alias: cust)(code, date, name, value) regions(code, value, type, salary) Task: Find code from customers where value exceeds the average salary from regions for the same status. SQL:
SELECT code FROM customers AS cust WHERE value > ( SELECT SUM(salary) FROM regions AS rgn WHERE rgn.status = cust.status );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_04775
train
T1
v1
Schema: accounts (alias: acct)(name, status, value, level) categories(status, name, type, salary) Task: Select code from accounts where status exists in categories for the same code. SQL:
SELECT code FROM accounts AS acct WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.code = acct.code );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "code", "filter_col": "status", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_04776
train
T1
v3
Schema: warehouses (alias: whs)(amount, date, status, salary) employees(salary, amount, code, level) Task: Find amount from warehouses where salary exceeds the average value from employees for the same id. SQL:
SELECT amount FROM warehouses AS whs WHERE salary > ( SELECT MIN(value) FROM employees AS emp WHERE emp.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "employees", "outer_alias": "whs", "inner_alias": "emp", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_04777
train
T2
v3
Schema: products (alias: prod)(amount, value, id, name) schedules(type, salary, amount, value) Task: Find salary from products where amount exceeds the average value from schedules for the same status. SQL:
SELECT salary FROM products AS prod WHERE amount > ( SELECT AVG(value) FROM schedules AS schd WHERE schd.status = prod.status );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_04778
train
T1
v2
Schema: transactions (alias: txn)(amount, value, type, date) categories(level, value, type, id) Task: Find code from transactions where a matching record exists in categories with the same type. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = txn.type );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "code", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_04779
train
T1
v1
Schema: managers (alias: mgr)(code, value, salary, amount) requests(id, name, date, status) Task: Find code from managers where id appears in requests entries with matching code. SQL:
SELECT code FROM managers AS mgr WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.code = mgr.code );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "code", "filter_col": "id", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_04780
train
T1
v1
Schema: items (alias: lne)(level, code, salary, id) invoices(amount, code, name, status) Task: Select id from items where id exists in invoices for the same level. SQL:
SELECT id FROM items AS lne WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.level = lne.level );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_04781
train
T2
v1
Schema: regions (alias: rgn)(name, date, salary, status) products(name, id, code, date) Task: Select salary from regions where type exists in products for the same type. SQL:
SELECT salary FROM regions AS rgn WHERE type IN ( SELECT type FROM products AS prod WHERE prod.type = rgn.type );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_04782
train
T2
v1
Schema: sales (alias: sale)(type, id, value, level) items(name, status, amount, date) Task: Select code from sales where type exists in items for the same id. SQL:
SELECT code FROM sales AS sale WHERE type IN ( SELECT type FROM items AS lne WHERE lne.id = sale.id );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "code", "filter_col": "type", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_04783
train
T1
v3
Schema: schedules (alias: schd)(name, status, value, date) budgets(date, type, amount, salary) Task: Find code from schedules where value exceeds the average salary from budgets for the same status. SQL:
SELECT code FROM schedules AS schd WHERE value > ( SELECT SUM(salary) FROM budgets AS budg WHERE budg.status = schd.status );
{ "outer_table": "schedules", "inner_table": "budgets", "outer_alias": "schd", "inner_alias": "budg", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_04784
train
T2
v3
Schema: products (alias: prod)(salary, status, id, date) warehouses(level, code, amount, status) Task: Find amount from products where amount exceeds the average value from warehouses for the same id. SQL:
SELECT amount FROM products AS prod WHERE amount > ( SELECT COUNT(value) FROM warehouses AS whs WHERE whs.id = prod.id );
{ "outer_table": "products", "inner_table": "warehouses", "outer_alias": "prod", "inner_alias": "whs", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_04785
train
T1
v1
Schema: services (alias: srvc)(salary, type, value, id) customers(salary, status, date, id) Task: Select amount from services where id exists in customers for the same status. SQL:
SELECT amount FROM services AS srvc WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.status = srvc.status );
{ "outer_table": "services", "inner_table": "customers", "outer_alias": "srvc", "inner_alias": "cust", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_04786
train
T2
v2
Schema: regions (alias: rgn)(type, date, status, value) managers(value, id, status, level) Task: Find name from regions where a matching record exists in managers with the same type. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = rgn.type );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "name", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_04787
train
T2
v3
Schema: accounts (alias: acct)(level, value, salary, name) schedules(salary, type, name, status) Task: Find amount from accounts where salary exceeds the average salary from schedules for the same status. SQL:
SELECT amount FROM accounts AS acct WHERE salary > ( SELECT MIN(salary) FROM schedules AS schd WHERE schd.status = acct.status );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_04788
train
T1
v3
Schema: products (alias: prod)(code, type, name, id) invoices(salary, status, amount, value) Task: Find name from products where salary exceeds the average amount from invoices for the same type. SQL:
SELECT name FROM products AS prod WHERE salary > ( SELECT AVG(amount) FROM invoices AS inv WHERE inv.type = prod.type );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_04789
train
T1
v1
Schema: customers (alias: cust)(code, level, id, type) shipments(name, salary, value, code) Task: Retrieve value from customers whose code is found in shipments rows where code matches the outer record. SQL:
SELECT value FROM customers AS cust WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.code = cust.code );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_04790
train
T1
v3
Schema: products (alias: prod)(name, amount, code, value) invoices(type, status, salary, id) Task: Find value from products where value exceeds the average value from invoices for the same code. SQL:
SELECT value FROM products AS prod WHERE value > ( SELECT AVG(value) FROM invoices AS inv WHERE inv.code = prod.code );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_04791
train
T1
v1
Schema: sales (alias: sale)(salary, id, name, level) managers(type, level, code, amount) Task: Find amount from sales where id appears in managers entries with matching status. SQL:
SELECT amount FROM sales AS sale WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.status = sale.status );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_04792
train
T1
v3
Schema: categories (alias: catg)(amount, value, type, name) sales(date, type, name, amount) Task: Find value from categories where value exceeds the average amount from sales for the same type. SQL:
SELECT value FROM categories AS catg WHERE value > ( SELECT SUM(amount) FROM sales AS sale WHERE sale.type = catg.type );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_04793
train
T2
v3
Schema: warehouses (alias: whs)(value, salary, type, name) orders(type, value, level, status) Task: Retrieve amount from warehouses with value above the AVG(salary) of orders rows sharing the same status. SQL:
SELECT amount FROM warehouses AS whs WHERE value > ( SELECT AVG(salary) FROM orders AS ord WHERE ord.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "orders", "outer_alias": "whs", "inner_alias": "ord", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_04794
train
T2
v3
Schema: products (alias: prod)(amount, level, value, id) transactions(amount, code, salary, level) Task: Retrieve salary from products with value above the AVG(salary) of transactions rows sharing the same status. SQL:
SELECT salary FROM products AS prod WHERE value > ( SELECT AVG(salary) FROM transactions AS txn WHERE txn.status = prod.status );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_04795
train
T1
v1
Schema: requests (alias: ordr)(type, level, code, name) categories(date, id, code, salary) Task: Select amount from requests where type exists in categories for the same status. SQL:
SELECT amount FROM requests AS ordr WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.status = ordr.status );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_04796
train
T2
v3
Schema: invoices (alias: inv)(level, salary, name, code) employees(name, date, amount, status) Task: Find value from invoices where value exceeds the average value from employees for the same status. SQL:
SELECT value FROM invoices AS inv WHERE value > ( SELECT SUM(value) FROM employees AS emp WHERE emp.status = inv.status );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_04797
train
T1
v2
Schema: services (alias: srvc)(code, amount, id, status) departments(date, code, value, level) Task: Retrieve id from services that have at least one corresponding entry in departments sharing the same type. SQL:
SELECT id FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = srvc.type );
{ "outer_table": "services", "inner_table": "departments", "outer_alias": "srvc", "inner_alias": "dept", "proj_col": "id", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_04798
train
T2
v3
Schema: employees (alias: emp)(level, type, code, name) products(code, name, type, amount) Task: Find amount from employees where value exceeds the average salary from products for the same level. SQL:
SELECT amount FROM employees AS emp WHERE value > ( SELECT AVG(salary) FROM products AS prod WHERE prod.level = emp.level );
{ "outer_table": "employees", "inner_table": "products", "outer_alias": "emp", "inner_alias": "prod", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_04799
train
T1