variant
stringclasses
3 values
prompt
stringlengths
163
237
sql
stringlengths
103
143
metadata
unknown
id
stringlengths
21
21
split
stringclasses
1 value
token_group
stringclasses
2 values
v2
Schema: requests (alias: ordr)(id, code, level, type) invoices(code, salary, level, status) Task: Retrieve value from requests that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = ordr.type );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "value", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_00600
train
T2
v1
Schema: invoices (alias: inv)(id, level, status, amount) sales(salary, amount, id, value) Task: Find amount from invoices where status appears in sales entries with matching id. SQL:
SELECT amount FROM invoices AS inv WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.id = inv.id );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_00601
train
T1
v3
Schema: products (alias: prod)(type, status, name, amount) requests(code, date, type, name) Task: Retrieve name from products with salary above the COUNT(value) of requests rows sharing the same id. SQL:
SELECT name FROM products AS prod WHERE salary > ( SELECT COUNT(value) FROM requests AS ordr WHERE ordr.id = prod.id );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_00602
train
T1
v3
Schema: invoices (alias: inv)(amount, name, level, type) customers(status, name, level, code) Task: Retrieve id from invoices with value above the MAX(amount) of customers rows sharing the same status. SQL:
SELECT id FROM invoices AS inv WHERE value > ( SELECT MAX(amount) FROM customers AS cust WHERE cust.status = inv.status );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_00603
train
T1
v1
Schema: managers (alias: mgr)(value, type, level, status) shipments(value, amount, date, level) Task: Find amount from managers where level appears in shipments entries with matching level. SQL:
SELECT amount FROM managers AS mgr WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.level = mgr.level );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "amount", "filter_col": "level", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_00604
train
T1
v2
Schema: accounts (alias: acct)(status, level, id, date) employees(code, status, salary, id) Task: Retrieve value from accounts that have at least one corresponding entry in employees sharing the same code. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = acct.code );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "value", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_00605
train
T1
v1
Schema: orders (alias: ord)(status, amount, type, salary) transactions(level, name, id, salary) Task: Select amount from orders where type exists in transactions for the same id. SQL:
SELECT amount FROM orders AS ord WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.id = ord.id );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_00606
train
T1
v3
Schema: departments (alias: dept)(name, status, level, id) regions(date, level, amount, code) Task: Find name from departments where amount exceeds the average salary from regions for the same id. SQL:
SELECT name FROM departments AS dept WHERE amount > ( SELECT MIN(salary) FROM regions AS rgn WHERE rgn.id = dept.id );
{ "outer_table": "departments", "inner_table": "regions", "outer_alias": "dept", "inner_alias": "rgn", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_00607
train
T1
v3
Schema: sales (alias: sale)(id, name, salary, status) regions(type, name, date, code) Task: Retrieve amount from sales with value above the MAX(salary) of regions rows sharing the same level. SQL:
SELECT amount FROM sales AS sale WHERE value > ( SELECT MAX(salary) FROM regions AS rgn WHERE rgn.level = sale.level );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_00608
train
T1
v1
Schema: items (alias: lne)(date, type, name, salary) accounts(id, type, name, code) Task: Find code from items where code appears in accounts entries with matching status. SQL:
SELECT code FROM items AS lne WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.status = lne.status );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "code", "filter_col": "code", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_00609
train
T2
v1
Schema: items (alias: lne)(salary, name, amount, id) sales(level, type, date, salary) Task: Find amount from items where code appears in sales entries with matching type. SQL:
SELECT amount FROM items AS lne WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.type = lne.type );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_00610
train
T2
v3
Schema: managers (alias: mgr)(date, value, salary, name) services(value, id, name, amount) Task: Retrieve code from managers with amount above the MIN(value) of services rows sharing the same type. SQL:
SELECT code FROM managers AS mgr WHERE amount > ( SELECT MIN(value) FROM services AS srvc WHERE srvc.type = mgr.type );
{ "outer_table": "managers", "inner_table": "services", "outer_alias": "mgr", "inner_alias": "srvc", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_00611
train
T1
v2
Schema: departments (alias: dept)(salary, status, date, code) regions(status, salary, amount, date) Task: Find name from departments where a matching record exists in regions with the same level. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = dept.level );
{ "outer_table": "departments", "inner_table": "regions", "outer_alias": "dept", "inner_alias": "rgn", "proj_col": "name", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_00612
train
T1
v3
Schema: accounts (alias: acct)(value, id, type, code) customers(name, date, salary, level) Task: Find id from accounts where value exceeds the average value from customers for the same status. SQL:
SELECT id FROM accounts AS acct WHERE value > ( SELECT MIN(value) FROM customers AS cust WHERE cust.status = acct.status );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_00613
train
T1
v1
Schema: employees (alias: emp)(id, code, salary, amount) services(salary, type, amount, code) Task: Retrieve salary from employees whose level is found in services rows where level matches the outer record. SQL:
SELECT salary FROM employees AS emp WHERE level IN ( SELECT level FROM services AS srvc WHERE srvc.level = emp.level );
{ "outer_table": "employees", "inner_table": "services", "outer_alias": "emp", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "level", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_00614
train
T1
v1
Schema: categories (alias: catg)(code, name, salary, value) departments(date, level, name, id) Task: Find id from categories where type appears in departments entries with matching type. SQL:
SELECT id FROM categories AS catg WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.type = catg.type );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "id", "filter_col": "type", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_00615
train
T2
v3
Schema: managers (alias: mgr)(type, date, level, name) warehouses(type, amount, date, name) Task: Retrieve amount from managers with salary above the SUM(value) of warehouses rows sharing the same id. SQL:
SELECT amount FROM managers AS mgr WHERE salary > ( SELECT SUM(value) FROM warehouses AS whs WHERE whs.id = mgr.id );
{ "outer_table": "managers", "inner_table": "warehouses", "outer_alias": "mgr", "inner_alias": "whs", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_00616
train
T1
v1
Schema: customers (alias: cust)(salary, id, status, date) transactions(code, value, status, id) Task: Select name from customers where status exists in transactions for the same id. SQL:
SELECT name FROM customers AS cust WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.id = cust.id );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "name", "filter_col": "status", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_00617
train
T1
v3
Schema: managers (alias: mgr)(level, status, type, name) staff(id, amount, salary, level) Task: Retrieve salary from managers with value above the MIN(salary) of staff rows sharing the same level. SQL:
SELECT salary FROM managers AS mgr WHERE value > ( SELECT MIN(salary) FROM staff AS empl WHERE empl.level = mgr.level );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_00618
train
T1
v1
Schema: managers (alias: mgr)(value, salary, status, code) customers(salary, date, value, amount) Task: Find value from managers where status appears in customers entries with matching status. SQL:
SELECT value FROM managers AS mgr WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.status = mgr.status );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_00619
train
T1
v1
Schema: accounts (alias: acct)(id, amount, name, status) invoices(code, salary, date, name) Task: Find code from accounts where status appears in invoices entries with matching id. SQL:
SELECT code FROM accounts AS acct WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.id = acct.id );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_00620
train
T1
v3
Schema: shipments (alias: shp)(value, salary, level, amount) warehouses(amount, id, salary, status) Task: Find salary from shipments where amount exceeds the average amount from warehouses for the same code. SQL:
SELECT salary FROM shipments AS shp WHERE amount > ( SELECT AVG(amount) FROM warehouses AS whs WHERE whs.code = shp.code );
{ "outer_table": "shipments", "inner_table": "warehouses", "outer_alias": "shp", "inner_alias": "whs", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_00621
train
T2
v3
Schema: staff (alias: empl)(type, id, code, name) managers(name, value, date, amount) Task: Retrieve salary from staff with salary above the COUNT(value) of managers rows sharing the same code. SQL:
SELECT salary FROM staff AS empl WHERE salary > ( SELECT COUNT(value) FROM managers AS mgr WHERE mgr.code = empl.code );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_00622
train
T2
v2
Schema: schedules (alias: schd)(code, value, level, status) employees(name, code, value, id) Task: Find code from schedules where a matching record exists in employees with the same id. SQL:
SELECT code FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = schd.id );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "code", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_00623
train
T2
v3
Schema: shipments (alias: shp)(code, id, type, value) items(salary, status, id, value) Task: Retrieve salary from shipments with salary above the AVG(amount) of items rows sharing the same code. SQL:
SELECT salary FROM shipments AS shp WHERE salary > ( SELECT AVG(amount) FROM items AS lne WHERE lne.code = shp.code );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_00624
train
T2
v1
Schema: sales (alias: sale)(value, code, status, type) budgets(id, date, type, value) Task: Find id from sales where id appears in budgets entries with matching status. SQL:
SELECT id FROM sales AS sale WHERE id IN ( SELECT id FROM budgets AS budg WHERE budg.status = sale.status );
{ "outer_table": "sales", "inner_table": "budgets", "outer_alias": "sale", "inner_alias": "budg", "proj_col": "id", "filter_col": "id", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_00625
train
T1
v3
Schema: products (alias: prod)(value, id, amount, salary) warehouses(name, date, level, code) Task: Retrieve value from products with salary above the MIN(amount) of warehouses rows sharing the same status. SQL:
SELECT value FROM products AS prod WHERE salary > ( SELECT MIN(amount) FROM warehouses AS whs WHERE whs.status = prod.status );
{ "outer_table": "products", "inner_table": "warehouses", "outer_alias": "prod", "inner_alias": "whs", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_00626
train
T1
v1
Schema: categories (alias: catg)(name, amount, level, date) customers(name, type, code, date) Task: Retrieve name from categories whose type is found in customers rows where type matches the outer record. SQL:
SELECT name FROM categories AS catg WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.type = catg.type );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "name", "filter_col": "type", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_00627
train
T2
v1
Schema: staff (alias: empl)(status, name, id, amount) orders(name, status, id, amount) Task: Retrieve value from staff whose id is found in orders rows where type matches the outer record. SQL:
SELECT value FROM staff AS empl WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.type = empl.type );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_00628
train
T2
v1
Schema: categories (alias: catg)(salary, date, status, value) accounts(type, id, date, code) Task: Find name from categories where code appears in accounts entries with matching level. SQL:
SELECT name FROM categories AS catg WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.level = catg.level );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_00629
train
T2
v1
Schema: budgets (alias: budg)(name, type, salary, status) shipments(type, id, salary, name) Task: Find id from budgets where level appears in shipments entries with matching code. SQL:
SELECT id FROM budgets AS budg WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.code = budg.code );
{ "outer_table": "budgets", "inner_table": "shipments", "outer_alias": "budg", "inner_alias": "shp", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_00630
train
T2
v2
Schema: staff (alias: empl)(name, level, value, date) employees(name, id, status, amount) Task: Find name from staff where a matching record exists in employees with the same level. SQL:
SELECT name FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = empl.level );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "name", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_00631
train
T2
v1
Schema: shipments (alias: shp)(code, name, status, value) requests(value, date, salary, level) Task: Find salary from shipments where status appears in requests entries with matching code. SQL:
SELECT salary FROM shipments AS shp WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.code = shp.code );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_00632
train
T2
v1
Schema: transactions (alias: txn)(date, value, type, status) regions(code, amount, name, type) Task: Retrieve salary from transactions whose code is found in regions rows where level matches the outer record. SQL:
SELECT salary FROM transactions AS txn WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.level = txn.level );
{ "outer_table": "transactions", "inner_table": "regions", "outer_alias": "txn", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "code", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_00633
train
T1
v1
Schema: staff (alias: empl)(id, salary, value, type) warehouses(level, date, value, type) Task: Retrieve value from staff whose code is found in warehouses rows where code matches the outer record. SQL:
SELECT value FROM staff AS empl WHERE code IN ( SELECT code FROM warehouses AS whs WHERE whs.code = empl.code );
{ "outer_table": "staff", "inner_table": "warehouses", "outer_alias": "empl", "inner_alias": "whs", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_00634
train
T2
v3
Schema: schedules (alias: schd)(level, code, name, value) employees(salary, amount, status, name) Task: Find value from schedules where amount exceeds the average value from employees for the same code. SQL:
SELECT value FROM schedules AS schd WHERE amount > ( SELECT MIN(value) FROM employees AS emp WHERE emp.code = schd.code );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_00635
train
T2
v1
Schema: orders (alias: ord)(value, salary, date, level) accounts(date, code, id, salary) Task: Select id from orders where id exists in accounts for the same type. SQL:
SELECT id FROM orders AS ord WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.type = ord.type );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_00636
train
T1
v1
Schema: departments (alias: dept)(date, id, salary, code) customers(date, code, status, name) Task: Select code from departments where id exists in customers for the same id. SQL:
SELECT code FROM departments AS dept WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.id = dept.id );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "code", "filter_col": "id", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_00637
train
T1
v3
Schema: requests (alias: ordr)(salary, name, level, code) categories(date, level, name, id) Task: Find amount from requests where salary exceeds the average amount from categories for the same id. SQL:
SELECT amount FROM requests AS ordr WHERE salary > ( SELECT MIN(amount) FROM categories AS catg WHERE catg.id = ordr.id );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_00638
train
T2
v3
Schema: shipments (alias: shp)(salary, amount, id, level) invoices(level, value, name, status) Task: Find salary from shipments where salary exceeds the average salary from invoices for the same status. SQL:
SELECT salary FROM shipments AS shp WHERE salary > ( SELECT SUM(salary) FROM invoices AS inv WHERE inv.status = shp.status );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_00639
train
T2
v1
Schema: accounts (alias: acct)(level, salary, code, value) products(level, status, value, date) Task: Find amount from accounts where level appears in products entries with matching code. SQL:
SELECT amount FROM accounts AS acct WHERE level IN ( SELECT level FROM products AS prod WHERE prod.code = acct.code );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_00640
train
T1
v2
Schema: categories (alias: catg)(name, level, id, salary) sales(amount, status, name, id) Task: Retrieve value from categories that have at least one corresponding entry in sales sharing the same id. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = catg.id );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "value", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_00641
train
T2
v2
Schema: budgets (alias: budg)(type, date, amount, salary) invoices(status, type, level, date) Task: Retrieve name from budgets that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT name FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = budg.type );
{ "outer_table": "budgets", "inner_table": "invoices", "outer_alias": "budg", "inner_alias": "inv", "proj_col": "name", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_00642
train
T2
v2
Schema: regions (alias: rgn)(name, code, level, amount) schedules(value, type, status, amount) Task: Retrieve salary from regions that have at least one corresponding entry in schedules sharing the same type. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.type = rgn.type );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "salary", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_00643
train
T2
v1
Schema: warehouses (alias: whs)(id, value, date, type) shipments(amount, value, code, salary) Task: Retrieve code from warehouses whose id is found in shipments rows where level matches the outer record. SQL:
SELECT code FROM warehouses AS whs WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "shipments", "outer_alias": "whs", "inner_alias": "shp", "proj_col": "code", "filter_col": "id", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_00644
train
T2
v3
Schema: orders (alias: ord)(type, level, value, salary) customers(status, amount, date, salary) Task: Find amount from orders where amount exceeds the average amount from customers for the same id. SQL:
SELECT amount FROM orders AS ord WHERE amount > ( SELECT SUM(amount) FROM customers AS cust WHERE cust.id = ord.id );
{ "outer_table": "orders", "inner_table": "customers", "outer_alias": "ord", "inner_alias": "cust", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_00645
train
T1
v2
Schema: employees (alias: emp)(type, level, id, name) accounts(status, type, value, salary) Task: Retrieve code from employees that have at least one corresponding entry in accounts sharing the same level. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = emp.level );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "code", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_00646
train
T1
v2
Schema: customers (alias: cust)(type, id, date, status) shipments(type, code, date, amount) Task: Find code from customers where a matching record exists in shipments with the same status. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = cust.status );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "code", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_00647
train
T1
v3
Schema: shipments (alias: shp)(salary, value, level, name) accounts(type, id, status, value) Task: Find value from shipments where value exceeds the average value from accounts for the same level. SQL:
SELECT value FROM shipments AS shp WHERE value > ( SELECT MIN(value) FROM accounts AS acct WHERE acct.level = shp.level );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_00648
train
T2
v2
Schema: services (alias: srvc)(code, id, level, amount) budgets(type, code, salary, name) Task: Retrieve code from services that have at least one corresponding entry in budgets sharing the same status. SQL:
SELECT code FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.status = srvc.status );
{ "outer_table": "services", "inner_table": "budgets", "outer_alias": "srvc", "inner_alias": "budg", "proj_col": "code", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_00649
train
T2
v3
Schema: managers (alias: mgr)(type, level, id, code) budgets(id, value, name, amount) Task: Retrieve id from managers with salary above the MIN(salary) of budgets rows sharing the same code. SQL:
SELECT id FROM managers AS mgr WHERE salary > ( SELECT MIN(salary) FROM budgets AS budg WHERE budg.code = mgr.code );
{ "outer_table": "managers", "inner_table": "budgets", "outer_alias": "mgr", "inner_alias": "budg", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_00650
train
T1
v1
Schema: items (alias: lne)(level, type, amount, name) services(status, amount, level, name) Task: Retrieve code from items whose id is found in services rows where id matches the outer record. SQL:
SELECT code FROM items AS lne WHERE id IN ( SELECT id FROM services AS srvc WHERE srvc.id = lne.id );
{ "outer_table": "items", "inner_table": "services", "outer_alias": "lne", "inner_alias": "srvc", "proj_col": "code", "filter_col": "id", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_00651
train
T2
v2
Schema: customers (alias: cust)(status, level, salary, id) accounts(salary, value, amount, date) Task: Find salary from customers where a matching record exists in accounts with the same level. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = cust.level );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "salary", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_00652
train
T1
v2
Schema: departments (alias: dept)(date, level, type, name) warehouses(amount, status, date, level) Task: Retrieve id from departments that have at least one corresponding entry in warehouses sharing the same type. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.type = dept.type );
{ "outer_table": "departments", "inner_table": "warehouses", "outer_alias": "dept", "inner_alias": "whs", "proj_col": "id", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_00653
train
T1
v3
Schema: sales (alias: sale)(name, salary, type, date) managers(type, id, code, amount) Task: Find name from sales where salary exceeds the average salary from managers for the same code. SQL:
SELECT name FROM sales AS sale WHERE salary > ( SELECT COUNT(salary) FROM managers AS mgr WHERE mgr.code = sale.code );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_00654
train
T1
v2
Schema: customers (alias: cust)(id, level, code, amount) items(type, name, amount, code) Task: Retrieve value from customers that have at least one corresponding entry in items sharing the same type. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = cust.type );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "value", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_00655
train
T1
v1
Schema: categories (alias: catg)(date, value, status, type) transactions(value, id, code, amount) Task: Select amount from categories where id exists in transactions for the same status. SQL:
SELECT amount FROM categories AS catg WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.status = catg.status );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_00656
train
T2
v2
Schema: services (alias: srvc)(name, value, status, id) transactions(type, code, level, status) Task: Retrieve code from services that have at least one corresponding entry in transactions sharing the same status. SQL:
SELECT code FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = srvc.status );
{ "outer_table": "services", "inner_table": "transactions", "outer_alias": "srvc", "inner_alias": "txn", "proj_col": "code", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_00657
train
T2
v1
Schema: shipments (alias: shp)(code, salary, value, name) sales(salary, amount, date, level) Task: Retrieve name from shipments whose level is found in sales rows where type matches the outer record. SQL:
SELECT name FROM shipments AS shp WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.type = shp.type );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_00658
train
T2
v2
Schema: managers (alias: mgr)(date, status, level, id) products(name, level, id, amount) Task: Find amount from managers where a matching record exists in products with the same status. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = mgr.status );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "amount", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_00659
train
T1
v1
Schema: employees (alias: emp)(salary, type, code, amount) customers(code, id, level, status) Task: Find name from employees where id appears in customers entries with matching status. SQL:
SELECT name FROM employees AS emp WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.status = emp.status );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "name", "filter_col": "id", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_00660
train
T1
v1
Schema: accounts (alias: acct)(salary, level, status, code) customers(amount, salary, type, level) Task: Select name from accounts where status exists in customers for the same status. SQL:
SELECT name FROM accounts AS acct WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.status = acct.status );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "name", "filter_col": "status", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_00661
train
T1
v3
Schema: categories (alias: catg)(value, salary, id, status) transactions(level, date, type, id) Task: Find code from categories where salary exceeds the average amount from transactions for the same code. SQL:
SELECT code FROM categories AS catg WHERE salary > ( SELECT COUNT(amount) FROM transactions AS txn WHERE txn.code = catg.code );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_00662
train
T2
v3
Schema: requests (alias: ordr)(type, code, salary, amount) shipments(level, code, id, status) Task: Retrieve value from requests with amount above the AVG(value) of shipments rows sharing the same level. SQL:
SELECT value FROM requests AS ordr WHERE amount > ( SELECT AVG(value) FROM shipments AS shp WHERE shp.level = ordr.level );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_00663
train
T2
v3
Schema: customers (alias: cust)(code, level, type, status) warehouses(value, type, code, amount) Task: Retrieve id from customers with value above the SUM(value) of warehouses rows sharing the same id. SQL:
SELECT id FROM customers AS cust WHERE value > ( SELECT SUM(value) FROM warehouses AS whs WHERE whs.id = cust.id );
{ "outer_table": "customers", "inner_table": "warehouses", "outer_alias": "cust", "inner_alias": "whs", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_00664
train
T1
v1
Schema: products (alias: prod)(id, date, level, value) managers(salary, type, id, name) Task: Retrieve salary from products whose code is found in managers rows where code matches the outer record. SQL:
SELECT salary FROM products AS prod WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.code = prod.code );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_00665
train
T1
v2
Schema: accounts (alias: acct)(id, type, name, date) budgets(code, name, salary, value) Task: Find code from accounts where a matching record exists in budgets with the same type. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.type = acct.type );
{ "outer_table": "accounts", "inner_table": "budgets", "outer_alias": "acct", "inner_alias": "budg", "proj_col": "code", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_00666
train
T1
v3
Schema: items (alias: lne)(name, date, status, amount) customers(level, name, code, salary) Task: Retrieve amount from items with salary above the COUNT(value) of customers rows sharing the same id. SQL:
SELECT amount FROM items AS lne WHERE salary > ( SELECT COUNT(value) FROM customers AS cust WHERE cust.id = lne.id );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_00667
train
T2
v2
Schema: sales (alias: sale)(date, level, name, type) items(status, code, type, salary) Task: Find code from sales where a matching record exists in items with the same status. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = sale.status );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "code", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_00668
train
T1
v1
Schema: managers (alias: mgr)(amount, salary, id, name) shipments(code, id, status, type) Task: Find salary from managers where id appears in shipments entries with matching code. SQL:
SELECT salary FROM managers AS mgr WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.code = mgr.code );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_00669
train
T1
v3
Schema: requests (alias: ordr)(salary, date, name, level) products(amount, code, id, salary) Task: Find code from requests where amount exceeds the average salary from products for the same code. SQL:
SELECT code FROM requests AS ordr WHERE amount > ( SELECT SUM(salary) FROM products AS prod WHERE prod.code = ordr.code );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_00670
train
T2
v1
Schema: staff (alias: empl)(status, type, code, id) orders(type, id, value, date) Task: Select salary from staff where code exists in orders for the same level. SQL:
SELECT salary FROM staff AS empl WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.level = empl.level );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "salary", "filter_col": "code", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_00671
train
T2
v2
Schema: items (alias: lne)(level, date, type, value) warehouses(level, date, code, type) Task: Find code from items where a matching record exists in warehouses with the same status. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.status = lne.status );
{ "outer_table": "items", "inner_table": "warehouses", "outer_alias": "lne", "inner_alias": "whs", "proj_col": "code", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_00672
train
T2
v3
Schema: accounts (alias: acct)(code, level, status, date) products(status, level, id, amount) Task: Find value from accounts where amount exceeds the average amount from products for the same status. SQL:
SELECT value FROM accounts AS acct WHERE amount > ( SELECT MAX(amount) FROM products AS prod WHERE prod.status = acct.status );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_00673
train
T1
v3
Schema: products (alias: prod)(id, name, type, value) staff(id, amount, code, salary) Task: Retrieve amount from products with salary above the COUNT(amount) of staff rows sharing the same status. SQL:
SELECT amount FROM products AS prod WHERE salary > ( SELECT COUNT(amount) FROM staff AS empl WHERE empl.status = prod.status );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_00674
train
T1
v3
Schema: invoices (alias: inv)(code, value, name, id) staff(value, id, amount, salary) Task: Find salary from invoices where salary exceeds the average value from staff for the same id. SQL:
SELECT salary FROM invoices AS inv WHERE salary > ( SELECT COUNT(value) FROM staff AS empl WHERE empl.id = inv.id );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_00675
train
T1
v2
Schema: requests (alias: ordr)(code, salary, status, name) products(name, level, status, amount) Task: Retrieve amount from requests that have at least one corresponding entry in products sharing the same level. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = ordr.level );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "amount", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_00676
train
T2
v2
Schema: schedules (alias: schd)(value, date, amount, status) warehouses(type, salary, value, id) Task: Find amount from schedules where a matching record exists in warehouses with the same type. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.type = schd.type );
{ "outer_table": "schedules", "inner_table": "warehouses", "outer_alias": "schd", "inner_alias": "whs", "proj_col": "amount", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_00677
train
T2
v1
Schema: orders (alias: ord)(status, date, type, amount) requests(amount, value, level, id) Task: Find amount from orders where code appears in requests entries with matching status. SQL:
SELECT amount FROM orders AS ord WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.status = ord.status );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_00678
train
T1
v3
Schema: transactions (alias: txn)(date, type, salary, id) departments(type, level, amount, code) Task: Find salary from transactions where salary exceeds the average value from departments for the same code. SQL:
SELECT salary FROM transactions AS txn WHERE salary > ( SELECT MAX(value) FROM departments AS dept WHERE dept.code = txn.code );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_00679
train
T1
v3
Schema: services (alias: srvc)(code, id, name, amount) schedules(type, name, code, status) Task: Retrieve amount from services with salary above the MIN(value) of schedules rows sharing the same status. SQL:
SELECT amount FROM services AS srvc WHERE salary > ( SELECT MIN(value) FROM schedules AS schd WHERE schd.status = srvc.status );
{ "outer_table": "services", "inner_table": "schedules", "outer_alias": "srvc", "inner_alias": "schd", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_00680
train
T2
v1
Schema: transactions (alias: txn)(date, level, name, status) accounts(type, id, value, salary) Task: Retrieve name from transactions whose status is found in accounts rows where code matches the outer record. SQL:
SELECT name FROM transactions AS txn WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.code = txn.code );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_00681
train
T1
v2
Schema: products (alias: prod)(code, date, level, type) sales(date, id, code, name) Task: Retrieve amount from products that have at least one corresponding entry in sales sharing the same type. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = prod.type );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "amount", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_00682
train
T1
v1
Schema: departments (alias: dept)(id, date, salary, code) services(date, id, salary, level) Task: Select code from departments where status exists in services for the same type. SQL:
SELECT code FROM departments AS dept WHERE status IN ( SELECT status FROM services AS srvc WHERE srvc.type = dept.type );
{ "outer_table": "departments", "inner_table": "services", "outer_alias": "dept", "inner_alias": "srvc", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_00683
train
T1
v1
Schema: services (alias: srvc)(amount, status, id, date) categories(amount, id, salary, code) Task: Select id from services where code exists in categories for the same status. SQL:
SELECT id FROM services AS srvc WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.status = srvc.status );
{ "outer_table": "services", "inner_table": "categories", "outer_alias": "srvc", "inner_alias": "catg", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_00684
train
T2
v1
Schema: warehouses (alias: whs)(status, name, value, amount) shipments(status, amount, salary, code) Task: Retrieve id from warehouses whose type is found in shipments rows where level matches the outer record. SQL:
SELECT id FROM warehouses AS whs WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "shipments", "outer_alias": "whs", "inner_alias": "shp", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_00685
train
T2
v3
Schema: budgets (alias: budg)(salary, date, code, id) transactions(value, code, type, date) Task: Retrieve value from budgets with salary above the COUNT(salary) of transactions rows sharing the same id. SQL:
SELECT value FROM budgets AS budg WHERE salary > ( SELECT COUNT(salary) FROM transactions AS txn WHERE txn.id = budg.id );
{ "outer_table": "budgets", "inner_table": "transactions", "outer_alias": "budg", "inner_alias": "txn", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_00686
train
T2
v3
Schema: products (alias: prod)(status, id, level, type) schedules(level, amount, type, id) Task: Find value from products where amount exceeds the average value from schedules for the same level. SQL:
SELECT value FROM products AS prod WHERE amount > ( SELECT COUNT(value) FROM schedules AS schd WHERE schd.level = prod.level );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_00687
train
T1
v1
Schema: managers (alias: mgr)(name, amount, status, salary) orders(salary, status, level, amount) Task: Retrieve amount from managers whose id is found in orders rows where status matches the outer record. SQL:
SELECT amount FROM managers AS mgr WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.status = mgr.status );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_00688
train
T1
v1
Schema: orders (alias: ord)(name, value, status, code) managers(salary, id, amount, status) Task: Find value from orders where code appears in managers entries with matching code. SQL:
SELECT value FROM orders AS ord WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.code = ord.code );
{ "outer_table": "orders", "inner_table": "managers", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_00689
train
T1
v2
Schema: invoices (alias: inv)(name, id, level, salary) shipments(value, code, date, amount) Task: Retrieve id from invoices that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = inv.status );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "id", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_00690
train
T1
v3
Schema: products (alias: prod)(level, date, type, amount) accounts(name, value, code, type) Task: Retrieve code from products with amount above the MIN(value) of accounts rows sharing the same id. SQL:
SELECT code FROM products AS prod WHERE amount > ( SELECT MIN(value) FROM accounts AS acct WHERE acct.id = prod.id );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_00691
train
T1
v2
Schema: orders (alias: ord)(name, date, id, code) schedules(amount, value, salary, date) Task: Retrieve name from orders that have at least one corresponding entry in schedules sharing the same status. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = ord.status );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "name", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_00692
train
T1
v1
Schema: departments (alias: dept)(name, level, date, value) accounts(amount, level, code, id) Task: Find id from departments where level appears in accounts entries with matching code. SQL:
SELECT id FROM departments AS dept WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.code = dept.code );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_00693
train
T1
v3
Schema: warehouses (alias: whs)(value, name, type, id) shipments(date, id, amount, level) Task: Find id from warehouses where amount exceeds the average amount from shipments for the same level. SQL:
SELECT id FROM warehouses AS whs WHERE amount > ( SELECT AVG(amount) FROM shipments AS shp WHERE shp.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "shipments", "outer_alias": "whs", "inner_alias": "shp", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_00694
train
T2
v1
Schema: categories (alias: catg)(name, type, salary, level) shipments(name, value, level, amount) Task: Select code from categories where code exists in shipments for the same status. SQL:
SELECT code FROM categories AS catg WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.status = catg.status );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "catg", "inner_alias": "shp", "proj_col": "code", "filter_col": "code", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_00695
train
T2
v3
Schema: sales (alias: sale)(value, type, name, salary) employees(id, level, date, status) Task: Retrieve name from sales with amount above the SUM(salary) of employees rows sharing the same code. SQL:
SELECT name FROM sales AS sale WHERE amount > ( SELECT SUM(salary) FROM employees AS emp WHERE emp.code = sale.code );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_00696
train
T1
v2
Schema: products (alias: prod)(status, value, name, type) orders(type, id, status, code) Task: Retrieve name from products that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = prod.code );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "name", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_00697
train
T1
v2
Schema: items (alias: lne)(type, date, name, salary) categories(date, id, salary, level) Task: Retrieve amount from items that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = lne.code );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "amount", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_00698
train
T2
v1
Schema: managers (alias: mgr)(code, status, date, name) employees(status, level, amount, code) Task: Select salary from managers where status exists in employees for the same type. SQL:
SELECT salary FROM managers AS mgr WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.type = mgr.type );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_00699
train
T1