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
v1
Schema: employees (alias: emp)(amount, name, level, value) shipments(date, type, level, name) Task: Retrieve name from employees whose code is found in shipments rows where code matches the outer record. SQL:
SELECT name FROM employees AS emp WHERE code IN ( SELECT code FROM shipments AS shp WHERE shp.code = emp.code );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_04100
train
T1
v2
Schema: warehouses (alias: whs)(type, amount, salary, level) sales(id, type, code, level) Task: Find value from warehouses where a matching record exists in sales with the same type. SQL:
SELECT value FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "sales", "outer_alias": "whs", "inner_alias": "sale", "proj_col": "value", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_04101
train
T2
v1
Schema: products (alias: prod)(value, type, salary, name) orders(value, id, amount, date) Task: Select name from products where status exists in orders for the same level. SQL:
SELECT name 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": "name", "filter_col": "status", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_04102
train
T1
v2
Schema: schedules (alias: schd)(type, value, amount, date) services(type, salary, id, date) Task: Find value from schedules where a matching record exists in services with the same id. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = schd.id );
{ "outer_table": "schedules", "inner_table": "services", "outer_alias": "schd", "inner_alias": "srvc", "proj_col": "value", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_04103
train
T2
v3
Schema: products (alias: prod)(name, level, amount, code) departments(name, code, salary, date) Task: Retrieve name from products with salary above the MAX(amount) of departments rows sharing the same code. SQL:
SELECT name FROM products AS prod WHERE salary > ( SELECT MAX(amount) FROM departments AS dept WHERE dept.code = prod.code );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_04104
train
T1
v1
Schema: items (alias: lne)(code, amount, name, value) invoices(id, status, name, code) Task: Find name from items where type appears in invoices entries with matching code. SQL:
SELECT name FROM items AS lne WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.code = lne.code );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_04105
train
T2
v2
Schema: products (alias: prod)(amount, status, date, salary) accounts(value, id, type, status) Task: Find code from products where a matching record exists in accounts with the same id. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = prod.id );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "code", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_04106
train
T1
v1
Schema: shipments (alias: shp)(code, status, level, value) budgets(value, name, id, code) Task: Find name from shipments where id appears in budgets entries with matching status. SQL:
SELECT name FROM shipments AS shp WHERE id IN ( SELECT id FROM budgets AS budg WHERE budg.status = shp.status );
{ "outer_table": "shipments", "inner_table": "budgets", "outer_alias": "shp", "inner_alias": "budg", "proj_col": "name", "filter_col": "id", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_04107
train
T2
v2
Schema: departments (alias: dept)(salary, status, value, id) requests(level, name, value, status) Task: Retrieve id from departments that have at least one corresponding entry in requests sharing the same status. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = dept.status );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "id", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_04108
train
T1
v2
Schema: warehouses (alias: whs)(level, id, status, date) invoices(date, name, level, id) Task: Retrieve code from warehouses that have at least one corresponding entry in invoices sharing the same level. SQL:
SELECT code FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "invoices", "outer_alias": "whs", "inner_alias": "inv", "proj_col": "code", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_04109
train
T2
v3
Schema: customers (alias: cust)(date, type, amount, status) services(type, id, level, date) Task: Retrieve amount from customers with amount above the AVG(salary) of services rows sharing the same level. SQL:
SELECT amount FROM customers AS cust WHERE amount > ( SELECT AVG(salary) FROM services AS srvc WHERE srvc.level = cust.level );
{ "outer_table": "customers", "inner_table": "services", "outer_alias": "cust", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_04110
train
T1
v3
Schema: budgets (alias: budg)(amount, code, salary, date) accounts(amount, level, type, value) Task: Retrieve salary from budgets with value above the MIN(value) of accounts rows sharing the same id. SQL:
SELECT salary FROM budgets AS budg WHERE value > ( SELECT MIN(value) FROM accounts AS acct WHERE acct.id = budg.id );
{ "outer_table": "budgets", "inner_table": "accounts", "outer_alias": "budg", "inner_alias": "acct", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_04111
train
T2
v2
Schema: products (alias: prod)(status, amount, type, code) departments(amount, value, level, salary) Task: Find code from products where a matching record exists in departments with the same id. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = prod.id );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "code", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_04112
train
T1
v1
Schema: departments (alias: dept)(name, amount, code, salary) transactions(value, status, level, id) Task: Retrieve name from departments whose id is found in transactions rows where code matches the outer record. SQL:
SELECT name FROM departments AS dept WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.code = dept.code );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_04113
train
T1
v1
Schema: customers (alias: cust)(name, salary, id, type) employees(salary, code, status, value) Task: Retrieve value from customers whose status is found in employees rows where id matches the outer record. SQL:
SELECT value FROM customers AS cust WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.id = cust.id );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_04114
train
T1
v1
Schema: invoices (alias: inv)(value, name, id, date) products(type, name, salary, value) Task: Retrieve id from invoices whose id is found in products rows where type matches the outer record. SQL:
SELECT id FROM invoices AS inv WHERE id IN ( SELECT id FROM products AS prod WHERE prod.type = inv.type );
{ "outer_table": "invoices", "inner_table": "products", "outer_alias": "inv", "inner_alias": "prod", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1" }
cs8_fixed_train_04115
train
T1
v2
Schema: accounts (alias: acct)(date, status, code, id) schedules(level, date, id, salary) Task: Find code from accounts where a matching record exists in schedules with the same id. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = acct.id );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "code", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_04116
train
T1
v3
Schema: transactions (alias: txn)(salary, type, status, date) departments(code, type, value, level) Task: Find value from transactions where salary exceeds the average salary from departments for the same level. SQL:
SELECT value FROM transactions AS txn WHERE salary > ( SELECT AVG(salary) FROM departments AS dept WHERE dept.level = txn.level );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_04117
train
T1
v3
Schema: departments (alias: dept)(code, date, amount, salary) schedules(id, amount, value, status) Task: Find value from departments where value exceeds the average value from schedules for the same code. SQL:
SELECT value FROM departments AS dept WHERE value > ( SELECT SUM(value) FROM schedules AS schd WHERE schd.code = dept.code );
{ "outer_table": "departments", "inner_table": "schedules", "outer_alias": "dept", "inner_alias": "schd", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_04118
train
T1
v1
Schema: sales (alias: sale)(salary, level, code, date) invoices(amount, date, id, name) Task: Retrieve id from sales whose status is found in invoices rows where type matches the outer record. SQL:
SELECT id FROM sales AS sale WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.type = sale.type );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_04119
train
T1
v2
Schema: transactions (alias: txn)(amount, status, id, code) shipments(status, amount, level, code) Task: Retrieve code from transactions that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = txn.id );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "code", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_04120
train
T1
v3
Schema: employees (alias: emp)(value, salary, status, date) shipments(date, value, level, code) Task: Retrieve id from employees with amount above the COUNT(salary) of shipments rows sharing the same id. SQL:
SELECT id FROM employees AS emp WHERE amount > ( SELECT COUNT(salary) FROM shipments AS shp WHERE shp.id = emp.id );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_04121
train
T1
v3
Schema: categories (alias: catg)(id, type, level, value) budgets(name, status, id, value) Task: Find amount from categories where amount exceeds the average amount from budgets for the same id. SQL:
SELECT amount FROM categories AS catg WHERE amount > ( SELECT COUNT(amount) FROM budgets AS budg WHERE budg.id = catg.id );
{ "outer_table": "categories", "inner_table": "budgets", "outer_alias": "catg", "inner_alias": "budg", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_04122
train
T2
v1
Schema: services (alias: srvc)(name, amount, id, status) budgets(level, name, code, amount) Task: Retrieve value from services whose id is found in budgets rows where level matches the outer record. SQL:
SELECT value FROM services AS srvc WHERE id IN ( SELECT id FROM budgets AS budg WHERE budg.level = srvc.level );
{ "outer_table": "services", "inner_table": "budgets", "outer_alias": "srvc", "inner_alias": "budg", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_04123
train
T2
v3
Schema: services (alias: srvc)(id, type, code, name) customers(level, value, code, id) Task: Retrieve code from services with value above the COUNT(salary) of customers rows sharing the same status. SQL:
SELECT code FROM services AS srvc WHERE value > ( SELECT COUNT(salary) FROM customers AS cust WHERE cust.status = srvc.status );
{ "outer_table": "services", "inner_table": "customers", "outer_alias": "srvc", "inner_alias": "cust", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_04124
train
T2
v3
Schema: departments (alias: dept)(level, salary, type, name) employees(value, id, type, amount) Task: Find code from departments where amount exceeds the average value from employees for the same code. SQL:
SELECT code FROM departments AS dept WHERE amount > ( SELECT MAX(value) FROM employees AS emp WHERE emp.code = dept.code );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_04125
train
T1
v2
Schema: shipments (alias: shp)(status, level, value, salary) staff(type, salary, id, value) Task: Retrieve amount from shipments that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = shp.type );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "amount", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_04126
train
T2
v2
Schema: items (alias: lne)(status, salary, date, amount) categories(id, value, salary, amount) Task: Find code from items where a matching record exists in categories with the same id. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = lne.id );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "code", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_04127
train
T2
v2
Schema: employees (alias: emp)(status, code, amount, value) orders(name, date, id, code) Task: Find value from employees where a matching record exists in orders with the same status. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = emp.status );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "value", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_04128
train
T1
v2
Schema: items (alias: lne)(type, amount, level, date) schedules(amount, status, level, value) Task: Retrieve id from items that have at least one corresponding entry in schedules sharing the same status. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = lne.status );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "id", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_04129
train
T2
v1
Schema: budgets (alias: budg)(value, name, id, status) accounts(name, salary, level, value) Task: Select code from budgets where code exists in accounts for the same id. SQL:
SELECT code FROM budgets AS budg WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.id = budg.id );
{ "outer_table": "budgets", "inner_table": "accounts", "outer_alias": "budg", "inner_alias": "acct", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_04130
train
T2
v3
Schema: invoices (alias: inv)(level, salary, date, id) customers(code, type, status, date) Task: Retrieve value from invoices with salary above the MAX(salary) of customers rows sharing the same code. SQL:
SELECT value FROM invoices AS inv WHERE salary > ( SELECT MAX(salary) FROM customers AS cust WHERE cust.code = inv.code );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_04131
train
T1
v2
Schema: budgets (alias: budg)(date, salary, amount, id) customers(value, level, id, amount) Task: Find name from budgets where a matching record exists in customers with the same code. SQL:
SELECT name FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = budg.code );
{ "outer_table": "budgets", "inner_table": "customers", "outer_alias": "budg", "inner_alias": "cust", "proj_col": "name", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_04132
train
T2
v3
Schema: services (alias: srvc)(status, date, salary, level) managers(date, value, type, amount) Task: Find code from services where value exceeds the average salary from managers for the same code. SQL:
SELECT code FROM services AS srvc WHERE value > ( SELECT MAX(salary) FROM managers AS mgr WHERE mgr.code = srvc.code );
{ "outer_table": "services", "inner_table": "managers", "outer_alias": "srvc", "inner_alias": "mgr", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_04133
train
T2
v1
Schema: sales (alias: sale)(salary, name, id, date) employees(id, type, value, date) Task: Select salary from sales where id exists in employees for the same id. SQL:
SELECT salary FROM sales AS sale WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.id = sale.id );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_04134
train
T1
v1
Schema: accounts (alias: acct)(id, status, type, value) sales(code, type, date, id) Task: Retrieve salary from accounts whose status is found in sales rows where code matches the outer record. SQL:
SELECT salary FROM accounts AS acct WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.code = acct.code );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_04135
train
T1
v1
Schema: requests (alias: ordr)(salary, id, status, date) accounts(code, name, type, salary) Task: Select amount from requests where id exists in accounts for the same id. SQL:
SELECT amount FROM requests AS ordr WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.id = ordr.id );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "amount", "filter_col": "id", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_04136
train
T2
v1
Schema: requests (alias: ordr)(type, salary, level, name) staff(level, code, amount, type) Task: Select salary from requests where status exists in staff for the same level. SQL:
SELECT salary FROM requests AS ordr WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.level = ordr.level );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_04137
train
T2
v1
Schema: budgets (alias: budg)(date, id, type, amount) transactions(value, code, status, date) Task: Retrieve salary from budgets whose status is found in transactions rows where type matches the outer record. SQL:
SELECT salary FROM budgets AS budg WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.type = budg.type );
{ "outer_table": "budgets", "inner_table": "transactions", "outer_alias": "budg", "inner_alias": "txn", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_04138
train
T2
v1
Schema: departments (alias: dept)(id, date, amount, code) sales(date, level, amount, id) Task: Find id from departments where id appears in sales entries with matching type. SQL:
SELECT id FROM departments AS dept WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.type = dept.type );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_04139
train
T1
v1
Schema: items (alias: lne)(code, type, date, value) invoices(code, type, status, level) Task: Select name from items where status exists in invoices for the same code. SQL:
SELECT name FROM items AS lne WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.code = lne.code );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_04140
train
T2
v2
Schema: orders (alias: ord)(level, value, code, name) items(type, value, amount, level) Task: Retrieve amount from orders that have at least one corresponding entry in items sharing the same level. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.level = ord.level );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "amount", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_04141
train
T1
v2
Schema: schedules (alias: schd)(code, id, value, type) budgets(id, type, date, name) Task: Retrieve salary from schedules that have at least one corresponding entry in budgets sharing the same id. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.id = schd.id );
{ "outer_table": "schedules", "inner_table": "budgets", "outer_alias": "schd", "inner_alias": "budg", "proj_col": "salary", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_04142
train
T2
v2
Schema: sales (alias: sale)(value, id, amount, level) transactions(code, amount, status, id) Task: Find value from sales where a matching record exists in transactions with the same id. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.id = sale.id );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "value", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_04143
train
T1
v3
Schema: staff (alias: empl)(date, code, name, salary) sales(value, name, type, level) Task: Retrieve amount from staff with value above the AVG(amount) of sales rows sharing the same id. SQL:
SELECT amount FROM staff AS empl WHERE value > ( SELECT AVG(amount) FROM sales AS sale WHERE sale.id = empl.id );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_04144
train
T2
v3
Schema: services (alias: srvc)(date, status, id, type) regions(type, salary, code, level) Task: Retrieve salary from services with salary above the MAX(salary) of regions rows sharing the same status. SQL:
SELECT salary FROM services AS srvc WHERE salary > ( SELECT MAX(salary) FROM regions AS rgn WHERE rgn.status = srvc.status );
{ "outer_table": "services", "inner_table": "regions", "outer_alias": "srvc", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_04145
train
T2
v3
Schema: accounts (alias: acct)(code, date, level, id) budgets(date, name, status, type) Task: Retrieve id from accounts with amount above the AVG(salary) of budgets rows sharing the same status. SQL:
SELECT id FROM accounts AS acct WHERE amount > ( SELECT AVG(salary) FROM budgets AS budg WHERE budg.status = acct.status );
{ "outer_table": "accounts", "inner_table": "budgets", "outer_alias": "acct", "inner_alias": "budg", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_04146
train
T1
v3
Schema: customers (alias: cust)(name, level, id, date) categories(level, date, value, id) Task: Retrieve id from customers with amount above the MIN(salary) of categories rows sharing the same id. SQL:
SELECT id FROM customers AS cust WHERE amount > ( SELECT MIN(salary) FROM categories AS catg WHERE catg.id = cust.id );
{ "outer_table": "customers", "inner_table": "categories", "outer_alias": "cust", "inner_alias": "catg", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_04147
train
T1
v1
Schema: requests (alias: ordr)(value, status, date, code) categories(code, type, salary, value) Task: Select value from requests where level exists in categories for the same id. SQL:
SELECT value FROM requests AS ordr WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.id = ordr.id );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "value", "filter_col": "level", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_04148
train
T2
v1
Schema: categories (alias: catg)(type, code, value, name) schedules(status, date, value, amount) Task: Retrieve amount from categories whose status is found in schedules rows where id matches the outer record. SQL:
SELECT amount FROM categories AS catg WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.id = catg.id );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_04149
train
T2
v2
Schema: invoices (alias: inv)(type, level, status, code) orders(date, status, code, level) Task: Find salary from invoices where a matching record exists in orders with the same id. SQL:
SELECT salary FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = inv.id );
{ "outer_table": "invoices", "inner_table": "orders", "outer_alias": "inv", "inner_alias": "ord", "proj_col": "salary", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_04150
train
T1
v1
Schema: orders (alias: ord)(code, date, status, level) items(amount, id, date, value) Task: Find code from orders where status appears in items entries with matching status. SQL:
SELECT code FROM orders AS ord WHERE status IN ( SELECT status FROM items AS lne WHERE lne.status = ord.status );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "code", "filter_col": "status", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_04151
train
T1
v1
Schema: transactions (alias: txn)(status, salary, amount, date) employees(name, id, value, code) Task: Retrieve name from transactions whose type is found in employees rows where status matches the outer record. SQL:
SELECT name FROM transactions AS txn WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.status = txn.status );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "name", "filter_col": "type", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_04152
train
T1
v2
Schema: categories (alias: catg)(type, salary, date, id) schedules(amount, value, type, name) Task: Retrieve name from categories that have at least one corresponding entry in schedules sharing the same level. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = catg.level );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "name", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_04153
train
T2
v3
Schema: schedules (alias: schd)(name, salary, status, level) warehouses(amount, type, status, id) Task: Retrieve name from schedules with amount above the COUNT(salary) of warehouses rows sharing the same code. SQL:
SELECT name FROM schedules AS schd WHERE amount > ( 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": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_04154
train
T2
v1
Schema: services (alias: srvc)(salary, status, date, code) managers(date, amount, type, salary) Task: Find code from services where id appears in managers entries with matching id. SQL:
SELECT code FROM services AS srvc WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.id = srvc.id );
{ "outer_table": "services", "inner_table": "managers", "outer_alias": "srvc", "inner_alias": "mgr", "proj_col": "code", "filter_col": "id", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_04155
train
T2
v2
Schema: warehouses (alias: whs)(type, salary, status, date) departments(type, code, status, amount) Task: Find value from warehouses where a matching record exists in departments with the same level. SQL:
SELECT value FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "departments", "outer_alias": "whs", "inner_alias": "dept", "proj_col": "value", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_04156
train
T2
v1
Schema: orders (alias: ord)(value, amount, date, code) schedules(type, code, amount, date) Task: Find value from orders where id appears in schedules entries with matching id. SQL:
SELECT value FROM orders AS ord WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.id = ord.id );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_04157
train
T1
v2
Schema: employees (alias: emp)(id, date, status, amount) regions(id, level, code, salary) Task: Find value from employees where a matching record exists in regions with the same status. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = emp.status );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "value", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_04158
train
T1
v2
Schema: accounts (alias: acct)(status, value, id, salary) managers(id, amount, date, status) Task: Retrieve id from accounts that have at least one corresponding entry in managers sharing the same type. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = acct.type );
{ "outer_table": "accounts", "inner_table": "managers", "outer_alias": "acct", "inner_alias": "mgr", "proj_col": "id", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_04159
train
T1
v2
Schema: transactions (alias: txn)(date, code, status, amount) departments(date, code, name, amount) Task: Retrieve code from transactions that have at least one corresponding entry in departments sharing the same level. SQL:
SELECT code FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = txn.level );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "code", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_04160
train
T1
v1
Schema: products (alias: prod)(id, code, salary, status) budgets(type, value, amount, id) Task: Select amount from products where status exists in budgets for the same level. SQL:
SELECT amount FROM products AS prod WHERE status IN ( SELECT status FROM budgets AS budg WHERE budg.level = prod.level );
{ "outer_table": "products", "inner_table": "budgets", "outer_alias": "prod", "inner_alias": "budg", "proj_col": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_04161
train
T1
v3
Schema: departments (alias: dept)(code, value, date, level) sales(date, salary, code, value) Task: Retrieve amount from departments with value above the AVG(amount) of sales rows sharing the same level. SQL:
SELECT amount FROM departments AS dept WHERE value > ( SELECT AVG(amount) FROM sales AS sale WHERE sale.level = dept.level );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_04162
train
T1
v3
Schema: services (alias: srvc)(salary, id, name, date) employees(amount, value, salary, name) Task: Find name from services where value exceeds the average amount from employees for the same status. SQL:
SELECT name FROM services AS srvc WHERE value > ( SELECT MAX(amount) FROM employees AS emp WHERE emp.status = srvc.status );
{ "outer_table": "services", "inner_table": "employees", "outer_alias": "srvc", "inner_alias": "emp", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_04163
train
T2
v1
Schema: requests (alias: ordr)(salary, amount, status, type) managers(id, date, type, level) Task: Select value from requests where level exists in managers for the same level. SQL:
SELECT value FROM requests AS ordr WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.level = ordr.level );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_04164
train
T2
v1
Schema: accounts (alias: acct)(date, status, value, level) transactions(value, status, id, level) Task: Retrieve name from accounts whose id is found in transactions rows where level matches the outer record. SQL:
SELECT name FROM accounts AS acct WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.level = acct.level );
{ "outer_table": "accounts", "inner_table": "transactions", "outer_alias": "acct", "inner_alias": "txn", "proj_col": "name", "filter_col": "id", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_04165
train
T1
v1
Schema: warehouses (alias: whs)(date, level, status, id) budgets(date, id, level, type) Task: Select code from warehouses where type exists in budgets for the same type. SQL:
SELECT code FROM warehouses AS whs WHERE type IN ( SELECT type FROM budgets AS budg WHERE budg.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "budgets", "outer_alias": "whs", "inner_alias": "budg", "proj_col": "code", "filter_col": "type", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_04166
train
T2
v2
Schema: categories (alias: catg)(id, date, name, level) services(date, amount, name, level) Task: Retrieve value from categories that have at least one corresponding entry in services sharing the same id. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = catg.id );
{ "outer_table": "categories", "inner_table": "services", "outer_alias": "catg", "inner_alias": "srvc", "proj_col": "value", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_04167
train
T2
v1
Schema: staff (alias: empl)(name, value, level, type) warehouses(level, salary, date, status) Task: Retrieve salary from staff whose level is found in warehouses rows where status matches the outer record. SQL:
SELECT salary FROM staff AS empl WHERE level IN ( SELECT level FROM warehouses AS whs WHERE whs.status = empl.status );
{ "outer_table": "staff", "inner_table": "warehouses", "outer_alias": "empl", "inner_alias": "whs", "proj_col": "salary", "filter_col": "level", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_04168
train
T2
v1
Schema: warehouses (alias: whs)(id, type, value, salary) categories(date, level, amount, id) Task: Find code from warehouses where id appears in categories entries with matching type. SQL:
SELECT code FROM warehouses AS whs WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "categories", "outer_alias": "whs", "inner_alias": "catg", "proj_col": "code", "filter_col": "id", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_04169
train
T2
v1
Schema: budgets (alias: budg)(status, code, salary, name) schedules(code, status, amount, level) Task: Find value from budgets where type appears in schedules entries with matching status. SQL:
SELECT value FROM budgets AS budg WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.status = budg.status );
{ "outer_table": "budgets", "inner_table": "schedules", "outer_alias": "budg", "inner_alias": "schd", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_04170
train
T2
v3
Schema: departments (alias: dept)(level, code, salary, status) accounts(value, code, type, salary) Task: Retrieve id from departments with salary above the AVG(salary) of accounts rows sharing the same code. SQL:
SELECT id FROM departments AS dept WHERE salary > ( SELECT AVG(salary) 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": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_04171
train
T1
v3
Schema: items (alias: lne)(id, code, value, date) requests(amount, salary, id, name) Task: Find salary from items where salary exceeds the average salary from requests for the same status. SQL:
SELECT salary FROM items AS lne WHERE salary > ( SELECT SUM(salary) FROM requests AS ordr WHERE ordr.status = lne.status );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_04172
train
T2
v3
Schema: managers (alias: mgr)(value, salary, status, amount) schedules(level, salary, amount, value) Task: Find code from managers where value exceeds the average value from schedules for the same type. SQL:
SELECT code FROM managers AS mgr WHERE value > ( SELECT COUNT(value) FROM schedules AS schd WHERE schd.type = mgr.type );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_04173
train
T1
v1
Schema: schedules (alias: schd)(status, name, value, date) invoices(name, salary, id, status) Task: Find amount from schedules where status appears in invoices entries with matching code. SQL:
SELECT amount FROM schedules AS schd WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.code = schd.code );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "amount", "filter_col": "status", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_04174
train
T2
v1
Schema: warehouses (alias: whs)(code, amount, type, status) invoices(status, type, level, salary) Task: Retrieve name from warehouses whose type is found in invoices rows where code matches the outer record. SQL:
SELECT name FROM warehouses AS whs WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "invoices", "outer_alias": "whs", "inner_alias": "inv", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_04175
train
T2
v3
Schema: regions (alias: rgn)(amount, level, code, type) employees(status, salary, id, code) Task: Find amount from regions where value exceeds the average amount from employees for the same level. SQL:
SELECT amount FROM regions AS rgn WHERE value > ( SELECT MIN(amount) FROM employees AS emp WHERE emp.level = rgn.level );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_04176
train
T2
v1
Schema: budgets (alias: budg)(status, code, salary, value) departments(value, salary, type, id) Task: Select name from budgets where code exists in departments for the same level. SQL:
SELECT name FROM budgets AS budg WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.level = budg.level );
{ "outer_table": "budgets", "inner_table": "departments", "outer_alias": "budg", "inner_alias": "dept", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_04177
train
T2
v2
Schema: shipments (alias: shp)(status, salary, level, amount) regions(date, id, name, type) Task: Retrieve id from shipments that have at least one corresponding entry in regions sharing the same status. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = shp.status );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "id", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_04178
train
T2
v3
Schema: items (alias: lne)(type, name, id, amount) services(name, type, status, date) Task: Retrieve salary from items with value above the MIN(value) of services rows sharing the same code. SQL:
SELECT salary FROM items AS lne WHERE value > ( SELECT MIN(value) FROM services AS srvc WHERE srvc.code = lne.code );
{ "outer_table": "items", "inner_table": "services", "outer_alias": "lne", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_04179
train
T2
v1
Schema: services (alias: srvc)(level, id, code, value) customers(name, level, id, status) Task: Retrieve amount from services whose status is found in customers rows where code matches the outer record. SQL:
SELECT amount FROM services AS srvc WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.code = srvc.code );
{ "outer_table": "services", "inner_table": "customers", "outer_alias": "srvc", "inner_alias": "cust", "proj_col": "amount", "filter_col": "status", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_04180
train
T2
v3
Schema: managers (alias: mgr)(code, name, status, id) budgets(id, level, code, type) Task: Retrieve id from managers with amount above the COUNT(amount) of budgets rows sharing the same status. SQL:
SELECT id FROM managers AS mgr WHERE amount > ( SELECT COUNT(amount) FROM budgets AS budg WHERE budg.status = mgr.status );
{ "outer_table": "managers", "inner_table": "budgets", "outer_alias": "mgr", "inner_alias": "budg", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_04181
train
T1
v1
Schema: products (alias: prod)(salary, type, id, date) categories(type, id, name, level) Task: Find value from products where status appears in categories entries with matching level. SQL:
SELECT value FROM products AS prod WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.level = prod.level );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_04182
train
T1
v2
Schema: customers (alias: cust)(amount, value, salary, level) managers(name, code, value, level) Task: Retrieve value from customers that have at least one corresponding entry in managers sharing the same id. SQL:
SELECT value FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = cust.id );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "value", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_04183
train
T1
v1
Schema: services (alias: srvc)(amount, code, salary, name) products(amount, value, level, salary) Task: Find code from services where level appears in products entries with matching type. SQL:
SELECT code FROM services AS srvc WHERE level IN ( SELECT level FROM products AS prod WHERE prod.type = srvc.type );
{ "outer_table": "services", "inner_table": "products", "outer_alias": "srvc", "inner_alias": "prod", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_04184
train
T2
v2
Schema: budgets (alias: budg)(type, id, level, name) schedules(date, value, name, status) Task: Retrieve salary from budgets that have at least one corresponding entry in schedules sharing the same code. SQL:
SELECT salary FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = budg.code );
{ "outer_table": "budgets", "inner_table": "schedules", "outer_alias": "budg", "inner_alias": "schd", "proj_col": "salary", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_04185
train
T2
v2
Schema: schedules (alias: schd)(id, date, status, type) items(code, value, date, salary) Task: Find salary from schedules where a matching record exists in items with the same type. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = schd.type );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "salary", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_04186
train
T2
v1
Schema: orders (alias: ord)(value, name, amount, level) products(status, salary, code, level) Task: Retrieve amount from orders whose id is found in products rows where type matches the outer record. SQL:
SELECT amount FROM orders AS ord WHERE id IN ( SELECT id FROM products AS prod WHERE prod.type = ord.type );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_04187
train
T1
v3
Schema: invoices (alias: inv)(id, value, status, salary) schedules(value, id, amount, level) Task: Retrieve code from invoices with value above the COUNT(salary) of schedules rows sharing the same code. SQL:
SELECT code FROM invoices AS inv WHERE value > ( SELECT COUNT(salary) FROM schedules AS schd WHERE schd.code = inv.code );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_04188
train
T1
v1
Schema: orders (alias: ord)(salary, amount, date, type) departments(name, status, salary, type) Task: Retrieve id from orders whose id is found in departments rows where id matches the outer record. SQL:
SELECT id FROM orders AS ord WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.id = ord.id );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_04189
train
T1
v1
Schema: sales (alias: sale)(value, status, amount, code) customers(status, id, name, date) Task: Select amount from sales where status exists in customers for the same id. SQL:
SELECT amount FROM sales AS sale WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.id = sale.id );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_04190
train
T1
v1
Schema: accounts (alias: acct)(status, level, salary, amount) shipments(status, date, salary, code) Task: Find amount from accounts where level appears in shipments entries with matching level. SQL:
SELECT amount FROM accounts AS acct WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.level = acct.level );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "amount", "filter_col": "level", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_04191
train
T1
v2
Schema: customers (alias: cust)(salary, value, status, level) managers(type, value, salary, amount) Task: Retrieve name from customers that have at least one corresponding entry in managers sharing the same type. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = cust.type );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "name", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_04192
train
T1
v2
Schema: orders (alias: ord)(name, level, id, code) transactions(status, salary, name, date) Task: Retrieve name from orders that have at least one corresponding entry in transactions sharing the same status. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = ord.status );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "name", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_04193
train
T1
v3
Schema: requests (alias: ordr)(code, amount, name, id) customers(type, name, amount, level) Task: Retrieve salary from requests with value above the MIN(salary) of customers rows sharing the same code. SQL:
SELECT salary FROM requests AS ordr WHERE value > ( SELECT MIN(salary) 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": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_04194
train
T2
v1
Schema: departments (alias: dept)(salary, amount, type, code) regions(date, id, level, type) Task: Find value from departments where status appears in regions entries with matching id. SQL:
SELECT value FROM departments AS dept WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.id = dept.id );
{ "outer_table": "departments", "inner_table": "regions", "outer_alias": "dept", "inner_alias": "rgn", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_04195
train
T1
v3
Schema: items (alias: lne)(name, amount, id, level) schedules(salary, code, name, value) Task: Retrieve id from items with salary above the SUM(salary) of schedules rows sharing the same code. SQL:
SELECT id FROM items AS lne WHERE salary > ( SELECT SUM(salary) FROM schedules AS schd WHERE schd.code = lne.code );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_04196
train
T2
v1
Schema: managers (alias: mgr)(level, salary, date, code) departments(status, type, code, amount) Task: Find amount from managers where level appears in departments entries with matching code. SQL:
SELECT amount FROM managers AS mgr WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.code = mgr.code );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_04197
train
T1
v1
Schema: employees (alias: emp)(value, amount, name, level) managers(type, value, name, status) Task: Select id from employees where status exists in managers for the same status. SQL:
SELECT id FROM employees AS emp WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.status = emp.status );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "id", "filter_col": "status", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_04198
train
T1
v3
Schema: employees (alias: emp)(name, date, value, status) services(date, id, value, level) Task: Retrieve code from employees with amount above the AVG(amount) of services rows sharing the same code. SQL:
SELECT code FROM employees AS emp WHERE amount > ( SELECT AVG(amount) FROM services AS srvc WHERE srvc.code = emp.code );
{ "outer_table": "employees", "inner_table": "services", "outer_alias": "emp", "inner_alias": "srvc", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_04199
train
T1