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: requests (alias: ordr)(salary, name, value, status) orders(code, salary, status, type) Task: Retrieve salary from requests with value above the MIN(salary) of orders rows sharing the same level. SQL:
SELECT salary FROM requests AS ordr WHERE value > ( SELECT MIN(salary) FROM orders AS ord WHERE ord.level = ordr.level );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2" }
cs8_fixed_train_04800
train
T2
v3
Schema: regions (alias: rgn)(date, status, salary, level) sales(salary, level, amount, date) Task: Find name from regions where amount exceeds the average salary from sales for the same id. SQL:
SELECT name FROM regions AS rgn WHERE amount > ( SELECT MAX(salary) FROM sales AS sale WHERE sale.id = rgn.id );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_04801
train
T2
v3
Schema: invoices (alias: inv)(id, level, amount, status) employees(level, value, date, status) Task: Retrieve name from invoices with amount above the MAX(salary) of employees rows sharing the same id. SQL:
SELECT name FROM invoices AS inv WHERE amount > ( SELECT MAX(salary) FROM employees AS emp WHERE emp.id = inv.id );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1" }
cs8_fixed_train_04802
train
T1
v3
Schema: schedules (alias: schd)(amount, name, status, level) transactions(salary, amount, type, level) Task: Find code from schedules where salary exceeds the average salary from transactions for the same level. SQL:
SELECT code FROM schedules AS schd WHERE salary > ( SELECT MAX(salary) FROM transactions AS txn WHERE txn.level = schd.level );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_04803
train
T2
v1
Schema: transactions (alias: txn)(salary, level, date, amount) invoices(date, salary, amount, type) Task: Select value from transactions where id exists in invoices for the same status. SQL:
SELECT value FROM transactions AS txn WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.status = txn.status );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_04804
train
T1
v3
Schema: products (alias: prod)(id, amount, name, salary) sales(type, id, date, level) Task: Retrieve value from products with value above the AVG(value) of sales rows sharing the same type. SQL:
SELECT value FROM products AS prod WHERE value > ( SELECT AVG(value) FROM sales AS sale WHERE sale.type = prod.type );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_04805
train
T1
v1
Schema: shipments (alias: shp)(value, date, code, status) customers(date, type, value, salary) Task: Find name from shipments where code appears in customers entries with matching level. SQL:
SELECT name FROM shipments AS shp WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.level = shp.level );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2" }
cs8_fixed_train_04806
train
T2
v1
Schema: categories (alias: catg)(code, salary, id, value) schedules(name, date, amount, level) Task: Retrieve value from categories whose level is found in schedules rows where code matches the outer record. SQL:
SELECT value FROM categories AS catg WHERE level IN ( SELECT level FROM schedules AS schd WHERE schd.code = catg.code );
{ "outer_table": "categories", "inner_table": "schedules", "outer_alias": "catg", "inner_alias": "schd", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "catg.code", "token_group": "T2" }
cs8_fixed_train_04807
train
T2
v2
Schema: departments (alias: dept)(type, level, amount, name) orders(salary, amount, status, id) Task: Retrieve name from departments that have at least one corresponding entry in orders sharing the same status. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = dept.status );
{ "outer_table": "departments", "inner_table": "orders", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "name", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1" }
cs8_fixed_train_04808
train
T1
v2
Schema: transactions (alias: txn)(id, salary, type, amount) items(salary, name, date, code) Task: Find name from transactions where a matching record exists in items with the same status. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = txn.status );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "name", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1" }
cs8_fixed_train_04809
train
T1
v3
Schema: services (alias: srvc)(level, amount, salary, value) sales(status, code, amount, salary) Task: Find code from services where amount exceeds the average value from sales for the same id. SQL:
SELECT code FROM services AS srvc WHERE amount > ( SELECT AVG(value) FROM sales AS sale WHERE sale.id = srvc.id );
{ "outer_table": "services", "inner_table": "sales", "outer_alias": "srvc", "inner_alias": "sale", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "srvc.id", "token_group": "T2" }
cs8_fixed_train_04810
train
T2
v3
Schema: warehouses (alias: whs)(type, code, name, salary) departments(status, level, type, amount) Task: Find amount from warehouses where salary exceeds the average value from departments for the same level. SQL:
SELECT amount FROM warehouses AS whs WHERE salary > ( SELECT MAX(value) FROM departments AS dept WHERE dept.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "departments", "outer_alias": "whs", "inner_alias": "dept", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_04811
train
T2
v2
Schema: staff (alias: empl)(id, date, salary, type) departments(value, salary, type, level) Task: Find id from staff where a matching record exists in departments with the same level. SQL:
SELECT id FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = empl.level );
{ "outer_table": "staff", "inner_table": "departments", "outer_alias": "empl", "inner_alias": "dept", "proj_col": "id", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_04812
train
T2
v3
Schema: requests (alias: ordr)(type, id, name, amount) items(status, code, id, value) Task: Retrieve salary from requests with amount above the AVG(salary) of items rows sharing the same status. SQL:
SELECT salary FROM requests AS ordr WHERE amount > ( SELECT AVG(salary) FROM items AS lne WHERE lne.status = ordr.status );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_04813
train
T2
v3
Schema: budgets (alias: budg)(code, status, level, name) invoices(salary, value, id, name) Task: Find code from budgets where salary exceeds the average salary from invoices for the same id. SQL:
SELECT code FROM budgets AS budg WHERE salary > ( SELECT COUNT(salary) FROM invoices AS inv WHERE inv.id = budg.id );
{ "outer_table": "budgets", "inner_table": "invoices", "outer_alias": "budg", "inner_alias": "inv", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "budg.id", "token_group": "T2" }
cs8_fixed_train_04814
train
T2
v3
Schema: warehouses (alias: whs)(name, value, id, code) shipments(name, date, code, amount) Task: Retrieve salary from warehouses with amount above the MAX(value) of shipments rows sharing the same id. SQL:
SELECT salary FROM warehouses AS whs WHERE amount > ( SELECT MAX(value) FROM shipments AS shp WHERE shp.id = whs.id );
{ "outer_table": "warehouses", "inner_table": "shipments", "outer_alias": "whs", "inner_alias": "shp", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "whs.id", "token_group": "T2" }
cs8_fixed_train_04815
train
T2
v1
Schema: shipments (alias: shp)(salary, name, id, level) departments(date, name, status, code) Task: Select salary from shipments where code exists in departments for the same type. SQL:
SELECT salary FROM shipments AS shp WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.type = shp.type );
{ "outer_table": "shipments", "inner_table": "departments", "outer_alias": "shp", "inner_alias": "dept", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2" }
cs8_fixed_train_04816
train
T2
v2
Schema: products (alias: prod)(type, name, date, level) accounts(value, salary, amount, status) Task: Retrieve salary from products that have at least one corresponding entry in accounts sharing the same type. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = prod.type );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "salary", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_04817
train
T1
v1
Schema: products (alias: prod)(name, type, code, id) accounts(level, name, type, salary) Task: Find id from products where level appears in accounts entries with matching code. SQL:
SELECT id FROM products AS prod WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.code = prod.code );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_04818
train
T1
v2
Schema: orders (alias: ord)(code, type, date, salary) requests(date, status, amount, code) Task: Find name from orders where a matching record exists in requests with the same id. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = ord.id );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "name", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1" }
cs8_fixed_train_04819
train
T1
v2
Schema: products (alias: prod)(id, date, level, status) transactions(level, amount, value, type) Task: Retrieve name from products that have at least one corresponding entry in transactions sharing the same code. SQL:
SELECT name FROM products AS prod WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = prod.code );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "name", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_04820
train
T1
v3
Schema: products (alias: prod)(code, id, date, name) customers(amount, date, level, salary) Task: Find value from products where salary exceeds the average value from customers for the same type. SQL:
SELECT value FROM products AS prod WHERE salary > ( SELECT COUNT(value) FROM customers AS cust WHERE cust.type = prod.type );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1" }
cs8_fixed_train_04821
train
T1
v1
Schema: managers (alias: mgr)(level, name, code, id) items(name, value, id, date) Task: Retrieve name from managers whose level is found in items rows where type matches the outer record. SQL:
SELECT name FROM managers AS mgr WHERE level IN ( SELECT level FROM items AS lne WHERE lne.type = mgr.type );
{ "outer_table": "managers", "inner_table": "items", "outer_alias": "mgr", "inner_alias": "lne", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1" }
cs8_fixed_train_04822
train
T1
v3
Schema: staff (alias: empl)(level, name, type, code) orders(salary, level, type, amount) Task: Find amount from staff where salary exceeds the average value from orders for the same level. SQL:
SELECT amount FROM staff AS empl WHERE salary > ( SELECT MIN(value) FROM orders AS ord WHERE ord.level = empl.level );
{ "outer_table": "staff", "inner_table": "orders", "outer_alias": "empl", "inner_alias": "ord", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2" }
cs8_fixed_train_04823
train
T2
v3
Schema: sales (alias: sale)(type, name, salary, code) shipments(salary, amount, code, type) Task: Retrieve name from sales with value above the AVG(salary) of shipments rows sharing the same type. SQL:
SELECT name FROM sales AS sale WHERE value > ( SELECT AVG(salary) FROM shipments AS shp WHERE shp.type = sale.type );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1" }
cs8_fixed_train_04824
train
T1
v2
Schema: invoices (alias: inv)(salary, date, code, value) departments(type, code, value, amount) Task: Find amount from invoices where a matching record exists in departments with the same status. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = inv.status );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "amount", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_04825
train
T1
v3
Schema: regions (alias: rgn)(salary, status, code, level) transactions(status, salary, code, date) Task: Retrieve value from regions with value above the MIN(salary) of transactions rows sharing the same type. SQL:
SELECT value FROM regions AS rgn WHERE value > ( SELECT MIN(salary) FROM transactions AS txn WHERE txn.type = rgn.type );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_04826
train
T2
v2
Schema: departments (alias: dept)(date, type, code, level) sales(status, type, salary, value) Task: Find name from departments where a matching record exists in sales with the same type. SQL:
SELECT name FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = dept.type );
{ "outer_table": "departments", "inner_table": "sales", "outer_alias": "dept", "inner_alias": "sale", "proj_col": "name", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_04827
train
T1
v1
Schema: services (alias: srvc)(id, code, salary, amount) customers(salary, type, date, name) Task: Retrieve salary from services whose type is found in customers rows where type matches the outer record. SQL:
SELECT salary FROM services AS srvc WHERE type IN ( SELECT type FROM customers AS cust WHERE cust.type = srvc.type );
{ "outer_table": "services", "inner_table": "customers", "outer_alias": "srvc", "inner_alias": "cust", "proj_col": "salary", "filter_col": "type", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_04828
train
T2
v3
Schema: employees (alias: emp)(id, status, amount, date) items(value, name, type, salary) Task: Retrieve amount from employees with value above the MAX(amount) of items rows sharing the same code. SQL:
SELECT amount FROM employees AS emp WHERE value > ( SELECT MAX(amount) FROM items AS lne WHERE lne.code = emp.code );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1" }
cs8_fixed_train_04829
train
T1
v2
Schema: warehouses (alias: whs)(level, type, name, id) employees(name, amount, salary, level) Task: Find value from warehouses where a matching record exists in employees with the same level. SQL:
SELECT value FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "employees", "outer_alias": "whs", "inner_alias": "emp", "proj_col": "value", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_04830
train
T2
v1
Schema: products (alias: prod)(level, id, type, salary) transactions(name, level, amount, id) Task: Retrieve name from products whose code is found in transactions rows where id matches the outer record. SQL:
SELECT name FROM products AS prod WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.id = prod.id );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_04831
train
T1
v3
Schema: employees (alias: emp)(amount, level, value, code) managers(type, code, status, value) Task: Retrieve amount from employees with salary above the SUM(value) of managers rows sharing the same level. SQL:
SELECT amount FROM employees AS emp WHERE salary > ( SELECT SUM(value) FROM managers AS mgr WHERE mgr.level = emp.level );
{ "outer_table": "employees", "inner_table": "managers", "outer_alias": "emp", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1" }
cs8_fixed_train_04832
train
T1
v1
Schema: requests (alias: ordr)(level, amount, status, salary) managers(amount, code, value, id) Task: Find code from requests where level appears in managers entries with matching id. SQL:
SELECT code FROM requests AS ordr WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.id = ordr.id );
{ "outer_table": "requests", "inner_table": "managers", "outer_alias": "ordr", "inner_alias": "mgr", "proj_col": "code", "filter_col": "level", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_04833
train
T2
v3
Schema: requests (alias: ordr)(type, salary, code, amount) orders(status, value, code, name) Task: Find name from requests where salary exceeds the average salary from orders for the same level. SQL:
SELECT name FROM requests AS ordr WHERE salary > ( SELECT MIN(salary) FROM orders AS ord WHERE ord.level = ordr.level );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "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_04834
train
T2
v2
Schema: products (alias: prod)(amount, date, status, salary) invoices(date, code, name, status) Task: Retrieve code from products that have at least one corresponding entry in invoices sharing the same code. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = prod.code );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "code", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1" }
cs8_fixed_train_04835
train
T1
v3
Schema: warehouses (alias: whs)(id, date, code, value) categories(code, level, type, id) Task: Find value from warehouses where value exceeds the average value from categories for the same code. SQL:
SELECT value FROM warehouses AS whs WHERE value > ( SELECT MAX(value) FROM categories AS catg WHERE catg.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "categories", "outer_alias": "whs", "inner_alias": "catg", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_04836
train
T2
v1
Schema: employees (alias: emp)(salary, status, type, name) budgets(status, name, value, code) Task: Find salary from employees where code appears in budgets entries with matching status. SQL:
SELECT salary FROM employees AS emp WHERE code IN ( SELECT code FROM budgets AS budg WHERE budg.status = emp.status );
{ "outer_table": "employees", "inner_table": "budgets", "outer_alias": "emp", "inner_alias": "budg", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1" }
cs8_fixed_train_04837
train
T1
v1
Schema: warehouses (alias: whs)(value, salary, type, amount) sales(amount, status, name, code) Task: Retrieve value from warehouses whose status is found in sales rows where level matches the outer record. SQL:
SELECT value FROM warehouses AS whs WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.level = whs.level );
{ "outer_table": "warehouses", "inner_table": "sales", "outer_alias": "whs", "inner_alias": "sale", "proj_col": "value", "filter_col": "status", "join_col": "level", "correlated_ref": "whs.level", "token_group": "T2" }
cs8_fixed_train_04838
train
T2
v1
Schema: items (alias: lne)(level, type, status, salary) categories(status, level, salary, name) Task: Retrieve amount from items whose status is found in categories rows where code matches the outer record. SQL:
SELECT amount FROM items AS lne WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.code = lne.code );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "amount", "filter_col": "status", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2" }
cs8_fixed_train_04839
train
T2
v3
Schema: shipments (alias: shp)(date, name, id, status) orders(status, id, value, code) Task: Find name from shipments where value exceeds the average salary from orders for the same id. SQL:
SELECT name FROM shipments AS shp WHERE value > ( SELECT AVG(salary) FROM orders AS ord WHERE ord.id = shp.id );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2" }
cs8_fixed_train_04840
train
T2
v3
Schema: products (alias: prod)(code, status, amount, value) transactions(status, date, level, code) Task: Find id from products where amount exceeds the average value from transactions for the same id. SQL:
SELECT id FROM products AS prod WHERE amount > ( SELECT COUNT(value) FROM transactions AS txn WHERE txn.id = prod.id );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_04841
train
T1
v2
Schema: items (alias: lne)(salary, code, level, amount) staff(name, type, amount, salary) Task: Find code from items where a matching record exists in staff with the same id. SQL:
SELECT code FROM items AS lne WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = lne.id );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "code", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_04842
train
T2
v3
Schema: departments (alias: dept)(level, salary, type, id) items(value, salary, code, level) Task: Retrieve amount from departments with amount above the SUM(value) of items rows sharing the same type. SQL:
SELECT amount FROM departments AS dept WHERE amount > ( SELECT SUM(value) FROM items AS lne WHERE lne.type = dept.type );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1" }
cs8_fixed_train_04843
train
T1
v3
Schema: requests (alias: ordr)(code, status, id, value) customers(name, type, value, code) Task: Retrieve value from requests with salary above the MIN(amount) of customers rows sharing the same status. SQL:
SELECT value FROM requests AS ordr WHERE salary > ( SELECT MIN(amount) FROM customers AS cust WHERE cust.status = ordr.status );
{ "outer_table": "requests", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2" }
cs8_fixed_train_04844
train
T2
v1
Schema: orders (alias: ord)(name, code, amount, value) products(type, salary, code, id) Task: Select salary from orders where id exists in products for the same code. SQL:
SELECT salary FROM orders AS ord WHERE id IN ( SELECT id FROM products AS prod WHERE prod.code = ord.code );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "salary", "filter_col": "id", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1" }
cs8_fixed_train_04845
train
T1
v2
Schema: categories (alias: catg)(id, salary, amount, level) transactions(salary, status, amount, code) Task: Retrieve value from categories that have at least one corresponding entry in transactions sharing the same status. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.status = catg.status );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "value", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2" }
cs8_fixed_train_04846
train
T2
v3
Schema: transactions (alias: txn)(level, date, salary, value) employees(amount, status, id, value) Task: Find id from transactions where value exceeds the average amount from employees for the same id. SQL:
SELECT id FROM transactions AS txn WHERE value > ( SELECT MIN(amount) FROM employees AS emp WHERE emp.id = txn.id );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_04847
train
T1
v1
Schema: customers (alias: cust)(amount, type, value, code) warehouses(id, level, date, salary) Task: Select name from customers where type exists in warehouses for the same id. SQL:
SELECT name FROM customers AS cust WHERE type IN ( SELECT type FROM warehouses AS whs WHERE whs.id = cust.id );
{ "outer_table": "customers", "inner_table": "warehouses", "outer_alias": "cust", "inner_alias": "whs", "proj_col": "name", "filter_col": "type", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1" }
cs8_fixed_train_04848
train
T1
v1
Schema: regions (alias: rgn)(name, type, amount, code) services(code, id, type, salary) Task: Select value from regions where level exists in services for the same code. SQL:
SELECT value FROM regions AS rgn WHERE level IN ( SELECT level FROM services AS srvc WHERE srvc.code = rgn.code );
{ "outer_table": "regions", "inner_table": "services", "outer_alias": "rgn", "inner_alias": "srvc", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2" }
cs8_fixed_train_04849
train
T2
v1
Schema: products (alias: prod)(salary, id, type, date) items(name, status, code, date) Task: Retrieve id from products whose type is found in items rows where id matches the outer record. SQL:
SELECT id FROM products AS prod WHERE type IN ( SELECT type FROM items AS lne WHERE lne.id = prod.id );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1" }
cs8_fixed_train_04850
train
T1
v3
Schema: managers (alias: mgr)(amount, salary, type, id) customers(amount, status, name, value) Task: Retrieve code from managers with value above the COUNT(salary) of customers rows sharing the same code. SQL:
SELECT code FROM managers AS mgr WHERE value > ( SELECT COUNT(salary) FROM customers AS cust WHERE cust.code = mgr.code );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_04851
train
T1
v2
Schema: schedules (alias: schd)(salary, date, type, name) budgets(date, type, status, code) Task: Retrieve id from schedules that have at least one corresponding entry in budgets sharing the same type. SQL:
SELECT id FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM budgets AS budg WHERE budg.type = schd.type );
{ "outer_table": "schedules", "inner_table": "budgets", "outer_alias": "schd", "inner_alias": "budg", "proj_col": "id", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2" }
cs8_fixed_train_04852
train
T2
v1
Schema: customers (alias: cust)(type, status, salary, amount) orders(name, date, salary, id) Task: Retrieve salary from customers whose status is found in orders rows where level matches the outer record. SQL:
SELECT salary FROM customers AS cust WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.level = cust.level );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1" }
cs8_fixed_train_04853
train
T1
v1
Schema: transactions (alias: txn)(amount, level, date, type) items(type, status, value, salary) Task: Select code from transactions where status exists in items for the same level. SQL:
SELECT code FROM transactions AS txn WHERE status IN ( SELECT status FROM items AS lne WHERE lne.level = txn.level );
{ "outer_table": "transactions", "inner_table": "items", "outer_alias": "txn", "inner_alias": "lne", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_04854
train
T1
v1
Schema: transactions (alias: txn)(level, date, id, amount) employees(id, status, code, date) Task: Retrieve amount from transactions whose code is found in employees rows where type matches the outer record. SQL:
SELECT amount FROM transactions AS txn WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.type = txn.type );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1" }
cs8_fixed_train_04855
train
T1
v1
Schema: items (alias: lne)(level, id, type, salary) sales(amount, value, code, type) Task: Retrieve name from items whose type is found in sales rows where status matches the outer record. SQL:
SELECT name FROM items AS lne WHERE type IN ( SELECT type FROM sales AS sale WHERE sale.status = lne.status );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "name", "filter_col": "type", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2" }
cs8_fixed_train_04856
train
T2
v2
Schema: categories (alias: catg)(id, status, salary, code) items(type, date, name, amount) Task: Find amount from categories where a matching record exists in items with the same type. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.type = catg.type );
{ "outer_table": "categories", "inner_table": "items", "outer_alias": "catg", "inner_alias": "lne", "proj_col": "amount", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2" }
cs8_fixed_train_04857
train
T2
v1
Schema: warehouses (alias: whs)(amount, salary, value, name) staff(status, type, date, id) Task: Retrieve code from warehouses whose status is found in staff rows where type matches the outer record. SQL:
SELECT code FROM warehouses AS whs WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.type = whs.type );
{ "outer_table": "warehouses", "inner_table": "staff", "outer_alias": "whs", "inner_alias": "empl", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "whs.type", "token_group": "T2" }
cs8_fixed_train_04858
train
T2
v3
Schema: transactions (alias: txn)(salary, type, status, name) shipments(level, name, id, amount) Task: Retrieve name from transactions with amount above the MIN(value) of shipments rows sharing the same level. SQL:
SELECT name FROM transactions AS txn WHERE amount > ( SELECT MIN(value) FROM shipments AS shp WHERE shp.level = txn.level );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1" }
cs8_fixed_train_04859
train
T1
v2
Schema: items (alias: lne)(status, name, value, id) invoices(date, status, type, value) Task: Retrieve id from items that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = lne.id );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "id", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_04860
train
T2
v3
Schema: employees (alias: emp)(code, salary, name, value) invoices(amount, date, id, status) Task: Retrieve value from employees with salary above the MIN(salary) of invoices rows sharing the same id. SQL:
SELECT value FROM employees AS emp WHERE salary > ( SELECT MIN(salary) FROM invoices AS inv WHERE inv.id = emp.id );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1" }
cs8_fixed_train_04861
train
T1
v3
Schema: shipments (alias: shp)(type, date, id, value) categories(level, value, name, amount) Task: Retrieve id from shipments with amount above the SUM(salary) of categories rows sharing the same status. SQL:
SELECT id FROM shipments AS shp WHERE amount > ( SELECT SUM(salary) FROM categories AS catg WHERE catg.status = shp.status );
{ "outer_table": "shipments", "inner_table": "categories", "outer_alias": "shp", "inner_alias": "catg", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_04862
train
T2
v2
Schema: orders (alias: ord)(value, amount, type, code) warehouses(id, value, type, salary) Task: Find code from orders where a matching record exists in warehouses with the same level. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.level = ord.level );
{ "outer_table": "orders", "inner_table": "warehouses", "outer_alias": "ord", "inner_alias": "whs", "proj_col": "code", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1" }
cs8_fixed_train_04863
train
T1
v1
Schema: shipments (alias: shp)(date, value, name, salary) sales(salary, type, code, status) Task: Retrieve id from shipments whose code is found in sales rows where code matches the outer record. SQL:
SELECT id FROM shipments AS shp WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.code = shp.code );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2" }
cs8_fixed_train_04864
train
T2
v2
Schema: invoices (alias: inv)(date, level, code, amount) shipments(name, code, type, status) Task: Retrieve id from invoices that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = inv.status );
{ "outer_table": "invoices", "inner_table": "shipments", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "id", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1" }
cs8_fixed_train_04865
train
T1
v1
Schema: budgets (alias: budg)(amount, id, status, level) sales(value, status, amount, id) Task: Retrieve code from budgets whose id is found in sales rows where level matches the outer record. SQL:
SELECT code FROM budgets AS budg WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.level = budg.level );
{ "outer_table": "budgets", "inner_table": "sales", "outer_alias": "budg", "inner_alias": "sale", "proj_col": "code", "filter_col": "id", "join_col": "level", "correlated_ref": "budg.level", "token_group": "T2" }
cs8_fixed_train_04866
train
T2
v1
Schema: warehouses (alias: whs)(amount, code, date, status) managers(value, date, id, salary) Task: Select id from warehouses where id exists in managers for the same status. SQL:
SELECT id FROM warehouses AS whs WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.status = whs.status );
{ "outer_table": "warehouses", "inner_table": "managers", "outer_alias": "whs", "inner_alias": "mgr", "proj_col": "id", "filter_col": "id", "join_col": "status", "correlated_ref": "whs.status", "token_group": "T2" }
cs8_fixed_train_04867
train
T2
v3
Schema: accounts (alias: acct)(code, value, type, id) services(id, type, date, amount) Task: Find amount from accounts where salary exceeds the average amount from services for the same status. SQL:
SELECT amount FROM accounts AS acct WHERE salary > ( SELECT MIN(amount) FROM services AS srvc WHERE srvc.status = acct.status );
{ "outer_table": "accounts", "inner_table": "services", "outer_alias": "acct", "inner_alias": "srvc", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1" }
cs8_fixed_train_04868
train
T1
v1
Schema: budgets (alias: budg)(level, amount, code, value) shipments(level, name, type, date) Task: Find name from budgets where type appears in shipments entries with matching code. SQL:
SELECT name FROM budgets AS budg WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.code = budg.code );
{ "outer_table": "budgets", "inner_table": "shipments", "outer_alias": "budg", "inner_alias": "shp", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_04869
train
T2
v1
Schema: customers (alias: cust)(id, type, value, code) accounts(level, status, code, amount) Task: Find amount from customers where id appears in accounts entries with matching status. SQL:
SELECT amount FROM customers AS cust WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.status = cust.status );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1" }
cs8_fixed_train_04870
train
T1
v1
Schema: items (alias: lne)(level, amount, date, value) orders(code, status, salary, type) Task: Retrieve salary from items whose status is found in orders rows where level matches the outer record. SQL:
SELECT salary FROM items AS lne WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.level = lne.level );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2" }
cs8_fixed_train_04871
train
T2
v2
Schema: warehouses (alias: whs)(name, level, salary, type) employees(level, code, id, status) Task: Find salary from warehouses where a matching record exists in employees with the same code. SQL:
SELECT salary FROM warehouses AS whs WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = whs.code );
{ "outer_table": "warehouses", "inner_table": "employees", "outer_alias": "whs", "inner_alias": "emp", "proj_col": "salary", "join_col": "code", "correlated_ref": "whs.code", "token_group": "T2" }
cs8_fixed_train_04872
train
T2
v2
Schema: shipments (alias: shp)(id, value, amount, level) warehouses(type, status, amount, date) Task: Find value from shipments where a matching record exists in warehouses with the same status. SQL:
SELECT value FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM warehouses AS whs WHERE whs.status = shp.status );
{ "outer_table": "shipments", "inner_table": "warehouses", "outer_alias": "shp", "inner_alias": "whs", "proj_col": "value", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_04873
train
T2
v1
Schema: staff (alias: empl)(status, date, amount, type) requests(code, salary, amount, value) Task: Retrieve salary from staff whose level is found in requests rows where id matches the outer record. SQL:
SELECT salary FROM staff AS empl WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.id = empl.id );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "level", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_04874
train
T2
v1
Schema: accounts (alias: acct)(salary, status, amount, date) requests(level, status, id, type) Task: Select id from accounts where id exists in requests for the same type. SQL:
SELECT id FROM accounts AS acct WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.type = acct.type );
{ "outer_table": "accounts", "inner_table": "requests", "outer_alias": "acct", "inner_alias": "ordr", "proj_col": "id", "filter_col": "id", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1" }
cs8_fixed_train_04875
train
T1
v2
Schema: services (alias: srvc)(status, value, amount, salary) regions(name, date, value, amount) Task: Find code from services where a matching record exists in regions with the same code. SQL:
SELECT code FROM services AS srvc WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = srvc.code );
{ "outer_table": "services", "inner_table": "regions", "outer_alias": "srvc", "inner_alias": "rgn", "proj_col": "code", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_04876
train
T2
v2
Schema: shipments (alias: shp)(code, salary, status, level) employees(amount, id, value, status) Task: Find code from shipments where a matching record exists in employees with the same status. SQL:
SELECT code FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = shp.status );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "code", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_04877
train
T2
v3
Schema: regions (alias: rgn)(date, value, code, status) warehouses(value, name, code, status) Task: Retrieve amount from regions with amount above the MAX(salary) of warehouses rows sharing the same type. SQL:
SELECT amount FROM regions AS rgn WHERE amount > ( SELECT MAX(salary) FROM warehouses AS whs WHERE whs.type = rgn.type );
{ "outer_table": "regions", "inner_table": "warehouses", "outer_alias": "rgn", "inner_alias": "whs", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_04878
train
T2
v2
Schema: regions (alias: rgn)(status, code, salary, name) managers(salary, level, amount, status) Task: Find salary from regions where a matching record exists in managers with the same id. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = rgn.id );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "salary", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2" }
cs8_fixed_train_04879
train
T2
v2
Schema: transactions (alias: txn)(value, status, level, type) invoices(value, level, name, type) Task: Retrieve id from transactions that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT id FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = txn.id );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "id", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1" }
cs8_fixed_train_04880
train
T1
v1
Schema: sales (alias: sale)(amount, type, id, name) accounts(type, level, salary, status) Task: Select value from sales where status exists in accounts for the same status. SQL:
SELECT value FROM sales AS sale WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.status = sale.status );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1" }
cs8_fixed_train_04881
train
T1
v1
Schema: schedules (alias: schd)(name, value, level, type) budgets(status, name, value, salary) Task: Retrieve code from schedules whose code is found in budgets rows where level matches the outer record. SQL:
SELECT code FROM schedules AS schd WHERE code IN ( SELECT code FROM budgets AS budg WHERE budg.level = schd.level );
{ "outer_table": "schedules", "inner_table": "budgets", "outer_alias": "schd", "inner_alias": "budg", "proj_col": "code", "filter_col": "code", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2" }
cs8_fixed_train_04882
train
T2
v3
Schema: services (alias: srvc)(code, id, name, date) shipments(status, type, id, value) Task: Find name from services where value exceeds the average amount from shipments for the same code. SQL:
SELECT name FROM services AS srvc WHERE value > ( SELECT MIN(amount) FROM shipments AS shp WHERE shp.code = srvc.code );
{ "outer_table": "services", "inner_table": "shipments", "outer_alias": "srvc", "inner_alias": "shp", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "srvc.code", "token_group": "T2" }
cs8_fixed_train_04883
train
T2
v3
Schema: staff (alias: empl)(salary, name, date, type) customers(code, status, salary, value) Task: Find salary from staff where salary exceeds the average amount from customers for the same id. SQL:
SELECT salary FROM staff AS empl WHERE salary > ( SELECT MAX(amount) FROM customers AS cust WHERE cust.id = empl.id );
{ "outer_table": "staff", "inner_table": "customers", "outer_alias": "empl", "inner_alias": "cust", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2" }
cs8_fixed_train_04884
train
T2
v3
Schema: shipments (alias: shp)(status, level, value, type) warehouses(value, salary, amount, date) Task: Find value from shipments where amount exceeds the average amount from warehouses for the same status. SQL:
SELECT value FROM shipments AS shp WHERE amount > ( SELECT SUM(amount) FROM warehouses AS whs WHERE whs.status = shp.status );
{ "outer_table": "shipments", "inner_table": "warehouses", "outer_alias": "shp", "inner_alias": "whs", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2" }
cs8_fixed_train_04885
train
T2
v2
Schema: budgets (alias: budg)(type, amount, value, level) departments(date, name, salary, amount) Task: Retrieve id from budgets that have at least one corresponding entry in departments sharing the same code. SQL:
SELECT id FROM budgets AS budg WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = budg.code );
{ "outer_table": "budgets", "inner_table": "departments", "outer_alias": "budg", "inner_alias": "dept", "proj_col": "id", "join_col": "code", "correlated_ref": "budg.code", "token_group": "T2" }
cs8_fixed_train_04886
train
T2
v1
Schema: accounts (alias: acct)(level, value, type, date) services(date, level, amount, type) Task: Select value from accounts where status exists in services for the same id. SQL:
SELECT value FROM accounts AS acct WHERE status IN ( SELECT status FROM services AS srvc WHERE srvc.id = acct.id );
{ "outer_table": "accounts", "inner_table": "services", "outer_alias": "acct", "inner_alias": "srvc", "proj_col": "value", "filter_col": "status", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1" }
cs8_fixed_train_04887
train
T1
v3
Schema: items (alias: lne)(code, name, status, id) transactions(level, status, type, code) Task: Find value from items where amount exceeds the average amount from transactions for the same type. SQL:
SELECT value FROM items AS lne WHERE amount > ( SELECT MIN(amount) FROM transactions AS txn WHERE txn.type = lne.type );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2" }
cs8_fixed_train_04888
train
T2
v2
Schema: orders (alias: ord)(amount, value, salary, type) requests(date, salary, level, name) Task: Find code from orders where a matching record exists in requests with the same type. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = ord.type );
{ "outer_table": "orders", "inner_table": "requests", "outer_alias": "ord", "inner_alias": "ordr", "proj_col": "code", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1" }
cs8_fixed_train_04889
train
T1
v1
Schema: services (alias: srvc)(value, code, status, level) staff(date, name, status, code) Task: Retrieve name from services whose status is found in staff rows where type matches the outer record. SQL:
SELECT name FROM services AS srvc WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.type = srvc.type );
{ "outer_table": "services", "inner_table": "staff", "outer_alias": "srvc", "inner_alias": "empl", "proj_col": "name", "filter_col": "status", "join_col": "type", "correlated_ref": "srvc.type", "token_group": "T2" }
cs8_fixed_train_04890
train
T2
v2
Schema: requests (alias: ordr)(date, type, code, status) customers(salary, value, status, type) Task: Retrieve value from requests that have at least one corresponding entry in customers sharing the same id. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.id = ordr.id );
{ "outer_table": "requests", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "value", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2" }
cs8_fixed_train_04891
train
T2
v1
Schema: staff (alias: empl)(id, level, value, salary) sales(salary, code, id, name) Task: Retrieve salary from staff whose status is found in sales rows where code matches the outer record. SQL:
SELECT salary FROM staff AS empl WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.code = empl.code );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2" }
cs8_fixed_train_04892
train
T2
v2
Schema: items (alias: lne)(type, code, salary, date) services(date, salary, name, value) Task: Retrieve salary from items that have at least one corresponding entry in services sharing the same id. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM services AS srvc WHERE srvc.id = lne.id );
{ "outer_table": "items", "inner_table": "services", "outer_alias": "lne", "inner_alias": "srvc", "proj_col": "salary", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2" }
cs8_fixed_train_04893
train
T2
v2
Schema: departments (alias: dept)(code, level, value, name) requests(code, date, type, id) Task: Find name from departments where a matching record exists in requests with the same level. SQL:
SELECT name 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": "name", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1" }
cs8_fixed_train_04894
train
T1
v1
Schema: budgets (alias: budg)(code, amount, id, type) items(type, name, code, value) Task: Retrieve name from budgets whose id is found in items rows where type matches the outer record. SQL:
SELECT name FROM budgets AS budg WHERE id IN ( SELECT id 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": "id", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_04895
train
T2
v1
Schema: managers (alias: mgr)(level, value, salary, type) staff(amount, level, value, status) Task: Select id from managers where type exists in staff for the same code. SQL:
SELECT id FROM managers AS mgr WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.code = mgr.code );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1" }
cs8_fixed_train_04896
train
T1
v2
Schema: products (alias: prod)(amount, level, date, value) transactions(code, id, type, status) Task: Find code from products where a matching record exists in transactions with the same level. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.level = prod.level );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "code", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1" }
cs8_fixed_train_04897
train
T1
v3
Schema: budgets (alias: budg)(level, type, date, value) transactions(code, date, value, name) Task: Retrieve code from budgets with value above the MIN(salary) of transactions rows sharing the same type. SQL:
SELECT code FROM budgets AS budg WHERE value > ( SELECT MIN(salary) FROM transactions AS txn WHERE txn.type = budg.type );
{ "outer_table": "budgets", "inner_table": "transactions", "outer_alias": "budg", "inner_alias": "txn", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "budg.type", "token_group": "T2" }
cs8_fixed_train_04898
train
T2
v2
Schema: regions (alias: rgn)(level, amount, status, type) categories(code, amount, id, name) Task: Find salary from regions where a matching record exists in categories with the same type. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = rgn.type );
{ "outer_table": "regions", "inner_table": "categories", "outer_alias": "rgn", "inner_alias": "catg", "proj_col": "salary", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2" }
cs8_fixed_train_04899
train
T2