variant
stringclasses
3 values
prompt
stringlengths
163
237
sql
stringlengths
103
143
metadata
unknown
id
stringlengths
21
21
split
stringclasses
1 value
token_group
stringclasses
2 values
v3
Schema: schedules (alias: schd)(type, id, name, code) sales(level, name, amount, date) Task: Find amount from schedules where salary exceeds the average salary from sales for the same code. SQL:
SELECT amount FROM schedules AS schd WHERE salary > ( SELECT MIN(salary) FROM sales AS sale WHERE sale.code = schd.code );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_05600
train
T2
v2
Schema: categories (alias: catg)(level, amount, code, id) managers(id, salary, type, value) Task: Find id from categories where a matching record exists in managers with the same code. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = catg.code );
{ "outer_table": "categories", "inner_table": "managers", "outer_alias": "catg", "inner_alias": "mgr", "proj_col": "id", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_05601
train
T2
v1
Schema: schedules (alias: schd)(id, date, level, name) regions(code, type, value, level) Task: Select name from schedules where code exists in regions for the same type. SQL:
SELECT name FROM schedules AS schd WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.type = schd.type );
{ "outer_table": "schedules", "inner_table": "regions", "outer_alias": "schd", "inner_alias": "rgn", "proj_col": "name", "filter_col": "code", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_05602
train
T2
v1
Schema: accounts (alias: acct)(id, date, code, name) categories(value, salary, type, status) Task: Find amount from accounts where type appears in categories entries with matching level. SQL:
SELECT amount FROM accounts AS acct WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.level = acct.level );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_05603
train
T1
v3
Schema: budgets (alias: budg)(code, type, name, id) services(status, salary, level, type) Task: Find amount from budgets where salary exceeds the average amount from services for the same code. SQL:
SELECT amount FROM budgets AS budg WHERE salary > ( SELECT SUM(amount) FROM services AS srvc WHERE srvc.code = budg.code );
{ "outer_table": "budgets", "inner_table": "services", "outer_alias": "budg", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_05604
train
T2
v3
Schema: staff (alias: empl)(type, level, date, code) shipments(name, salary, level, date) Task: Retrieve salary from staff with value above the MIN(value) of shipments rows sharing the same type. SQL:
SELECT salary FROM staff AS empl WHERE value > ( SELECT MIN(value) FROM shipments AS shp WHERE shp.type = empl.type );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_05605
train
T2
v2
Schema: shipments (alias: shp)(value, level, salary, date) customers(level, date, status, amount) Task: Find salary from shipments where a matching record exists in customers with the same code. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = shp.code );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "salary", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_05606
train
T2
v3
Schema: employees (alias: emp)(amount, status, date, salary) departments(date, status, level, type) Task: Find value from employees where value exceeds the average salary from departments for the same level. SQL:
SELECT value FROM employees AS emp WHERE value > ( SELECT MAX(salary) FROM departments AS dept WHERE dept.level = emp.level );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_05607
train
T1
v3
Schema: regions (alias: rgn)(value, name, status, amount) accounts(type, date, amount, id) Task: Find code from regions where salary exceeds the average salary from accounts for the same level. SQL:
SELECT code FROM regions AS rgn WHERE salary > ( SELECT AVG(salary) FROM accounts AS acct WHERE acct.level = rgn.level );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "rgn", "inner_alias": "acct", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_05608
train
T2
v2
Schema: sales (alias: sale)(status, level, salary, name) departments(code, type, id, date) Task: Retrieve value from sales that have at least one corresponding entry in departments sharing the same status. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = sale.status );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "value", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_05609
train
T1
v3
Schema: customers (alias: cust)(salary, amount, date, value) staff(value, id, salary, level) Task: Find salary from customers where value exceeds the average salary from staff for the same code. SQL:
SELECT salary FROM customers AS cust WHERE value > ( SELECT COUNT(salary) FROM staff AS empl WHERE empl.code = cust.code );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_05610
train
T1
v3
Schema: services (alias: srvc)(level, code, status, id) accounts(amount, date, name, value) Task: Find salary from services where value exceeds the average salary from accounts for the same id. SQL:
SELECT salary FROM services AS srvc WHERE value > ( SELECT COUNT(salary) FROM accounts AS acct WHERE acct.id = srvc.id );
{ "outer_table": "services", "inner_table": "accounts", "outer_alias": "srvc", "inner_alias": "acct", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_05611
train
T2
v2
Schema: regions (alias: rgn)(status, amount, id, value) sales(id, level, value, type) Task: Retrieve salary from regions that have at least one corresponding entry in sales sharing the same code. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = rgn.code );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "salary", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_05612
train
T2
v3
Schema: departments (alias: dept)(salary, level, name, id) shipments(name, amount, type, id) Task: Retrieve value from departments with amount above the MIN(value) of shipments rows sharing the same status. SQL:
SELECT value FROM departments AS dept WHERE amount > ( SELECT MIN(value) FROM shipments AS shp WHERE shp.status = dept.status );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_05613
train
T1
v2
Schema: departments (alias: dept)(name, salary, value, code) requests(date, amount, level, id) Task: Find value from departments where a matching record exists in requests with the same code. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = dept.code );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "value", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_05614
train
T1
v1
Schema: staff (alias: empl)(status, id, amount, value) managers(salary, amount, date, status) Task: Find value from staff where level appears in managers entries with matching level. SQL:
SELECT value FROM staff AS empl WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.level = empl.level );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_05615
train
T2
v2
Schema: employees (alias: emp)(status, name, date, salary) requests(salary, type, code, level) Task: Retrieve amount from employees that have at least one corresponding entry in requests sharing the same id. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = emp.id );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "amount", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_05616
train
T1
v2
Schema: staff (alias: empl)(level, date, name, code) categories(code, id, date, value) Task: Retrieve id from staff that have at least one corresponding entry in categories sharing the same type. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = empl.type );
{ "outer_table": "staff", "inner_table": "categories", "outer_alias": "empl", "inner_alias": "catg", "proj_col": "id", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_05617
train
T2
v2
Schema: warehouses (alias: whs)(value, status, salary, amount) categories(amount, date, name, status) Task: Retrieve id from warehouses that have at least one corresponding entry in categories sharing the same status. SQL:
SELECT id FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "categories", "outer_alias": "whs", "inner_alias": "catg", "proj_col": "id", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_05618
train
T2
v3
Schema: requests (alias: ordr)(salary, id, level, value) transactions(date, value, code, id) Task: Find id from requests where salary exceeds the average salary from transactions for the same level. SQL:
SELECT id FROM requests AS ordr WHERE salary > ( SELECT COUNT(salary) FROM transactions AS txn WHERE txn.level = ordr.level );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_05619
train
T2
v1
Schema: products (alias: prod)(level, amount, type, salary) orders(salary, value, id, code) Task: Select code from products where status exists in orders for the same level. SQL:
SELECT code FROM products AS prod WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.level = prod.level );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_05620
train
T1
v2
Schema: accounts (alias: acct)(amount, code, id, date) orders(id, salary, code, value) Task: Find code from accounts where a matching record exists in orders with the same level. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = acct.level );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "code", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_05621
train
T1
v2
Schema: accounts (alias: acct)(amount, type, salary, status) invoices(name, level, amount, salary) Task: Find amount from accounts where a matching record exists in invoices with the same id. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = acct.id );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "amount", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_05622
train
T1
v1
Schema: employees (alias: emp)(type, amount, name, code) categories(salary, type, amount, code) Task: Retrieve id from employees whose code is found in categories rows where level matches the outer record. SQL:
SELECT id FROM employees AS emp WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.level = emp.level );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "id", "filter_col": "code", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_05623
train
T1
v3
Schema: categories (alias: catg)(status, code, type, date) services(type, status, amount, value) Task: Find amount from categories where salary exceeds the average salary from services for the same level. SQL:
SELECT amount FROM categories AS catg WHERE salary > ( SELECT AVG(salary) FROM services AS srvc WHERE srvc.level = catg.level );
{ "outer_table": "categories", "inner_table": "services", "outer_alias": "catg", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_05624
train
T2
v1
Schema: requests (alias: ordr)(name, code, type, date) warehouses(name, type, amount, date) Task: Find value from requests where type appears in warehouses entries with matching code. SQL:
SELECT value FROM requests AS ordr WHERE type IN ( SELECT type FROM warehouses AS whs WHERE whs.code = ordr.code );
{ "outer_table": "requests", "inner_table": "warehouses", "outer_alias": "ordr", "inner_alias": "whs", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_05625
train
T2
v1
Schema: managers (alias: mgr)(amount, status, level, id) services(salary, code, date, amount) Task: Retrieve salary from managers whose level is found in services rows where id matches the outer record. SQL:
SELECT salary FROM managers AS mgr WHERE level IN ( SELECT level FROM services AS srvc WHERE srvc.id = mgr.id );
{ "outer_table": "managers", "inner_table": "services", "outer_alias": "mgr", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "level", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_05626
train
T1
v3
Schema: requests (alias: ordr)(status, amount, date, level) customers(name, amount, id, level) Task: Find salary from requests where salary exceeds the average value from customers for the same code. SQL:
SELECT salary FROM requests AS ordr WHERE salary > ( SELECT MIN(value) FROM customers AS cust WHERE cust.code = ordr.code );
{ "outer_table": "requests", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_05627
train
T2
v3
Schema: staff (alias: empl)(salary, date, code, value) sales(salary, name, date, amount) Task: Find salary from staff where value exceeds the average salary from sales for the same type. SQL:
SELECT salary FROM staff AS empl WHERE value > ( SELECT COUNT(salary) FROM sales AS sale WHERE sale.type = empl.type );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_05628
train
T2
v3
Schema: products (alias: prod)(name, type, status, amount) accounts(salary, id, type, value) Task: Find name from products where value exceeds the average salary from accounts for the same status. SQL:
SELECT name FROM products AS prod WHERE value > ( SELECT AVG(salary) FROM accounts AS acct WHERE acct.status = prod.status );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_05629
train
T1
v3
Schema: orders (alias: ord)(value, amount, type, code) items(salary, type, status, id) Task: Find salary from orders where amount exceeds the average value from items for the same status. SQL:
SELECT salary FROM orders AS ord WHERE amount > ( SELECT COUNT(value) FROM items AS lne WHERE lne.status = ord.status );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_05630
train
T1
v2
Schema: budgets (alias: budg)(salary, type, value, name) departments(id, date, name, salary) Task: Find code from budgets where a matching record exists in departments with the same level. SQL:
SELECT code FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = budg.level );
{ "outer_table": "budgets", "inner_table": "departments", "outer_alias": "budg", "inner_alias": "dept", "proj_col": "code", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_05631
train
T2
v1
Schema: warehouses (alias: whs)(name, value, code, id) categories(status, code, salary, value) Task: Retrieve code from warehouses whose id is found in categories rows where code matches the outer record. SQL:
SELECT code FROM warehouses AS whs WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "categories", "outer_alias": "whs", "inner_alias": "catg", "proj_col": "code", "filter_col": "id", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_05632
train
T2
v2
Schema: services (alias: srvc)(type, salary, date, code) employees(level, id, amount, name) Task: Find amount from services where a matching record exists in employees with the same level. SQL:
SELECT amount FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = srvc.level );
{ "outer_table": "services", "inner_table": "employees", "outer_alias": "srvc", "inner_alias": "emp", "proj_col": "amount", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_05633
train
T2
v1
Schema: categories (alias: catg)(value, code, name, type) transactions(id, name, type, status) Task: Find value from categories where code appears in transactions entries with matching level. SQL:
SELECT value FROM categories AS catg WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.level = catg.level );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_05634
train
T2
v2
Schema: sales (alias: sale)(type, code, date, status) orders(type, amount, level, value) Task: Retrieve amount from sales that have at least one corresponding entry in orders sharing the same status. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = sale.status );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "amount", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_05635
train
T1
v3
Schema: regions (alias: rgn)(level, value, type, id) shipments(type, status, salary, code) Task: Retrieve name from regions with salary above the COUNT(salary) of shipments rows sharing the same type. SQL:
SELECT name FROM regions AS rgn WHERE salary > ( SELECT COUNT(salary) FROM shipments AS shp WHERE shp.type = rgn.type );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_05636
train
T2
v2
Schema: sales (alias: sale)(id, salary, name, status) transactions(value, level, code, status) Task: Find salary from sales where a matching record exists in transactions with the same code. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = sale.code );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "salary", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_05637
train
T1
v3
Schema: warehouses (alias: whs)(id, salary, name, amount) schedules(name, salary, code, type) Task: Retrieve value from warehouses with salary above the MIN(value) of schedules rows sharing the same level. SQL:
SELECT value FROM warehouses AS whs WHERE salary > ( SELECT MIN(value) FROM schedules AS schd WHERE schd.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "schedules", "outer_alias": "whs", "inner_alias": "schd", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_05638
train
T2
v1
Schema: categories (alias: catg)(value, status, code, salary) schedules(amount, code, name, id) Task: Retrieve code from categories whose status is found in schedules rows where status matches the outer record. SQL:
SELECT code FROM categories AS catg WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.status = catg.status );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "code", "filter_col": "status", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_05639
train
T2
v1
Schema: invoices (alias: inv)(status, value, id, salary) services(salary, value, amount, date) Task: Find name from invoices where code appears in services entries with matching id. SQL:
SELECT name FROM invoices AS inv WHERE code IN ( SELECT code FROM services AS srvc WHERE srvc.id = inv.id );
{ "outer_table": "invoices", "inner_table": "services", "outer_alias": "inv", "inner_alias": "srvc", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_05640
train
T1
v3
Schema: schedules (alias: schd)(salary, id, level, code) sales(id, amount, value, status) Task: Find id from schedules where salary exceeds the average amount from sales for the same level. SQL:
SELECT id FROM schedules AS schd WHERE salary > ( SELECT COUNT(amount) FROM sales AS sale WHERE sale.level = schd.level );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_05641
train
T2
v2
Schema: customers (alias: cust)(level, name, date, type) staff(level, value, name, type) Task: Retrieve name from customers that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = cust.type );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "name", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_05642
train
T1
v2
Schema: transactions (alias: txn)(code, level, type, id) requests(code, salary, amount, value) Task: Retrieve id from transactions that have at least one corresponding entry in requests sharing the same code. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = txn.code );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "id", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_05643
train
T1
v3
Schema: shipments (alias: shp)(name, salary, status, id) managers(status, code, salary, level) Task: Retrieve salary from shipments with amount above the MAX(salary) of managers rows sharing the same id. SQL:
SELECT salary FROM shipments AS shp WHERE amount > ( SELECT MAX(salary) FROM managers AS mgr WHERE mgr.id = shp.id );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_05644
train
T2
v2
Schema: sales (alias: sale)(id, code, type, date) invoices(name, amount, status, salary) Task: Retrieve amount from sales that have at least one corresponding entry in invoices sharing the same code. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = sale.code );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "amount", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_05645
train
T1
v1
Schema: invoices (alias: inv)(level, status, name, id) categories(id, date, level, status) Task: Find name from invoices where status appears in categories entries with matching level. SQL:
SELECT name FROM invoices AS inv WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.level = inv.level );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_05646
train
T1
v3
Schema: transactions (alias: txn)(date, value, salary, level) orders(code, name, status, salary) Task: Find value from transactions where amount exceeds the average amount from orders for the same code. SQL:
SELECT value FROM transactions AS txn WHERE amount > ( SELECT AVG(amount) FROM orders AS ord WHERE ord.code = txn.code );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_05647
train
T1
v3
Schema: departments (alias: dept)(status, name, salary, date) items(date, code, name, amount) Task: Retrieve name from departments with salary above the MIN(amount) of items rows sharing the same id. SQL:
SELECT name FROM departments AS dept WHERE salary > ( SELECT MIN(amount) FROM items AS lne WHERE lne.id = dept.id );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_05648
train
T1
v2
Schema: products (alias: prod)(value, status, id, name) services(name, salary, id, status) Task: Find salary from products where a matching record exists in services with the same status. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.status = prod.status );
{ "outer_table": "products", "inner_table": "services", "outer_alias": "prod", "inner_alias": "srvc", "proj_col": "salary", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_05649
train
T1
v2
Schema: services (alias: srvc)(status, amount, value, date) requests(date, amount, level, id) Task: Retrieve value from services that have at least one corresponding entry in requests sharing the same level. SQL:
SELECT value FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = srvc.level );
{ "outer_table": "services", "inner_table": "requests", "outer_alias": "srvc", "inner_alias": "ordr", "proj_col": "value", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_05650
train
T2
v1
Schema: staff (alias: empl)(level, amount, status, type) transactions(amount, value, date, name) Task: Retrieve salary from staff whose code is found in transactions rows where level matches the outer record. SQL:
SELECT salary FROM staff AS empl WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.level = empl.level );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "salary", "filter_col": "code", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_05651
train
T2
v2
Schema: sales (alias: sale)(code, status, level, amount) categories(amount, type, salary, value) Task: Find value from sales where a matching record exists in categories with the same code. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = sale.code );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "value", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_05652
train
T1
v2
Schema: managers (alias: mgr)(date, salary, type, code) employees(date, name, level, salary) Task: Find amount from managers where a matching record exists in employees with the same level. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = mgr.level );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "amount", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_05653
train
T1
v1
Schema: managers (alias: mgr)(value, code, salary, id) employees(type, salary, name, date) Task: Find id from managers where code appears in employees entries with matching status. SQL:
SELECT id FROM managers AS mgr WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.status = mgr.status );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "id", "filter_col": "code", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_05654
train
T1
v2
Schema: managers (alias: mgr)(name, type, status, date) schedules(date, code, level, id) Task: Find salary from managers where a matching record exists in schedules with the same status. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = mgr.status );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "salary", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_05655
train
T1
v3
Schema: departments (alias: dept)(code, date, amount, name) items(date, amount, type, salary) Task: Find id from departments where amount exceeds the average salary from items for the same status. SQL:
SELECT id FROM departments AS dept WHERE amount > ( SELECT SUM(salary) FROM items AS lne WHERE lne.status = dept.status );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_05656
train
T1
v3
Schema: sales (alias: sale)(salary, value, name, type) managers(id, code, date, status) Task: Retrieve code from sales with salary above the SUM(salary) of managers rows sharing the same level. SQL:
SELECT code FROM sales AS sale WHERE salary > ( SELECT SUM(salary) FROM managers AS mgr WHERE mgr.level = sale.level );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_05657
train
T1
v1
Schema: requests (alias: ordr)(code, amount, id, type) employees(salary, amount, id, type) Task: Select amount from requests where code exists in employees for the same code. SQL:
SELECT amount FROM requests AS ordr WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.code = ordr.code );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_05658
train
T2
v2
Schema: regions (alias: rgn)(id, amount, status, type) budgets(name, code, status, level) Task: Retrieve amount from regions that have at least one corresponding entry in budgets sharing the same id. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.id = rgn.id );
{ "outer_table": "regions", "inner_table": "budgets", "outer_alias": "rgn", "inner_alias": "budg", "proj_col": "amount", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_05659
train
T2
v1
Schema: transactions (alias: txn)(amount, level, type, status) customers(type, salary, code, id) Task: Retrieve salary from transactions whose type is found in customers rows where id matches the outer record. SQL:
SELECT salary FROM transactions AS txn WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.id = txn.id );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "salary", "filter_col": "type", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_05660
train
T1
v3
Schema: orders (alias: ord)(amount, status, code, level) departments(salary, value, id, date) Task: Retrieve code from orders with value above the COUNT(amount) of departments rows sharing the same id. SQL:
SELECT code FROM orders AS ord WHERE value > ( SELECT COUNT(amount) FROM departments AS dept WHERE dept.id = ord.id );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_05661
train
T1
v1
Schema: customers (alias: cust)(type, level, status, salary) budgets(level, salary, code, value) Task: Select name from customers where level exists in budgets for the same type. SQL:
SELECT name FROM customers AS cust WHERE level IN ( SELECT level FROM budgets AS budg WHERE budg.type = cust.type );
{ "outer_table": "customers", "inner_table": "budgets", "outer_alias": "cust", "inner_alias": "budg", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_05662
train
T1
v1
Schema: regions (alias: rgn)(value, id, status, date) requests(name, type, salary, level) Task: Find amount from regions where code appears in requests entries with matching status. SQL:
SELECT amount FROM regions AS rgn WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.status = rgn.status );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "rgn.status", "token_group": "T2" }
cs8_fixed_train_05663
train
T2
v1
Schema: invoices (alias: inv)(amount, date, value, name) requests(status, level, name, salary) Task: Select salary from invoices where id exists in requests for the same level. SQL:
SELECT salary FROM invoices AS inv WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.level = inv.level );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "id", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_05664
train
T1
v2
Schema: services (alias: srvc)(type, value, name, salary) employees(type, id, value, salary) Task: Find amount from services where a matching record exists in employees with the same code. SQL:
SELECT amount FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = srvc.code );
{ "outer_table": "services", "inner_table": "employees", "outer_alias": "srvc", "inner_alias": "emp", "proj_col": "amount", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_05665
train
T2
v1
Schema: shipments (alias: shp)(date, id, status, name) employees(salary, code, date, level) Task: Find amount from shipments where level appears in employees entries with matching id. SQL:
SELECT amount FROM shipments AS shp WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.id = shp.id );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_05666
train
T2
v2
Schema: services (alias: srvc)(name, date, status, salary) transactions(name, amount, type, status) Task: Retrieve value from services that have at least one corresponding entry in transactions sharing the same code. SQL:
SELECT value FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = srvc.code );
{ "outer_table": "services", "inner_table": "transactions", "outer_alias": "srvc", "inner_alias": "txn", "proj_col": "value", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_05667
train
T2
v2
Schema: services (alias: srvc)(value, code, type, salary) budgets(id, salary, name, status) Task: Retrieve name from services that have at least one corresponding entry in budgets sharing the same type. SQL:
SELECT name FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.type = srvc.type );
{ "outer_table": "services", "inner_table": "budgets", "outer_alias": "srvc", "inner_alias": "budg", "proj_col": "name", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_05668
train
T2
v3
Schema: customers (alias: cust)(date, name, code, status) shipments(id, name, amount, value) Task: Find value from customers where salary exceeds the average amount from shipments for the same id. SQL:
SELECT value FROM customers AS cust WHERE salary > ( SELECT MIN(amount) FROM shipments AS shp WHERE shp.id = cust.id );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_05669
train
T1
v2
Schema: departments (alias: dept)(type, name, value, level) transactions(value, salary, id, level) Task: Retrieve salary from departments that have at least one corresponding entry in transactions sharing the same code. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = dept.code );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "salary", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_05670
train
T1
v3
Schema: shipments (alias: shp)(salary, level, value, status) products(level, value, type, status) Task: Retrieve code from shipments with amount above the AVG(salary) of products rows sharing the same level. SQL:
SELECT code FROM shipments AS shp WHERE amount > ( SELECT AVG(salary) FROM products AS prod WHERE prod.level = shp.level );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_05671
train
T2
v3
Schema: regions (alias: rgn)(id, status, name, type) warehouses(id, date, level, status) Task: Find amount from regions where amount exceeds the average value from warehouses for the same id. SQL:
SELECT amount FROM regions AS rgn WHERE amount > ( SELECT MAX(value) FROM warehouses AS whs WHERE whs.id = rgn.id );
{ "outer_table": "regions", "inner_table": "warehouses", "outer_alias": "rgn", "inner_alias": "whs", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_05672
train
T2
v1
Schema: employees (alias: emp)(level, salary, id, amount) accounts(level, code, status, amount) Task: Retrieve amount from employees whose code is found in accounts rows where level matches the outer record. SQL:
SELECT amount FROM employees AS emp WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.level = emp.level );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_05673
train
T1
v2
Schema: budgets (alias: budg)(amount, id, name, type) departments(level, code, name, salary) Task: Find value from budgets where a matching record exists in departments with the same code. SQL:
SELECT value FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = budg.code );
{ "outer_table": "budgets", "inner_table": "departments", "outer_alias": "budg", "inner_alias": "dept", "proj_col": "value", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_05674
train
T2
v3
Schema: transactions (alias: txn)(amount, code, id, value) invoices(salary, status, date, level) Task: Retrieve amount from transactions with amount above the MIN(amount) of invoices rows sharing the same code. SQL:
SELECT amount FROM transactions AS txn WHERE amount > ( SELECT MIN(amount) FROM invoices AS inv WHERE inv.code = txn.code );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_05675
train
T1
v3
Schema: items (alias: lne)(salary, id, date, status) sales(code, id, salary, amount) Task: Retrieve salary from items with value above the AVG(value) of sales rows sharing the same id. SQL:
SELECT salary FROM items AS lne WHERE value > ( SELECT AVG(value) FROM sales AS sale WHERE sale.id = lne.id );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_05676
train
T2
v1
Schema: orders (alias: ord)(date, status, amount, name) warehouses(level, type, date, code) Task: Select name from orders where level exists in warehouses for the same status. SQL:
SELECT name FROM orders AS ord WHERE level IN ( SELECT level FROM warehouses AS whs WHERE whs.status = ord.status );
{ "outer_table": "orders", "inner_table": "warehouses", "outer_alias": "ord", "inner_alias": "whs", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_05677
train
T1
v3
Schema: services (alias: srvc)(type, amount, id, code) departments(amount, salary, status, value) Task: Retrieve value from services with amount above the AVG(salary) of departments rows sharing the same id. SQL:
SELECT value FROM services AS srvc WHERE amount > ( SELECT AVG(salary) FROM departments AS dept WHERE dept.id = srvc.id );
{ "outer_table": "services", "inner_table": "departments", "outer_alias": "srvc", "inner_alias": "dept", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_05678
train
T2
v1
Schema: orders (alias: ord)(value, type, code, status) sales(date, code, id, amount) Task: Find salary from orders where code appears in sales entries with matching type. SQL:
SELECT salary FROM orders AS ord WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.type = ord.type );
{ "outer_table": "orders", "inner_table": "sales", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_05679
train
T1
v3
Schema: schedules (alias: schd)(amount, id, code, level) warehouses(amount, id, name, date) Task: Find value from schedules where salary exceeds the average salary from warehouses for the same code. SQL:
SELECT value FROM schedules AS schd WHERE salary > ( SELECT COUNT(salary) FROM warehouses AS whs WHERE whs.code = schd.code );
{ "outer_table": "schedules", "inner_table": "warehouses", "outer_alias": "schd", "inner_alias": "whs", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_05680
train
T2
v1
Schema: staff (alias: empl)(salary, level, code, type) budgets(name, status, id, code) Task: Select name from staff where code exists in budgets for the same level. SQL:
SELECT name FROM staff AS empl WHERE code IN ( SELECT code FROM budgets AS budg WHERE budg.level = empl.level );
{ "outer_table": "staff", "inner_table": "budgets", "outer_alias": "empl", "inner_alias": "budg", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_05681
train
T2
v1
Schema: categories (alias: catg)(code, value, date, id) items(type, id, salary, amount) Task: Select name from categories where type exists in items for the same id. SQL:
SELECT name FROM categories AS catg WHERE type IN ( SELECT type FROM items AS lne WHERE lne.id = catg.id );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "name", "filter_col": "type", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_05682
train
T2
v1
Schema: accounts (alias: acct)(code, id, type, salary) warehouses(amount, salary, id, status) Task: Retrieve amount from accounts whose code is found in warehouses rows where id matches the outer record. SQL:
SELECT amount FROM accounts AS acct WHERE code IN ( SELECT code FROM warehouses AS whs WHERE whs.id = acct.id );
{ "outer_table": "accounts", "inner_table": "warehouses", "outer_alias": "acct", "inner_alias": "whs", "proj_col": "amount", "filter_col": "code", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_05683
train
T1
v3
Schema: shipments (alias: shp)(code, amount, name, value) accounts(salary, amount, date, value) Task: Find salary from shipments where value exceeds the average value from accounts for the same code. SQL:
SELECT salary FROM shipments AS shp WHERE value > ( SELECT MAX(value) FROM accounts AS acct WHERE acct.code = shp.code );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_05684
train
T2
v2
Schema: employees (alias: emp)(type, amount, value, salary) budgets(id, salary, amount, name) Task: Retrieve code from employees that have at least one corresponding entry in budgets sharing the same status. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.status = emp.status );
{ "outer_table": "employees", "inner_table": "budgets", "outer_alias": "emp", "inner_alias": "budg", "proj_col": "code", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_05685
train
T1
v2
Schema: regions (alias: rgn)(level, date, name, value) sales(id, type, value, name) Task: Find amount from regions where a matching record exists in sales with the same code. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = rgn.code );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "amount", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_05686
train
T2
v1
Schema: shipments (alias: shp)(amount, name, status, salary) items(type, id, status, date) Task: Select code from shipments where code exists in items for the same id. SQL:
SELECT code FROM shipments AS shp WHERE code IN ( SELECT code FROM items AS lne WHERE lne.id = shp.id );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_05687
train
T2
v1
Schema: customers (alias: cust)(status, type, amount, value) employees(status, id, value, amount) Task: Select id from customers where level exists in employees for the same status. SQL:
SELECT id FROM customers AS cust WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.status = cust.status );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "id", "filter_col": "level", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_05688
train
T1
v3
Schema: items (alias: lne)(status, value, date, level) budgets(id, level, amount, status) Task: Find name from items where amount exceeds the average salary from budgets for the same status. SQL:
SELECT name FROM items AS lne WHERE amount > ( SELECT COUNT(salary) FROM budgets AS budg WHERE budg.status = lne.status );
{ "outer_table": "items", "inner_table": "budgets", "outer_alias": "lne", "inner_alias": "budg", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_05689
train
T2
v3
Schema: orders (alias: ord)(code, id, type, date) employees(code, status, amount, name) Task: Retrieve value from orders with salary above the AVG(salary) of employees rows sharing the same status. SQL:
SELECT value FROM orders AS ord WHERE salary > ( SELECT AVG(salary) FROM employees AS emp WHERE emp.status = ord.status );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_05690
train
T1
v2
Schema: managers (alias: mgr)(value, code, type, amount) orders(name, id, level, value) Task: Retrieve amount from managers that have at least one corresponding entry in orders sharing the same status. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = mgr.status );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "amount", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_05691
train
T1
v2
Schema: departments (alias: dept)(code, value, name, level) invoices(type, amount, value, level) Task: Find id from departments where a matching record exists in invoices with the same type. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = dept.type );
{ "outer_table": "departments", "inner_table": "invoices", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "id", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_05692
train
T1
v3
Schema: shipments (alias: shp)(code, value, salary, type) managers(id, date, amount, name) Task: Find code from shipments where amount exceeds the average amount from managers for the same status. SQL:
SELECT code FROM shipments AS shp WHERE amount > ( SELECT COUNT(amount) FROM managers AS mgr WHERE mgr.status = shp.status );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_05693
train
T2
v1
Schema: requests (alias: ordr)(value, salary, amount, name) shipments(id, level, date, type) Task: Retrieve code from requests whose status is found in shipments rows where type matches the outer record. SQL:
SELECT code FROM requests AS ordr WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.type = ordr.type );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_05694
train
T2
v3
Schema: categories (alias: catg)(id, code, name, amount) managers(type, level, status, date) Task: Find amount from categories where value exceeds the average value from managers for the same level. SQL:
SELECT amount FROM categories AS catg WHERE value > ( SELECT AVG(value) FROM managers AS mgr WHERE mgr.level = catg.level );
{ "outer_table": "categories", "inner_table": "managers", "outer_alias": "catg", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_05695
train
T2
v2
Schema: shipments (alias: shp)(type, amount, code, salary) employees(amount, status, value, type) Task: Retrieve code from shipments that have at least one corresponding entry in employees sharing the same id. SQL:
SELECT code FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = shp.id );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "code", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_05696
train
T2
v1
Schema: managers (alias: mgr)(code, name, value, type) categories(code, id, value, amount) Task: Find id from managers where code appears in categories entries with matching id. SQL:
SELECT id FROM managers AS mgr WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.id = mgr.id );
{ "outer_table": "managers", "inner_table": "categories", "outer_alias": "mgr", "inner_alias": "catg", "proj_col": "id", "filter_col": "code", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_05697
train
T1
v1
Schema: staff (alias: empl)(type, value, code, status) invoices(code, salary, status, type) Task: Retrieve amount from staff whose status is found in invoices rows where code matches the outer record. SQL:
SELECT amount FROM staff AS empl WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.code = empl.code );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "amount", "filter_col": "status", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_05698
train
T2
v2
Schema: orders (alias: ord)(date, status, type, level) items(name, status, type, date) Task: Retrieve id from orders that have at least one corresponding entry in items sharing the same id. SQL:
SELECT id FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.id = ord.id );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "id", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_05699
train
T1