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
v2
Schema: regions (alias: ordr)(level, value, id, name) invoices(name, level, type, value) Task: Find value from regions where a matching record exists in invoices with the same status. SQL:
SELECT value FROM regions AS ordr WHERE EXISTS ( SELECT 1 FROM invoices AS rgn WHERE rgn.status = ordr.status );
{ "outer_table": "regions", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "value", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_train_00600
train
T2
v1
Schema: categories (alias: inv)(amount, type, code, name) branches(date, type, status, name) Task: Select value from categories where level exists in branches for the same id. SQL:
SELECT value FROM categories AS inv WHERE level IN ( SELECT level FROM branches AS ordr WHERE ordr.id = inv.id );
{ "outer_table": "categories", "inner_table": "branches", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "value", "filter_col": "level", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_train_00601
train
T1
v3
Schema: accounts (alias: prod)(code, id, date, value) warehouses(type, salary, status, value) Task: Retrieve value from accounts with amount above the MIN(value) of warehouses rows sharing the same id. SQL:
SELECT value FROM accounts AS prod WHERE amount > ( SELECT MIN(value) FROM warehouses AS catg WHERE catg.id = prod.id );
{ "outer_table": "accounts", "inner_table": "warehouses", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_train_00602
train
T1
v3
Schema: regions (alias: inv)(salary, value, name, type) employees(type, amount, date, name) Task: Retrieve id from regions with salary above the MAX(amount) of employees rows sharing the same status. SQL:
SELECT id FROM regions AS inv WHERE salary > ( SELECT MAX(amount) FROM employees AS shp WHERE shp.status = inv.status );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_train_00603
train
T1
v1
Schema: accounts (alias: mgr)(status, code, salary, level) customers(type, name, date, value) Task: Retrieve name from accounts whose status is found in customers rows where code matches the outer record. SQL:
SELECT name FROM accounts AS mgr WHERE status IN ( SELECT status FROM customers AS prod WHERE prod.code = mgr.code );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_train_00604
train
T1
v2
Schema: customers (alias: acct)(id, level, amount, status) regions(level, amount, type, value) Task: Retrieve salary from customers that have at least one corresponding entry in regions sharing the same status. SQL:
SELECT salary FROM customers AS acct WHERE EXISTS ( SELECT 1 FROM regions AS srvc WHERE srvc.status = acct.status );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "srvc", "proj_col": "salary", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_train_00605
train
T1
v1
Schema: warehouses (alias: ord)(value, code, name, amount) employees(salary, name, amount, date) Task: Retrieve salary from warehouses whose code is found in employees rows where id matches the outer record. SQL:
SELECT salary FROM warehouses AS ord WHERE code IN ( SELECT code FROM employees AS lne WHERE lne.id = ord.id );
{ "outer_table": "warehouses", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_train_00606
train
T1
v3
Schema: projects (alias: dept)(amount, name, value, salary) branches(status, type, amount, salary) Task: Find id from projects where salary exceeds the average amount from branches for the same level. SQL:
SELECT id FROM projects AS dept WHERE salary > ( SELECT AVG(amount) FROM branches AS schd WHERE schd.level = dept.level );
{ "outer_table": "projects", "inner_table": "branches", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_train_00607
train
T1
v3
Schema: transactions (alias: sale)(level, amount, name, status) customers(date, type, name, salary) Task: Find id from transactions where salary exceeds the average value from customers for the same type. SQL:
SELECT id FROM transactions AS sale WHERE salary > ( SELECT AVG(value) FROM customers AS mgr WHERE mgr.type = sale.type );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_train_00608
train
T1
v1
Schema: invoices (alias: lne)(salary, type, amount, status) regions(amount, code, id, salary) Task: Select amount from invoices where type exists in regions for the same code. SQL:
SELECT amount FROM invoices AS lne WHERE type IN ( SELECT type FROM regions AS inv WHERE inv.code = lne.code );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "amount", "filter_col": "type", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_train_00609
train
T2
v1
Schema: transactions (alias: lne)(date, type, salary, id) accounts(date, amount, code, status) Task: Select code from transactions where id exists in accounts for the same code. SQL:
SELECT code FROM transactions AS lne WHERE id IN ( SELECT id FROM accounts AS schd WHERE schd.code = lne.code );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "code", "filter_col": "id", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_train_00610
train
T2
v3
Schema: invoices (alias: mgr)(amount, code, status, salary) transactions(salary, amount, type, value) Task: Retrieve value from invoices with salary above the SUM(value) of transactions rows sharing the same type. SQL:
SELECT value FROM invoices AS mgr WHERE salary > ( SELECT SUM(value) FROM transactions AS ordr WHERE ordr.type = mgr.type );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_train_00611
train
T1
v2
Schema: transactions (alias: dept)(salary, value, name, type) orders(date, status, value, type) Task: Retrieve value from transactions that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT value FROM transactions AS dept WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = dept.code );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "value", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_train_00612
train
T1
v3
Schema: projects (alias: acct)(date, salary, type, status) categories(date, amount, level, type) Task: Retrieve id from projects with value above the COUNT(salary) of categories rows sharing the same type. SQL:
SELECT id FROM projects AS acct WHERE value > ( SELECT COUNT(salary) FROM categories AS txn WHERE txn.type = acct.type );
{ "outer_table": "projects", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_train_00613
train
T1
v1
Schema: departments (alias: emp)(type, level, name, value) invoices(date, salary, amount, value) Task: Retrieve code from departments whose id is found in invoices rows where code matches the outer record. SQL:
SELECT code FROM departments AS emp WHERE id IN ( SELECT id FROM invoices AS srvc WHERE srvc.code = emp.code );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "srvc", "proj_col": "code", "filter_col": "id", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_train_00614
train
T1
v1
Schema: departments (alias: catg)(code, id, amount, type) tasks(level, type, status, date) Task: Retrieve amount from departments whose code is found in tasks rows where level matches the outer record. SQL:
SELECT amount FROM departments AS catg WHERE code IN ( SELECT code FROM tasks AS schd WHERE schd.level = catg.level );
{ "outer_table": "departments", "inner_table": "tasks", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_train_00615
train
T2
v3
Schema: invoices (alias: mgr)(amount, salary, id, code) categories(value, code, amount, name) Task: Retrieve id from invoices with amount above the SUM(salary) of categories rows sharing the same id. SQL:
SELECT id FROM invoices AS mgr WHERE amount > ( SELECT SUM(salary) FROM categories AS rgn WHERE rgn.id = mgr.id );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_train_00616
train
T1
v1
Schema: transactions (alias: cust)(status, id, salary, value) regions(status, value, amount, date) Task: Select code from transactions where code exists in regions for the same code. SQL:
SELECT code FROM transactions AS cust WHERE code IN ( SELECT code FROM regions AS txn WHERE txn.code = cust.code );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_train_00617
train
T1
v3
Schema: categories (alias: mgr)(name, salary, type, date) tasks(id, salary, status, name) Task: Retrieve name from categories with value above the MAX(value) of tasks rows sharing the same status. SQL:
SELECT name FROM categories AS mgr WHERE value > ( SELECT MAX(value) FROM tasks AS txn WHERE txn.status = mgr.status );
{ "outer_table": "categories", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "txn", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_train_00618
train
T1
v1
Schema: accounts (alias: mgr)(salary, amount, value, status) suppliers(id, type, code, name) Task: Find salary from accounts where id appears in suppliers entries with matching code. SQL:
SELECT salary FROM accounts AS mgr WHERE id IN ( SELECT id FROM suppliers AS inv WHERE inv.code = mgr.code );
{ "outer_table": "accounts", "inner_table": "suppliers", "outer_alias": "mgr", "inner_alias": "inv", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_train_00619
train
T1
v1
Schema: branches (alias: acct)(value, type, id, date) orders(date, level, amount, type) Task: Select value from branches where id exists in orders for the same type. SQL:
SELECT value FROM branches AS acct WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.type = acct.type );
{ "outer_table": "branches", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_train_00620
train
T1
v3
Schema: customers (alias: shp)(salary, id, amount, value) tasks(salary, name, date, type) Task: Retrieve value from customers with value above the COUNT(value) of tasks rows sharing the same status. SQL:
SELECT value FROM customers AS shp WHERE value > ( SELECT COUNT(value) FROM tasks AS lne WHERE lne.status = shp.status );
{ "outer_table": "customers", "inner_table": "tasks", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_train_00621
train
T2
v3
Schema: accounts (alias: empl)(amount, salary, status, date) regions(status, amount, date, name) Task: Retrieve salary from accounts with salary above the COUNT(amount) of regions rows sharing the same status. SQL:
SELECT salary FROM accounts AS empl WHERE salary > ( SELECT COUNT(amount) FROM regions AS cust WHERE cust.status = empl.status );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_train_00622
train
T2
v2
Schema: shipments (alias: schd)(level, value, salary, id) products(amount, value, code, salary) Task: Find value from shipments where a matching record exists in products with the same id. SQL:
SELECT value FROM shipments AS schd WHERE EXISTS ( SELECT 1 FROM products AS sale WHERE sale.id = schd.id );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "value", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_train_00623
train
T2
v3
Schema: products (alias: shp)(name, type, code, level) categories(status, amount, salary, level) Task: Find code from products where value exceeds the average amount from categories for the same level. SQL:
SELECT code FROM products AS shp WHERE value > ( SELECT SUM(amount) FROM categories AS cust WHERE cust.level = shp.level );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_train_00624
train
T2
v1
Schema: orders (alias: sale)(salary, code, level, name) categories(level, code, amount, name) Task: Retrieve id from orders whose code is found in categories rows where type matches the outer record. SQL:
SELECT id FROM orders AS sale WHERE code IN ( SELECT code FROM categories AS ord WHERE ord.type = sale.type );
{ "outer_table": "orders", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "id", "filter_col": "code", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_train_00625
train
T1
v3
Schema: products (alias: prod)(code, type, status, value) accounts(date, code, salary, value) Task: Find id from products where salary exceeds the average amount from accounts for the same code. SQL:
SELECT id FROM products AS prod WHERE salary > ( SELECT MAX(amount) FROM accounts AS ordr WHERE ordr.code = prod.code );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_train_00626
train
T1
v1
Schema: warehouses (alias: catg)(level, amount, code, name) employees(code, name, status, salary) Task: Select amount from warehouses where type exists in employees for the same id. SQL:
SELECT amount FROM warehouses AS catg WHERE type IN ( SELECT type FROM employees AS dept WHERE dept.id = catg.id );
{ "outer_table": "warehouses", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_train_00627
train
T2
v1
Schema: products (alias: empl)(type, id, level, date) invoices(name, salary, status, date) Task: Retrieve salary from products whose type is found in invoices rows where level matches the outer record. SQL:
SELECT salary FROM products AS empl WHERE type IN ( SELECT type FROM invoices AS cust WHERE cust.level = empl.level );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "salary", "filter_col": "type", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_train_00628
train
T2
v1
Schema: products (alias: catg)(name, amount, value, id) customers(id, level, salary, value) Task: Select salary from products where code exists in customers for the same code. SQL:
SELECT salary FROM products AS catg WHERE code IN ( SELECT code FROM customers AS inv WHERE inv.code = catg.code );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_train_00629
train
T2
v1
Schema: projects (alias: budg)(amount, code, value, id) products(level, code, date, status) Task: Find id from projects where status appears in products entries with matching type. SQL:
SELECT id FROM projects AS budg WHERE status IN ( SELECT status FROM products AS cust WHERE cust.type = budg.type );
{ "outer_table": "projects", "inner_table": "products", "outer_alias": "budg", "inner_alias": "cust", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_train_00630
train
T2
v2
Schema: warehouses (alias: empl)(date, id, salary, name) employees(type, salary, name, value) Task: Retrieve amount from warehouses that have at least one corresponding entry in employees sharing the same code. SQL:
SELECT amount FROM warehouses AS empl WHERE EXISTS ( SELECT 1 FROM employees AS dept WHERE dept.code = empl.code );
{ "outer_table": "warehouses", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "amount", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_train_00631
train
T2
v1
Schema: warehouses (alias: shp)(date, name, salary, code) orders(date, level, id, value) Task: Retrieve amount from warehouses whose level is found in orders rows where status matches the outer record. SQL:
SELECT amount FROM warehouses AS shp WHERE level IN ( SELECT level FROM orders AS whs WHERE whs.status = shp.status );
{ "outer_table": "warehouses", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "whs", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_train_00632
train
T2
v1
Schema: invoices (alias: txn)(code, amount, name, type) accounts(id, level, value, status) Task: Select code from invoices where type exists in accounts for the same level. SQL:
SELECT code FROM invoices AS txn WHERE type IN ( SELECT type FROM accounts AS schd WHERE schd.level = txn.level );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "code", "filter_col": "type", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_train_00633
train
T1
v1
Schema: tasks (alias: empl)(type, value, status, amount) products(value, amount, code, salary) Task: Select value from tasks where type exists in products for the same status. SQL:
SELECT value FROM tasks AS empl WHERE type IN ( SELECT type FROM products AS srvc WHERE srvc.status = empl.status );
{ "outer_table": "tasks", "inner_table": "products", "outer_alias": "empl", "inner_alias": "srvc", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_train_00634
train
T2
v3
Schema: projects (alias: schd)(type, date, value, level) products(name, level, id, salary) Task: Find name from projects where value exceeds the average value from products for the same type. SQL:
SELECT name FROM projects AS schd WHERE value > ( SELECT COUNT(value) FROM products AS cust WHERE cust.type = schd.type );
{ "outer_table": "projects", "inner_table": "products", "outer_alias": "schd", "inner_alias": "cust", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_train_00635
train
T2
v1
Schema: suppliers (alias: ord)(type, salary, name, status) tasks(value, amount, name, salary) Task: Select name from suppliers where level exists in tasks for the same type. SQL:
SELECT name FROM suppliers AS ord WHERE level IN ( SELECT level FROM tasks AS schd WHERE schd.type = ord.type );
{ "outer_table": "suppliers", "inner_table": "tasks", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_train_00636
train
T1
v1
Schema: accounts (alias: dept)(salary, amount, value, name) shipments(status, level, type, value) Task: Find id from accounts where status appears in shipments entries with matching level. SQL:
SELECT id FROM accounts AS dept WHERE status IN ( SELECT status FROM shipments AS sale WHERE sale.level = dept.level );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "id", "filter_col": "status", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_train_00637
train
T1
v3
Schema: branches (alias: ordr)(amount, code, id, salary) invoices(date, salary, name, status) Task: Find code from branches where salary exceeds the average value from invoices for the same level. SQL:
SELECT code FROM branches AS ordr WHERE salary > ( SELECT MAX(value) FROM invoices AS ord WHERE ord.level = ordr.level );
{ "outer_table": "branches", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_train_00638
train
T2
v3
Schema: regions (alias: shp)(value, id, code, type) accounts(status, value, date, salary) Task: Retrieve amount from regions with amount above the MAX(salary) of accounts rows sharing the same id. SQL:
SELECT amount FROM regions AS shp WHERE amount > ( SELECT MAX(salary) FROM accounts AS prod WHERE prod.id = shp.id );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_train_00639
train
T2
v1
Schema: branches (alias: acct)(name, level, code, amount) products(code, amount, level, type) Task: Find amount from branches where type appears in products entries with matching type. SQL:
SELECT amount FROM branches AS acct WHERE type IN ( SELECT type FROM products AS srvc WHERE srvc.type = acct.type );
{ "outer_table": "branches", "inner_table": "products", "outer_alias": "acct", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_train_00640
train
T1
v2
Schema: suppliers (alias: catg)(id, type, date, amount) employees(date, salary, amount, name) Task: Retrieve salary from suppliers that have at least one corresponding entry in employees sharing the same type. SQL:
SELECT salary FROM suppliers AS catg WHERE EXISTS ( SELECT 1 FROM employees AS budg WHERE budg.type = catg.type );
{ "outer_table": "suppliers", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "budg", "proj_col": "salary", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_train_00641
train
T2
v2
Schema: transactions (alias: budg)(status, level, id, salary) regions(name, id, status, type) Task: Retrieve code from transactions that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT code FROM transactions AS budg WHERE EXISTS ( SELECT 1 FROM regions AS shp WHERE shp.level = budg.level );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "budg", "inner_alias": "shp", "proj_col": "code", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_train_00642
train
T2
v2
Schema: invoices (alias: rgn)(date, name, amount, type) warehouses(level, type, id, name) Task: Find amount from invoices where a matching record exists in warehouses with the same level. SQL:
SELECT amount FROM invoices AS rgn WHERE EXISTS ( SELECT 1 FROM warehouses AS txn WHERE txn.level = rgn.level );
{ "outer_table": "invoices", "inner_table": "warehouses", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "amount", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_train_00643
train
T2
v1
Schema: accounts (alias: whs)(date, id, name, type) orders(code, status, salary, level) Task: Find amount from accounts where level appears in orders entries with matching level. SQL:
SELECT amount FROM accounts AS whs WHERE level IN ( SELECT level FROM orders AS sale WHERE sale.level = whs.level );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "whs", "inner_alias": "sale", "proj_col": "amount", "filter_col": "level", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_train_00644
train
T2
v3
Schema: departments (alias: ord)(status, id, code, date) warehouses(code, status, id, level) Task: Find id from departments where value exceeds the average value from warehouses for the same status. SQL:
SELECT id FROM departments AS ord WHERE value > ( SELECT SUM(value) FROM warehouses AS whs WHERE whs.status = ord.status );
{ "outer_table": "departments", "inner_table": "warehouses", "outer_alias": "ord", "inner_alias": "whs", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_train_00645
train
T1
v2
Schema: departments (alias: emp)(amount, status, date, id) shipments(value, amount, status, type) Task: Retrieve salary from departments that have at least one corresponding entry in shipments sharing the same type. SQL:
SELECT salary FROM departments AS emp WHERE EXISTS ( SELECT 1 FROM shipments AS rgn WHERE rgn.type = emp.type );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "salary", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_train_00646
train
T1
v2
Schema: projects (alias: cust)(date, status, value, salary) suppliers(type, value, salary, status) Task: Find name from projects where a matching record exists in suppliers with the same status. SQL:
SELECT name FROM projects AS cust WHERE EXISTS ( SELECT 1 FROM suppliers AS shp WHERE shp.status = cust.status );
{ "outer_table": "projects", "inner_table": "suppliers", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "name", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_train_00647
train
T1
v3
Schema: projects (alias: shp)(value, date, level, salary) orders(value, name, code, salary) Task: Retrieve salary from projects with amount above the MAX(amount) of orders rows sharing the same code. SQL:
SELECT salary FROM projects AS shp WHERE amount > ( SELECT MAX(amount) FROM orders AS inv WHERE inv.code = shp.code );
{ "outer_table": "projects", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_train_00648
train
T2
v2
Schema: employees (alias: srvc)(name, status, level, code) regions(value, name, type, status) Task: Retrieve code from employees that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT code FROM employees AS srvc WHERE EXISTS ( SELECT 1 FROM regions AS txn WHERE txn.level = srvc.level );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "srvc", "inner_alias": "txn", "proj_col": "code", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_train_00649
train
T2
v3
Schema: regions (alias: mgr)(status, level, value, id) products(value, status, name, date) Task: Find amount from regions where value exceeds the average salary from products for the same level. SQL:
SELECT amount FROM regions AS mgr WHERE value > ( SELECT MIN(salary) FROM products AS budg WHERE budg.level = mgr.level );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "budg", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_train_00650
train
T1
v1
Schema: tasks (alias: lne)(name, salary, value, id) customers(salary, value, level, id) Task: Retrieve id from tasks whose id is found in customers rows where id matches the outer record. SQL:
SELECT id FROM tasks AS lne WHERE id IN ( SELECT id FROM customers AS emp WHERE emp.id = lne.id );
{ "outer_table": "tasks", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_train_00651
train
T2
v2
Schema: invoices (alias: cust)(status, amount, id, value) branches(salary, date, type, status) Task: Retrieve amount from invoices that have at least one corresponding entry in branches sharing the same type. SQL:
SELECT amount FROM invoices AS cust WHERE EXISTS ( SELECT 1 FROM branches AS mgr WHERE mgr.type = cust.type );
{ "outer_table": "invoices", "inner_table": "branches", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "amount", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_train_00652
train
T1
v2
Schema: invoices (alias: dept)(id, date, level, name) suppliers(salary, date, type, status) Task: Retrieve id from invoices that have at least one corresponding entry in suppliers sharing the same id. SQL:
SELECT id FROM invoices AS dept WHERE EXISTS ( SELECT 1 FROM suppliers AS ordr WHERE ordr.id = dept.id );
{ "outer_table": "invoices", "inner_table": "suppliers", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "id", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_train_00653
train
T1
v3
Schema: regions (alias: sale)(code, amount, name, type) accounts(id, date, salary, level) Task: Find value from regions where amount exceeds the average amount from accounts for the same status. SQL:
SELECT value FROM regions AS sale WHERE amount > ( SELECT MAX(amount) FROM accounts AS emp WHERE emp.status = sale.status );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_train_00654
train
T1
v2
Schema: customers (alias: cust)(salary, level, id, date) branches(date, id, status, name) Task: Find value from customers where a matching record exists in branches with the same code. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM branches AS ordr WHERE ordr.code = cust.code );
{ "outer_table": "customers", "inner_table": "branches", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "value", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_train_00655
train
T1
v1
Schema: orders (alias: catg)(level, type, date, id) customers(code, status, salary, level) Task: Find value from orders where status appears in customers entries with matching id. SQL:
SELECT value FROM orders AS catg WHERE status IN ( SELECT status FROM customers AS srvc WHERE srvc.id = catg.id );
{ "outer_table": "orders", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "srvc", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_train_00656
train
T2
v2
Schema: suppliers (alias: srvc)(salary, status, name, value) accounts(type, id, level, name) Task: Retrieve salary from suppliers that have at least one corresponding entry in accounts sharing the same code. SQL:
SELECT salary FROM suppliers AS srvc WHERE EXISTS ( SELECT 1 FROM accounts AS whs WHERE whs.code = srvc.code );
{ "outer_table": "suppliers", "inner_table": "accounts", "outer_alias": "srvc", "inner_alias": "whs", "proj_col": "salary", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_train_00657
train
T2
v1
Schema: categories (alias: shp)(name, id, amount, level) tasks(type, name, id, date) Task: Select salary from categories where id exists in tasks for the same status. SQL:
SELECT salary FROM categories AS shp WHERE id IN ( SELECT id FROM tasks AS empl WHERE empl.status = shp.status );
{ "outer_table": "categories", "inner_table": "tasks", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_train_00658
train
T2
v2
Schema: departments (alias: mgr)(id, level, status, name) employees(type, code, value, level) Task: Retrieve code from departments that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT code FROM departments AS mgr WHERE EXISTS ( SELECT 1 FROM employees AS budg WHERE budg.status = mgr.status );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "budg", "proj_col": "code", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_train_00659
train
T1
v1
Schema: customers (alias: emp)(salary, amount, level, code) transactions(salary, status, value, code) Task: Select amount from customers where id exists in transactions for the same status. SQL:
SELECT amount FROM customers AS emp WHERE id IN ( SELECT id FROM transactions AS sale WHERE sale.status = emp.status );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "sale", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_train_00660
train
T1
v1
Schema: categories (alias: acct)(status, level, date, amount) transactions(value, amount, salary, date) Task: Retrieve amount from categories whose type is found in transactions rows where status matches the outer record. SQL:
SELECT amount FROM categories AS acct WHERE type IN ( SELECT type FROM transactions AS rgn WHERE rgn.status = acct.status );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_train_00661
train
T1
v3
Schema: products (alias: catg)(salary, amount, date, code) employees(id, type, value, salary) Task: Retrieve code from products with salary above the SUM(value) of employees rows sharing the same type. SQL:
SELECT code FROM products AS catg WHERE salary > ( SELECT SUM(value) FROM employees AS sale WHERE sale.type = catg.type );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_train_00662
train
T2
v3
Schema: invoices (alias: ordr)(status, id, value, type) regions(code, salary, date, status) Task: Find code from invoices where amount exceeds the average salary from regions for the same level. SQL:
SELECT code FROM invoices AS ordr WHERE amount > ( SELECT SUM(salary) FROM regions AS shp WHERE shp.level = ordr.level );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_train_00663
train
T2
v3
Schema: departments (alias: cust)(level, status, id, amount) branches(value, code, type, name) Task: Find id from departments where amount exceeds the average salary from branches for the same type. SQL:
SELECT id FROM departments AS cust WHERE amount > ( SELECT MIN(salary) FROM branches AS dept WHERE dept.type = cust.type );
{ "outer_table": "departments", "inner_table": "branches", "outer_alias": "cust", "inner_alias": "dept", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_train_00664
train
T1
v1
Schema: customers (alias: prod)(amount, status, id, value) transactions(type, level, code, name) Task: Find id from customers where level appears in transactions entries with matching level. SQL:
SELECT id FROM customers AS prod WHERE level IN ( SELECT level FROM transactions AS inv WHERE inv.level = prod.level );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_train_00665
train
T1
v2
Schema: departments (alias: acct)(id, value, code, name) tasks(id, code, salary, amount) Task: Retrieve salary from departments that have at least one corresponding entry in tasks sharing the same type. SQL:
SELECT salary FROM departments AS acct WHERE EXISTS ( SELECT 1 FROM tasks AS ord WHERE ord.type = acct.type );
{ "outer_table": "departments", "inner_table": "tasks", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "salary", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_train_00666
train
T1
v3
Schema: regions (alias: lne)(date, value, amount, salary) shipments(date, code, id, status) Task: Find value from regions where value exceeds the average salary from shipments for the same code. SQL:
SELECT value FROM regions AS lne WHERE value > ( SELECT AVG(salary) FROM shipments AS emp WHERE emp.code = lne.code );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_train_00667
train
T2
v2
Schema: departments (alias: sale)(code, level, id, type) customers(date, value, status, id) Task: Find amount from departments where a matching record exists in customers with the same type. SQL:
SELECT amount FROM departments AS sale WHERE EXISTS ( SELECT 1 FROM customers AS txn WHERE txn.type = sale.type );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "amount", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_train_00668
train
T1
v1
Schema: branches (alias: mgr)(status, amount, level, id) categories(id, salary, amount, type) Task: Retrieve id from branches whose code is found in categories rows where id matches the outer record. SQL:
SELECT id FROM branches AS mgr WHERE code IN ( SELECT code FROM categories AS budg WHERE budg.id = mgr.id );
{ "outer_table": "branches", "inner_table": "categories", "outer_alias": "mgr", "inner_alias": "budg", "proj_col": "id", "filter_col": "code", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_train_00669
train
T1
v3
Schema: warehouses (alias: ordr)(name, status, id, value) orders(name, level, status, id) Task: Retrieve salary from warehouses with salary above the MAX(salary) of orders rows sharing the same level. SQL:
SELECT salary FROM warehouses AS ordr WHERE salary > ( SELECT MAX(salary) FROM orders AS whs WHERE whs.level = ordr.level );
{ "outer_table": "warehouses", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "whs", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_train_00670
train
T2
v1
Schema: products (alias: empl)(salary, date, code, id) accounts(salary, amount, name, value) Task: Select id from products where code exists in accounts for the same code. SQL:
SELECT id FROM products AS empl WHERE code IN ( SELECT code FROM accounts AS rgn WHERE rgn.code = empl.code );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_train_00671
train
T2
v2
Schema: suppliers (alias: lne)(status, amount, id, date) branches(amount, date, value, id) Task: Find id from suppliers where a matching record exists in branches with the same level. SQL:
SELECT id FROM suppliers AS lne WHERE EXISTS ( SELECT 1 FROM branches AS rgn WHERE rgn.level = lne.level );
{ "outer_table": "suppliers", "inner_table": "branches", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "id", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_train_00672
train
T2
v3
Schema: orders (alias: acct)(salary, code, value, amount) accounts(value, amount, id, level) Task: Retrieve salary from orders with amount above the MAX(amount) of accounts rows sharing the same level. SQL:
SELECT salary FROM orders AS acct WHERE amount > ( SELECT MAX(amount) FROM accounts AS srvc WHERE srvc.level = acct.level );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "acct", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_train_00673
train
T1
v3
Schema: categories (alias: prod)(value, salary, level, type) shipments(name, code, status, type) Task: Find id from categories where amount exceeds the average value from shipments for the same code. SQL:
SELECT id FROM categories AS prod WHERE amount > ( SELECT MIN(value) FROM shipments AS ordr WHERE ordr.code = prod.code );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_train_00674
train
T1
v3
Schema: employees (alias: inv)(date, type, value, salary) products(value, amount, salary, name) Task: Retrieve amount from employees with salary above the COUNT(value) of products rows sharing the same code. SQL:
SELECT amount FROM employees AS inv WHERE salary > ( SELECT COUNT(value) FROM products AS rgn WHERE rgn.code = inv.code );
{ "outer_table": "employees", "inner_table": "products", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_train_00675
train
T1
v2
Schema: departments (alias: ordr)(amount, date, salary, code) projects(type, name, value, status) Task: Find id from departments where a matching record exists in projects with the same id. SQL:
SELECT id FROM departments AS ordr WHERE EXISTS ( SELECT 1 FROM projects AS rgn WHERE rgn.id = ordr.id );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "id", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_train_00676
train
T2
v2
Schema: projects (alias: schd)(id, amount, name, type) transactions(type, salary, date, name) Task: Retrieve salary from projects that have at least one corresponding entry in transactions sharing the same code. SQL:
SELECT salary FROM projects AS schd WHERE EXISTS ( SELECT 1 FROM transactions AS emp WHERE emp.code = schd.code );
{ "outer_table": "projects", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "salary", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_train_00677
train
T2
v1
Schema: invoices (alias: ord)(date, level, amount, value) transactions(salary, type, amount, code) Task: Find id from invoices where status appears in transactions entries with matching level. SQL:
SELECT id FROM invoices AS ord WHERE status IN ( SELECT status FROM transactions AS empl WHERE empl.level = ord.level );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "id", "filter_col": "status", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_train_00678
train
T1
v3
Schema: departments (alias: txn)(date, value, amount, name) employees(type, name, date, status) Task: Find value from departments where salary exceeds the average salary from employees for the same type. SQL:
SELECT value FROM departments AS txn WHERE salary > ( SELECT AVG(salary) FROM employees AS lne WHERE lne.type = txn.type );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_train_00679
train
T1
v3
Schema: departments (alias: srvc)(level, amount, salary, value) products(status, code, amount, salary) Task: Find code from departments where amount exceeds the average value from products for the same id. SQL:
SELECT code FROM departments AS srvc WHERE amount > ( SELECT AVG(value) FROM products AS sale WHERE sale.id = srvc.id );
{ "outer_table": "departments", "inner_table": "products", "outer_alias": "srvc", "inner_alias": "sale", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_train_00680
train
T2
v1
Schema: products (alias: txn)(date, level, type, salary) projects(amount, code, type, date) Task: Find id from products where id appears in projects entries with matching id. SQL:
SELECT id FROM products AS txn WHERE id IN ( SELECT id FROM projects AS srvc WHERE srvc.id = txn.id );
{ "outer_table": "products", "inner_table": "projects", "outer_alias": "txn", "inner_alias": "srvc", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_train_00681
train
T1
v2
Schema: customers (alias: prod)(code, value, id, type) employees(date, salary, status, value) Task: Retrieve amount from customers that have at least one corresponding entry in employees sharing the same id. SQL:
SELECT amount FROM customers AS prod WHERE EXISTS ( SELECT 1 FROM employees AS inv WHERE inv.id = prod.id );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "amount", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_train_00682
train
T1
v1
Schema: categories (alias: dept)(code, status, date, type) shipments(id, level, status, salary) Task: Retrieve salary from categories whose status is found in shipments rows where type matches the outer record. SQL:
SELECT salary FROM categories AS dept WHERE status IN ( SELECT status FROM shipments AS rgn WHERE rgn.type = dept.type );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_train_00683
train
T1
v1
Schema: projects (alias: srvc)(amount, type, salary, code) transactions(type, id, amount, value) Task: Find amount from projects where type appears in transactions entries with matching status. SQL:
SELECT amount FROM projects AS srvc WHERE type IN ( SELECT type FROM transactions AS dept WHERE dept.status = srvc.status );
{ "outer_table": "projects", "inner_table": "transactions", "outer_alias": "srvc", "inner_alias": "dept", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_train_00684
train
T2
v1
Schema: invoices (alias: whs)(date, code, status, level) products(level, code, name, date) Task: Find amount from invoices where status appears in products entries with matching id. SQL:
SELECT amount FROM invoices AS whs WHERE status IN ( SELECT status FROM products AS srvc WHERE srvc.id = whs.id );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "whs", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_train_00685
train
T2
v3
Schema: employees (alias: budg)(value, status, amount, type) products(amount, code, level, id) Task: Retrieve name from employees with amount above the AVG(salary) of products rows sharing the same code. SQL:
SELECT name FROM employees AS budg WHERE amount > ( SELECT AVG(salary) FROM products AS sale WHERE sale.code = budg.code );
{ "outer_table": "employees", "inner_table": "products", "outer_alias": "budg", "inner_alias": "sale", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_train_00686
train
T2
v3
Schema: departments (alias: prod)(amount, value, salary, type) suppliers(date, id, type, code) Task: Retrieve salary from departments with salary above the MAX(salary) of suppliers rows sharing the same status. SQL:
SELECT salary FROM departments AS prod WHERE salary > ( SELECT MAX(salary) FROM suppliers AS empl WHERE empl.status = prod.status );
{ "outer_table": "departments", "inner_table": "suppliers", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_train_00687
train
T1
v1
Schema: invoices (alias: mgr)(name, value, id, code) tasks(id, name, code, status) Task: Select id from invoices where type exists in tasks for the same id. SQL:
SELECT id FROM invoices AS mgr WHERE type IN ( SELECT type FROM tasks AS empl WHERE empl.id = mgr.id );
{ "outer_table": "invoices", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_train_00688
train
T1
v1
Schema: products (alias: ord)(type, name, code, status) suppliers(date, status, level, amount) Task: Find value from products where level appears in suppliers entries with matching level. SQL:
SELECT value FROM products AS ord WHERE level IN ( SELECT level FROM suppliers AS budg WHERE budg.level = ord.level );
{ "outer_table": "products", "inner_table": "suppliers", "outer_alias": "ord", "inner_alias": "budg", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_train_00689
train
T1
v2
Schema: invoices (alias: inv)(type, status, date, salary) customers(value, name, date, salary) Task: Find value from invoices where a matching record exists in customers with the same level. SQL:
SELECT value FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM customers AS mgr WHERE mgr.level = inv.level );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "mgr", "proj_col": "value", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_train_00690
train
T1
v3
Schema: regions (alias: prod)(name, value, amount, type) shipments(status, name, date, id) Task: Find id from regions where value exceeds the average amount from shipments for the same code. SQL:
SELECT id FROM regions AS prod WHERE value > ( SELECT COUNT(amount) FROM shipments AS emp WHERE emp.code = prod.code );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_train_00691
train
T1
v2
Schema: regions (alias: ord)(type, level, value, date) departments(amount, id, value, code) Task: Find salary from regions where a matching record exists in departments with the same id. SQL:
SELECT salary FROM regions AS ord WHERE EXISTS ( SELECT 1 FROM departments AS mgr WHERE mgr.id = ord.id );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "salary", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_train_00692
train
T1
v1
Schema: tasks (alias: dept)(date, name, value, id) branches(status, value, type, name) Task: Select name from tasks where type exists in branches for the same type. SQL:
SELECT name FROM tasks AS dept WHERE type IN ( SELECT type FROM branches AS ordr WHERE ordr.type = dept.type );
{ "outer_table": "tasks", "inner_table": "branches", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "name", "filter_col": "type", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_train_00693
train
T1
v3
Schema: employees (alias: whs)(date, code, status, amount) branches(salary, level, amount, value) Task: Find salary from employees where value exceeds the average amount from branches for the same type. SQL:
SELECT salary FROM employees AS whs WHERE value > ( SELECT COUNT(amount) FROM branches AS shp WHERE shp.type = whs.type );
{ "outer_table": "employees", "inner_table": "branches", "outer_alias": "whs", "inner_alias": "shp", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_train_00694
train
T2
v1
Schema: employees (alias: catg)(amount, status, level, id) products(status, date, id, value) Task: Select id from employees where level exists in products for the same level. SQL:
SELECT id FROM employees AS catg WHERE level IN ( SELECT level FROM products AS rgn WHERE rgn.level = catg.level );
{ "outer_table": "employees", "inner_table": "products", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_train_00695
train
T2
v3
Schema: regions (alias: sale)(name, level, date, id) warehouses(id, level, code, salary) Task: Find code from regions where amount exceeds the average value from warehouses for the same type. SQL:
SELECT code FROM regions AS sale WHERE amount > ( SELECT SUM(value) FROM warehouses AS inv WHERE inv.type = sale.type );
{ "outer_table": "regions", "inner_table": "warehouses", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_train_00696
train
T1
v2
Schema: regions (alias: prod)(status, name, amount, level) accounts(type, amount, date, value) Task: Retrieve id from regions that have at least one corresponding entry in accounts sharing the same level. SQL:
SELECT id FROM regions AS prod WHERE EXISTS ( SELECT 1 FROM accounts AS rgn WHERE rgn.level = prod.level );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "id", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_train_00697
train
T1
v2
Schema: warehouses (alias: lne)(salary, type, id, level) branches(level, value, code, id) Task: Retrieve code from warehouses that have at least one corresponding entry in branches sharing the same code. SQL:
SELECT code FROM warehouses AS lne WHERE EXISTS ( SELECT 1 FROM branches AS inv WHERE inv.code = lne.code );
{ "outer_table": "warehouses", "inner_table": "branches", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "code", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_train_00698
train
T2
v1
Schema: accounts (alias: mgr)(level, id, type, name) orders(date, id, code, status) Task: Find salary from accounts where id appears in orders entries with matching code. SQL:
SELECT salary FROM accounts AS mgr WHERE id IN ( SELECT id FROM orders AS inv WHERE inv.code = mgr.code );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "inv", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_train_00699
train
T1