variant
stringclasses
3 values
prompt
stringlengths
165
235
sql
stringlengths
104
143
metadata
unknown
id
stringlengths
15
15
split
stringclasses
1 value
token_group
stringclasses
2 values
v1
Schema: accounts (alias: mgr)(value, id, date, amount) shipments(salary, status, date, value) Task: Retrieve amount from accounts whose level is found in shipments rows where type matches the outer record. SQL:
SELECT amount FROM accounts AS mgr WHERE level IN ( SELECT level FROM shipments AS empl WHERE empl.type = mgr.type );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "amount", "filter_col": "level", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_train_00500
train
T1
v2
Schema: regions (alias: catg)(amount, salary, status, code) tasks(code, name, type, level) Task: Find value from regions where a matching record exists in tasks with the same code. SQL:
SELECT value FROM regions AS catg WHERE EXISTS ( SELECT 1 FROM tasks AS acct WHERE acct.code = catg.code );
{ "outer_table": "regions", "inner_table": "tasks", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "value", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_train_00501
train
T2
v2
Schema: warehouses (alias: ord)(level, name, code, id) orders(status, code, amount, id) Task: Retrieve amount from warehouses that have at least one corresponding entry in orders sharing the same status. SQL:
SELECT amount FROM warehouses AS ord WHERE EXISTS ( SELECT 1 FROM orders AS shp WHERE shp.status = ord.status );
{ "outer_table": "warehouses", "inner_table": "orders", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "amount", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_train_00502
train
T1
v1
Schema: suppliers (alias: empl)(type, id, code, value) orders(salary, value, date, id) Task: Find salary from suppliers where level appears in orders entries with matching code. SQL:
SELECT salary FROM suppliers AS empl WHERE level IN ( SELECT level FROM orders AS srvc WHERE srvc.code = empl.code );
{ "outer_table": "suppliers", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "level", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_train_00503
train
T2
v1
Schema: tasks (alias: sale)(type, amount, code, value) branches(level, name, status, code) Task: Select code from tasks where level exists in branches for the same id. SQL:
SELECT code FROM tasks AS sale WHERE level IN ( SELECT level FROM branches AS prod WHERE prod.id = sale.id );
{ "outer_table": "tasks", "inner_table": "branches", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "code", "filter_col": "level", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_train_00504
train
T1
v2
Schema: warehouses (alias: budg)(value, type, level, salary) transactions(id, date, code, type) Task: Retrieve value from warehouses that have at least one corresponding entry in transactions sharing the same type. SQL:
SELECT value FROM warehouses AS budg WHERE EXISTS ( SELECT 1 FROM transactions AS ord WHERE ord.type = budg.type );
{ "outer_table": "warehouses", "inner_table": "transactions", "outer_alias": "budg", "inner_alias": "ord", "proj_col": "value", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_train_00505
train
T2
v3
Schema: transactions (alias: ordr)(type, amount, code, name) invoices(salary, level, status, type) Task: Retrieve code from transactions with value above the AVG(value) of invoices rows sharing the same level. SQL:
SELECT code FROM transactions AS ordr WHERE value > ( SELECT AVG(value) FROM invoices AS catg WHERE catg.level = ordr.level );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_train_00506
train
T2
v3
Schema: regions (alias: rgn)(code, id, value, salary) employees(name, date, level, amount) Task: Find code from regions where salary exceeds the average amount from employees for the same id. SQL:
SELECT code FROM regions AS rgn WHERE salary > ( SELECT MAX(amount) FROM employees AS emp WHERE emp.id = rgn.id );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_train_00507
train
T2
v3
Schema: projects (alias: catg)(status, type, name, code) invoices(name, salary, id, level) Task: Find name from projects where amount exceeds the average salary from invoices for the same id. SQL:
SELECT name FROM projects AS catg WHERE amount > ( SELECT AVG(salary) FROM invoices AS prod WHERE prod.id = catg.id );
{ "outer_table": "projects", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_train_00508
train
T2
v2
Schema: customers (alias: schd)(date, code, value, id) orders(salary, value, amount, date) Task: Retrieve value from customers that have at least one corresponding entry in orders sharing the same id. SQL:
SELECT value FROM customers AS schd WHERE EXISTS ( SELECT 1 FROM orders AS ordr WHERE ordr.id = schd.id );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "value", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_train_00509
train
T2
v2
Schema: shipments (alias: txn)(type, code, salary, name) transactions(salary, code, date, level) Task: Retrieve amount from shipments that have at least one corresponding entry in transactions sharing the same id. SQL:
SELECT amount FROM shipments AS txn WHERE EXISTS ( SELECT 1 FROM transactions AS sale WHERE sale.id = txn.id );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "amount", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_train_00510
train
T1
v3
Schema: transactions (alias: catg)(status, code, id, date) departments(type, status, date, level) Task: Retrieve amount from transactions with value above the MAX(amount) of departments rows sharing the same status. SQL:
SELECT amount FROM transactions AS catg WHERE value > ( SELECT MAX(amount) FROM departments AS rgn WHERE rgn.status = catg.status );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_train_00511
train
T2
v1
Schema: employees (alias: shp)(salary, id, date, amount) departments(amount, code, salary, level) Task: Retrieve salary from employees whose id is found in departments rows where status matches the outer record. SQL:
SELECT salary FROM employees AS shp WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.status = shp.status );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "shp", "inner_alias": "dept", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_train_00512
train
T2
v1
Schema: products (alias: budg)(code, value, salary, level) regions(amount, status, salary, level) Task: Find name from products where status appears in regions entries with matching code. SQL:
SELECT name FROM products AS budg WHERE status IN ( SELECT status FROM regions AS whs WHERE whs.code = budg.code );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "budg", "inner_alias": "whs", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_train_00513
train
T2
v3
Schema: employees (alias: emp)(level, status, type, amount) orders(type, id, level, name) Task: Find code from employees where salary exceeds the average amount from orders for the same type. SQL:
SELECT code FROM employees AS emp WHERE salary > ( SELECT COUNT(amount) FROM orders AS txn WHERE txn.type = emp.type );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_train_00514
train
T1
v1
Schema: categories (alias: mgr)(status, type, name, code) accounts(type, code, level, amount) Task: Find salary from categories where id appears in accounts entries with matching code. SQL:
SELECT salary FROM categories AS mgr WHERE id IN ( SELECT id FROM accounts AS sale WHERE sale.code = mgr.code );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_train_00515
train
T1
v3
Schema: accounts (alias: txn)(amount, type, salary, date) categories(value, level, status, date) Task: Retrieve name from accounts with value above the MAX(salary) of categories rows sharing the same code. SQL:
SELECT name FROM accounts AS txn WHERE value > ( SELECT MAX(salary) FROM categories AS shp WHERE shp.code = txn.code );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_train_00516
train
T1
v3
Schema: categories (alias: shp)(value, amount, name, type) transactions(code, level, value, name) Task: Find id from categories where amount exceeds the average amount from transactions for the same type. SQL:
SELECT id FROM categories AS shp WHERE amount > ( SELECT COUNT(amount) FROM transactions AS txn WHERE txn.type = shp.type );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_train_00517
train
T2
v1
Schema: employees (alias: rgn)(type, code, salary, amount) transactions(level, status, amount, salary) Task: Find value from employees where status appears in transactions entries with matching code. SQL:
SELECT value FROM employees AS rgn WHERE status IN ( SELECT status FROM transactions AS shp WHERE shp.code = rgn.code );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "value", "filter_col": "status", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_train_00518
train
T2
v3
Schema: projects (alias: txn)(id, name, date, level) tasks(id, type, level, value) Task: Retrieve name from projects with value above the MAX(value) of tasks rows sharing the same code. SQL:
SELECT name FROM projects AS txn WHERE value > ( SELECT MAX(value) FROM tasks AS emp WHERE emp.code = txn.code );
{ "outer_table": "projects", "inner_table": "tasks", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_train_00519
train
T1
v1
Schema: suppliers (alias: empl)(date, salary, amount, type) branches(code, salary, status, value) Task: Find salary from suppliers where level appears in branches entries with matching code. SQL:
SELECT salary FROM suppliers AS empl WHERE level IN ( SELECT level FROM branches AS ord WHERE ord.code = empl.code );
{ "outer_table": "suppliers", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "salary", "filter_col": "level", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_train_00520
train
T2
v3
Schema: suppliers (alias: ord)(status, value, type, name) transactions(name, value, amount, salary) Task: Find amount from suppliers where value exceeds the average amount from transactions for the same code. SQL:
SELECT amount FROM suppliers AS ord WHERE value > ( SELECT MAX(amount) FROM transactions AS empl WHERE empl.code = ord.code );
{ "outer_table": "suppliers", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_train_00521
train
T1
v2
Schema: customers (alias: txn)(id, date, amount, salary) transactions(salary, id, date, code) Task: Retrieve salary from customers that have at least one corresponding entry in transactions sharing the same id. SQL:
SELECT salary FROM customers AS txn WHERE EXISTS ( SELECT 1 FROM transactions AS prod WHERE prod.id = txn.id );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "salary", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_train_00522
train
T1
v2
Schema: customers (alias: dept)(date, level, id, code) invoices(value, status, salary, type) Task: Retrieve id from customers that have at least one corresponding entry in invoices sharing the same level. SQL:
SELECT id FROM customers AS dept WHERE EXISTS ( SELECT 1 FROM invoices AS ordr WHERE ordr.level = dept.level );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "id", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_train_00523
train
T1
v3
Schema: categories (alias: emp)(amount, code, date, salary) employees(type, id, name, status) Task: Find code from categories where salary exceeds the average salary from employees for the same type. SQL:
SELECT code FROM categories AS emp WHERE salary > ( SELECT MAX(salary) FROM employees AS inv WHERE inv.type = emp.type );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_train_00524
train
T1
v3
Schema: projects (alias: mgr)(salary, amount, type, status) products(level, code, status, type) Task: Find salary from projects where value exceeds the average salary from products for the same type. SQL:
SELECT salary FROM projects AS mgr WHERE value > ( SELECT COUNT(salary) FROM products AS srvc WHERE srvc.type = mgr.type );
{ "outer_table": "projects", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_train_00525
train
T1
v1
Schema: orders (alias: ordr)(level, type, amount, name) products(id, code, type, level) Task: Retrieve name from orders whose type is found in products rows where code matches the outer record. SQL:
SELECT name FROM orders AS ordr WHERE type IN ( SELECT type FROM products AS lne WHERE lne.code = ordr.code );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_train_00526
train
T2
v1
Schema: customers (alias: emp)(salary, name, status, type) regions(name, id, salary, level) Task: Select id from customers where level exists in regions for the same id. SQL:
SELECT id FROM customers AS emp WHERE level IN ( SELECT level FROM regions AS shp WHERE shp.id = emp.id );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "id", "filter_col": "level", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_train_00527
train
T1
v2
Schema: departments (alias: mgr)(status, code, id, name) employees(code, level, type, amount) Task: Retrieve amount from departments that have at least one corresponding entry in employees sharing the same id. SQL:
SELECT amount FROM departments AS mgr WHERE EXISTS ( SELECT 1 FROM employees AS inv WHERE inv.id = mgr.id );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "inv", "proj_col": "amount", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_train_00528
train
T1
v1
Schema: shipments (alias: ordr)(status, id, salary, level) customers(amount, date, id, status) Task: Retrieve id from shipments whose code is found in customers rows where level matches the outer record. SQL:
SELECT id FROM shipments AS ordr WHERE code IN ( SELECT code FROM customers AS srvc WHERE srvc.level = ordr.level );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "srvc", "proj_col": "id", "filter_col": "code", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_train_00529
train
T2
v2
Schema: regions (alias: inv)(code, level, id, value) products(amount, name, date, id) Task: Find salary from regions where a matching record exists in products with the same level. SQL:
SELECT salary FROM regions AS inv WHERE EXISTS ( SELECT 1 FROM products AS emp WHERE emp.level = inv.level );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "salary", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_train_00530
train
T1
v1
Schema: transactions (alias: ordr)(amount, salary, name, code) projects(level, id, salary, name) Task: Retrieve code from transactions whose type is found in projects rows where code matches the outer record. SQL:
SELECT code FROM transactions AS ordr WHERE type IN ( SELECT type FROM projects AS ord WHERE ord.code = ordr.code );
{ "outer_table": "transactions", "inner_table": "projects", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_train_00531
train
T2
v2
Schema: categories (alias: rgn)(level, name, code, type) regions(name, type, salary, status) Task: Retrieve amount from categories that have at least one corresponding entry in regions sharing the same id. SQL:
SELECT amount FROM categories AS rgn WHERE EXISTS ( SELECT 1 FROM regions AS dept WHERE dept.id = rgn.id );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "amount", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_train_00532
train
T2
v2
Schema: categories (alias: empl)(code, date, status, level) transactions(date, code, amount, id) Task: Retrieve code from categories that have at least one corresponding entry in transactions sharing the same id. SQL:
SELECT code FROM categories AS empl WHERE EXISTS ( SELECT 1 FROM transactions AS emp WHERE emp.id = empl.id );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "code", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_train_00533
train
T2
v2
Schema: shipments (alias: ord)(type, date, code, value) orders(name, status, amount, salary) Task: Retrieve salary from shipments that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT salary FROM shipments AS ord WHERE EXISTS ( SELECT 1 FROM orders AS mgr WHERE mgr.level = ord.level );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "salary", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_train_00534
train
T1
v2
Schema: categories (alias: inv)(level, value, status, salary) invoices(amount, level, type, salary) Task: Find salary from categories where a matching record exists in invoices with the same id. SQL:
SELECT salary FROM categories AS inv WHERE EXISTS ( SELECT 1 FROM invoices AS lne WHERE lne.id = inv.id );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "salary", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_train_00535
train
T1
v2
Schema: categories (alias: cust)(id, level, amount, salary) invoices(code, name, amount, status) Task: Find name from categories where a matching record exists in invoices with the same id. SQL:
SELECT name FROM categories AS cust WHERE EXISTS ( SELECT 1 FROM invoices AS catg WHERE catg.id = cust.id );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "name", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_train_00536
train
T1
v1
Schema: tasks (alias: shp)(amount, code, date, type) invoices(salary, id, status, amount) Task: Find name from tasks where id appears in invoices entries with matching id. SQL:
SELECT name FROM tasks AS shp WHERE id IN ( SELECT id FROM invoices AS rgn WHERE rgn.id = shp.id );
{ "outer_table": "tasks", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "name", "filter_col": "id", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_train_00537
train
T2
v2
Schema: shipments (alias: acct)(date, type, name, amount) categories(date, salary, id, name) Task: Find value from shipments where a matching record exists in categories with the same level. SQL:
SELECT value FROM shipments AS acct WHERE EXISTS ( SELECT 1 FROM categories AS cust WHERE cust.level = acct.level );
{ "outer_table": "shipments", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "value", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_train_00538
train
T1
v3
Schema: warehouses (alias: ordr)(status, id, type, amount) projects(status, amount, name, value) Task: Retrieve id from warehouses with salary above the MIN(salary) of projects rows sharing the same type. SQL:
SELECT id FROM warehouses AS ordr WHERE salary > ( SELECT MIN(salary) FROM projects AS txn WHERE txn.type = ordr.type );
{ "outer_table": "warehouses", "inner_table": "projects", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_train_00539
train
T2
v3
Schema: shipments (alias: sale)(value, amount, salary, id) transactions(salary, name, type, status) Task: Find value from shipments where value exceeds the average value from transactions for the same status. SQL:
SELECT value FROM shipments AS sale WHERE value > ( SELECT SUM(value) FROM transactions AS txn WHERE txn.status = sale.status );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_train_00540
train
T1
v2
Schema: invoices (alias: emp)(value, amount, type, id) projects(status, date, salary, code) Task: Find amount from invoices where a matching record exists in projects with the same id. SQL:
SELECT amount FROM invoices AS emp WHERE EXISTS ( SELECT 1 FROM projects AS sale WHERE sale.id = emp.id );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "emp", "inner_alias": "sale", "proj_col": "amount", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_train_00541
train
T1
v2
Schema: categories (alias: emp)(date, code, status, value) tasks(name, id, value, code) Task: Retrieve value from categories that have at least one corresponding entry in tasks sharing the same type. SQL:
SELECT value FROM categories AS emp WHERE EXISTS ( SELECT 1 FROM tasks AS lne WHERE lne.type = emp.type );
{ "outer_table": "categories", "inner_table": "tasks", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "value", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_train_00542
train
T1
v1
Schema: transactions (alias: empl)(type, status, id, level) customers(status, type, salary, code) Task: Find code from transactions where code appears in customers entries with matching code. SQL:
SELECT code FROM transactions AS empl WHERE code IN ( SELECT code FROM customers AS inv WHERE inv.code = empl.code );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_train_00543
train
T2
v2
Schema: categories (alias: lne)(level, amount, salary, value) employees(value, id, code, amount) Task: Retrieve amount from categories that have at least one corresponding entry in employees sharing the same level. SQL:
SELECT amount FROM categories AS lne WHERE EXISTS ( SELECT 1 FROM employees AS acct WHERE acct.level = lne.level );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "amount", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_train_00544
train
T2
v1
Schema: shipments (alias: sale)(id, name, amount, salary) orders(value, salary, level, code) Task: Retrieve id from shipments whose code is found in orders rows where level matches the outer record. SQL:
SELECT id FROM shipments AS sale WHERE code IN ( SELECT code FROM orders AS srvc WHERE srvc.level = sale.level );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "srvc", "proj_col": "id", "filter_col": "code", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_train_00545
train
T1
v1
Schema: products (alias: ordr)(date, value, salary, type) suppliers(status, id, date, type) Task: Find name from products where status appears in suppliers entries with matching status. SQL:
SELECT name FROM products AS ordr WHERE status IN ( SELECT status FROM suppliers AS txn WHERE txn.status = ordr.status );
{ "outer_table": "products", "inner_table": "suppliers", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_train_00546
train
T2
v3
Schema: customers (alias: catg)(date, status, level, code) shipments(code, level, value, amount) Task: Retrieve id from customers with amount above the AVG(amount) of shipments rows sharing the same code. SQL:
SELECT id FROM customers AS catg WHERE amount > ( SELECT AVG(amount) FROM shipments AS ord WHERE ord.code = catg.code );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "catg", "inner_alias": "ord", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_train_00547
train
T2
v2
Schema: categories (alias: ordr)(date, amount, status, level) transactions(name, code, date, status) Task: Retrieve value from categories that have at least one corresponding entry in transactions sharing the same type. SQL:
SELECT value FROM categories AS ordr WHERE EXISTS ( SELECT 1 FROM transactions AS catg WHERE catg.type = ordr.type );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "value", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_train_00548
train
T2
v1
Schema: orders (alias: srvc)(name, salary, status, level) employees(date, amount, type, salary) Task: Find amount from orders where id appears in employees entries with matching id. SQL:
SELECT amount FROM orders AS srvc WHERE id IN ( SELECT id FROM employees AS empl WHERE empl.id = srvc.id );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "srvc", "inner_alias": "empl", "proj_col": "amount", "filter_col": "id", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_train_00549
train
T2
v1
Schema: branches (alias: lne)(name, code, type, date) customers(name, date, level, salary) Task: Find name from branches where type appears in customers entries with matching code. SQL:
SELECT name FROM branches AS lne WHERE type IN ( SELECT type FROM customers AS txn WHERE txn.code = lne.code );
{ "outer_table": "branches", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_train_00550
train
T2
v1
Schema: accounts (alias: rgn)(amount, type, name, value) projects(name, amount, status, type) Task: Find code from accounts where level appears in projects entries with matching code. SQL:
SELECT code FROM accounts AS rgn WHERE level IN ( SELECT level FROM projects AS dept WHERE dept.code = rgn.code );
{ "outer_table": "accounts", "inner_table": "projects", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_train_00551
train
T2
v3
Schema: invoices (alias: whs)(salary, name, type, value) projects(date, type, status, amount) Task: Retrieve id from invoices with salary above the COUNT(value) of projects rows sharing the same code. SQL:
SELECT id FROM invoices AS whs WHERE salary > ( SELECT COUNT(value) FROM projects AS inv WHERE inv.code = whs.code );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "whs", "inner_alias": "inv", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_train_00552
train
T2
v1
Schema: regions (alias: shp)(amount, code, status, type) warehouses(level, salary, status, amount) Task: Find id from regions where code appears in warehouses entries with matching type. SQL:
SELECT id FROM regions AS shp WHERE code IN ( SELECT code FROM warehouses AS empl WHERE empl.type = shp.type );
{ "outer_table": "regions", "inner_table": "warehouses", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "id", "filter_col": "code", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_train_00553
train
T2
v2
Schema: shipments (alias: mgr)(type, code, amount, id) orders(date, type, status, amount) Task: Retrieve value from shipments that have at least one corresponding entry in orders sharing the same status. SQL:
SELECT value FROM shipments AS mgr WHERE EXISTS ( SELECT 1 FROM orders AS whs WHERE whs.status = mgr.status );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "whs", "proj_col": "value", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_train_00554
train
T1
v3
Schema: suppliers (alias: acct)(salary, name, type, date) branches(name, status, salary, value) Task: Retrieve name from suppliers with amount above the SUM(salary) of branches rows sharing the same id. SQL:
SELECT name FROM suppliers AS acct WHERE amount > ( SELECT SUM(salary) FROM branches AS ordr WHERE ordr.id = acct.id );
{ "outer_table": "suppliers", "inner_table": "branches", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_train_00555
train
T1
v1
Schema: tasks (alias: empl)(date, salary, id, code) accounts(id, status, code, amount) Task: Find value from tasks where code appears in accounts entries with matching status. SQL:
SELECT value FROM tasks AS empl WHERE code IN ( SELECT code FROM accounts AS cust WHERE cust.status = empl.status );
{ "outer_table": "tasks", "inner_table": "accounts", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_train_00556
train
T2
v2
Schema: projects (alias: schd)(status, salary, date, level) warehouses(salary, level, date, id) Task: Find name from projects where a matching record exists in warehouses with the same status. SQL:
SELECT name FROM projects AS schd WHERE EXISTS ( SELECT 1 FROM warehouses AS srvc WHERE srvc.status = schd.status );
{ "outer_table": "projects", "inner_table": "warehouses", "outer_alias": "schd", "inner_alias": "srvc", "proj_col": "name", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_train_00557
train
T2
v2
Schema: tasks (alias: srvc)(value, level, id, type) regions(code, value, name, id) Task: Retrieve value from tasks that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT value FROM tasks AS srvc WHERE EXISTS ( SELECT 1 FROM regions AS schd WHERE schd.level = srvc.level );
{ "outer_table": "tasks", "inner_table": "regions", "outer_alias": "srvc", "inner_alias": "schd", "proj_col": "value", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_train_00558
train
T2
v2
Schema: orders (alias: inv)(name, salary, code, level) regions(id, type, salary, code) Task: Retrieve id from orders that have at least one corresponding entry in regions sharing the same status. SQL:
SELECT id FROM orders AS inv WHERE EXISTS ( SELECT 1 FROM regions AS ordr WHERE ordr.status = inv.status );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "id", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_train_00559
train
T1
v1
Schema: branches (alias: whs)(level, id, amount, type) shipments(level, date, amount, salary) Task: Select id from branches where type exists in shipments for the same level. SQL:
SELECT id FROM branches AS whs WHERE type IN ( SELECT type FROM shipments AS schd WHERE schd.level = whs.level );
{ "outer_table": "branches", "inner_table": "shipments", "outer_alias": "whs", "inner_alias": "schd", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_train_00560
train
T2
v2
Schema: tasks (alias: ordr)(status, code, amount, salary) orders(status, name, date, level) Task: Retrieve amount from tasks that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT amount FROM tasks AS ordr WHERE EXISTS ( SELECT 1 FROM orders AS srvc WHERE srvc.level = ordr.level );
{ "outer_table": "tasks", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "srvc", "proj_col": "amount", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_train_00561
train
T2
v1
Schema: customers (alias: acct)(type, value, salary, code) invoices(name, value, level, status) Task: Retrieve code from customers whose type is found in invoices rows where code matches the outer record. SQL:
SELECT code FROM customers AS acct WHERE type IN ( SELECT type FROM invoices AS txn WHERE txn.code = acct.code );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_train_00562
train
T1
v2
Schema: invoices (alias: rgn)(name, salary, id, level) warehouses(code, name, type, level) Task: Find value from invoices where a matching record exists in warehouses with the same id. SQL:
SELECT value FROM invoices AS rgn WHERE EXISTS ( SELECT 1 FROM warehouses AS schd WHERE schd.id = rgn.id );
{ "outer_table": "invoices", "inner_table": "warehouses", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "value", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_train_00563
train
T2
v1
Schema: shipments (alias: ord)(name, status, value, date) regions(level, value, name, salary) Task: Retrieve amount from shipments whose code is found in regions rows where status matches the outer record. SQL:
SELECT amount FROM shipments AS ord WHERE code IN ( SELECT code FROM regions AS empl WHERE empl.status = ord.status );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_train_00564
train
T1
v3
Schema: customers (alias: sale)(salary, type, status, date) warehouses(amount, salary, type, id) Task: Retrieve salary from customers with amount above the MIN(amount) of warehouses rows sharing the same status. SQL:
SELECT salary FROM customers AS sale WHERE amount > ( SELECT MIN(amount) FROM warehouses AS mgr WHERE mgr.status = sale.status );
{ "outer_table": "customers", "inner_table": "warehouses", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_train_00565
train
T1
v1
Schema: tasks (alias: acct)(name, date, salary, type) invoices(name, level, type, id) Task: Select value from tasks where status exists in invoices for the same type. SQL:
SELECT value FROM tasks AS acct WHERE status IN ( SELECT status FROM invoices AS whs WHERE whs.type = acct.type );
{ "outer_table": "tasks", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "whs", "proj_col": "value", "filter_col": "status", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_train_00566
train
T1
v1
Schema: customers (alias: inv)(status, value, date, id) invoices(amount, salary, date, status) Task: Retrieve amount from customers whose code is found in invoices rows where status matches the outer record. SQL:
SELECT amount FROM customers AS inv WHERE code IN ( SELECT code FROM invoices AS rgn WHERE rgn.status = inv.status );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_train_00567
train
T1
v2
Schema: employees (alias: cust)(id, name, value, type) regions(status, value, amount, id) Task: Retrieve id from employees that have at least one corresponding entry in regions sharing the same status. SQL:
SELECT id FROM employees AS cust WHERE EXISTS ( SELECT 1 FROM regions AS budg WHERE budg.status = cust.status );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "budg", "proj_col": "id", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_train_00568
train
T1
v3
Schema: categories (alias: schd)(name, amount, value, level) tasks(value, name, amount, code) Task: Find value from categories where amount exceeds the average amount from tasks for the same type. SQL:
SELECT value FROM categories AS schd WHERE amount > ( SELECT COUNT(amount) FROM tasks AS lne WHERE lne.type = schd.type );
{ "outer_table": "categories", "inner_table": "tasks", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_train_00569
train
T2
v3
Schema: branches (alias: dept)(date, value, id, type) customers(code, name, amount, date) Task: Find code from branches where value exceeds the average salary from customers for the same level. SQL:
SELECT code FROM branches AS dept WHERE value > ( SELECT SUM(salary) FROM customers AS budg WHERE budg.level = dept.level );
{ "outer_table": "branches", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "budg", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_train_00570
train
T1
v2
Schema: transactions (alias: ord)(value, status, salary, amount) regions(date, salary, code, type) Task: Find value from transactions where a matching record exists in regions with the same level. SQL:
SELECT value FROM transactions AS ord WHERE EXISTS ( SELECT 1 FROM regions AS whs WHERE whs.level = ord.level );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "whs", "proj_col": "value", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_train_00571
train
T1
v1
Schema: regions (alias: lne)(name, code, id, date) categories(name, salary, level, date) Task: Select amount from regions where level exists in categories for the same status. SQL:
SELECT amount FROM regions AS lne WHERE level IN ( SELECT level FROM categories AS emp WHERE emp.status = lne.status );
{ "outer_table": "regions", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_train_00572
train
T2
v2
Schema: accounts (alias: ord)(name, salary, code, id) shipments(type, date, amount, value) Task: Retrieve amount from accounts that have at least one corresponding entry in shipments sharing the same type. SQL:
SELECT amount FROM accounts AS ord WHERE EXISTS ( SELECT 1 FROM shipments AS sale WHERE sale.type = ord.type );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "amount", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_train_00573
train
T1
v1
Schema: regions (alias: acct)(id, name, date, level) suppliers(value, code, date, id) Task: Find amount from regions where id appears in suppliers entries with matching status. SQL:
SELECT amount FROM regions AS acct WHERE id IN ( SELECT id FROM suppliers AS schd WHERE schd.status = acct.status );
{ "outer_table": "regions", "inner_table": "suppliers", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_train_00574
train
T1
v3
Schema: categories (alias: inv)(level, status, value, amount) products(code, status, amount, value) Task: Find salary from categories where value exceeds the average amount from products for the same type. SQL:
SELECT salary FROM categories AS inv WHERE value > ( SELECT COUNT(amount) FROM products AS budg WHERE budg.type = inv.type );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "inv", "inner_alias": "budg", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_train_00575
train
T1
v2
Schema: departments (alias: acct)(level, date, status, name) invoices(status, code, name, id) Task: Retrieve code from departments that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT code FROM departments AS acct WHERE EXISTS ( SELECT 1 FROM invoices AS shp WHERE shp.type = acct.type );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "code", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_train_00576
train
T1
v2
Schema: transactions (alias: inv)(value, level, name, type) categories(level, status, value, id) Task: Retrieve name from transactions that have at least one corresponding entry in categories sharing the same type. SQL:
SELECT name FROM transactions AS inv WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = inv.type );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "name", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_train_00577
train
T1
v1
Schema: branches (alias: empl)(type, code, id, name) invoices(date, level, name, type) Task: Find salary from branches where type appears in invoices entries with matching id. SQL:
SELECT salary FROM branches AS empl WHERE type IN ( SELECT type FROM invoices AS prod WHERE prod.id = empl.id );
{ "outer_table": "branches", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "salary", "filter_col": "type", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_train_00578
train
T2
v3
Schema: orders (alias: lne)(date, value, status, level) categories(value, id, amount, type) Task: Find id from orders where value exceeds the average amount from categories for the same id. SQL:
SELECT id FROM orders AS lne WHERE value > ( SELECT AVG(amount) FROM categories AS whs WHERE whs.id = lne.id );
{ "outer_table": "orders", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "whs", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_train_00579
train
T2
v2
Schema: tasks (alias: sale)(id, code, name, date) categories(level, amount, type, name) Task: Find salary from tasks where a matching record exists in categories with the same level. SQL:
SELECT salary FROM tasks AS sale WHERE EXISTS ( SELECT 1 FROM categories AS txn WHERE txn.level = sale.level );
{ "outer_table": "tasks", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "salary", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_train_00580
train
T1
v2
Schema: invoices (alias: schd)(value, code, level, id) projects(code, value, date, name) Task: Find id from invoices where a matching record exists in projects with the same status. SQL:
SELECT id FROM invoices AS schd WHERE EXISTS ( SELECT 1 FROM projects AS prod WHERE prod.status = schd.status );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "id", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_train_00581
train
T2
v1
Schema: branches (alias: rgn)(id, salary, amount, type) orders(id, date, salary, level) Task: Select value from branches where code exists in orders for the same type. SQL:
SELECT value FROM branches AS rgn WHERE code IN ( SELECT code FROM orders AS prod WHERE prod.type = rgn.type );
{ "outer_table": "branches", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_train_00582
train
T2
v1
Schema: employees (alias: rgn)(type, amount, salary, level) tasks(date, code, type, level) Task: Select salary from employees where type exists in tasks for the same status. SQL:
SELECT salary FROM employees AS rgn WHERE type IN ( SELECT type FROM tasks AS srvc WHERE srvc.status = rgn.status );
{ "outer_table": "employees", "inner_table": "tasks", "outer_alias": "rgn", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "type", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_train_00583
train
T2
v1
Schema: customers (alias: txn)(salary, value, status, code) regions(level, amount, type, status) Task: Retrieve value from customers whose status is found in regions rows where id matches the outer record. SQL:
SELECT value FROM customers AS txn WHERE status IN ( SELECT status FROM regions AS dept WHERE dept.id = txn.id );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_train_00584
train
T1
v3
Schema: branches (alias: prod)(salary, value, date, type) departments(level, amount, status, id) Task: Retrieve code from branches with amount above the SUM(amount) of departments rows sharing the same status. SQL:
SELECT code FROM branches AS prod WHERE amount > ( SELECT SUM(amount) FROM departments AS whs WHERE whs.status = prod.status );
{ "outer_table": "branches", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "whs", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_train_00585
train
T1
v3
Schema: shipments (alias: catg)(level, type, name, status) suppliers(date, id, value, type) Task: Retrieve salary from shipments with amount above the SUM(salary) of suppliers rows sharing the same type. SQL:
SELECT salary FROM shipments AS catg WHERE amount > ( SELECT SUM(salary) FROM suppliers AS whs WHERE whs.type = catg.type );
{ "outer_table": "shipments", "inner_table": "suppliers", "outer_alias": "catg", "inner_alias": "whs", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_train_00586
train
T2
v3
Schema: transactions (alias: empl)(value, level, code, type) shipments(amount, code, name, level) Task: Retrieve value from transactions with amount above the COUNT(salary) of shipments rows sharing the same code. SQL:
SELECT value FROM transactions AS empl WHERE amount > ( SELECT COUNT(salary) FROM shipments AS sale WHERE sale.code = empl.code );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_train_00587
train
T2
v3
Schema: tasks (alias: inv)(value, id, name, code) warehouses(status, type, level, name) Task: Retrieve value from tasks with amount above the AVG(salary) of warehouses rows sharing the same status. SQL:
SELECT value FROM tasks AS inv WHERE amount > ( SELECT AVG(salary) FROM warehouses AS empl WHERE empl.status = inv.status );
{ "outer_table": "tasks", "inner_table": "warehouses", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_train_00588
train
T1
v3
Schema: categories (alias: dept)(id, value, type, salary) shipments(status, type, value, salary) Task: Retrieve id from categories with value above the MAX(value) of shipments rows sharing the same status. SQL:
SELECT id FROM categories AS dept WHERE value > ( SELECT MAX(value) FROM shipments AS empl WHERE empl.status = dept.status );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_train_00589
train
T1
v3
Schema: orders (alias: empl)(status, level, date, value) transactions(salary, name, id, value) Task: Retrieve amount from orders with salary above the AVG(amount) of transactions rows sharing the same id. SQL:
SELECT amount FROM orders AS empl WHERE salary > ( SELECT AVG(amount) FROM transactions AS inv WHERE inv.id = empl.id );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_train_00590
train
T2
v2
Schema: regions (alias: ord)(type, level, id, name) suppliers(type, salary, id, date) Task: Find code from regions where a matching record exists in suppliers with the same type. SQL:
SELECT code FROM regions AS ord WHERE EXISTS ( SELECT 1 FROM suppliers AS acct WHERE acct.type = ord.type );
{ "outer_table": "regions", "inner_table": "suppliers", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "code", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_train_00591
train
T1
v3
Schema: employees (alias: inv)(id, code, type, level) customers(amount, salary, type, name) Task: Retrieve value from employees with value above the MIN(value) of customers rows sharing the same status. SQL:
SELECT value FROM employees AS inv WHERE value > ( SELECT MIN(value) FROM customers AS ord WHERE ord.status = inv.status );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "ord", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_train_00592
train
T1
v3
Schema: branches (alias: emp)(value, id, type, status) invoices(code, status, salary, level) Task: Find value from branches where value exceeds the average amount from invoices for the same id. SQL:
SELECT value FROM branches AS emp WHERE value > ( SELECT SUM(amount) FROM invoices AS budg WHERE budg.id = emp.id );
{ "outer_table": "branches", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "budg", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_train_00593
train
T1
v3
Schema: departments (alias: srvc)(code, status, level, name) tasks(amount, value, name, type) Task: Retrieve id from departments with salary above the SUM(value) of tasks rows sharing the same type. SQL:
SELECT id FROM departments AS srvc WHERE salary > ( SELECT SUM(value) FROM tasks AS cust WHERE cust.type = srvc.type );
{ "outer_table": "departments", "inner_table": "tasks", "outer_alias": "srvc", "inner_alias": "cust", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_train_00594
train
T2
v2
Schema: orders (alias: ord)(name, code, id, amount) suppliers(date, level, status, type) Task: Find amount from orders where a matching record exists in suppliers with the same type. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM suppliers AS srvc WHERE srvc.type = ord.type );
{ "outer_table": "orders", "inner_table": "suppliers", "outer_alias": "ord", "inner_alias": "srvc", "proj_col": "amount", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_train_00595
train
T1
v3
Schema: products (alias: acct)(type, status, id, name) departments(date, code, salary, amount) Task: Retrieve id from products with amount above the SUM(amount) of departments rows sharing the same code. SQL:
SELECT id FROM products AS acct WHERE amount > ( SELECT SUM(amount) FROM departments AS ordr WHERE ordr.code = acct.code );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_train_00596
train
T1
v3
Schema: products (alias: srvc)(name, salary, id, type) projects(amount, salary, date, code) Task: Retrieve value from products with amount above the SUM(value) of projects rows sharing the same status. SQL:
SELECT value FROM products AS srvc WHERE amount > ( SELECT SUM(value) FROM projects AS acct WHERE acct.status = srvc.status );
{ "outer_table": "products", "inner_table": "projects", "outer_alias": "srvc", "inner_alias": "acct", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_train_00597
train
T2
v2
Schema: tasks (alias: ord)(code, type, amount, name) employees(level, salary, type, id) Task: Retrieve id from tasks that have at least one corresponding entry in employees sharing the same code. SQL:
SELECT id FROM tasks AS ord WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = ord.code );
{ "outer_table": "tasks", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "id", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_train_00598
train
T1
v3
Schema: categories (alias: schd)(salary, code, date, level) invoices(status, code, date, id) Task: Retrieve name from categories with amount above the MIN(salary) of invoices rows sharing the same code. SQL:
SELECT name FROM categories AS schd WHERE amount > ( SELECT MIN(salary) FROM invoices AS ordr WHERE ordr.code = schd.code );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "ordr", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_train_00599
train
T2