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: accounts (alias: ordr)(status, level, salary, name) regions(date, value, id, name) Task: Retrieve salary from accounts that have at least one corresponding entry in regions sharing the same id. SQL:
SELECT salary FROM accounts AS ordr WHERE EXISTS ( SELECT 1 FROM regions AS cust WHERE cust.id = ordr.id );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "salary", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_train_00800
train
T2
v2
Schema: invoices (alias: schd)(amount, id, name, value) categories(status, level, salary, id) Task: Find code from invoices where a matching record exists in categories with the same status. SQL:
SELECT code FROM invoices AS schd WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = schd.status );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "code", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_train_00801
train
T2
v3
Schema: warehouses (alias: ord)(amount, salary, name, type) projects(value, salary, status, name) Task: Retrieve amount from warehouses with amount above the SUM(amount) of projects rows sharing the same id. SQL:
SELECT amount FROM warehouses AS ord WHERE amount > ( SELECT SUM(amount) FROM projects AS inv WHERE inv.id = ord.id );
{ "outer_table": "warehouses", "inner_table": "projects", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_train_00802
train
T1
v3
Schema: departments (alias: mgr)(type, date, status, id) projects(code, value, amount, type) Task: Retrieve code from departments with value above the COUNT(amount) of projects rows sharing the same id. SQL:
SELECT code FROM departments AS mgr WHERE value > ( SELECT COUNT(amount) FROM projects AS budg WHERE budg.id = mgr.id );
{ "outer_table": "departments", "inner_table": "projects", "outer_alias": "mgr", "inner_alias": "budg", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_train_00803
train
T1
v3
Schema: tasks (alias: txn)(date, name, level, salary) categories(date, name, status, value) Task: Find code from tasks where salary exceeds the average amount from categories for the same code. SQL:
SELECT code FROM tasks AS txn WHERE salary > ( SELECT SUM(amount) FROM categories AS mgr WHERE mgr.code = txn.code );
{ "outer_table": "tasks", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_train_00804
train
T1
v2
Schema: departments (alias: mgr)(type, amount, level, status) shipments(code, value, date, salary) Task: Find name from departments where a matching record exists in shipments with the same status. SQL:
SELECT name FROM departments AS mgr WHERE EXISTS ( SELECT 1 FROM shipments AS emp WHERE emp.status = mgr.status );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "name", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_train_00805
train
T1
v2
Schema: categories (alias: dept)(name, id, code, value) orders(type, id, level, code) Task: Retrieve amount from categories that have at least one corresponding entry in orders sharing the same status. SQL:
SELECT amount FROM categories AS dept WHERE EXISTS ( SELECT 1 FROM orders AS srvc WHERE srvc.status = dept.status );
{ "outer_table": "categories", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "srvc", "proj_col": "amount", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_train_00806
train
T1
v1
Schema: departments (alias: catg)(type, date, amount, name) employees(type, level, status, salary) Task: Select name from departments where code exists in employees for the same code. SQL:
SELECT name FROM departments AS catg WHERE code IN ( SELECT code FROM employees AS txn WHERE txn.code = catg.code );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_train_00807
train
T2
v3
Schema: employees (alias: ordr)(status, date, salary, amount) tasks(salary, type, level, code) Task: Find value from employees where value exceeds the average amount from tasks for the same status. SQL:
SELECT value FROM employees AS ordr WHERE value > ( SELECT MIN(amount) FROM tasks AS srvc WHERE srvc.status = ordr.status );
{ "outer_table": "employees", "inner_table": "tasks", "outer_alias": "ordr", "inner_alias": "srvc", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_train_00808
train
T2
v1
Schema: products (alias: acct)(value, amount, code, level) tasks(code, name, date, value) Task: Find salary from products where status appears in tasks entries with matching level. SQL:
SELECT salary FROM products AS acct WHERE status IN ( SELECT status FROM tasks AS ordr WHERE ordr.level = acct.level );
{ "outer_table": "products", "inner_table": "tasks", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_train_00809
train
T1
v3
Schema: departments (alias: ord)(level, salary, name, type) regions(code, name, amount, salary) Task: Retrieve code from departments with value above the MAX(value) of regions rows sharing the same level. SQL:
SELECT code FROM departments AS ord WHERE value > ( SELECT MAX(value) FROM regions AS emp WHERE emp.level = ord.level );
{ "outer_table": "departments", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_train_00810
train
T1
v3
Schema: departments (alias: txn)(level, id, value, amount) employees(salary, status, code, amount) Task: Find id from departments where salary exceeds the average amount from employees for the same type. SQL:
SELECT id FROM departments AS txn WHERE salary > ( SELECT COUNT(amount) FROM employees AS acct WHERE acct.type = txn.type );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_train_00811
train
T1
v1
Schema: employees (alias: empl)(value, code, id, name) regions(date, type, amount, value) Task: Find salary from employees where level appears in regions entries with matching type. SQL:
SELECT salary FROM employees AS empl WHERE level IN ( SELECT level FROM regions AS txn WHERE txn.type = empl.type );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "salary", "filter_col": "level", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_train_00812
train
T2
v2
Schema: transactions (alias: acct)(status, salary, date, level) projects(type, salary, id, name) Task: Find value from transactions where a matching record exists in projects with the same type. SQL:
SELECT value FROM transactions AS acct WHERE EXISTS ( SELECT 1 FROM projects AS emp WHERE emp.type = acct.type );
{ "outer_table": "transactions", "inner_table": "projects", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "value", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_train_00813
train
T1
v1
Schema: tasks (alias: budg)(value, level, name, id) departments(status, name, date, code) Task: Select id from tasks where id exists in departments for the same level. SQL:
SELECT id FROM tasks AS budg WHERE id IN ( SELECT id FROM departments AS rgn WHERE rgn.level = budg.level );
{ "outer_table": "tasks", "inner_table": "departments", "outer_alias": "budg", "inner_alias": "rgn", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_train_00814
train
T2
v1
Schema: shipments (alias: budg)(name, id, code, status) transactions(name, salary, level, amount) Task: Select amount from shipments where level exists in transactions for the same status. SQL:
SELECT amount FROM shipments AS budg WHERE level IN ( SELECT level FROM transactions AS empl WHERE empl.status = budg.status );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "budg", "inner_alias": "empl", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_train_00815
train
T2
v3
Schema: accounts (alias: srvc)(date, status, level, code) transactions(type, value, status, level) Task: Find name from accounts where salary exceeds the average amount from transactions for the same status. SQL:
SELECT name FROM accounts AS srvc WHERE salary > ( SELECT MIN(amount) FROM transactions AS catg WHERE catg.status = srvc.status );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "srvc", "inner_alias": "catg", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_train_00816
train
T2
v3
Schema: departments (alias: rgn)(value, salary, amount, type) shipments(code, status, salary, type) Task: Find value from departments where value exceeds the average value from shipments for the same level. SQL:
SELECT value FROM departments AS rgn WHERE value > ( SELECT MIN(value) FROM shipments AS txn WHERE txn.level = rgn.level );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_train_00817
train
T2
v1
Schema: branches (alias: ord)(type, status, amount, value) products(amount, status, name, value) Task: Find amount from branches where code appears in products entries with matching type. SQL:
SELECT amount FROM branches AS ord WHERE code IN ( SELECT code FROM products AS inv WHERE inv.type = ord.type );
{ "outer_table": "branches", "inner_table": "products", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_train_00818
train
T1
v1
Schema: tasks (alias: txn)(value, type, id, date) regions(status, type, salary, amount) Task: Find id from tasks where id appears in regions entries with matching code. SQL:
SELECT id FROM tasks AS txn WHERE id IN ( SELECT id FROM regions AS ordr WHERE ordr.code = txn.code );
{ "outer_table": "tasks", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "id", "filter_col": "id", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_train_00819
train
T1
v1
Schema: products (alias: prod)(amount, salary, id, name) projects(type, code, status, amount) Task: Retrieve name from products whose code is found in projects rows where level matches the outer record. SQL:
SELECT name FROM products AS prod WHERE code IN ( SELECT code FROM projects AS ordr WHERE ordr.level = prod.level );
{ "outer_table": "products", "inner_table": "projects", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_train_00820
train
T1
v1
Schema: suppliers (alias: shp)(date, code, status, value) projects(code, salary, amount, value) Task: Select name from suppliers where code exists in projects for the same type. SQL:
SELECT name FROM suppliers AS shp WHERE code IN ( SELECT code FROM projects AS prod WHERE prod.type = shp.type );
{ "outer_table": "suppliers", "inner_table": "projects", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "name", "filter_col": "code", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_train_00821
train
T2
v2
Schema: accounts (alias: rgn)(id, salary, type, amount) departments(level, name, type, date) Task: Retrieve amount from accounts that have at least one corresponding entry in departments sharing the same code. SQL:
SELECT amount FROM accounts AS rgn WHERE EXISTS ( SELECT 1 FROM departments AS cust WHERE cust.code = rgn.code );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "amount", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_train_00822
train
T2
v1
Schema: branches (alias: inv)(name, date, status, type) regions(id, date, value, status) Task: Find value from branches where code appears in regions entries with matching code. SQL:
SELECT value FROM branches AS inv WHERE code IN ( SELECT code FROM regions AS whs WHERE whs.code = inv.code );
{ "outer_table": "branches", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "whs", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_train_00823
train
T1
v2
Schema: products (alias: ordr)(level, amount, code, type) projects(salary, status, code, id) Task: Find name from products where a matching record exists in projects with the same status. SQL:
SELECT name FROM products AS ordr WHERE EXISTS ( SELECT 1 FROM projects AS sale WHERE sale.status = ordr.status );
{ "outer_table": "products", "inner_table": "projects", "outer_alias": "ordr", "inner_alias": "sale", "proj_col": "name", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_train_00824
train
T2
v2
Schema: customers (alias: empl)(name, id, date, type) tasks(value, salary, level, code) Task: Find value from customers where a matching record exists in tasks with the same type. SQL:
SELECT value FROM customers AS empl WHERE EXISTS ( SELECT 1 FROM tasks AS shp WHERE shp.type = empl.type );
{ "outer_table": "customers", "inner_table": "tasks", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "value", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_train_00825
train
T2
v2
Schema: warehouses (alias: ordr)(name, date, salary, value) customers(salary, name, type, code) Task: Find code from warehouses where a matching record exists in customers with the same code. SQL:
SELECT code FROM warehouses AS ordr WHERE EXISTS ( SELECT 1 FROM customers AS rgn WHERE rgn.code = ordr.code );
{ "outer_table": "warehouses", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "code", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_train_00826
train
T2
v3
Schema: projects (alias: mgr)(status, code, amount, date) shipments(value, status, name, code) Task: Retrieve code from projects with value above the AVG(value) of shipments rows sharing the same level. SQL:
SELECT code FROM projects AS mgr WHERE value > ( SELECT AVG(value) FROM shipments AS rgn WHERE rgn.level = mgr.level );
{ "outer_table": "projects", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_train_00827
train
T1
v1
Schema: suppliers (alias: ordr)(level, date, name, amount) regions(code, level, salary, id) Task: Retrieve amount from suppliers whose code is found in regions rows where type matches the outer record. SQL:
SELECT amount FROM suppliers AS ordr WHERE code IN ( SELECT code FROM regions AS inv WHERE inv.type = ordr.type );
{ "outer_table": "suppliers", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_train_00828
train
T2
v1
Schema: warehouses (alias: whs)(value, id, code, date) transactions(status, name, value, id) Task: Select code from warehouses where type exists in transactions for the same code. SQL:
SELECT code FROM warehouses AS whs WHERE type IN ( SELECT type FROM transactions AS dept WHERE dept.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "transactions", "outer_alias": "whs", "inner_alias": "dept", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_train_00829
train
T2
v2
Schema: suppliers (alias: dept)(level, salary, type, name) invoices(amount, salary, status, code) Task: Find name from suppliers where a matching record exists in invoices with the same level. SQL:
SELECT name FROM suppliers AS dept WHERE EXISTS ( SELECT 1 FROM invoices AS catg WHERE catg.level = dept.level );
{ "outer_table": "suppliers", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "name", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_train_00830
train
T1
v3
Schema: transactions (alias: cust)(status, amount, salary, code) projects(date, value, name, salary) Task: Retrieve value from transactions with amount above the SUM(amount) of projects rows sharing the same id. SQL:
SELECT value FROM transactions AS cust WHERE amount > ( SELECT SUM(amount) FROM projects AS budg WHERE budg.id = cust.id );
{ "outer_table": "transactions", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "budg", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_train_00831
train
T1
v2
Schema: departments (alias: shp)(status, level, value, id) categories(salary, status, value, code) Task: Find salary from departments where a matching record exists in categories with the same code. SQL:
SELECT salary FROM departments AS shp WHERE EXISTS ( SELECT 1 FROM categories AS mgr WHERE mgr.code = shp.code );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "salary", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_train_00832
train
T2
v1
Schema: projects (alias: cust)(status, salary, value, date) suppliers(type, id, name, date) Task: Find amount from projects where level appears in suppliers entries with matching level. SQL:
SELECT amount FROM projects AS cust WHERE level IN ( SELECT level FROM suppliers AS prod WHERE prod.level = cust.level );
{ "outer_table": "projects", "inner_table": "suppliers", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "amount", "filter_col": "level", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_train_00833
train
T1
v1
Schema: categories (alias: cust)(code, name, amount, status) regions(id, type, amount, date) Task: Select amount from categories where type exists in regions for the same status. SQL:
SELECT amount FROM categories AS cust WHERE type IN ( SELECT type FROM regions AS mgr WHERE mgr.status = cust.status );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_train_00834
train
T1
v3
Schema: orders (alias: shp)(status, value, type, name) regions(date, status, code, amount) Task: Find salary from orders where value exceeds the average salary from regions for the same status. SQL:
SELECT salary FROM orders AS shp WHERE value > ( SELECT MAX(salary) FROM regions AS rgn WHERE rgn.status = shp.status );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_train_00835
train
T2
v1
Schema: categories (alias: lne)(type, salary, code, status) warehouses(value, code, status, name) Task: Select code from categories where status exists in warehouses for the same level. SQL:
SELECT code FROM categories AS lne WHERE status IN ( SELECT status FROM warehouses AS whs WHERE whs.level = lne.level );
{ "outer_table": "categories", "inner_table": "warehouses", "outer_alias": "lne", "inner_alias": "whs", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_train_00836
train
T2
v2
Schema: suppliers (alias: emp)(name, value, date, code) shipments(status, level, salary, amount) Task: Find amount from suppliers where a matching record exists in shipments with the same status. SQL:
SELECT amount FROM suppliers AS emp WHERE EXISTS ( SELECT 1 FROM shipments AS dept WHERE dept.status = emp.status );
{ "outer_table": "suppliers", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "amount", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_train_00837
train
T1
v1
Schema: projects (alias: sale)(name, level, value, status) tasks(name, value, status, amount) Task: Select value from projects where type exists in tasks for the same status. SQL:
SELECT value FROM projects AS sale WHERE type IN ( SELECT type FROM tasks AS emp WHERE emp.status = sale.status );
{ "outer_table": "projects", "inner_table": "tasks", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_train_00838
train
T1
v1
Schema: employees (alias: budg)(salary, amount, level, code) categories(salary, date, value, name) Task: Find value from employees where type appears in categories entries with matching id. SQL:
SELECT value FROM employees AS budg WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.id = budg.id );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "budg", "inner_alias": "catg", "proj_col": "value", "filter_col": "type", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_train_00839
train
T2
v1
Schema: warehouses (alias: ord)(amount, level, code, name) accounts(code, id, status, amount) Task: Select name from warehouses where type exists in accounts for the same level. SQL:
SELECT name FROM warehouses AS ord WHERE type IN ( SELECT type FROM accounts AS shp WHERE shp.level = ord.level );
{ "outer_table": "warehouses", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_train_00840
train
T1
v2
Schema: orders (alias: rgn)(value, type, date, amount) branches(code, value, date, amount) Task: Retrieve code from orders that have at least one corresponding entry in branches sharing the same level. SQL:
SELECT code FROM orders AS rgn WHERE EXISTS ( SELECT 1 FROM branches AS budg WHERE budg.level = rgn.level );
{ "outer_table": "orders", "inner_table": "branches", "outer_alias": "rgn", "inner_alias": "budg", "proj_col": "code", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_train_00841
train
T2
v1
Schema: employees (alias: txn)(salary, id, date, type) branches(amount, level, id, status) Task: Select salary from employees where id exists in branches for the same level. SQL:
SELECT salary FROM employees AS txn WHERE id IN ( SELECT id FROM branches AS cust WHERE cust.level = txn.level );
{ "outer_table": "employees", "inner_table": "branches", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "salary", "filter_col": "id", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_train_00842
train
T1
v1
Schema: customers (alias: whs)(code, name, type, level) employees(salary, value, amount, status) Task: Retrieve code from customers whose id is found in employees rows where status matches the outer record. SQL:
SELECT code FROM customers AS whs WHERE id IN ( SELECT id FROM employees AS acct WHERE acct.status = whs.status );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "whs", "inner_alias": "acct", "proj_col": "code", "filter_col": "id", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_train_00843
train
T2
v2
Schema: accounts (alias: sale)(name, amount, code, status) categories(date, code, amount, value) Task: Find id from accounts where a matching record exists in categories with the same status. SQL:
SELECT id FROM accounts AS sale WHERE EXISTS ( SELECT 1 FROM categories AS emp WHERE emp.status = sale.status );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "id", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_train_00844
train
T1
v2
Schema: transactions (alias: inv)(type, salary, value, name) orders(name, date, level, type) Task: Retrieve salary from transactions that have at least one corresponding entry in orders sharing the same id. SQL:
SELECT salary FROM transactions AS inv WHERE EXISTS ( SELECT 1 FROM orders AS catg WHERE catg.id = inv.id );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "salary", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_train_00845
train
T1
v1
Schema: categories (alias: emp)(date, level, id, salary) products(id, name, value, amount) Task: Find name from categories where status appears in products entries with matching type. SQL:
SELECT name FROM categories AS emp WHERE status IN ( SELECT status FROM products AS ordr WHERE ordr.type = emp.type );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_train_00846
train
T1
v3
Schema: orders (alias: schd)(id, code, value, name) products(name, code, date, level) Task: Find name from orders where amount exceeds the average salary from products for the same type. SQL:
SELECT name FROM orders AS schd WHERE amount > ( SELECT COUNT(salary) FROM products AS budg WHERE budg.type = schd.type );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "schd", "inner_alias": "budg", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_train_00847
train
T2
v3
Schema: customers (alias: rgn)(date, name, level, status) accounts(code, amount, value, date) Task: Retrieve name from customers with value above the COUNT(value) of accounts rows sharing the same id. SQL:
SELECT name FROM customers AS rgn WHERE value > ( SELECT COUNT(value) FROM accounts AS prod WHERE prod.id = rgn.id );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_train_00848
train
T2
v3
Schema: tasks (alias: budg)(type, value, name, code) shipments(type, code, name, value) Task: Retrieve amount from tasks with value above the MAX(value) of shipments rows sharing the same id. SQL:
SELECT amount FROM tasks AS budg WHERE value > ( SELECT MAX(value) FROM shipments AS shp WHERE shp.id = budg.id );
{ "outer_table": "tasks", "inner_table": "shipments", "outer_alias": "budg", "inner_alias": "shp", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_train_00849
train
T2
v3
Schema: departments (alias: schd)(salary, value, amount, code) orders(code, salary, name, date) Task: Find id from departments where amount exceeds the average salary from orders for the same id. SQL:
SELECT id FROM departments AS schd WHERE amount > ( SELECT COUNT(salary) FROM orders AS srvc WHERE srvc.id = schd.id );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "srvc", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_train_00850
train
T2
v2
Schema: customers (alias: mgr)(value, code, type, name) shipments(code, salary, amount, value) Task: Retrieve value from customers that have at least one corresponding entry in shipments sharing the same level. SQL:
SELECT value FROM customers AS mgr WHERE EXISTS ( SELECT 1 FROM shipments AS catg WHERE catg.level = mgr.level );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "catg", "proj_col": "value", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_train_00851
train
T1
v1
Schema: customers (alias: mgr)(type, amount, code, value) tasks(salary, level, status, date) Task: Retrieve amount from customers whose status is found in tasks rows where status matches the outer record. SQL:
SELECT amount FROM customers AS mgr WHERE status IN ( SELECT status FROM tasks AS sale WHERE sale.status = mgr.status );
{ "outer_table": "customers", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_train_00852
train
T1
v1
Schema: products (alias: dept)(salary, status, id, type) warehouses(value, level, name, status) Task: Retrieve amount from products whose type is found in warehouses rows where status matches the outer record. SQL:
SELECT amount FROM products AS dept WHERE type IN ( SELECT type FROM warehouses AS schd WHERE schd.status = dept.status );
{ "outer_table": "products", "inner_table": "warehouses", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_train_00853
train
T1
v1
Schema: transactions (alias: srvc)(id, value, level, amount) suppliers(date, amount, code, salary) Task: Find id from transactions where type appears in suppliers entries with matching status. SQL:
SELECT id FROM transactions AS srvc WHERE type IN ( SELECT type FROM suppliers AS mgr WHERE mgr.status = srvc.status );
{ "outer_table": "transactions", "inner_table": "suppliers", "outer_alias": "srvc", "inner_alias": "mgr", "proj_col": "id", "filter_col": "type", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_train_00854
train
T2
v2
Schema: accounts (alias: prod)(date, code, name, level) categories(code, level, status, value) Task: Find value from accounts where a matching record exists in categories with the same id. SQL:
SELECT value FROM accounts AS prod WHERE EXISTS ( SELECT 1 FROM categories AS ord WHERE ord.id = prod.id );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "value", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_train_00855
train
T1
v1
Schema: transactions (alias: inv)(level, salary, amount, type) branches(level, date, salary, amount) Task: Find code from transactions where status appears in branches entries with matching id. SQL:
SELECT code FROM transactions AS inv WHERE status IN ( SELECT status FROM branches AS dept WHERE dept.id = inv.id );
{ "outer_table": "transactions", "inner_table": "branches", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_train_00856
train
T1
v2
Schema: projects (alias: empl)(code, level, status, amount) suppliers(code, status, date, salary) Task: Find amount from projects where a matching record exists in suppliers with the same id. SQL:
SELECT amount FROM projects AS empl WHERE EXISTS ( SELECT 1 FROM suppliers AS dept WHERE dept.id = empl.id );
{ "outer_table": "projects", "inner_table": "suppliers", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "amount", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_train_00857
train
T2
v2
Schema: invoices (alias: budg)(id, amount, value, name) warehouses(name, date, amount, salary) Task: Retrieve salary from invoices that have at least one corresponding entry in warehouses sharing the same status. SQL:
SELECT salary FROM invoices AS budg WHERE EXISTS ( SELECT 1 FROM warehouses AS txn WHERE txn.status = budg.status );
{ "outer_table": "invoices", "inner_table": "warehouses", "outer_alias": "budg", "inner_alias": "txn", "proj_col": "salary", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_train_00858
train
T2
v2
Schema: branches (alias: prod)(status, code, salary, type) warehouses(name, id, type, status) Task: Retrieve id from branches that have at least one corresponding entry in warehouses sharing the same status. SQL:
SELECT id FROM branches AS prod WHERE EXISTS ( SELECT 1 FROM warehouses AS mgr WHERE mgr.status = prod.status );
{ "outer_table": "branches", "inner_table": "warehouses", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "id", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_train_00859
train
T1
v2
Schema: orders (alias: schd)(type, name, date, code) tasks(value, name, id, amount) Task: Retrieve code from orders that have at least one corresponding entry in tasks sharing the same type. SQL:
SELECT code FROM orders AS schd WHERE EXISTS ( SELECT 1 FROM tasks AS rgn WHERE rgn.type = schd.type );
{ "outer_table": "orders", "inner_table": "tasks", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "code", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_train_00860
train
T2
v3
Schema: regions (alias: sale)(date, id, salary, status) departments(value, id, salary, amount) Task: Retrieve amount from regions with salary above the SUM(value) of departments rows sharing the same code. SQL:
SELECT amount FROM regions AS sale WHERE salary > ( SELECT SUM(value) FROM departments AS schd WHERE schd.code = sale.code );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_train_00861
train
T1
v1
Schema: accounts (alias: srvc)(code, id, amount, status) departments(type, level, value, code) Task: Find name from accounts where code appears in departments entries with matching status. SQL:
SELECT name FROM accounts AS srvc WHERE code IN ( SELECT code FROM departments AS cust WHERE cust.status = srvc.status );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "srvc", "inner_alias": "cust", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_train_00862
train
T2
v3
Schema: tasks (alias: inv)(date, salary, name, level) departments(type, code, amount, status) Task: Find code from tasks where amount exceeds the average amount from departments for the same id. SQL:
SELECT code FROM tasks AS inv WHERE amount > ( SELECT SUM(amount) FROM departments AS cust WHERE cust.id = inv.id );
{ "outer_table": "tasks", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_train_00863
train
T1
v3
Schema: regions (alias: srvc)(value, code, salary, level) suppliers(code, date, salary, status) Task: Retrieve value from regions with value above the COUNT(value) of suppliers rows sharing the same code. SQL:
SELECT value FROM regions AS srvc WHERE value > ( SELECT COUNT(value) FROM suppliers AS shp WHERE shp.code = srvc.code );
{ "outer_table": "regions", "inner_table": "suppliers", "outer_alias": "srvc", "inner_alias": "shp", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_train_00864
train
T2
v3
Schema: categories (alias: shp)(salary, value, code, status) transactions(amount, salary, name, level) Task: Find name from categories where value exceeds the average amount from transactions for the same code. SQL:
SELECT name FROM categories AS shp WHERE value > ( SELECT COUNT(amount) FROM transactions AS acct WHERE acct.code = shp.code );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_train_00865
train
T2
v3
Schema: products (alias: ord)(type, status, salary, code) shipments(level, code, date, value) Task: Find id from products where amount exceeds the average salary from shipments for the same code. SQL:
SELECT id FROM products AS ord WHERE amount > ( SELECT AVG(salary) FROM shipments AS sale WHERE sale.code = ord.code );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_train_00866
train
T1
v1
Schema: warehouses (alias: schd)(id, value, date, level) customers(id, level, type, amount) Task: Find code from warehouses where id appears in customers entries with matching status. SQL:
SELECT code FROM warehouses AS schd WHERE id IN ( SELECT id FROM customers AS acct WHERE acct.status = schd.status );
{ "outer_table": "warehouses", "inner_table": "customers", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "code", "filter_col": "id", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_train_00867
train
T2
v1
Schema: branches (alias: dept)(amount, code, salary, name) warehouses(amount, date, code, id) Task: Select amount from branches where level exists in warehouses for the same code. SQL:
SELECT amount FROM branches AS dept WHERE level IN ( SELECT level FROM warehouses AS emp WHERE emp.code = dept.code );
{ "outer_table": "branches", "inner_table": "warehouses", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_train_00868
train
T1
v3
Schema: warehouses (alias: txn)(salary, id, status, type) categories(salary, name, value, date) Task: Find salary from warehouses where amount exceeds the average salary from categories for the same id. SQL:
SELECT salary FROM warehouses AS txn WHERE amount > ( SELECT MAX(salary) FROM categories AS inv WHERE inv.id = txn.id );
{ "outer_table": "warehouses", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_train_00869
train
T1
v1
Schema: invoices (alias: emp)(id, name, value, status) projects(code, amount, name, level) Task: Retrieve amount from invoices whose status is found in projects rows where level matches the outer record. SQL:
SELECT amount FROM invoices AS emp WHERE status IN ( SELECT status FROM projects AS txn WHERE txn.level = emp.level );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_train_00870
train
T1
v3
Schema: regions (alias: budg)(date, status, level, salary) orders(amount, salary, code, type) Task: Retrieve salary from regions with value above the MAX(amount) of orders rows sharing the same code. SQL:
SELECT salary FROM regions AS budg WHERE value > ( SELECT MAX(amount) FROM orders AS rgn WHERE rgn.code = budg.code );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "budg", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_train_00871
train
T2
v1
Schema: projects (alias: acct)(name, value, level, status) warehouses(amount, id, type, date) Task: Retrieve salary from projects whose status is found in warehouses rows where status matches the outer record. SQL:
SELECT salary FROM projects AS acct WHERE status IN ( SELECT status FROM warehouses AS shp WHERE shp.status = acct.status );
{ "outer_table": "projects", "inner_table": "warehouses", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_train_00872
train
T1
v1
Schema: employees (alias: shp)(level, name, type, value) suppliers(date, name, type, salary) Task: Find value from employees where id appears in suppliers entries with matching type. SQL:
SELECT value FROM employees AS shp WHERE id IN ( SELECT id FROM suppliers AS mgr WHERE mgr.type = shp.type );
{ "outer_table": "employees", "inner_table": "suppliers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_train_00873
train
T2
v1
Schema: employees (alias: whs)(value, date, amount, id) warehouses(amount, name, type, status) Task: Select id from employees where id exists in warehouses for the same type. SQL:
SELECT id FROM employees AS whs WHERE id IN ( SELECT id FROM warehouses AS dept WHERE dept.type = whs.type );
{ "outer_table": "employees", "inner_table": "warehouses", "outer_alias": "whs", "inner_alias": "dept", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_train_00874
train
T2
v2
Schema: regions (alias: emp)(amount, date, id, code) employees(type, code, name, status) Task: Retrieve id from regions that have at least one corresponding entry in employees sharing the same level. SQL:
SELECT id FROM regions AS emp WHERE EXISTS ( SELECT 1 FROM employees AS ordr WHERE ordr.level = emp.level );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "id", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_train_00875
train
T1
v2
Schema: warehouses (alias: ordr)(type, level, id, code) employees(amount, salary, value, code) Task: Find name from warehouses where a matching record exists in employees with the same id. SQL:
SELECT name FROM warehouses AS ordr WHERE EXISTS ( SELECT 1 FROM employees AS txn WHERE txn.id = ordr.id );
{ "outer_table": "warehouses", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "name", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_train_00876
train
T2
v2
Schema: customers (alias: shp)(id, code, status, level) categories(name, status, level, id) Task: Find salary from customers where a matching record exists in categories with the same type. SQL:
SELECT salary FROM customers AS shp WHERE EXISTS ( SELECT 1 FROM categories AS emp WHERE emp.type = shp.type );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "salary", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_train_00877
train
T2
v1
Schema: branches (alias: sale)(status, code, type, value) transactions(code, date, name, type) Task: Find value from branches where id appears in transactions entries with matching id. SQL:
SELECT value FROM branches AS sale WHERE id IN ( SELECT id FROM transactions AS shp WHERE shp.id = sale.id );
{ "outer_table": "branches", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_train_00878
train
T1
v2
Schema: accounts (alias: schd)(status, code, value, amount) suppliers(status, date, type, name) Task: Retrieve value from accounts that have at least one corresponding entry in suppliers sharing the same status. SQL:
SELECT value FROM accounts AS schd WHERE EXISTS ( SELECT 1 FROM suppliers AS budg WHERE budg.status = schd.status );
{ "outer_table": "accounts", "inner_table": "suppliers", "outer_alias": "schd", "inner_alias": "budg", "proj_col": "value", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_train_00879
train
T2
v1
Schema: orders (alias: sale)(name, status, salary, date) accounts(status, code, date, level) Task: Select amount from orders where level exists in accounts for the same type. SQL:
SELECT amount FROM orders AS sale WHERE level IN ( SELECT level FROM accounts AS mgr WHERE mgr.type = sale.type );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "level", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_train_00880
train
T1
v2
Schema: transactions (alias: whs)(value, date, salary, status) products(date, level, id, value) Task: Retrieve salary from transactions that have at least one corresponding entry in products sharing the same code. SQL:
SELECT salary FROM transactions AS whs WHERE EXISTS ( SELECT 1 FROM products AS schd WHERE schd.code = whs.code );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "whs", "inner_alias": "schd", "proj_col": "salary", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_train_00881
train
T2
v3
Schema: products (alias: ordr)(code, type, name, status) suppliers(value, date, type, salary) Task: Find amount from products where salary exceeds the average amount from suppliers for the same status. SQL:
SELECT amount FROM products AS ordr WHERE salary > ( SELECT SUM(amount) FROM suppliers AS acct WHERE acct.status = ordr.status );
{ "outer_table": "products", "inner_table": "suppliers", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_train_00882
train
T2
v2
Schema: departments (alias: mgr)(salary, type, level, value) branches(code, salary, amount, date) Task: Find id from departments where a matching record exists in branches with the same status. SQL:
SELECT id FROM departments AS mgr WHERE EXISTS ( SELECT 1 FROM branches AS ord WHERE ord.status = mgr.status );
{ "outer_table": "departments", "inner_table": "branches", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "id", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_train_00883
train
T1
v2
Schema: warehouses (alias: sale)(level, id, type, name) categories(id, code, level, amount) Task: Retrieve id from warehouses that have at least one corresponding entry in categories sharing the same level. SQL:
SELECT id FROM warehouses AS sale WHERE EXISTS ( SELECT 1 FROM categories AS budg WHERE budg.level = sale.level );
{ "outer_table": "warehouses", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "budg", "proj_col": "id", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_train_00884
train
T1
v3
Schema: tasks (alias: empl)(id, name, code, value) categories(id, status, type, level) Task: Find id from tasks where amount exceeds the average value from categories for the same type. SQL:
SELECT id FROM tasks AS empl WHERE amount > ( SELECT COUNT(value) FROM categories AS budg WHERE budg.type = empl.type );
{ "outer_table": "tasks", "inner_table": "categories", "outer_alias": "empl", "inner_alias": "budg", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_train_00885
train
T2
v2
Schema: departments (alias: dept)(code, type, amount, date) orders(code, value, salary, name) Task: Find code from departments where a matching record exists in orders with the same id. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM orders AS catg WHERE catg.id = dept.id );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "code", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_train_00886
train
T1
v1
Schema: projects (alias: ordr)(value, status, salary, amount) accounts(amount, status, level, name) Task: Retrieve value from projects whose status is found in accounts rows where level matches the outer record. SQL:
SELECT value FROM projects AS ordr WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.level = ordr.level );
{ "outer_table": "projects", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_train_00887
train
T2
v1
Schema: projects (alias: srvc)(name, code, salary, level) invoices(amount, name, salary, id) Task: Select name from projects where code exists in invoices for the same type. SQL:
SELECT name FROM projects AS srvc WHERE code IN ( SELECT code FROM invoices AS prod WHERE prod.type = srvc.type );
{ "outer_table": "projects", "inner_table": "invoices", "outer_alias": "srvc", "inner_alias": "prod", "proj_col": "name", "filter_col": "code", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_train_00888
train
T2
v1
Schema: products (alias: srvc)(status, type, code, name) projects(status, amount, name, level) Task: Retrieve code from products whose level is found in projects rows where code matches the outer record. SQL:
SELECT code FROM products AS srvc WHERE level IN ( SELECT level FROM projects AS mgr WHERE mgr.code = srvc.code );
{ "outer_table": "products", "inner_table": "projects", "outer_alias": "srvc", "inner_alias": "mgr", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_train_00889
train
T2
v2
Schema: tasks (alias: emp)(id, amount, date, type) accounts(amount, date, salary, code) Task: Find id from tasks where a matching record exists in accounts with the same level. SQL:
SELECT id FROM tasks AS emp WHERE EXISTS ( SELECT 1 FROM accounts AS sale WHERE sale.level = emp.level );
{ "outer_table": "tasks", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "sale", "proj_col": "id", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_train_00890
train
T1
v3
Schema: departments (alias: lne)(level, date, status, type) branches(date, type, code, salary) Task: Find value from departments where value exceeds the average value from branches for the same status. SQL:
SELECT value FROM departments AS lne WHERE value > ( SELECT MIN(value) FROM branches AS dept WHERE dept.status = lne.status );
{ "outer_table": "departments", "inner_table": "branches", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_train_00891
train
T2
v2
Schema: categories (alias: rgn)(name, status, level, date) products(date, id, level, code) Task: Retrieve amount from categories that have at least one corresponding entry in products sharing the same level. SQL:
SELECT amount FROM categories AS rgn WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = rgn.level );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "amount", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_train_00892
train
T2
v2
Schema: employees (alias: shp)(date, name, status, level) shipments(amount, level, date, name) Task: Find value from employees where a matching record exists in shipments with the same type. SQL:
SELECT value FROM employees AS shp WHERE EXISTS ( SELECT 1 FROM shipments AS empl WHERE empl.type = shp.type );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "value", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_train_00893
train
T2
v1
Schema: categories (alias: dept)(code, amount, name, value) tasks(type, level, name, salary) Task: Retrieve amount from categories whose status is found in tasks rows where level matches the outer record. SQL:
SELECT amount FROM categories AS dept WHERE status IN ( SELECT status FROM tasks AS srvc WHERE srvc.level = dept.level );
{ "outer_table": "categories", "inner_table": "tasks", "outer_alias": "dept", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_train_00894
train
T1
v2
Schema: customers (alias: whs)(amount, status, value, code) transactions(level, id, code, amount) Task: Retrieve code from customers that have at least one corresponding entry in transactions sharing the same level. SQL:
SELECT code FROM customers AS whs WHERE EXISTS ( SELECT 1 FROM transactions AS mgr WHERE mgr.level = whs.level );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "whs", "inner_alias": "mgr", "proj_col": "code", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_train_00895
train
T2
v3
Schema: transactions (alias: ord)(amount, status, value, salary) tasks(type, amount, code, id) Task: Retrieve salary from transactions with salary above the COUNT(salary) of tasks rows sharing the same id. SQL:
SELECT salary FROM transactions AS ord WHERE salary > ( SELECT COUNT(salary) FROM tasks AS ordr WHERE ordr.id = ord.id );
{ "outer_table": "transactions", "inner_table": "tasks", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_train_00896
train
T1
v1
Schema: projects (alias: txn)(level, name, id, value) employees(type, code, id, salary) Task: Select value from projects where id exists in employees for the same status. SQL:
SELECT value FROM projects AS txn WHERE id IN ( SELECT id FROM employees AS dept WHERE dept.status = txn.status );
{ "outer_table": "projects", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_train_00897
train
T1
v2
Schema: categories (alias: prod)(type, id, level, code) branches(level, value, amount, code) Task: Find value from categories where a matching record exists in branches with the same id. SQL:
SELECT value FROM categories AS prod WHERE EXISTS ( SELECT 1 FROM branches AS acct WHERE acct.id = prod.id );
{ "outer_table": "categories", "inner_table": "branches", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "value", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_train_00898
train
T1
v2
Schema: employees (alias: empl)(name, type, code, amount) branches(name, value, id, level) Task: Retrieve salary from employees that have at least one corresponding entry in branches sharing the same code. SQL:
SELECT salary FROM employees AS empl WHERE EXISTS ( SELECT 1 FROM branches AS shp WHERE shp.code = empl.code );
{ "outer_table": "employees", "inner_table": "branches", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "salary", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_train_00899
train
T2