variant
stringclasses
3 values
prompt
stringlengths
163
237
sql
stringlengths
103
143
metadata
unknown
id
stringlengths
21
21
split
stringclasses
1 value
token_group
stringclasses
2 values
v2
Schema: products (alias: prod)(status, salary, id, code) staff(level, amount, code, status) Task: Retrieve salary from products that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = prod.status );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "salary", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_06800
train
T1
v3
Schema: orders (alias: ord)(name, value, status, date) regions(type, status, code, salary) Task: Find name from orders where salary exceeds the average value from regions for the same level. SQL:
SELECT name FROM orders AS ord WHERE salary > ( SELECT MAX(value) FROM regions AS rgn WHERE rgn.level = ord.level );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_06801
train
T1
v1
Schema: categories (alias: catg)(salary, amount, date, value) accounts(status, amount, salary, id) Task: Find salary from categories where status appears in accounts entries with matching status. SQL:
SELECT salary FROM categories AS catg WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.status = catg.status );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_06802
train
T2
v2
Schema: schedules (alias: schd)(status, level, type, code) transactions(value, level, code, date) Task: Find salary from schedules where a matching record exists in transactions with the same code. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = schd.code );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "salary", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_06803
train
T2
v3
Schema: accounts (alias: acct)(level, id, status, date) orders(level, date, type, amount) Task: Find amount from accounts where amount exceeds the average salary from orders for the same type. SQL:
SELECT amount FROM accounts AS acct WHERE amount > ( SELECT COUNT(salary) FROM orders AS ord WHERE ord.type = acct.type );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_06804
train
T1
v2
Schema: customers (alias: cust)(date, id, name, type) employees(amount, status, value, type) Task: Retrieve salary from customers that have at least one corresponding entry in employees sharing the same id. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = cust.id );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "salary", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_06805
train
T1
v2
Schema: departments (alias: dept)(name, date, amount, value) employees(type, level, code, date) Task: Retrieve salary from departments that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = dept.status );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "salary", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_06806
train
T1
v2
Schema: departments (alias: dept)(date, status, value, type) shipments(level, value, code, type) Task: Retrieve code from departments that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = dept.id );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "code", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_06807
train
T1
v3
Schema: categories (alias: catg)(date, level, type, value) customers(level, name, type, code) Task: Find amount from categories where value exceeds the average value from customers for the same type. SQL:
SELECT amount FROM categories AS catg WHERE value > ( SELECT AVG(value) FROM customers AS cust WHERE cust.type = catg.type );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_06808
train
T2
v2
Schema: departments (alias: dept)(code, salary, id, amount) accounts(value, code, status, level) Task: Find name from departments where a matching record exists in accounts with the same status. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = dept.status );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "name", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_06809
train
T1
v2
Schema: employees (alias: emp)(amount, code, type, date) managers(amount, salary, status, name) Task: Retrieve id from employees that have at least one corresponding entry in managers sharing the same status. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = emp.status );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "id", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_06810
train
T1
v3
Schema: transactions (alias: txn)(name, level, status, salary) shipments(level, value, date, code) Task: Find id from transactions where value exceeds the average salary from shipments for the same level. SQL:
SELECT id FROM transactions AS txn WHERE value > ( SELECT SUM(salary) FROM shipments AS shp WHERE shp.level = txn.level );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_06811
train
T1
v3
Schema: requests (alias: ordr)(value, status, amount, name) shipments(value, type, code, id) Task: Retrieve amount from requests with amount above the SUM(value) of shipments rows sharing the same status. SQL:
SELECT amount FROM requests AS ordr WHERE amount > ( SELECT SUM(value) FROM shipments AS shp WHERE shp.status = ordr.status );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_06812
train
T2
v2
Schema: shipments (alias: shp)(type, code, date, status) customers(code, amount, id, salary) Task: Retrieve salary from shipments that have at least one corresponding entry in customers sharing the same type. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = shp.type );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "salary", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_06813
train
T2
v2
Schema: products (alias: prod)(id, amount, date, level) sales(level, type, salary, id) Task: Retrieve value from products that have at least one corresponding entry in sales sharing the same level. SQL:
SELECT value FROM products AS prod WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = prod.level );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "value", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_06814
train
T1
v3
Schema: requests (alias: ordr)(salary, id, level, code) accounts(date, type, name, status) Task: Find code from requests where salary exceeds the average salary from accounts for the same id. SQL:
SELECT code FROM requests AS ordr WHERE salary > ( SELECT AVG(salary) FROM accounts AS acct WHERE acct.id = ordr.id );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_06815
train
T2
v3
Schema: departments (alias: dept)(date, level, name, code) categories(code, name, type, value) Task: Find code from departments where salary exceeds the average amount from categories for the same level. SQL:
SELECT code FROM departments AS dept WHERE salary > ( SELECT COUNT(amount) FROM categories AS catg WHERE catg.level = dept.level );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_06816
train
T1
v1
Schema: warehouses (alias: whs)(date, amount, code, level) products(type, status, amount, date) Task: Select name from warehouses where type exists in products for the same id. SQL:
SELECT name FROM warehouses AS whs WHERE type IN ( SELECT type FROM products AS prod WHERE prod.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "products", "outer_alias": "whs", "inner_alias": "prod", "proj_col": "name", "filter_col": "type", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_06817
train
T2
v2
Schema: employees (alias: emp)(level, amount, name, status) staff(code, amount, type, date) Task: Retrieve amount from employees that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = emp.status );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "amount", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_06818
train
T1
v2
Schema: accounts (alias: acct)(date, status, amount, type) shipments(id, salary, date, code) Task: Find value from accounts where a matching record exists in shipments with the same code. SQL:
SELECT value FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = acct.code );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "value", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_06819
train
T1
v3
Schema: customers (alias: cust)(salary, date, type, code) staff(level, amount, salary, value) Task: Retrieve salary from customers with value above the AVG(salary) of staff rows sharing the same id. SQL:
SELECT salary FROM customers AS cust WHERE value > ( SELECT AVG(salary) FROM staff AS empl WHERE empl.id = cust.id );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_06820
train
T1
v2
Schema: staff (alias: empl)(amount, id, date, salary) orders(amount, level, id, type) Task: Find value from staff where a matching record exists in orders with the same level. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = empl.level );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "value", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_06821
train
T2
v1
Schema: invoices (alias: inv)(status, code, level, amount) items(salary, level, code, value) Task: Select value from invoices where id exists in items for the same code. SQL:
SELECT value FROM invoices AS inv WHERE id IN ( SELECT id FROM items AS lne WHERE lne.code = inv.code );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "value", "filter_col": "id", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_06822
train
T1
v3
Schema: sales (alias: sale)(value, code, amount, name) employees(status, code, type, name) Task: Retrieve name from sales with salary above the MAX(amount) of employees rows sharing the same id. SQL:
SELECT name FROM sales AS sale WHERE salary > ( SELECT MAX(amount) FROM employees AS emp WHERE emp.id = sale.id );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_06823
train
T1
v3
Schema: services (alias: srvc)(salary, type, date, status) staff(id, code, date, status) Task: Find amount from services where salary exceeds the average value from staff for the same status. SQL:
SELECT amount FROM services AS srvc WHERE salary > ( SELECT AVG(value) FROM staff AS empl WHERE empl.status = srvc.status );
{ "outer_table": "services", "inner_table": "staff", "outer_alias": "srvc", "inner_alias": "empl", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_06824
train
T2
v2
Schema: budgets (alias: budg)(code, status, name, date) categories(type, date, amount, value) Task: Retrieve name from budgets that have at least one corresponding entry in categories sharing the same id. SQL:
SELECT name FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = budg.id );
{ "outer_table": "budgets", "inner_table": "categories", "outer_alias": "budg", "inner_alias": "catg", "proj_col": "name", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_06825
train
T2
v1
Schema: staff (alias: empl)(status, salary, type, date) services(id, type, date, amount) Task: Select code from staff where id exists in services for the same status. SQL:
SELECT code FROM staff AS empl WHERE id IN ( SELECT id FROM services AS srvc WHERE srvc.status = empl.status );
{ "outer_table": "staff", "inner_table": "services", "outer_alias": "empl", "inner_alias": "srvc", "proj_col": "code", "filter_col": "id", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_06826
train
T2
v2
Schema: managers (alias: mgr)(salary, name, id, level) shipments(code, name, type, value) Task: Find code from managers where a matching record exists in shipments with the same status. SQL:
SELECT code FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = mgr.status );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "code", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_06827
train
T1
v3
Schema: warehouses (alias: whs)(value, code, status, name) shipments(date, code, status, amount) Task: Find name from warehouses where value exceeds the average value from shipments for the same status. SQL:
SELECT name FROM warehouses AS whs WHERE value > ( SELECT AVG(value) FROM shipments AS shp WHERE shp.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "shipments", "outer_alias": "whs", "inner_alias": "shp", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_06828
train
T2
v2
Schema: departments (alias: dept)(status, amount, date, level) shipments(name, level, salary, id) Task: Retrieve code from departments that have at least one corresponding entry in shipments sharing the same type. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = dept.type );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "code", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_06829
train
T1
v1
Schema: items (alias: lne)(type, level, value, amount) transactions(salary, level, date, status) Task: Select name from items where level exists in transactions for the same code. SQL:
SELECT name FROM items AS lne WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.code = lne.code );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_06830
train
T2
v3
Schema: categories (alias: catg)(code, level, status, date) invoices(name, salary, id, amount) Task: Find amount from categories where salary exceeds the average salary from invoices for the same id. SQL:
SELECT amount FROM categories AS catg WHERE salary > ( SELECT MAX(salary) FROM invoices AS inv WHERE inv.id = catg.id );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_06831
train
T2
v2
Schema: schedules (alias: schd)(amount, type, value, level) invoices(type, id, salary, value) Task: Find amount from schedules where a matching record exists in invoices with the same code. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = schd.code );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "amount", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_06832
train
T2
v1
Schema: invoices (alias: inv)(amount, id, status, name) transactions(salary, type, id, name) Task: Select name from invoices where type exists in transactions for the same level. SQL:
SELECT name FROM invoices AS inv WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.level = inv.level );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1" }
cs8_fixed_train_06833
train
T1
v1
Schema: accounts (alias: acct)(date, status, id, name) customers(name, level, id, amount) Task: Find name from accounts where code appears in customers entries with matching status. SQL:
SELECT name FROM accounts AS acct WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.status = acct.status );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_06834
train
T1
v1
Schema: categories (alias: catg)(status, id, amount, level) regions(value, id, salary, date) Task: Select value from categories where code exists in regions for the same code. SQL:
SELECT value FROM categories AS catg WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.code = catg.code );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_06835
train
T2
v2
Schema: transactions (alias: txn)(value, amount, level, name) managers(name, date, salary, id) Task: Retrieve value from transactions that have at least one corresponding entry in managers sharing the same id. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = txn.id );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "value", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_06836
train
T1
v2
Schema: invoices (alias: inv)(type, salary, name, status) categories(type, level, id, status) Task: Find id from invoices where a matching record exists in categories with the same id. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = inv.id );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "id", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_06837
train
T1
v2
Schema: departments (alias: dept)(amount, level, value, id) warehouses(value, amount, date, salary) Task: Retrieve value from departments that have at least one corresponding entry in warehouses sharing the same code. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.code = dept.code );
{ "outer_table": "departments", "inner_table": "warehouses", "outer_alias": "dept", "inner_alias": "whs", "proj_col": "value", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_06838
train
T1
v2
Schema: customers (alias: cust)(code, level, date, status) orders(status, salary, level, date) Task: Find name from customers where a matching record exists in orders with the same status. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = cust.status );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "name", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_06839
train
T1
v2
Schema: schedules (alias: schd)(status, level, amount, date) services(value, date, type, status) Task: Find amount from schedules where a matching record exists in services with the same type. SQL:
SELECT amount FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.type = schd.type );
{ "outer_table": "schedules", "inner_table": "services", "outer_alias": "schd", "inner_alias": "srvc", "proj_col": "amount", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_06840
train
T2
v2
Schema: shipments (alias: shp)(date, level, value, code) accounts(type, name, level, value) Task: Retrieve salary from shipments that have at least one corresponding entry in accounts sharing the same level. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = shp.level );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "salary", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_06841
train
T2
v1
Schema: schedules (alias: schd)(level, amount, value, date) products(amount, status, date, id) Task: Select id from schedules where type exists in products for the same status. SQL:
SELECT id FROM schedules AS schd WHERE type IN ( SELECT type FROM products AS prod WHERE prod.status = schd.status );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "id", "filter_col": "type", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_06842
train
T2
v3
Schema: requests (alias: ordr)(amount, status, type, code) products(status, salary, code, level) Task: Find id from requests where amount exceeds the average amount from products for the same level. SQL:
SELECT id FROM requests AS ordr WHERE amount > ( SELECT COUNT(amount) FROM products AS prod WHERE prod.level = ordr.level );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_06843
train
T2
v2
Schema: requests (alias: ordr)(salary, code, date, value) departments(value, date, code, level) Task: Retrieve name from requests that have at least one corresponding entry in departments sharing the same status. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = ordr.status );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "name", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_06844
train
T2
v2
Schema: customers (alias: cust)(status, level, salary, type) services(date, level, type, status) Task: Find salary from customers where a matching record exists in services with the same level. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.level = cust.level );
{ "outer_table": "customers", "inner_table": "services", "outer_alias": "cust", "inner_alias": "srvc", "proj_col": "salary", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_06845
train
T1
v2
Schema: orders (alias: ord)(value, salary, status, type) departments(status, id, value, date) Task: Find name from orders where a matching record exists in departments with the same status. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = ord.status );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "name", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_06846
train
T1
v1
Schema: shipments (alias: shp)(date, amount, type, salary) transactions(code, amount, salary, type) Task: Select id from shipments where id exists in transactions for the same type. SQL:
SELECT id FROM shipments AS shp WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.type = shp.type );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_06847
train
T2
v2
Schema: budgets (alias: budg)(amount, salary, type, status) services(name, salary, code, status) Task: Retrieve salary from budgets that have at least one corresponding entry in services sharing the same status. SQL:
SELECT salary FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.status = budg.status );
{ "outer_table": "budgets", "inner_table": "services", "outer_alias": "budg", "inner_alias": "srvc", "proj_col": "salary", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_06848
train
T2
v2
Schema: items (alias: lne)(status, code, type, value) schedules(amount, value, status, level) Task: Retrieve id from items that have at least one corresponding entry in schedules sharing the same level. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = lne.level );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "id", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_06849
train
T2
v3
Schema: orders (alias: ord)(type, amount, date, level) schedules(value, level, code, salary) Task: Retrieve code from orders with salary above the MIN(salary) of schedules rows sharing the same status. SQL:
SELECT code FROM orders AS ord WHERE salary > ( SELECT MIN(salary) FROM schedules AS schd WHERE schd.status = ord.status );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_06850
train
T1
v3
Schema: services (alias: srvc)(value, status, id, date) categories(code, salary, id, date) Task: Retrieve salary from services with value above the AVG(amount) of categories rows sharing the same level. SQL:
SELECT salary FROM services AS srvc WHERE value > ( SELECT AVG(amount) FROM categories AS catg WHERE catg.level = srvc.level );
{ "outer_table": "services", "inner_table": "categories", "outer_alias": "srvc", "inner_alias": "catg", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_06851
train
T2
v3
Schema: products (alias: prod)(id, level, amount, value) managers(salary, level, id, status) Task: Find code from products where value exceeds the average salary from managers for the same type. SQL:
SELECT code FROM products AS prod WHERE value > ( SELECT SUM(salary) FROM managers AS mgr WHERE mgr.type = prod.type );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_06852
train
T1
v3
Schema: accounts (alias: acct)(date, status, name, code) items(status, type, date, salary) Task: Retrieve code from accounts with salary above the AVG(amount) of items rows sharing the same id. SQL:
SELECT code FROM accounts AS acct WHERE salary > ( SELECT AVG(amount) FROM items AS lne WHERE lne.id = acct.id );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_06853
train
T1
v1
Schema: shipments (alias: shp)(salary, status, date, id) regions(salary, value, status, type) Task: Select salary from shipments where type exists in regions for the same status. SQL:
SELECT salary FROM shipments AS shp WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.status = shp.status );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "type", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_06854
train
T2
v3
Schema: sales (alias: sale)(level, date, amount, code) warehouses(value, amount, name, date) Task: Retrieve amount from sales with amount above the COUNT(amount) of warehouses rows sharing the same id. SQL:
SELECT amount FROM sales AS sale WHERE amount > ( SELECT COUNT(amount) FROM warehouses AS whs WHERE whs.id = sale.id );
{ "outer_table": "sales", "inner_table": "warehouses", "outer_alias": "sale", "inner_alias": "whs", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_06855
train
T1
v1
Schema: managers (alias: mgr)(date, status, type, code) schedules(status, salary, code, name) Task: Retrieve code from managers whose status is found in schedules rows where status matches the outer record. SQL:
SELECT code FROM managers AS mgr WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.status = mgr.status );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "code", "filter_col": "status", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1" }
cs8_fixed_train_06856
train
T1
v3
Schema: shipments (alias: shp)(salary, id, code, status) regions(type, code, name, date) Task: Retrieve amount from shipments with value above the MIN(value) of regions rows sharing the same status. SQL:
SELECT amount FROM shipments AS shp WHERE value > ( SELECT MIN(value) FROM regions AS rgn WHERE rgn.status = shp.status );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_06857
train
T2
v2
Schema: managers (alias: mgr)(name, status, value, salary) regions(value, level, date, name) Task: Find id from managers where a matching record exists in regions with the same code. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = mgr.code );
{ "outer_table": "managers", "inner_table": "regions", "outer_alias": "mgr", "inner_alias": "rgn", "proj_col": "id", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_06858
train
T1
v1
Schema: orders (alias: ord)(value, level, date, amount) services(salary, code, value, type) Task: Find salary from orders where id appears in services entries with matching id. SQL:
SELECT salary FROM orders AS ord WHERE id IN ( SELECT id FROM services AS srvc WHERE srvc.id = ord.id );
{ "outer_table": "orders", "inner_table": "services", "outer_alias": "ord", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_06859
train
T1
v1
Schema: employees (alias: emp)(salary, level, id, code) budgets(value, id, level, amount) Task: Find amount from employees where status appears in budgets entries with matching level. SQL:
SELECT amount FROM employees AS emp WHERE status IN ( SELECT status FROM budgets AS budg WHERE budg.level = emp.level );
{ "outer_table": "employees", "inner_table": "budgets", "outer_alias": "emp", "inner_alias": "budg", "proj_col": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_06860
train
T1
v1
Schema: items (alias: lne)(value, name, type, date) managers(status, level, id, date) Task: Retrieve id from items whose id is found in managers rows where id matches the outer record. SQL:
SELECT id FROM items AS lne WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.id = lne.id );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "id", "filter_col": "id", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_06861
train
T2
v3
Schema: products (alias: prod)(type, code, name, date) requests(level, status, type, id) Task: Find salary from products where value exceeds the average amount from requests for the same id. SQL:
SELECT salary FROM products AS prod WHERE value > ( SELECT AVG(amount) FROM requests AS ordr WHERE ordr.id = prod.id );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_06862
train
T1
v2
Schema: items (alias: lne)(code, date, value, id) requests(salary, code, value, status) Task: Retrieve id from items that have at least one corresponding entry in requests sharing the same status. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.status = lne.status );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "id", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_06863
train
T2
v1
Schema: warehouses (alias: whs)(date, name, code, salary) customers(type, level, id, date) Task: Find value from warehouses where level appears in customers entries with matching level. SQL:
SELECT value FROM warehouses AS whs WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "customers", "outer_alias": "whs", "inner_alias": "cust", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_06864
train
T2
v3
Schema: orders (alias: ord)(date, code, type, salary) customers(level, name, date, amount) Task: Retrieve code from orders with salary above the MIN(salary) of customers rows sharing the same id. SQL:
SELECT code FROM orders AS ord WHERE salary > ( SELECT MIN(salary) FROM customers AS cust WHERE cust.id = ord.id );
{ "outer_table": "orders", "inner_table": "customers", "outer_alias": "ord", "inner_alias": "cust", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_06865
train
T1
v3
Schema: departments (alias: dept)(type, code, amount, level) warehouses(code, id, type, amount) Task: Find name from departments where salary exceeds the average amount from warehouses for the same id. SQL:
SELECT name FROM departments AS dept WHERE salary > ( SELECT MAX(amount) FROM warehouses AS whs WHERE whs.id = dept.id );
{ "outer_table": "departments", "inner_table": "warehouses", "outer_alias": "dept", "inner_alias": "whs", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_06866
train
T1
v3
Schema: departments (alias: dept)(type, amount, date, level) requests(value, amount, id, name) Task: Retrieve amount from departments with amount above the SUM(salary) of requests rows sharing the same status. SQL:
SELECT amount FROM departments AS dept WHERE amount > ( SELECT SUM(salary) FROM requests AS ordr WHERE ordr.status = dept.status );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_06867
train
T1
v1
Schema: transactions (alias: txn)(name, type, amount, salary) products(name, status, salary, date) Task: Retrieve amount from transactions whose level is found in products rows where code matches the outer record. SQL:
SELECT amount FROM transactions AS txn WHERE level IN ( SELECT level FROM products AS prod WHERE prod.code = txn.code );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "amount", "filter_col": "level", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_06868
train
T1
v2
Schema: services (alias: srvc)(level, value, status, type) shipments(amount, status, type, name) Task: Find id from services where a matching record exists in shipments with the same code. SQL:
SELECT id FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = srvc.code );
{ "outer_table": "services", "inner_table": "shipments", "outer_alias": "srvc", "inner_alias": "shp", "proj_col": "id", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_06869
train
T2
v2
Schema: staff (alias: empl)(salary, value, code, amount) products(amount, value, level, code) Task: Retrieve amount from staff that have at least one corresponding entry in products sharing the same code. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = empl.code );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "amount", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_06870
train
T2
v1
Schema: budgets (alias: budg)(code, status, type, value) items(amount, value, level, name) Task: Select value from budgets where id exists in items for the same id. SQL:
SELECT value FROM budgets AS budg WHERE id IN ( SELECT id FROM items AS lne WHERE lne.id = budg.id );
{ "outer_table": "budgets", "inner_table": "items", "outer_alias": "budg", "inner_alias": "lne", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_06871
train
T2
v1
Schema: budgets (alias: budg)(date, amount, type, id) services(level, code, salary, date) Task: Retrieve code from budgets whose status is found in services rows where type matches the outer record. SQL:
SELECT code FROM budgets AS budg WHERE status IN ( SELECT status FROM services AS srvc WHERE srvc.type = budg.type );
{ "outer_table": "budgets", "inner_table": "services", "outer_alias": "budg", "inner_alias": "srvc", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_06872
train
T2
v3
Schema: requests (alias: ordr)(type, status, level, id) warehouses(code, salary, value, date) Task: Retrieve amount from requests with salary above the SUM(amount) of warehouses rows sharing the same type. SQL:
SELECT amount FROM requests AS ordr WHERE salary > ( SELECT SUM(amount) FROM warehouses AS whs WHERE whs.type = ordr.type );
{ "outer_table": "requests", "inner_table": "warehouses", "outer_alias": "ordr", "inner_alias": "whs", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_06873
train
T2
v2
Schema: orders (alias: ord)(date, level, code, type) shipments(date, code, level, name) Task: Retrieve value from orders that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = ord.id );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "value", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_06874
train
T1
v1
Schema: customers (alias: cust)(salary, amount, value, code) regions(value, date, level, amount) Task: Retrieve amount from customers whose id is found in regions rows where type matches the outer record. SQL:
SELECT amount FROM customers AS cust WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.type = cust.type );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_06875
train
T1
v2
Schema: customers (alias: cust)(salary, id, status, name) budgets(type, name, value, code) Task: Retrieve name from customers that have at least one corresponding entry in budgets sharing the same code. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.code = cust.code );
{ "outer_table": "customers", "inner_table": "budgets", "outer_alias": "cust", "inner_alias": "budg", "proj_col": "name", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_06876
train
T1
v3
Schema: warehouses (alias: whs)(date, status, type, salary) transactions(code, status, type, value) Task: Retrieve id from warehouses with salary above the MIN(salary) of transactions rows sharing the same status. SQL:
SELECT id FROM warehouses AS whs WHERE salary > ( SELECT MIN(salary) FROM transactions AS txn WHERE txn.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "transactions", "outer_alias": "whs", "inner_alias": "txn", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_06877
train
T2
v3
Schema: warehouses (alias: whs)(date, id, salary, value) employees(date, salary, type, name) Task: Retrieve code from warehouses with value above the AVG(amount) of employees rows sharing the same id. SQL:
SELECT code FROM warehouses AS whs WHERE value > ( SELECT AVG(amount) FROM employees AS emp WHERE emp.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "employees", "outer_alias": "whs", "inner_alias": "emp", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_06878
train
T2
v3
Schema: employees (alias: emp)(name, type, amount, id) customers(name, type, status, value) Task: Retrieve code from employees with value above the SUM(amount) of customers rows sharing the same id. SQL:
SELECT code FROM employees AS emp WHERE value > ( SELECT SUM(amount) FROM customers AS cust WHERE cust.id = emp.id );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_06879
train
T1
v2
Schema: accounts (alias: acct)(level, amount, name, date) invoices(status, type, level, name) Task: Retrieve code from accounts that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT code 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": "code", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_06880
train
T1
v2
Schema: items (alias: lne)(value, amount, id, level) requests(name, code, salary, type) Task: Retrieve code from items that have at least one corresponding entry in requests sharing the same level. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = lne.level );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "code", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_06881
train
T2
v2
Schema: invoices (alias: inv)(amount, date, code, name) categories(code, amount, status, salary) Task: Find salary from invoices where a matching record exists in categories with the same id. SQL:
SELECT salary FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = inv.id );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "salary", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_06882
train
T1
v3
Schema: regions (alias: rgn)(type, salary, level, date) budgets(salary, code, amount, type) Task: Find id from regions where salary exceeds the average value from budgets for the same id. SQL:
SELECT id FROM regions AS rgn WHERE salary > ( SELECT MAX(value) FROM budgets AS budg WHERE budg.id = rgn.id );
{ "outer_table": "regions", "inner_table": "budgets", "outer_alias": "rgn", "inner_alias": "budg", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_06883
train
T2
v3
Schema: staff (alias: empl)(name, amount, date, code) customers(name, amount, value, level) Task: Find value from staff where amount exceeds the average salary from customers for the same level. SQL:
SELECT value FROM staff AS empl WHERE amount > ( SELECT AVG(salary) FROM customers AS cust WHERE cust.level = empl.level );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_06884
train
T2
v1
Schema: sales (alias: sale)(date, id, salary, amount) items(status, name, id, value) Task: Select name from sales where id exists in items for the same level. SQL:
SELECT name FROM sales AS sale WHERE id IN ( SELECT id FROM items AS lne WHERE lne.level = sale.level );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "name", "filter_col": "id", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_06885
train
T1
v3
Schema: invoices (alias: inv)(date, code, amount, id) warehouses(id, amount, date, type) Task: Retrieve value from invoices with amount above the AVG(salary) of warehouses rows sharing the same code. SQL:
SELECT value FROM invoices AS inv WHERE amount > ( SELECT AVG(salary) FROM warehouses AS whs WHERE whs.code = inv.code );
{ "outer_table": "invoices", "inner_table": "warehouses", "outer_alias": "inv", "inner_alias": "whs", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_06886
train
T1
v1
Schema: services (alias: srvc)(name, amount, level, status) orders(value, amount, code, level) Task: Select value from services where level exists in orders for the same id. SQL:
SELECT value FROM services AS srvc WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.id = srvc.id );
{ "outer_table": "services", "inner_table": "orders", "outer_alias": "srvc", "inner_alias": "ord", "proj_col": "value", "filter_col": "level", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_06887
train
T2
v2
Schema: regions (alias: rgn)(level, status, name, id) warehouses(amount, code, id, value) Task: Find id from regions where a matching record exists in warehouses with the same code. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.code = rgn.code );
{ "outer_table": "regions", "inner_table": "warehouses", "outer_alias": "rgn", "inner_alias": "whs", "proj_col": "id", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_06888
train
T2
v2
Schema: customers (alias: cust)(status, value, type, date) shipments(amount, value, level, name) Task: Retrieve salary from customers that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = cust.id );
{ "outer_table": "customers", "inner_table": "shipments", "outer_alias": "cust", "inner_alias": "shp", "proj_col": "salary", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_06889
train
T1
v3
Schema: departments (alias: dept)(value, date, status, level) warehouses(amount, date, type, level) Task: Retrieve id from departments with salary above the COUNT(value) of warehouses rows sharing the same id. SQL:
SELECT id FROM departments AS dept WHERE salary > ( SELECT COUNT(value) FROM warehouses AS whs WHERE whs.id = dept.id );
{ "outer_table": "departments", "inner_table": "warehouses", "outer_alias": "dept", "inner_alias": "whs", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_06890
train
T1
v3
Schema: sales (alias: sale)(value, id, code, type) shipments(type, code, id, amount) Task: Retrieve amount from sales with amount above the SUM(amount) of shipments rows sharing the same code. SQL:
SELECT amount FROM sales AS sale WHERE amount > ( SELECT SUM(amount) FROM shipments AS shp WHERE shp.code = sale.code );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_06891
train
T1
v3
Schema: transactions (alias: txn)(name, status, code, salary) schedules(status, id, name, code) Task: Find amount from transactions where value exceeds the average salary from schedules for the same id. SQL:
SELECT amount FROM transactions AS txn WHERE value > ( SELECT AVG(salary) FROM schedules AS schd WHERE schd.id = txn.id );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_06892
train
T1
v2
Schema: items (alias: lne)(value, salary, type, id) transactions(amount, name, salary, code) Task: Retrieve name from items that have at least one corresponding entry in transactions sharing the same level. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = lne.level );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "name", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_06893
train
T2
v2
Schema: categories (alias: catg)(level, type, name, status) warehouses(value, code, name, id) Task: Retrieve id from categories that have at least one corresponding entry in warehouses sharing the same status. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.status = catg.status );
{ "outer_table": "categories", "inner_table": "warehouses", "outer_alias": "catg", "inner_alias": "whs", "proj_col": "id", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_06894
train
T2
v3
Schema: employees (alias: emp)(type, level, value, code) orders(type, level, name, status) Task: Retrieve value from employees with value above the MIN(salary) of orders rows sharing the same id. SQL:
SELECT value FROM employees AS emp WHERE value > ( SELECT MIN(salary) FROM orders AS ord WHERE ord.id = emp.id );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_06895
train
T1
v3
Schema: regions (alias: rgn)(type, date, id, name) employees(code, level, type, name) Task: Find code from regions where salary exceeds the average value from employees for the same type. SQL:
SELECT code FROM regions AS rgn WHERE salary > ( SELECT COUNT(value) FROM employees AS emp WHERE emp.type = rgn.type );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_06896
train
T2
v3
Schema: managers (alias: mgr)(id, amount, value, status) warehouses(date, level, amount, id) Task: Find name from managers where salary exceeds the average value from warehouses for the same type. SQL:
SELECT name FROM managers AS mgr WHERE salary > ( SELECT AVG(value) FROM warehouses AS whs WHERE whs.type = mgr.type );
{ "outer_table": "managers", "inner_table": "warehouses", "outer_alias": "mgr", "inner_alias": "whs", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_06897
train
T1
v3
Schema: categories (alias: catg)(date, salary, status, level) warehouses(status, level, code, salary) Task: Find salary from categories where value exceeds the average amount from warehouses for the same level. SQL:
SELECT salary FROM categories AS catg WHERE value > ( SELECT SUM(amount) FROM warehouses AS whs WHERE whs.level = catg.level );
{ "outer_table": "categories", "inner_table": "warehouses", "outer_alias": "catg", "inner_alias": "whs", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_06898
train
T2
v2
Schema: departments (alias: dept)(amount, value, level, date) categories(level, type, salary, date) Task: Retrieve salary from departments that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = dept.code );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "salary", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_06899
train
T1