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: regions (alias: rgn)(level, salary, name, status) departments(level, id, date, code) Task: Find amount from regions where salary exceeds the average amount from departments for the same level. SQL:
SELECT amount FROM regions AS rgn WHERE salary > ( SELECT MAX(amount) FROM departments AS dept WHERE dept.level = rgn.level );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_03800
train
T2
v1
Schema: orders (alias: ord)(value, id, level, amount) services(amount, level, id, status) Task: Select salary from orders where code exists in services for the same id. SQL:
SELECT salary FROM orders AS ord WHERE code IN ( SELECT code 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": "code", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_03801
train
T1
v2
Schema: shipments (alias: shp)(level, date, id, value) budgets(code, id, name, type) Task: Retrieve salary from shipments that have at least one corresponding entry in budgets sharing the same level. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.level = shp.level );
{ "outer_table": "shipments", "inner_table": "budgets", "outer_alias": "shp", "inner_alias": "budg", "proj_col": "salary", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_03802
train
T2
v3
Schema: categories (alias: catg)(level, date, name, salary) services(value, salary, id, type) Task: Find salary from categories where salary exceeds the average value from services for the same id. SQL:
SELECT salary FROM categories AS catg WHERE salary > ( SELECT COUNT(value) FROM services AS srvc WHERE srvc.id = catg.id );
{ "outer_table": "categories", "inner_table": "services", "outer_alias": "catg", "inner_alias": "srvc", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_03803
train
T2
v2
Schema: requests (alias: ordr)(amount, date, code, value) services(date, value, name, id) Task: Find name from requests where a matching record exists in services with the same type. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.type = ordr.type );
{ "outer_table": "requests", "inner_table": "services", "outer_alias": "ordr", "inner_alias": "srvc", "proj_col": "name", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_03804
train
T2
v3
Schema: regions (alias: rgn)(amount, code, type, level) warehouses(status, id, salary, type) Task: Retrieve code from regions with salary above the SUM(value) of warehouses rows sharing the same code. SQL:
SELECT code FROM regions AS rgn WHERE salary > ( SELECT SUM(value) FROM warehouses AS whs WHERE whs.code = rgn.code );
{ "outer_table": "regions", "inner_table": "warehouses", "outer_alias": "rgn", "inner_alias": "whs", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_03805
train
T2
v3
Schema: warehouses (alias: whs)(status, level, value, name) budgets(id, type, code, status) Task: Find salary from warehouses where amount exceeds the average value from budgets for the same id. SQL:
SELECT salary FROM warehouses AS whs WHERE amount > ( SELECT MIN(value) FROM budgets AS budg WHERE budg.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "budgets", "outer_alias": "whs", "inner_alias": "budg", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_03806
train
T2
v2
Schema: staff (alias: empl)(type, status, date, name) services(status, amount, code, name) Task: Find code from staff where a matching record exists in services with the same status. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.status = empl.status );
{ "outer_table": "staff", "inner_table": "services", "outer_alias": "empl", "inner_alias": "srvc", "proj_col": "code", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2" }
cs8_fixed_train_03807
train
T2
v2
Schema: accounts (alias: acct)(date, code, salary, id) orders(amount, status, value, id) Task: Find salary from accounts where a matching record exists in orders with the same id. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = acct.id );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "salary", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_03808
train
T1
v1
Schema: items (alias: lne)(date, salary, id, status) orders(date, amount, name, id) Task: Select amount from items where level exists in orders for the same status. SQL:
SELECT amount FROM items AS lne WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.status = lne.status );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_03809
train
T2
v3
Schema: departments (alias: dept)(value, name, status, type) categories(level, code, date, value) Task: Retrieve name from departments with salary above the COUNT(salary) of categories rows sharing the same id. SQL:
SELECT name FROM departments AS dept WHERE salary > ( SELECT COUNT(salary) FROM categories AS catg WHERE catg.id = dept.id );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1" }
cs8_fixed_train_03810
train
T1
v1
Schema: regions (alias: rgn)(type, name, level, amount) orders(status, id, date, salary) Task: Retrieve amount from regions whose level is found in orders rows where id matches the outer record. SQL:
SELECT amount FROM regions AS rgn WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.id = rgn.id );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_03811
train
T2
v1
Schema: staff (alias: empl)(name, id, date, amount) employees(name, salary, amount, status) Task: Retrieve amount from staff whose id is found in employees rows where type matches the outer record. SQL:
SELECT amount FROM staff AS empl WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.type = empl.type );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_03812
train
T2
v1
Schema: customers (alias: cust)(value, salary, id, level) managers(type, level, status, id) Task: Select id from customers where status exists in managers for the same status. SQL:
SELECT id FROM customers AS cust WHERE status IN ( SELECT status 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": "status", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_03813
train
T1
v3
Schema: employees (alias: emp)(code, status, amount, date) budgets(status, salary, date, value) Task: Find code from employees where salary exceeds the average value from budgets for the same id. SQL:
SELECT code FROM employees AS emp WHERE salary > ( SELECT AVG(value) FROM budgets AS budg WHERE budg.id = emp.id );
{ "outer_table": "employees", "inner_table": "budgets", "outer_alias": "emp", "inner_alias": "budg", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_03814
train
T1
v3
Schema: schedules (alias: schd)(status, level, value, salary) categories(date, salary, value, name) Task: Find amount from schedules where salary exceeds the average value from categories for the same level. SQL:
SELECT amount FROM schedules AS schd WHERE salary > ( SELECT AVG(value) FROM categories AS catg WHERE catg.level = schd.level );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_03815
train
T2
v2
Schema: employees (alias: emp)(level, date, amount, name) transactions(date, name, value, type) Task: Find code from employees where a matching record exists in transactions with the same status. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = emp.status );
{ "outer_table": "employees", "inner_table": "transactions", "outer_alias": "emp", "inner_alias": "txn", "proj_col": "code", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_03816
train
T1
v2
Schema: requests (alias: ordr)(code, salary, level, status) orders(name, level, amount, value) Task: Retrieve amount from requests that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = ordr.level );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "amount", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_03817
train
T2
v2
Schema: services (alias: srvc)(level, value, salary, code) transactions(amount, date, value, id) Task: Retrieve code from services that have at least one corresponding entry in transactions sharing the same status. SQL:
SELECT code FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = srvc.status );
{ "outer_table": "services", "inner_table": "transactions", "outer_alias": "srvc", "inner_alias": "txn", "proj_col": "code", "join_col": "status", "correlated_ref": "srvc.status", "token_group": "T2" }
cs8_fixed_train_03818
train
T2
v2
Schema: orders (alias: ord)(level, status, salary, name) staff(date, salary, value, status) Task: Retrieve id from orders that have at least one corresponding entry in staff sharing the same level. SQL:
SELECT id FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = ord.level );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "id", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_03819
train
T1
v2
Schema: products (alias: prod)(code, level, status, id) regions(amount, code, type, status) Task: Retrieve amount from products that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = prod.level );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "amount", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_03820
train
T1
v2
Schema: categories (alias: catg)(type, level, code, amount) products(name, date, amount, salary) Task: Find value from categories where a matching record exists in products with the same type. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = catg.type );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "value", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_03821
train
T2
v3
Schema: schedules (alias: schd)(level, status, amount, code) managers(code, status, salary, date) Task: Retrieve value from schedules with amount above the SUM(amount) of managers rows sharing the same level. SQL:
SELECT value FROM schedules AS schd WHERE amount > ( SELECT SUM(amount) FROM managers AS mgr WHERE mgr.level = schd.level );
{ "outer_table": "schedules", "inner_table": "managers", "outer_alias": "schd", "inner_alias": "mgr", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_03822
train
T2
v3
Schema: categories (alias: catg)(level, amount, salary, id) invoices(id, value, date, type) Task: Find id from categories where salary exceeds the average amount from invoices for the same id. SQL:
SELECT id FROM categories AS catg WHERE salary > ( SELECT SUM(amount) FROM invoices AS inv WHERE inv.id = catg.id );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2" }
cs8_fixed_train_03823
train
T2
v3
Schema: sales (alias: sale)(level, date, value, amount) customers(date, level, amount, id) Task: Retrieve salary from sales with amount above the AVG(amount) of customers rows sharing the same id. SQL:
SELECT salary FROM sales AS sale WHERE amount > ( SELECT AVG(amount) FROM customers AS cust WHERE cust.id = sale.id );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_03824
train
T1
v1
Schema: regions (alias: rgn)(amount, type, code, level) sales(type, date, amount, id) Task: Retrieve code from regions whose status is found in sales rows where level matches the outer record. SQL:
SELECT code FROM regions AS rgn WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.level = rgn.level );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_03825
train
T2
v3
Schema: warehouses (alias: whs)(level, code, amount, name) employees(type, date, id, name) Task: Retrieve amount from warehouses with value above the MAX(value) of employees rows sharing the same type. SQL:
SELECT amount FROM warehouses AS whs WHERE value > ( SELECT MAX(value) FROM employees AS emp WHERE emp.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "employees", "outer_alias": "whs", "inner_alias": "emp", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_03826
train
T2
v3
Schema: schedules (alias: schd)(code, name, date, amount) warehouses(type, salary, amount, value) Task: Find code from schedules where amount exceeds the average salary from warehouses for the same code. SQL:
SELECT code FROM schedules AS schd WHERE amount > ( SELECT MAX(salary) FROM warehouses AS whs WHERE whs.code = schd.code );
{ "outer_table": "schedules", "inner_table": "warehouses", "outer_alias": "schd", "inner_alias": "whs", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2" }
cs8_fixed_train_03827
train
T2
v1
Schema: sales (alias: sale)(name, code, amount, type) shipments(value, level, type, amount) Task: Find salary from sales where id appears in shipments entries with matching status. SQL:
SELECT salary FROM sales AS sale WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.status = sale.status );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_03828
train
T1
v1
Schema: employees (alias: emp)(code, level, amount, status) customers(status, type, value, name) Task: Find salary from employees where id appears in customers entries with matching code. SQL:
SELECT salary FROM employees AS emp WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.code = emp.code );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_03829
train
T1
v2
Schema: employees (alias: emp)(value, type, name, level) staff(amount, salary, level, status) Task: Retrieve value from employees that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = emp.type );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "value", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_03830
train
T1
v3
Schema: employees (alias: emp)(date, type, name, level) categories(salary, name, value, amount) Task: Find id from employees where value exceeds the average salary from categories for the same id. SQL:
SELECT id FROM employees AS emp WHERE value > ( SELECT MIN(salary) FROM categories AS catg WHERE catg.id = emp.id );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_03831
train
T1
v2
Schema: requests (alias: ordr)(id, type, date, level) shipments(value, type, date, code) Task: Find code from requests where a matching record exists in shipments with the same type. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.type = ordr.type );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "code", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2" }
cs8_fixed_train_03832
train
T2
v1
Schema: accounts (alias: acct)(type, status, name, amount) budgets(code, name, value, level) Task: Find amount from accounts where type appears in budgets entries with matching code. SQL:
SELECT amount FROM accounts AS acct WHERE type IN ( SELECT type FROM budgets AS budg WHERE budg.code = acct.code );
{ "outer_table": "accounts", "inner_table": "budgets", "outer_alias": "acct", "inner_alias": "budg", "proj_col": "amount", "filter_col": "type", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1" }
cs8_fixed_train_03833
train
T1
v3
Schema: orders (alias: ord)(salary, value, code, status) accounts(date, salary, level, amount) Task: Retrieve salary from orders with amount above the COUNT(salary) of accounts rows sharing the same level. SQL:
SELECT salary FROM orders AS ord WHERE amount > ( SELECT COUNT(salary) FROM accounts AS acct WHERE acct.level = ord.level );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_03834
train
T1
v3
Schema: transactions (alias: txn)(value, code, name, status) services(level, status, salary, value) Task: Find amount from transactions where amount exceeds the average amount from services for the same level. SQL:
SELECT amount FROM transactions AS txn WHERE amount > ( SELECT MIN(amount) FROM services AS srvc WHERE srvc.level = txn.level );
{ "outer_table": "transactions", "inner_table": "services", "outer_alias": "txn", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_03835
train
T1
v3
Schema: services (alias: srvc)(level, name, date, status) managers(salary, level, type, value) Task: Retrieve salary from services with value above the MIN(salary) of managers rows sharing the same type. SQL:
SELECT salary FROM services AS srvc WHERE value > ( SELECT MIN(salary) FROM managers AS mgr WHERE mgr.type = srvc.type );
{ "outer_table": "services", "inner_table": "managers", "outer_alias": "srvc", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_03836
train
T2
v3
Schema: employees (alias: emp)(id, status, code, type) sales(salary, status, name, code) Task: Find name from employees where amount exceeds the average salary from sales for the same level. SQL:
SELECT name FROM employees AS emp WHERE amount > ( SELECT MAX(salary) FROM sales AS sale WHERE sale.level = emp.level );
{ "outer_table": "employees", "inner_table": "sales", "outer_alias": "emp", "inner_alias": "sale", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_03837
train
T1
v3
Schema: regions (alias: rgn)(amount, id, salary, name) warehouses(level, amount, type, date) Task: Find name from regions where salary exceeds the average amount from warehouses for the same level. SQL:
SELECT name FROM regions AS rgn WHERE salary > ( SELECT COUNT(amount) FROM warehouses AS whs WHERE whs.level = rgn.level );
{ "outer_table": "regions", "inner_table": "warehouses", "outer_alias": "rgn", "inner_alias": "whs", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2" }
cs8_fixed_train_03838
train
T2
v3
Schema: employees (alias: emp)(id, status, code, date) products(name, type, code, id) Task: Find salary from employees where amount exceeds the average salary from products for the same type. SQL:
SELECT salary FROM employees AS emp WHERE amount > ( SELECT SUM(salary) FROM products AS prod WHERE prod.type = emp.type );
{ "outer_table": "employees", "inner_table": "products", "outer_alias": "emp", "inner_alias": "prod", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_03839
train
T1
v3
Schema: schedules (alias: schd)(status, date, id, level) orders(type, id, level, status) Task: Retrieve salary from schedules with amount above the SUM(salary) of orders rows sharing the same id. SQL:
SELECT salary FROM schedules AS schd WHERE amount > ( SELECT SUM(salary) FROM orders AS ord WHERE ord.id = schd.id );
{ "outer_table": "schedules", "inner_table": "orders", "outer_alias": "schd", "inner_alias": "ord", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_03840
train
T2
v1
Schema: warehouses (alias: whs)(amount, code, status, id) regions(value, status, amount, type) Task: Retrieve id from warehouses whose type is found in regions rows where id matches the outer record. SQL:
SELECT id FROM warehouses AS whs WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "regions", "outer_alias": "whs", "inner_alias": "rgn", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_03841
train
T2
v3
Schema: orders (alias: ord)(value, type, name, code) shipments(amount, id, status, salary) Task: Retrieve id from orders with salary above the SUM(amount) of shipments rows sharing the same level. SQL:
SELECT id FROM orders AS ord WHERE salary > ( SELECT SUM(amount) FROM shipments AS shp WHERE shp.level = ord.level );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_03842
train
T1
v1
Schema: warehouses (alias: whs)(level, status, value, type) products(type, name, date, value) Task: Retrieve code from warehouses whose level is found in products rows where status matches the outer record. SQL:
SELECT code FROM warehouses AS whs WHERE level IN ( SELECT level FROM products AS prod WHERE prod.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "products", "outer_alias": "whs", "inner_alias": "prod", "proj_col": "code", "filter_col": "level", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_03843
train
T2
v2
Schema: sales (alias: sale)(code, value, status, type) accounts(status, name, id, date) Task: Find code from sales where a matching record exists in accounts with the same level. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = sale.level );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "code", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1" }
cs8_fixed_train_03844
train
T1
v2
Schema: budgets (alias: budg)(salary, date, id, amount) transactions(name, id, amount, salary) Task: Find value from budgets where a matching record exists in transactions with the same code. SQL:
SELECT value 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": "value", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_03845
train
T2
v3
Schema: requests (alias: ordr)(code, level, status, date) employees(type, date, level, status) Task: Find name from requests where salary exceeds the average salary from employees for the same level. SQL:
SELECT name FROM requests AS ordr WHERE salary > ( SELECT MIN(salary) FROM employees AS emp WHERE emp.level = ordr.level );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_03846
train
T2
v3
Schema: shipments (alias: shp)(amount, code, date, name) categories(level, salary, date, status) Task: Retrieve salary from shipments with salary above the MAX(value) of categories rows sharing the same level. SQL:
SELECT salary FROM shipments AS shp WHERE salary > ( SELECT MAX(value) FROM categories AS catg WHERE catg.level = shp.level );
{ "outer_table": "shipments", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "catg", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_03847
train
T2
v1
Schema: requests (alias: ordr)(type, salary, value, status) sales(id, value, type, code) Task: Select value from requests where code exists in sales for the same code. SQL:
SELECT value FROM requests AS ordr WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.code = ordr.code );
{ "outer_table": "requests", "inner_table": "sales", "outer_alias": "ordr", "inner_alias": "sale", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_03848
train
T2
v2
Schema: products (alias: prod)(status, salary, id, level) items(type, code, status, salary) Task: Find code from products where a matching record exists in items with the same status. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = prod.status );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "code", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_03849
train
T1
v2
Schema: shipments (alias: shp)(status, value, date, code) invoices(value, salary, amount, level) Task: Find value from shipments where a matching record exists in invoices with the same type. SQL:
SELECT value FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = shp.type );
{ "outer_table": "shipments", "inner_table": "invoices", "outer_alias": "shp", "inner_alias": "inv", "proj_col": "value", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_03850
train
T2
v2
Schema: departments (alias: dept)(id, value, type, date) services(status, id, level, name) Task: Find code from departments where a matching record exists in services with the same type. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.type = dept.type );
{ "outer_table": "departments", "inner_table": "services", "outer_alias": "dept", "inner_alias": "srvc", "proj_col": "code", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_03851
train
T1
v1
Schema: transactions (alias: txn)(date, type, name, status) invoices(value, date, status, level) Task: Retrieve code from transactions whose status is found in invoices rows where status matches the outer record. SQL:
SELECT code FROM transactions AS txn WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.status = txn.status );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "code", "filter_col": "status", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_03852
train
T1
v3
Schema: items (alias: lne)(type, id, salary, name) managers(code, salary, value, level) Task: Retrieve id from items with salary above the MIN(value) of managers rows sharing the same status. SQL:
SELECT id FROM items AS lne WHERE salary > ( SELECT MIN(value) FROM managers AS mgr WHERE mgr.status = lne.status );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_03853
train
T2
v2
Schema: items (alias: lne)(code, status, value, name) managers(value, name, amount, level) Task: Retrieve salary from items that have at least one corresponding entry in managers sharing the same type. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = lne.type );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "salary", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_03854
train
T2
v2
Schema: transactions (alias: txn)(type, value, code, name) products(value, id, amount, level) Task: Find salary from transactions where a matching record exists in products with the same level. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = txn.level );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "salary", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_03855
train
T1
v1
Schema: products (alias: prod)(code, level, id, amount) employees(name, status, date, level) Task: Select name from products where level exists in employees for the same status. SQL:
SELECT name FROM products AS prod WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.status = prod.status );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_03856
train
T1
v2
Schema: categories (alias: catg)(type, amount, date, value) orders(code, level, amount, type) Task: Retrieve value from categories that have at least one corresponding entry in orders sharing the same level. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.level = catg.level );
{ "outer_table": "categories", "inner_table": "orders", "outer_alias": "catg", "inner_alias": "ord", "proj_col": "value", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2" }
cs8_fixed_train_03857
train
T2
v3
Schema: sales (alias: sale)(level, id, date, name) departments(salary, amount, name, type) Task: Retrieve code from sales with value above the MIN(salary) of departments rows sharing the same id. SQL:
SELECT code FROM sales AS sale WHERE value > ( SELECT MIN(salary) FROM departments AS dept WHERE dept.id = sale.id );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1" }
cs8_fixed_train_03858
train
T1
v1
Schema: shipments (alias: shp)(name, status, amount, salary) employees(name, code, id, date) Task: Select amount from shipments where level exists in employees for the same id. SQL:
SELECT amount FROM shipments AS shp WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.id = shp.id );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_03859
train
T2
v1
Schema: managers (alias: mgr)(value, type, date, level) orders(date, value, level, type) Task: Retrieve code from managers whose type is found in orders rows where level matches the outer record. SQL:
SELECT code FROM managers AS mgr WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.level = mgr.level );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "code", "filter_col": "type", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1" }
cs8_fixed_train_03860
train
T1
v2
Schema: services (alias: srvc)(amount, name, type, id) schedules(id, amount, salary, value) Task: Find name from services where a matching record exists in schedules with the same code. SQL:
SELECT name FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = srvc.code );
{ "outer_table": "services", "inner_table": "schedules", "outer_alias": "srvc", "inner_alias": "schd", "proj_col": "name", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_03861
train
T2
v3
Schema: employees (alias: emp)(amount, status, date, code) regions(name, status, type, code) Task: Find value from employees where value exceeds the average amount from regions for the same status. SQL:
SELECT value FROM employees AS emp WHERE value > ( SELECT MIN(amount) FROM regions AS rgn WHERE rgn.status = emp.status );
{ "outer_table": "employees", "inner_table": "regions", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_03862
train
T1
v1
Schema: items (alias: lne)(level, id, status, value) regions(name, code, level, id) Task: Retrieve value from items whose type is found in regions rows where type matches the outer record. SQL:
SELECT value FROM items AS lne WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.type = lne.type );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "value", "filter_col": "type", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_03863
train
T2
v2
Schema: services (alias: srvc)(amount, salary, code, date) employees(status, name, type, code) Task: Find value from services where a matching record exists in employees with the same code. SQL:
SELECT value FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = srvc.code );
{ "outer_table": "services", "inner_table": "employees", "outer_alias": "srvc", "inner_alias": "emp", "proj_col": "value", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_03864
train
T2
v2
Schema: staff (alias: empl)(id, salary, code, amount) budgets(name, type, level, code) Task: Retrieve id from staff that have at least one corresponding entry in budgets sharing the same type. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.type = empl.type );
{ "outer_table": "staff", "inner_table": "budgets", "outer_alias": "empl", "inner_alias": "budg", "proj_col": "id", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_03865
train
T2
v2
Schema: transactions (alias: txn)(level, value, code, amount) employees(type, value, amount, name) Task: Retrieve salary from transactions that have at least one corresponding entry in employees sharing the same code. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = txn.code );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "salary", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1" }
cs8_fixed_train_03866
train
T1
v1
Schema: staff (alias: empl)(level, date, amount, salary) customers(amount, salary, name, date) Task: Find code from staff where type appears in customers entries with matching type. SQL:
SELECT code FROM staff AS empl WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.type = empl.type );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "code", "filter_col": "type", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2" }
cs8_fixed_train_03867
train
T2
v2
Schema: customers (alias: cust)(name, value, level, id) transactions(status, salary, amount, code) Task: Find id from customers where a matching record exists in transactions with the same level. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = cust.level );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "id", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_03868
train
T1
v1
Schema: customers (alias: cust)(type, date, status, code) budgets(salary, code, type, name) Task: Find id from customers where status appears in budgets entries with matching type. SQL:
SELECT id FROM customers AS cust WHERE status IN ( SELECT status FROM budgets AS budg WHERE budg.type = cust.type );
{ "outer_table": "customers", "inner_table": "budgets", "outer_alias": "cust", "inner_alias": "budg", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1" }
cs8_fixed_train_03869
train
T1
v1
Schema: departments (alias: dept)(date, status, salary, code) sales(name, amount, salary, level) Task: Find id from departments where type appears in sales entries with matching code. SQL:
SELECT id FROM departments AS dept WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.code = dept.code );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1" }
cs8_fixed_train_03870
train
T1
v2
Schema: products (alias: prod)(salary, level, code, amount) accounts(status, level, amount, type) Task: Find id from products where a matching record exists in accounts with the same level. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = prod.level );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "id", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_03871
train
T1
v2
Schema: staff (alias: empl)(amount, date, code, level) products(amount, status, value, code) Task: Find amount from staff where a matching record exists in products with the same level. SQL:
SELECT amount FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.level = empl.level );
{ "outer_table": "staff", "inner_table": "products", "outer_alias": "empl", "inner_alias": "prod", "proj_col": "amount", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_03872
train
T2
v2
Schema: employees (alias: emp)(name, id, value, status) items(type, code, name, level) Task: Retrieve salary from employees that have at least one corresponding entry in items sharing the same id. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.id = emp.id );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "salary", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_03873
train
T1
v1
Schema: items (alias: lne)(status, amount, value, date) budgets(status, name, salary, date) Task: Select salary from items where type exists in budgets for the same type. SQL:
SELECT salary FROM items AS lne WHERE type IN ( SELECT type FROM budgets AS budg WHERE budg.type = lne.type );
{ "outer_table": "items", "inner_table": "budgets", "outer_alias": "lne", "inner_alias": "budg", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_03874
train
T2
v1
Schema: warehouses (alias: whs)(status, id, level, name) customers(name, id, amount, value) Task: Select id from warehouses where code exists in customers for the same type. SQL:
SELECT id FROM warehouses AS whs WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "customers", "outer_alias": "whs", "inner_alias": "cust", "proj_col": "id", "filter_col": "code", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_03875
train
T2
v3
Schema: shipments (alias: shp)(id, status, level, amount) regions(code, status, id, date) Task: Find value from shipments where salary exceeds the average salary from regions for the same level. SQL:
SELECT value FROM shipments AS shp WHERE salary > ( SELECT MIN(salary) FROM regions AS rgn WHERE rgn.level = shp.level );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_03876
train
T2
v3
Schema: employees (alias: emp)(id, code, date, type) invoices(status, level, code, date) Task: Retrieve amount from employees with value above the SUM(value) of invoices rows sharing the same type. SQL:
SELECT amount FROM employees AS emp WHERE value > ( SELECT SUM(value) FROM invoices AS inv WHERE inv.type = emp.type );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1" }
cs8_fixed_train_03877
train
T1
v1
Schema: budgets (alias: budg)(value, level, id, status) regions(id, name, status, code) Task: Find salary from budgets where level appears in regions entries with matching status. SQL:
SELECT salary FROM budgets AS budg WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.status = budg.status );
{ "outer_table": "budgets", "inner_table": "regions", "outer_alias": "budg", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "level", "join_col": "status", "correlated_ref": "budg.status", "token_group": "T2" }
cs8_fixed_train_03878
train
T2
v3
Schema: requests (alias: ordr)(amount, date, id, code) items(name, value, status, amount) Task: Find id from requests where salary exceeds the average salary from items for the same code. SQL:
SELECT id FROM requests AS ordr WHERE salary > ( SELECT AVG(salary) FROM items AS lne WHERE lne.code = ordr.code );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2" }
cs8_fixed_train_03879
train
T2
v2
Schema: requests (alias: ordr)(status, name, value, amount) budgets(date, status, code, type) Task: Retrieve code from requests that have at least one corresponding entry in budgets sharing the same level. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.level = ordr.level );
{ "outer_table": "requests", "inner_table": "budgets", "outer_alias": "ordr", "inner_alias": "budg", "proj_col": "code", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_03880
train
T2
v3
Schema: shipments (alias: shp)(date, type, code, status) orders(code, status, date, salary) Task: Retrieve amount from shipments with salary above the MAX(salary) of orders rows sharing the same type. SQL:
SELECT amount FROM shipments AS shp WHERE salary > ( SELECT MAX(salary) FROM orders AS ord WHERE ord.type = shp.type );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_03881
train
T2
v3
Schema: orders (alias: ord)(status, value, amount, type) transactions(amount, salary, name, date) Task: Retrieve id from orders with value above the COUNT(value) of transactions rows sharing the same code. SQL:
SELECT id FROM orders AS ord WHERE value > ( SELECT COUNT(value) FROM transactions AS txn WHERE txn.code = ord.code );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_03882
train
T1
v2
Schema: managers (alias: mgr)(value, id, code, level) services(status, level, salary, date) Task: Retrieve salary from managers that have at least one corresponding entry in services sharing the same id. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = mgr.id );
{ "outer_table": "managers", "inner_table": "services", "outer_alias": "mgr", "inner_alias": "srvc", "proj_col": "salary", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1" }
cs8_fixed_train_03883
train
T1
v3
Schema: products (alias: prod)(status, salary, amount, date) schedules(level, value, salary, name) Task: Retrieve code from products with amount above the AVG(value) of schedules rows sharing the same level. SQL:
SELECT code FROM products AS prod WHERE amount > ( SELECT AVG(value) FROM schedules AS schd WHERE schd.level = prod.level );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_03884
train
T1
v1
Schema: items (alias: lne)(id, status, date, amount) shipments(code, level, date, salary) Task: Select code from items where id exists in shipments for the same level. SQL:
SELECT code FROM items AS lne WHERE id IN ( SELECT id FROM shipments AS shp WHERE shp.level = lne.level );
{ "outer_table": "items", "inner_table": "shipments", "outer_alias": "lne", "inner_alias": "shp", "proj_col": "code", "filter_col": "id", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_03885
train
T2
v3
Schema: products (alias: prod)(date, value, level, amount) warehouses(code, date, id, value) Task: Retrieve code from products with amount above the SUM(amount) of warehouses rows sharing the same status. SQL:
SELECT code FROM products AS prod WHERE amount > ( SELECT SUM(amount) FROM warehouses AS whs WHERE whs.status = prod.status );
{ "outer_table": "products", "inner_table": "warehouses", "outer_alias": "prod", "inner_alias": "whs", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1" }
cs8_fixed_train_03886
train
T1
v3
Schema: orders (alias: ord)(amount, level, salary, code) shipments(salary, level, date, code) Task: Find value from orders where amount exceeds the average salary from shipments for the same level. SQL:
SELECT value FROM orders AS ord WHERE amount > ( SELECT AVG(salary) FROM shipments AS shp WHERE shp.level = ord.level );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_03887
train
T1
v3
Schema: items (alias: lne)(id, type, status, code) transactions(amount, date, status, type) Task: Retrieve salary from items with value above the MIN(salary) of transactions rows sharing the same level. SQL:
SELECT salary FROM items AS lne WHERE value > ( SELECT MIN(salary) FROM transactions AS txn WHERE txn.level = lne.level );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_03888
train
T2
v3
Schema: managers (alias: mgr)(level, date, type, status) staff(salary, code, name, amount) Task: Retrieve name from managers with salary above the MAX(value) of staff rows sharing the same code. SQL:
SELECT name FROM managers AS mgr WHERE salary > ( SELECT MAX(value) FROM staff AS empl WHERE empl.code = mgr.code );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_03889
train
T1
v3
Schema: services (alias: srvc)(name, value, level, status) sales(id, status, salary, value) Task: Retrieve salary from services with salary above the COUNT(value) of sales rows sharing the same id. SQL:
SELECT salary FROM services AS srvc WHERE salary > ( SELECT COUNT(value) FROM sales AS sale WHERE sale.id = srvc.id );
{ "outer_table": "services", "inner_table": "sales", "outer_alias": "srvc", "inner_alias": "sale", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_03890
train
T2
v3
Schema: shipments (alias: shp)(name, date, code, status) sales(amount, level, type, salary) Task: Retrieve amount from shipments with amount above the COUNT(value) of sales rows sharing the same code. SQL:
SELECT amount FROM shipments AS shp WHERE amount > ( SELECT COUNT(value) FROM sales AS sale WHERE sale.code = shp.code );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_03891
train
T2
v3
Schema: services (alias: srvc)(name, salary, level, amount) products(status, name, date, value) Task: Retrieve amount from services with value above the MAX(salary) of products rows sharing the same level. SQL:
SELECT amount FROM services AS srvc WHERE value > ( SELECT MAX(salary) FROM products AS prod WHERE prod.level = srvc.level );
{ "outer_table": "services", "inner_table": "products", "outer_alias": "srvc", "inner_alias": "prod", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "srvc.level", "token_group": "T2" }
cs8_fixed_train_03892
train
T2
v3
Schema: departments (alias: dept)(amount, name, status, code) categories(status, type, date, amount) Task: Retrieve salary from departments with amount above the AVG(salary) of categories rows sharing the same status. SQL:
SELECT salary FROM departments AS dept WHERE amount > ( SELECT AVG(salary) FROM categories AS catg WHERE catg.status = dept.status );
{ "outer_table": "departments", "inner_table": "categories", "outer_alias": "dept", "inner_alias": "catg", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_03893
train
T1
v2
Schema: invoices (alias: inv)(value, id, date, name) categories(status, type, salary, level) Task: Retrieve salary from invoices that have at least one corresponding entry in categories sharing 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_03894
train
T1
v2
Schema: warehouses (alias: whs)(date, salary, amount, level) invoices(amount, id, salary, code) Task: Find salary from warehouses where a matching record exists in invoices with the same code. SQL:
SELECT salary FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "invoices", "outer_alias": "whs", "inner_alias": "inv", "proj_col": "salary", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_03895
train
T2
v1
Schema: invoices (alias: inv)(date, id, level, status) sales(name, code, status, type) Task: Find salary from invoices where type appears in sales entries with matching code. SQL:
SELECT salary FROM invoices AS inv WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.code = inv.code );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "salary", "filter_col": "type", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1" }
cs8_fixed_train_03896
train
T1
v2
Schema: shipments (alias: shp)(level, id, salary, name) products(status, date, salary, id) Task: Retrieve code from shipments that have at least one corresponding entry in products sharing the same type. SQL:
SELECT code FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = shp.type );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "code", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_03897
train
T2
v3
Schema: employees (alias: emp)(id, amount, type, status) services(id, date, type, status) Task: Find id from employees where salary exceeds the average amount from services for the same status. SQL:
SELECT id FROM employees AS emp WHERE salary > ( SELECT SUM(amount) FROM services AS srvc WHERE srvc.status = emp.status );
{ "outer_table": "employees", "inner_table": "services", "outer_alias": "emp", "inner_alias": "srvc", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_03898
train
T1
v1
Schema: schedules (alias: schd)(name, salary, code, amount) transactions(amount, value, date, type) Task: Select code from schedules where code exists in transactions for the same id. SQL:
SELECT code FROM schedules AS schd WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.id = schd.id );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2" }
cs8_fixed_train_03899
train
T2