variant
stringclasses
3 values
prompt
stringlengths
163
237
sql
stringlengths
103
143
metadata
unknown
id
stringlengths
21
21
split
stringclasses
1 value
token_group
stringclasses
2 values
v3
Schema: managers (alias: mgr)(level, salary, status, code) departments(salary, id, name, level) Task: Find salary from managers where salary exceeds the average salary from departments for the same id. SQL:
SELECT salary FROM managers AS mgr WHERE salary > ( SELECT MAX(salary) FROM departments AS dept WHERE dept.id = mgr.id );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_05800
train
T1
v2
Schema: shipments (alias: shp)(date, value, type, code) schedules(date, type, level, value) Task: Retrieve amount from shipments that have at least one corresponding entry in schedules sharing the same level. SQL:
SELECT amount FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.level = shp.level );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "amount", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_05801
train
T2
v2
Schema: staff (alias: empl)(status, type, date, id) invoices(type, name, salary, level) Task: Retrieve code from staff that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = empl.type );
{ "outer_table": "staff", "inner_table": "invoices", "outer_alias": "empl", "inner_alias": "inv", "proj_col": "code", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_05802
train
T2
v2
Schema: departments (alias: dept)(salary, value, level, amount) budgets(date, type, value, name) Task: Retrieve salary from departments that have at least one corresponding entry in budgets sharing the same code. SQL:
SELECT salary FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.code = dept.code );
{ "outer_table": "departments", "inner_table": "budgets", "outer_alias": "dept", "inner_alias": "budg", "proj_col": "salary", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_05803
train
T1
v3
Schema: customers (alias: cust)(status, name, id, salary) managers(level, name, value, id) Task: Find id from customers where value exceeds the average value from managers for the same status. SQL:
SELECT id FROM customers AS cust WHERE value > ( SELECT MIN(value) FROM managers AS mgr WHERE mgr.status = cust.status );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_05804
train
T1
v2
Schema: shipments (alias: shp)(status, type, name, code) employees(date, type, amount, level) Task: Retrieve id from shipments that have at least one corresponding entry in employees sharing the same code. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = shp.code );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "id", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_05805
train
T2
v3
Schema: categories (alias: catg)(code, date, salary, type) shipments(amount, level, status, code) Task: Find salary from categories where value exceeds the average salary from shipments for the same type. SQL:
SELECT salary FROM categories AS catg WHERE value > ( SELECT MAX(salary) FROM shipments AS shp WHERE shp.type = catg.type );
{ "outer_table": "categories", "inner_table": "shipments", "outer_alias": "catg", "inner_alias": "shp", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_05806
train
T2
v1
Schema: items (alias: lne)(salary, amount, date, code) regions(name, type, level, date) Task: Select value from items where code exists in regions for the same id. SQL:
SELECT value FROM items AS lne WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.id = lne.id );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_05807
train
T2
v3
Schema: warehouses (alias: whs)(name, code, type, level) budgets(status, level, salary, amount) Task: Retrieve id from warehouses with value above the SUM(value) of budgets rows sharing the same id. SQL:
SELECT id FROM warehouses AS whs WHERE value > ( SELECT SUM(value) FROM budgets AS budg WHERE budg.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "budgets", "outer_alias": "whs", "inner_alias": "budg", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_05808
train
T2
v3
Schema: services (alias: srvc)(name, id, salary, value) employees(value, salary, level, id) Task: Retrieve amount from services with amount above the AVG(salary) of employees rows sharing the same status. SQL:
SELECT amount FROM services AS srvc WHERE amount > ( SELECT AVG(salary) FROM employees AS emp WHERE emp.status = srvc.status );
{ "outer_table": "services", "inner_table": "employees", "outer_alias": "srvc", "inner_alias": "emp", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_05809
train
T2
v3
Schema: accounts (alias: acct)(date, value, level, status) requests(id, value, type, amount) Task: Find amount from accounts where salary exceeds the average amount from requests for the same type. SQL:
SELECT amount FROM accounts AS acct WHERE salary > ( SELECT AVG(amount) FROM requests AS ordr WHERE ordr.type = acct.type );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_05810
train
T1
v2
Schema: budgets (alias: budg)(type, status, date, id) items(level, date, salary, id) Task: Find code from budgets where a matching record exists in items with the same level. SQL:
SELECT code FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.level = budg.level );
{ "outer_table": "budgets", "inner_table": "items", "outer_alias": "budg", "inner_alias": "lne", "proj_col": "code", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_05811
train
T2
v2
Schema: orders (alias: ord)(name, status, amount, type) accounts(level, salary, id, type) Task: Retrieve salary from orders that have at least one corresponding entry in accounts sharing the same status. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = ord.status );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "salary", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_05812
train
T1
v1
Schema: warehouses (alias: whs)(code, id, level, date) items(level, type, amount, name) Task: Retrieve code from warehouses whose type is found in items rows where level matches the outer record. SQL:
SELECT code FROM warehouses AS whs WHERE type IN ( SELECT type FROM items AS lne WHERE lne.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "items", "outer_alias": "whs", "inner_alias": "lne", "proj_col": "code", "filter_col": "type", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_05813
train
T2
v2
Schema: budgets (alias: budg)(id, type, salary, amount) products(code, type, name, value) Task: Retrieve value from budgets that have at least one corresponding entry in products sharing the same level. SQL:
SELECT value FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = budg.level );
{ "outer_table": "budgets", "inner_table": "products", "outer_alias": "budg", "inner_alias": "prod", "proj_col": "value", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_05814
train
T2
v3
Schema: orders (alias: ord)(code, amount, level, id) staff(salary, date, value, name) Task: Retrieve code from orders with amount above the COUNT(value) of staff rows sharing the same level. SQL:
SELECT code FROM orders AS ord WHERE amount > ( SELECT COUNT(value) FROM staff AS empl WHERE empl.level = ord.level );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_05815
train
T1
v2
Schema: accounts (alias: acct)(value, type, name, level) invoices(salary, amount, status, type) Task: Retrieve amount from accounts that have at least one corresponding entry in invoices sharing the same type. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = acct.type );
{ "outer_table": "accounts", "inner_table": "invoices", "outer_alias": "acct", "inner_alias": "inv", "proj_col": "amount", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_05816
train
T1
v3
Schema: budgets (alias: budg)(type, value, salary, level) warehouses(name, type, id, salary) Task: Find amount from budgets where salary exceeds the average salary from warehouses for the same level. SQL:
SELECT amount FROM budgets AS budg WHERE salary > ( SELECT MAX(salary) FROM warehouses AS whs WHERE whs.level = budg.level );
{ "outer_table": "budgets", "inner_table": "warehouses", "outer_alias": "budg", "inner_alias": "whs", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_05817
train
T2
v3
Schema: services (alias: srvc)(date, value, salary, level) orders(code, name, type, level) Task: Retrieve id from services with amount above the COUNT(value) of orders rows sharing the same status. SQL:
SELECT id FROM services AS srvc WHERE amount > ( SELECT COUNT(value) FROM orders AS ord WHERE ord.status = srvc.status );
{ "outer_table": "services", "inner_table": "orders", "outer_alias": "srvc", "inner_alias": "ord", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_05818
train
T2
v1
Schema: products (alias: prod)(salary, date, type, status) staff(type, salary, code, level) Task: Retrieve amount from products whose level is found in staff rows where status matches the outer record. SQL:
SELECT amount FROM products AS prod WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.status = prod.status );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_05819
train
T1
v3
Schema: customers (alias: cust)(name, date, status, code) invoices(level, value, code, date) Task: Find id from customers where salary exceeds the average amount from invoices for the same level. SQL:
SELECT id FROM customers AS cust WHERE salary > ( SELECT MAX(amount) FROM invoices AS inv WHERE inv.level = cust.level );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_05820
train
T1
v3
Schema: accounts (alias: acct)(level, name, date, value) schedules(id, status, date, salary) Task: Retrieve id from accounts with amount above the AVG(salary) of schedules rows sharing the same type. SQL:
SELECT id FROM accounts AS acct WHERE amount > ( SELECT AVG(salary) FROM schedules AS schd WHERE schd.type = acct.type );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_05821
train
T1
v1
Schema: employees (alias: emp)(name, level, status, salary) shipments(type, salary, code, status) Task: Retrieve code from employees whose level is found in shipments rows where id matches the outer record. SQL:
SELECT code FROM employees AS emp WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.id = emp.id );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "code", "filter_col": "level", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_05822
train
T1
v1
Schema: customers (alias: cust)(id, status, code, salary) invoices(type, id, amount, level) Task: Retrieve name from customers whose code is found in invoices rows where id matches the outer record. SQL:
SELECT name FROM customers AS cust WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.id = cust.id );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_05823
train
T1
v1
Schema: products (alias: prod)(date, status, level, name) warehouses(name, code, type, date) Task: Find amount from products where type appears in warehouses entries with matching type. SQL:
SELECT amount FROM products AS prod WHERE type IN ( SELECT type FROM warehouses AS whs WHERE whs.type = prod.type );
{ "outer_table": "products", "inner_table": "warehouses", "outer_alias": "prod", "inner_alias": "whs", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_05824
train
T1
v2
Schema: departments (alias: dept)(value, id, level, code) requests(date, level, name, status) Task: Retrieve code from departments that have at least one corresponding entry in requests sharing the same level. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.level = dept.level );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "code", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_05825
train
T1
v3
Schema: requests (alias: ordr)(type, date, name, level) budgets(salary, type, amount, code) Task: Retrieve code from requests with amount above the MIN(amount) of budgets rows sharing the same code. SQL:
SELECT code FROM requests AS ordr WHERE amount > ( SELECT MIN(amount) FROM budgets AS budg WHERE budg.code = ordr.code );
{ "outer_table": "requests", "inner_table": "budgets", "outer_alias": "ordr", "inner_alias": "budg", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_05826
train
T2
v3
Schema: items (alias: lne)(type, level, date, status) staff(amount, level, type, value) Task: Find code from items where amount exceeds the average amount from staff for the same id. SQL:
SELECT code FROM items AS lne WHERE amount > ( SELECT SUM(amount) FROM staff AS empl WHERE empl.id = lne.id );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_05827
train
T2
v1
Schema: schedules (alias: schd)(name, status, amount, salary) items(id, value, status, amount) Task: Retrieve id from schedules whose id is found in items rows where level matches the outer record. SQL:
SELECT id FROM schedules AS schd WHERE id IN ( SELECT id FROM items AS lne WHERE lne.level = schd.level );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "id", "filter_col": "id", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_05828
train
T2
v3
Schema: sales (alias: sale)(amount, code, date, id) departments(amount, code, id, name) Task: Find amount from sales where salary exceeds the average value from departments for the same id. SQL:
SELECT amount FROM sales AS sale WHERE salary > ( SELECT AVG(value) FROM departments AS dept WHERE dept.id = sale.id );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_05829
train
T1
v2
Schema: services (alias: srvc)(type, amount, code, id) invoices(type, value, date, code) Task: Find name from services where a matching record exists in invoices with the same level. SQL:
SELECT name FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = srvc.level );
{ "outer_table": "services", "inner_table": "invoices", "outer_alias": "srvc", "inner_alias": "inv", "proj_col": "name", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_05830
train
T2
v3
Schema: employees (alias: emp)(value, status, level, date) categories(name, amount, code, status) Task: Find name from employees where value exceeds the average value from categories for the same level. SQL:
SELECT name FROM employees AS emp WHERE value > ( SELECT MIN(value) FROM categories AS catg WHERE catg.level = emp.level );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_05831
train
T1
v3
Schema: regions (alias: rgn)(level, date, salary, type) departments(salary, level, type, amount) Task: Find code from regions where value exceeds the average amount from departments for the same code. SQL:
SELECT code FROM regions AS rgn WHERE value > ( SELECT AVG(amount) FROM departments AS dept WHERE dept.code = rgn.code );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_05832
train
T2
v2
Schema: items (alias: lne)(code, value, type, name) schedules(salary, status, name, type) Task: Find id from items where a matching record exists in schedules with 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_05833
train
T2
v1
Schema: accounts (alias: acct)(amount, name, value, salary) items(name, id, value, code) Task: Retrieve value from accounts whose status is found in items rows where level matches the outer record. SQL:
SELECT value FROM accounts AS acct WHERE status IN ( SELECT status FROM items AS lne WHERE lne.level = acct.level );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1" }
cs8_fixed_train_05834
train
T1
v3
Schema: staff (alias: empl)(status, value, type, amount) regions(amount, level, value, type) Task: Retrieve value from staff with value above the COUNT(salary) of regions rows sharing the same level. SQL:
SELECT value FROM staff AS empl WHERE value > ( SELECT COUNT(salary) FROM regions AS rgn WHERE rgn.level = empl.level );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_05835
train
T2
v2
Schema: customers (alias: cust)(amount, status, value, id) sales(salary, amount, name, code) Task: Find code from customers where a matching record exists in sales with the same level. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = cust.level );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "code", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_05836
train
T1
v2
Schema: orders (alias: ord)(id, value, date, salary) regions(date, code, amount, type) Task: Find code from orders where a matching record exists in regions with the same status. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = ord.status );
{ "outer_table": "orders", "inner_table": "regions", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "code", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1" }
cs8_fixed_train_05837
train
T1
v1
Schema: categories (alias: catg)(salary, status, date, code) budgets(name, salary, amount, type) Task: Retrieve name from categories whose level is found in budgets rows where level matches the outer record. SQL:
SELECT name FROM categories AS catg WHERE level IN ( SELECT level FROM budgets AS budg WHERE budg.level = catg.level );
{ "outer_table": "categories", "inner_table": "budgets", "outer_alias": "catg", "inner_alias": "budg", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_05838
train
T2
v2
Schema: departments (alias: dept)(date, level, id, code) services(id, amount, salary, value) Task: Retrieve code from departments that have at least one corresponding entry in services sharing the same code. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.code = dept.code );
{ "outer_table": "departments", "inner_table": "services", "outer_alias": "dept", "inner_alias": "srvc", "proj_col": "code", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_05839
train
T1
v2
Schema: services (alias: srvc)(status, level, amount, type) transactions(name, date, amount, value) Task: Find salary from services where a matching record exists in transactions with the same type. SQL:
SELECT salary FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = srvc.type );
{ "outer_table": "services", "inner_table": "transactions", "outer_alias": "srvc", "inner_alias": "txn", "proj_col": "salary", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_05840
train
T2
v3
Schema: departments (alias: dept)(date, salary, status, level) employees(name, amount, value, level) Task: Retrieve salary from departments with salary above the AVG(amount) of employees rows sharing the same code. SQL:
SELECT salary FROM departments AS dept WHERE salary > ( SELECT AVG(amount) FROM employees AS emp WHERE emp.code = dept.code );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_05841
train
T1
v2
Schema: transactions (alias: txn)(level, status, type, amount) budgets(level, code, value, id) Task: Retrieve name from transactions that have at least one corresponding entry in budgets sharing the same level. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.level = txn.level );
{ "outer_table": "transactions", "inner_table": "budgets", "outer_alias": "txn", "inner_alias": "budg", "proj_col": "name", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_05842
train
T1
v3
Schema: customers (alias: cust)(type, salary, id, value) budgets(level, name, status, value) Task: Find id from customers where amount exceeds the average salary from budgets for the same code. SQL:
SELECT id FROM customers AS cust WHERE amount > ( SELECT AVG(salary) FROM budgets AS budg WHERE budg.code = cust.code );
{ "outer_table": "customers", "inner_table": "budgets", "outer_alias": "cust", "inner_alias": "budg", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1" }
cs8_fixed_train_05843
train
T1
v2
Schema: budgets (alias: budg)(id, code, type, amount) transactions(amount, id, date, salary) Task: Retrieve amount from budgets that have at least one corresponding entry in transactions sharing the same code. SQL:
SELECT amount FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = budg.code );
{ "outer_table": "budgets", "inner_table": "transactions", "outer_alias": "budg", "inner_alias": "txn", "proj_col": "amount", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_05844
train
T2
v2
Schema: departments (alias: dept)(status, name, id, salary) accounts(code, name, status, amount) Task: Retrieve amount from departments that have at least one corresponding entry in accounts sharing the same type. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = dept.type );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "amount", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_05845
train
T1
v3
Schema: categories (alias: catg)(salary, date, code, amount) items(value, salary, name, status) Task: Retrieve code from categories with value above the SUM(value) of items rows sharing the same type. SQL:
SELECT code FROM categories AS catg WHERE value > ( SELECT SUM(value) FROM items AS lne WHERE lne.type = catg.type );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_05846
train
T2
v3
Schema: budgets (alias: budg)(level, status, code, name) items(status, id, amount, name) Task: Retrieve name from budgets with amount above the SUM(amount) of items rows sharing the same type. SQL:
SELECT name FROM budgets AS budg WHERE amount > ( SELECT SUM(amount) FROM items AS lne WHERE lne.type = budg.type );
{ "outer_table": "budgets", "inner_table": "items", "outer_alias": "budg", "inner_alias": "lne", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_05847
train
T2
v3
Schema: items (alias: lne)(type, salary, code, amount) departments(amount, level, code, id) Task: Retrieve id from items with value above the AVG(value) of departments rows sharing the same code. SQL:
SELECT id FROM items AS lne WHERE value > ( SELECT AVG(value) FROM departments AS dept WHERE dept.code = lne.code );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_05848
train
T2
v2
Schema: sales (alias: sale)(date, status, amount, salary) products(salary, code, date, id) Task: Find value from sales where a matching record exists in products with the same type. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = sale.type );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "value", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_05849
train
T1
v2
Schema: customers (alias: cust)(type, name, date, value) regions(code, type, date, value) Task: Retrieve id from customers that have at least one corresponding entry in regions sharing the same id. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.id = cust.id );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "id", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_05850
train
T1
v3
Schema: categories (alias: catg)(date, id, amount, status) departments(status, id, date, amount) Task: Retrieve name from categories with value above the MAX(amount) of departments rows sharing the same id. SQL:
SELECT name FROM categories AS catg WHERE value > ( SELECT MAX(amount) FROM departments AS dept WHERE dept.id = catg.id );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_05851
train
T2
v2
Schema: warehouses (alias: whs)(name, value, date, code) services(type, code, id, name) Task: Find name from warehouses where a matching record exists in services with the same code. SQL:
SELECT name FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "services", "outer_alias": "whs", "inner_alias": "srvc", "proj_col": "name", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_05852
train
T2
v1
Schema: warehouses (alias: whs)(level, amount, value, date) sales(salary, level, amount, type) Task: Find name from warehouses where id appears in sales entries with matching code. SQL:
SELECT name FROM warehouses AS whs WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "sales", "outer_alias": "whs", "inner_alias": "sale", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_05853
train
T2
v3
Schema: orders (alias: ord)(status, date, amount, id) staff(id, level, amount, code) Task: Retrieve code from orders with salary above the COUNT(salary) of staff rows sharing the same id. SQL:
SELECT code FROM orders AS ord WHERE salary > ( SELECT COUNT(salary) FROM staff AS empl WHERE empl.id = ord.id );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_05854
train
T1
v1
Schema: products (alias: prod)(name, amount, id, date) shipments(code, id, type, salary) Task: Find salary from products where id appears in shipments entries with matching status. SQL:
SELECT salary FROM products AS prod WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.status = prod.status );
{ "outer_table": "products", "inner_table": "shipments", "outer_alias": "prod", "inner_alias": "shp", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_05855
train
T1
v2
Schema: warehouses (alias: whs)(id, code, type, salary) accounts(amount, name, status, value) Task: Retrieve amount from warehouses that have at least one corresponding entry in accounts sharing the same type. SQL:
SELECT amount FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "accounts", "outer_alias": "whs", "inner_alias": "acct", "proj_col": "amount", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_05856
train
T2
v1
Schema: employees (alias: emp)(amount, code, value, name) managers(amount, salary, value, code) Task: Select amount from employees where id exists in managers for the same code. SQL:
SELECT amount FROM employees AS emp WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.code = emp.code );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_05857
train
T1
v2
Schema: transactions (alias: txn)(type, amount, status, name) schedules(status, type, amount, name) Task: Retrieve id from transactions that have at least one corresponding entry in schedules sharing the same code. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = txn.code );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "id", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_05858
train
T1
v3
Schema: services (alias: srvc)(type, salary, status, amount) departments(salary, level, type, code) Task: Retrieve name from services with salary above the MAX(value) of departments rows sharing the same id. SQL:
SELECT name FROM services AS srvc WHERE salary > ( SELECT MAX(value) FROM departments AS dept WHERE dept.id = srvc.id );
{ "outer_table": "services", "inner_table": "departments", "outer_alias": "srvc", "inner_alias": "dept", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_05859
train
T2
v3
Schema: orders (alias: ord)(id, amount, type, level) warehouses(value, type, level, name) Task: Find salary from orders where amount exceeds the average salary from warehouses for the same code. SQL:
SELECT salary FROM orders AS ord WHERE amount > ( SELECT COUNT(salary) FROM warehouses AS whs WHERE whs.code = ord.code );
{ "outer_table": "orders", "inner_table": "warehouses", "outer_alias": "ord", "inner_alias": "whs", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_05860
train
T1
v1
Schema: regions (alias: rgn)(salary, code, level, id) services(level, code, name, value) Task: Find id from regions where level appears in services entries with matching type. SQL:
SELECT id FROM regions AS rgn WHERE level IN ( SELECT level FROM services AS srvc WHERE srvc.type = rgn.type );
{ "outer_table": "regions", "inner_table": "services", "outer_alias": "rgn", "inner_alias": "srvc", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_05861
train
T2
v2
Schema: departments (alias: dept)(level, status, code, amount) customers(code, status, name, date) Task: Retrieve code from departments that have at least one corresponding entry in customers sharing the same status. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = dept.status );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "code", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_05862
train
T1
v1
Schema: schedules (alias: schd)(id, amount, level, date) items(value, level, code, type) Task: Retrieve code from schedules whose code is found in items rows where status matches the outer record. SQL:
SELECT code FROM schedules AS schd WHERE code IN ( SELECT code FROM items AS lne WHERE lne.status = schd.status );
{ "outer_table": "schedules", "inner_table": "items", "outer_alias": "schd", "inner_alias": "lne", "proj_col": "code", "filter_col": "code", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_05863
train
T2
v1
Schema: managers (alias: mgr)(salary, level, id, value) schedules(name, level, status, amount) Task: Select salary from managers where status exists in schedules for the same code. SQL:
SELECT salary FROM managers AS mgr WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.code = mgr.code );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_05864
train
T1
v3
Schema: staff (alias: empl)(amount, date, type, salary) shipments(salary, date, id, amount) Task: Find salary from staff where salary exceeds the average salary from shipments for the same code. SQL:
SELECT salary FROM staff AS empl WHERE salary > ( SELECT COUNT(salary) FROM shipments AS shp WHERE shp.code = empl.code );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_05865
train
T2
v3
Schema: invoices (alias: inv)(salary, value, status, level) categories(level, amount, name, id) Task: Retrieve id from invoices with salary above the MAX(value) of categories rows sharing the same code. SQL:
SELECT id FROM invoices AS inv WHERE salary > ( SELECT MAX(value) FROM categories AS catg WHERE catg.code = inv.code );
{ "outer_table": "invoices", "inner_table": "categories", "outer_alias": "inv", "inner_alias": "catg", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_05866
train
T1
v1
Schema: requests (alias: ordr)(status, salary, value, type) categories(salary, amount, code, type) Task: Find code from requests where id appears in categories entries with matching level. SQL:
SELECT code FROM requests AS ordr WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.level = ordr.level );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "code", "filter_col": "id", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_05867
train
T2
v1
Schema: departments (alias: dept)(value, amount, salary, level) transactions(level, salary, status, name) Task: Find code from departments where status appears in transactions entries with matching id. SQL:
SELECT code FROM departments AS dept WHERE status IN ( SELECT status FROM transactions AS txn WHERE txn.id = dept.id );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "code", "filter_col": "status", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_05868
train
T1
v2
Schema: sales (alias: sale)(type, value, date, code) shipments(salary, level, id, code) Task: Retrieve id from sales that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT id FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = sale.status );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "id", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_05869
train
T1
v2
Schema: requests (alias: ordr)(level, id, type, amount) budgets(type, name, amount, id) Task: Find salary from requests where a matching record exists in budgets with the same type. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.type = ordr.type );
{ "outer_table": "requests", "inner_table": "budgets", "outer_alias": "ordr", "inner_alias": "budg", "proj_col": "salary", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_05870
train
T2
v2
Schema: shipments (alias: shp)(amount, code, name, id) orders(salary, date, name, type) Task: Find id from shipments where a matching record exists in orders with the same type. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = shp.type );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "id", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_05871
train
T2
v3
Schema: orders (alias: ord)(id, code, amount, date) employees(date, status, salary, type) Task: Find id from orders where amount exceeds the average value from employees for the same code. SQL:
SELECT id FROM orders AS ord WHERE amount > ( SELECT SUM(value) FROM employees AS emp WHERE emp.code = ord.code );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_05872
train
T1
v3
Schema: employees (alias: emp)(id, salary, date, code) schedules(amount, date, status, type) Task: Retrieve code from employees with amount above the AVG(value) of schedules rows sharing the same status. SQL:
SELECT code FROM employees AS emp WHERE amount > ( SELECT AVG(value) FROM schedules AS schd WHERE schd.status = emp.status );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_05873
train
T1
v1
Schema: shipments (alias: shp)(status, amount, id, date) regions(code, name, id, value) Task: Find amount from shipments where status appears in regions entries with matching code. SQL:
SELECT amount FROM shipments AS shp WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.code = shp.code );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "status", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_05874
train
T2
v2
Schema: categories (alias: catg)(amount, status, value, code) items(id, value, salary, status) Task: Find code from categories where a matching record exists in items with the same code. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = catg.code );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "code", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_05875
train
T2
v3
Schema: budgets (alias: budg)(code, salary, level, id) products(level, code, name, type) Task: Find id from budgets where amount exceeds the average value from products for the same level. SQL:
SELECT id FROM budgets AS budg WHERE amount > ( SELECT SUM(value) FROM products AS prod WHERE prod.level = budg.level );
{ "outer_table": "budgets", "inner_table": "products", "outer_alias": "budg", "inner_alias": "prod", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_05876
train
T2
v2
Schema: shipments (alias: shp)(id, amount, level, status) customers(status, date, id, value) Task: Find code from shipments where a matching record exists in customers with the same status. SQL:
SELECT code FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = shp.status );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "code", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_05877
train
T2
v1
Schema: items (alias: lne)(name, code, status, salary) orders(id, value, status, date) Task: Retrieve amount from items whose code is found in orders rows where type matches the outer record. SQL:
SELECT amount FROM items AS lne WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.type = lne.type );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_05878
train
T2
v1
Schema: invoices (alias: inv)(type, code, level, amount) staff(status, name, salary, type) Task: Retrieve id from invoices whose type is found in staff rows where status matches the outer record. SQL:
SELECT id FROM invoices AS inv WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.status = inv.status );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "id", "filter_col": "type", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_05879
train
T1
v3
Schema: customers (alias: cust)(amount, level, date, code) employees(name, code, value, status) Task: Find value from customers where value exceeds the average amount from employees for the same id. SQL:
SELECT value FROM customers AS cust WHERE value > ( SELECT MIN(amount) 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": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_05880
train
T1
v3
Schema: services (alias: srvc)(level, name, type, date) products(type, code, name, id) Task: Retrieve code from services with salary above the MAX(salary) of products rows sharing the same code. SQL:
SELECT code FROM services AS srvc WHERE salary > ( SELECT MAX(salary) FROM products AS prod WHERE prod.code = srvc.code );
{ "outer_table": "services", "inner_table": "products", "outer_alias": "srvc", "inner_alias": "prod", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_05881
train
T2
v2
Schema: schedules (alias: schd)(status, type, level, id) shipments(code, name, date, salary) Task: Find salary from schedules where a matching record exists in shipments with the same code. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = schd.code );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "salary", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_05882
train
T2
v1
Schema: shipments (alias: shp)(name, date, amount, code) products(type, name, date, value) Task: Find id from shipments where id appears in products entries with matching status. SQL:
SELECT id FROM shipments AS shp WHERE id IN ( SELECT id FROM products AS prod WHERE prod.status = shp.status );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "id", "filter_col": "id", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_05883
train
T2
v3
Schema: sales (alias: sale)(id, type, status, name) transactions(level, date, amount, id) Task: Retrieve id from sales with salary above the MIN(value) of transactions rows sharing the same code. SQL:
SELECT id FROM sales AS sale WHERE salary > ( SELECT MIN(value) FROM transactions AS txn WHERE txn.code = sale.code );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_05884
train
T1
v3
Schema: schedules (alias: schd)(name, value, date, type) transactions(value, name, type, status) Task: Find salary from schedules where value exceeds the average value from transactions for the same status. SQL:
SELECT salary FROM schedules AS schd WHERE value > ( SELECT SUM(value) FROM transactions AS txn WHERE txn.status = schd.status );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_05885
train
T2
v1
Schema: accounts (alias: acct)(name, type, date, amount) schedules(type, value, salary, code) Task: Select id from accounts where level exists in schedules for the same type. SQL:
SELECT id FROM accounts AS acct WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.type = acct.type );
{ "outer_table": "accounts", "inner_table": "schedules", "outer_alias": "acct", "inner_alias": "schd", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_05886
train
T1
v2
Schema: sales (alias: sale)(date, level, name, salary) customers(name, level, status, date) Task: Find code from sales where a matching record exists in customers with the same code. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = sale.code );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "code", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1" }
cs8_fixed_train_05887
train
T1
v3
Schema: categories (alias: catg)(type, amount, status, date) sales(date, code, status, id) Task: Retrieve code from categories with salary above the COUNT(value) of sales rows sharing the same level. SQL:
SELECT code FROM categories AS catg WHERE salary > ( SELECT COUNT(value) FROM sales AS sale WHERE sale.level = catg.level );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_05888
train
T2
v2
Schema: categories (alias: catg)(level, id, code, value) orders(salary, status, id, amount) Task: Retrieve amount from categories that have at least one corresponding entry in orders sharing the same id. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = catg.id );
{ "outer_table": "categories", "inner_table": "orders", "outer_alias": "catg", "inner_alias": "ord", "proj_col": "amount", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_05889
train
T2
v3
Schema: departments (alias: dept)(value, id, salary, date) managers(amount, value, code, date) Task: Retrieve amount from departments with amount above the MIN(salary) of managers rows sharing the same code. SQL:
SELECT amount FROM departments AS dept WHERE amount > ( SELECT MIN(salary) FROM managers AS mgr WHERE mgr.code = dept.code );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_05890
train
T1
v2
Schema: services (alias: srvc)(value, date, code, level) invoices(status, type, level, code) Task: Find value from services where a matching record exists in invoices with the same status. SQL:
SELECT value FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = srvc.status );
{ "outer_table": "services", "inner_table": "invoices", "outer_alias": "srvc", "inner_alias": "inv", "proj_col": "value", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_05891
train
T2
v1
Schema: employees (alias: emp)(date, status, name, salary) budgets(type, salary, amount, code) Task: Find amount from employees where level appears in budgets entries with matching type. SQL:
SELECT amount FROM employees AS emp WHERE level IN ( SELECT level FROM budgets AS budg WHERE budg.type = emp.type );
{ "outer_table": "employees", "inner_table": "budgets", "outer_alias": "emp", "inner_alias": "budg", "proj_col": "amount", "filter_col": "level", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_05892
train
T1
v1
Schema: managers (alias: mgr)(id, type, salary, date) warehouses(value, amount, date, level) Task: Select amount from managers where code exists in warehouses for the same type. SQL:
SELECT amount FROM managers AS mgr WHERE code IN ( SELECT code FROM warehouses AS whs WHERE whs.type = mgr.type );
{ "outer_table": "managers", "inner_table": "warehouses", "outer_alias": "mgr", "inner_alias": "whs", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_05893
train
T1
v2
Schema: items (alias: lne)(value, code, name, status) orders(status, salary, id, date) Task: Retrieve value from items that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT value FROM items AS lne WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = lne.code );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "value", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_05894
train
T2
v2
Schema: invoices (alias: inv)(code, amount, date, type) schedules(id, type, date, value) Task: Retrieve salary from invoices that have at least one corresponding entry in schedules sharing the same status. SQL:
SELECT salary FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = inv.status );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "salary", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_05895
train
T1
v3
Schema: departments (alias: dept)(amount, date, value, status) customers(status, level, id, name) Task: Retrieve name from departments with amount above the MAX(salary) of customers rows sharing the same level. SQL:
SELECT name FROM departments AS dept WHERE amount > ( SELECT MAX(salary) FROM customers AS cust WHERE cust.level = dept.level );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_05896
train
T1
v3
Schema: managers (alias: mgr)(level, code, type, amount) warehouses(type, amount, status, name) Task: Retrieve salary from managers with amount above the AVG(amount) of warehouses rows sharing the same level. SQL:
SELECT salary FROM managers AS mgr WHERE amount > ( SELECT AVG(amount) FROM warehouses AS whs WHERE whs.level = mgr.level );
{ "outer_table": "managers", "inner_table": "warehouses", "outer_alias": "mgr", "inner_alias": "whs", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_05897
train
T1
v3
Schema: schedules (alias: schd)(level, amount, name, id) orders(id, amount, name, code) Task: Retrieve name from schedules with salary above the AVG(amount) of orders rows sharing the same status. SQL:
SELECT name FROM schedules AS schd WHERE salary > ( SELECT AVG(amount) FROM orders AS ord WHERE ord.status = schd.status );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2" }
cs8_fixed_train_05898
train
T2
v1
Schema: employees (alias: emp)(value, name, status, date) budgets(amount, code, level, value) Task: Find id from employees where level appears in budgets entries with matching level. SQL:
SELECT id FROM employees AS emp WHERE level IN ( SELECT level FROM budgets AS budg WHERE budg.level = emp.level );
{ "outer_table": "employees", "inner_table": "budgets", "outer_alias": "emp", "inner_alias": "budg", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_05899
train
T1