variant
stringclasses
3 values
prompt
stringlengths
160
237
sql
stringlengths
102
141
metadata
unknown
token_group
stringclasses
2 values
id
stringlengths
24
24
split
stringclasses
1 value
v3
Schema: requests (alias: ordr)(code, salary, level, name) employees(level, salary, amount, name) Task: Retrieve id from requests with value above the MIN(salary) of employees rows sharing the same status. SQL:
SELECT id FROM requests AS ordr WHERE value > ( SELECT MIN(salary) FROM employees AS emp WHERE emp.status = ordr.status );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04700
train
v1
Schema: regions (alias: rgn)(type, name, level, value) schedules(type, amount, status, code) Task: Find salary from regions where code appears in schedules entries with matching level. SQL:
SELECT salary FROM regions AS rgn WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.level = rgn.level );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "salary", "filter_col": "code", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04701
train
v3
Schema: items (alias: lne)(status, level, code, amount) tasks(value, salary, name, level) Task: Find code from items where amount exceeds the maximum value from tasks for the same level. SQL:
SELECT code FROM items AS lne WHERE amount > ( SELECT MAX(value) FROM tasks AS tsk WHERE tsk.level = lne.level );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04702
train
v1
Schema: managers (alias: mgr)(id, code, type, value) employees(value, date, type, id) Task: Retrieve code from managers whose code is found in employees rows where type matches the outer record. SQL:
SELECT code FROM managers AS mgr WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.type = mgr.type );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "code", "filter_col": "code", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04703
train
v3
Schema: sales (alias: sale)(value, code, type, date) schedules(level, value, status, date) Task: Find name from sales where amount exceeds the count of salary from schedules for the same type. SQL:
SELECT name FROM sales AS sale WHERE amount > ( SELECT COUNT(salary) FROM schedules AS schd WHERE schd.type = sale.type );
{ "outer_table": "sales", "inner_table": "schedules", "outer_alias": "sale", "inner_alias": "schd", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04704
train
v3
Schema: items (alias: lne)(date, salary, id, type) customers(level, value, amount, status) Task: Find name from items where amount exceeds the minimum salary from customers for the same type. SQL:
SELECT name FROM items AS lne WHERE amount > ( SELECT MIN(salary) FROM customers AS cust WHERE cust.type = lne.type );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "name", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04705
train
v2
Schema: employees (alias: emp)(type, name, level, salary) invoices(salary, type, name, value) Task: Retrieve salary from employees that have at least one corresponding entry in invoices sharing the same status. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = emp.status );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "salary", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04706
train
v3
Schema: items (alias: lne)(date, status, id, value) regions(salary, id, value, type) Task: Find amount from items where salary exceeds the total amount from regions for the same id. SQL:
SELECT amount FROM items AS lne WHERE salary > ( SELECT SUM(amount) FROM regions AS rgn WHERE rgn.id = lne.id );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04707
train
v1
Schema: items (alias: lne)(level, code, type, value) orders(amount, level, id, type) Task: Select id from items where level exists in orders for the same code. SQL:
SELECT id FROM items AS lne WHERE level IN ( SELECT level FROM orders AS ord WHERE ord.code = lne.code );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "id", "filter_col": "level", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04708
train
v1
Schema: managers (alias: mgr)(code, amount, level, date) schedules(type, status, name, id) Task: Retrieve id from managers whose status is found in schedules rows where code matches the outer record. SQL:
SELECT id FROM managers AS mgr WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.code = mgr.code );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04709
train
v3
Schema: tasks (alias: tsk)(amount, status, value, date) shipments(code, type, name, value) Task: Find salary from tasks where salary exceeds the average value from shipments for the same type. SQL:
SELECT salary FROM tasks AS tsk WHERE salary > ( SELECT AVG(value) FROM shipments AS shp WHERE shp.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "shipments", "outer_alias": "tsk", "inner_alias": "shp", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04710
train
v2
Schema: requests (alias: ordr)(name, amount, type, level) regions(code, name, id, date) Task: Find salary from requests where a matching record exists in regions with the same code. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = ordr.code );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "salary", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04711
train
v3
Schema: accounts (alias: acct)(type, amount, status, code) departments(value, status, code, level) Task: Find salary from accounts where amount exceeds the average amount from departments for the same level. SQL:
SELECT salary FROM accounts AS acct WHERE amount > ( SELECT AVG(amount) FROM departments AS dept WHERE dept.level = acct.level );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04712
train
v1
Schema: items (alias: lne)(id, type, amount, code) transactions(status, salary, type, date) Task: Select salary from items where id exists in transactions for the same id. SQL:
SELECT salary FROM items AS lne WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.id = lne.id );
{ "outer_table": "items", "inner_table": "transactions", "outer_alias": "lne", "inner_alias": "txn", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04713
train
v1
Schema: employees (alias: emp)(code, status, id, value) schedules(level, status, salary, code) Task: Select id from employees where type exists in schedules for the same level. SQL:
SELECT id FROM employees AS emp WHERE type IN ( SELECT type FROM schedules AS schd WHERE schd.level = emp.level );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04714
train
v3
Schema: regions (alias: rgn)(date, level, type, value) orders(name, date, level, code) Task: Find id from regions where value exceeds the maximum amount from orders for the same code. SQL:
SELECT id FROM regions AS rgn WHERE value > ( SELECT MAX(amount) FROM orders AS ord WHERE ord.code = rgn.code );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04715
train
v3
Schema: accounts (alias: acct)(name, level, id, amount) staff(code, date, status, amount) Task: Retrieve code from accounts with value above the MAX(amount) of staff rows sharing the same type. SQL:
SELECT code FROM accounts AS acct WHERE value > ( SELECT MAX(amount) FROM staff AS empl WHERE empl.type = acct.type );
{ "outer_table": "accounts", "inner_table": "staff", "outer_alias": "acct", "inner_alias": "empl", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04716
train
v2
Schema: products (alias: prod)(status, id, date, name) departments(amount, code, level, type) Task: Retrieve code from products that have at least one corresponding entry in departments sharing the same code. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = prod.code );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "code", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04717
train
v3
Schema: employees (alias: emp)(amount, name, date, code) shipments(name, type, amount, value) Task: Find id from employees where salary exceeds the average amount from shipments for the same id. SQL:
SELECT id FROM employees AS emp WHERE salary > ( SELECT AVG(amount) FROM shipments AS shp WHERE shp.id = emp.id );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04718
train
v2
Schema: branches (alias: brc)(id, date, code, type) tasks(name, type, id, status) Task: Retrieve id from branches that have at least one corresponding entry in tasks sharing the same status. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = brc.status );
{ "outer_table": "branches", "inner_table": "tasks", "outer_alias": "brc", "inner_alias": "tsk", "proj_col": "id", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04719
train
v2
Schema: orders (alias: ord)(date, value, amount, level) tasks(salary, amount, value, code) Task: Find value from orders where a matching record exists in tasks with the same code. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.code = ord.code );
{ "outer_table": "orders", "inner_table": "tasks", "outer_alias": "ord", "inner_alias": "tsk", "proj_col": "value", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04720
train
v2
Schema: schedules (alias: schd)(salary, type, level, status) invoices(level, name, status, date) Task: Find code from schedules where a matching record exists in invoices with the same status. SQL:
SELECT code FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = schd.status );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "code", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04721
train
v3
Schema: schedules (alias: schd)(name, date, type, value) categories(date, type, amount, salary) Task: Find amount from schedules where salary exceeds the maximum amount from categories for the same status. SQL:
SELECT amount FROM schedules AS schd WHERE salary > ( SELECT MAX(amount) FROM categories AS catg WHERE catg.status = schd.status );
{ "outer_table": "schedules", "inner_table": "categories", "outer_alias": "schd", "inner_alias": "catg", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04722
train
v3
Schema: invoices (alias: inv)(amount, name, value, level) items(amount, salary, type, name) Task: Retrieve salary from invoices with value above the AVG(value) of items rows sharing the same type. SQL:
SELECT salary FROM invoices AS inv WHERE value > ( SELECT AVG(value) FROM items AS lne WHERE lne.type = inv.type );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04723
train
v3
Schema: sales (alias: sale)(type, amount, id, code) departments(code, status, value, amount) Task: Retrieve amount from sales with value above the MAX(value) of departments rows sharing the same code. SQL:
SELECT amount FROM sales AS sale WHERE value > ( SELECT MAX(value) FROM departments AS dept WHERE dept.code = sale.code );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04724
train
v3
Schema: managers (alias: mgr)(salary, name, level, status) sales(salary, date, status, type) Task: Retrieve salary from managers with salary above the SUM(value) of sales rows sharing the same status. SQL:
SELECT salary FROM managers AS mgr WHERE salary > ( SELECT SUM(value) FROM sales AS sale WHERE sale.status = mgr.status );
{ "outer_table": "managers", "inner_table": "sales", "outer_alias": "mgr", "inner_alias": "sale", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04725
train
v1
Schema: tasks (alias: tsk)(code, name, status, value) staff(value, date, salary, level) Task: Find salary from tasks where status appears in staff entries with matching code. SQL:
SELECT salary FROM tasks AS tsk WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "staff", "outer_alias": "tsk", "inner_alias": "empl", "proj_col": "salary", "filter_col": "status", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04726
train
v3
Schema: departments (alias: dept)(level, date, value, amount) shipments(code, id, type, name) Task: Retrieve id from departments with salary above the AVG(value) of shipments rows sharing the same type. SQL:
SELECT id FROM departments AS dept WHERE salary > ( SELECT AVG(value) FROM shipments AS shp WHERE shp.type = dept.type );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04727
train
v2
Schema: tasks (alias: tsk)(amount, name, value, salary) branches(level, value, type, date) Task: Retrieve name from tasks that have at least one corresponding entry in branches sharing the same type. SQL:
SELECT name FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "branches", "outer_alias": "tsk", "inner_alias": "brc", "proj_col": "name", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04728
train
v1
Schema: projects (alias: prj)(amount, value, type, status) tasks(level, status, amount, value) Task: Retrieve amount from projects whose level is found in tasks rows where type matches the outer record. SQL:
SELECT amount FROM projects AS prj WHERE level IN ( SELECT level FROM tasks AS tsk WHERE tsk.type = prj.type );
{ "outer_table": "projects", "inner_table": "tasks", "outer_alias": "prj", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "level", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04729
train
v1
Schema: orders (alias: ord)(type, date, name, level) managers(salary, date, name, amount) Task: Select salary from orders where type exists in managers for the same level. SQL:
SELECT salary FROM orders AS ord WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.level = ord.level );
{ "outer_table": "orders", "inner_table": "managers", "outer_alias": "ord", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "type", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04730
train
v1
Schema: transactions (alias: txn)(value, level, status, code) staff(id, code, value, name) Task: Select id from transactions where code exists in staff for the same id. SQL:
SELECT id FROM transactions AS txn WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.id = txn.id );
{ "outer_table": "transactions", "inner_table": "staff", "outer_alias": "txn", "inner_alias": "empl", "proj_col": "id", "filter_col": "code", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04731
train
v3
Schema: items (alias: lne)(type, name, salary, level) schedules(amount, code, name, status) Task: Retrieve amount from items with value above the COUNT(salary) of schedules rows sharing the same code. SQL:
SELECT amount FROM items AS lne WHERE value > ( SELECT COUNT(salary) FROM schedules AS schd WHERE schd.code = lne.code );
{ "outer_table": "items", "inner_table": "schedules", "outer_alias": "lne", "inner_alias": "schd", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04732
train
v2
Schema: accounts (alias: acct)(amount, name, date, id) products(type, date, id, status) Task: Retrieve code from accounts that have at least one corresponding entry in products sharing the same type. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = acct.type );
{ "outer_table": "accounts", "inner_table": "products", "outer_alias": "acct", "inner_alias": "prod", "proj_col": "code", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04733
train
v2
Schema: managers (alias: mgr)(id, type, name, value) requests(salary, code, date, value) Task: Retrieve amount from managers that have at least one corresponding entry in requests sharing the same code. SQL:
SELECT amount FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = mgr.code );
{ "outer_table": "managers", "inner_table": "requests", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "amount", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04734
train
v3
Schema: categories (alias: catg)(amount, name, code, salary) sales(status, salary, type, id) Task: Retrieve id from categories with value above the COUNT(amount) of sales rows sharing the same status. SQL:
SELECT id FROM categories AS catg WHERE value > ( SELECT COUNT(amount) FROM sales AS sale WHERE sale.status = catg.status );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "id", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04735
train
v3
Schema: products (alias: prod)(date, name, type, amount) employees(id, salary, type, value) Task: Retrieve name from products with value above the MIN(amount) of employees rows sharing the same type. SQL:
SELECT name FROM products AS prod WHERE value > ( SELECT MIN(amount) FROM employees AS emp WHERE emp.type = prod.type );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04736
train
v3
Schema: customers (alias: cust)(date, code, amount, value) products(type, salary, id, date) Task: Find name from customers where amount exceeds the count of value from products for the same code. SQL:
SELECT name FROM customers AS cust WHERE amount > ( SELECT COUNT(value) FROM products AS prod WHERE prod.code = cust.code );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04737
train
v3
Schema: projects (alias: prj)(amount, code, date, id) regions(salary, level, name, value) Task: Retrieve salary from projects with amount above the AVG(salary) of regions rows sharing the same id. SQL:
SELECT salary FROM projects AS prj WHERE amount > ( SELECT AVG(salary) FROM regions AS rgn WHERE rgn.id = prj.id );
{ "outer_table": "projects", "inner_table": "regions", "outer_alias": "prj", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04738
train
v1
Schema: products (alias: prod)(name, id, status, type) regions(date, code, value, name) Task: Select code from products where code exists in regions for the same type. SQL:
SELECT code FROM products AS prod WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.type = prod.type );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "code", "filter_col": "code", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04739
train
v1
Schema: transactions (alias: txn)(salary, code, amount, name) customers(level, type, amount, code) Task: Retrieve salary from transactions whose level is found in customers rows where id matches the outer record. SQL:
SELECT salary FROM transactions AS txn WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.id = txn.id );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "salary", "filter_col": "level", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04740
train
v3
Schema: schedules (alias: schd)(value, salary, level, id) shipments(amount, level, status, date) Task: Find code from schedules where amount exceeds the average value from shipments for the same code. SQL:
SELECT code FROM schedules AS schd WHERE amount > ( SELECT AVG(value) FROM shipments AS shp WHERE shp.code = schd.code );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04741
train
v2
Schema: projects (alias: prj)(name, value, date, amount) regions(id, type, level, code) Task: Find name from projects where a matching record exists in regions with the same code. SQL:
SELECT name FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.code = prj.code );
{ "outer_table": "projects", "inner_table": "regions", "outer_alias": "prj", "inner_alias": "rgn", "proj_col": "name", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04742
train
v3
Schema: schedules (alias: schd)(name, id, amount, level) managers(code, name, salary, date) Task: Retrieve id from schedules with salary above the SUM(amount) of managers rows sharing the same level. SQL:
SELECT id FROM schedules AS schd WHERE salary > ( 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": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04743
train
v1
Schema: accounts (alias: acct)(id, code, type, value) regions(salary, type, amount, code) Task: Find amount from accounts where id appears in regions entries with matching code. SQL:
SELECT amount FROM accounts AS acct WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.code = acct.code );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04744
train
v2
Schema: customers (alias: cust)(id, salary, amount, name) sales(name, level, value, id) Task: Retrieve salary from customers that have at least one corresponding entry in sales sharing the same code. SQL:
SELECT salary FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.code = cust.code );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "salary", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04745
train
v3
Schema: staff (alias: empl)(id, name, level, type) schedules(type, salary, name, value) Task: Find amount from staff where value exceeds the total amount from schedules for the same type. SQL:
SELECT amount FROM staff AS empl WHERE value > ( SELECT SUM(amount) FROM schedules AS schd WHERE schd.type = empl.type );
{ "outer_table": "staff", "inner_table": "schedules", "outer_alias": "empl", "inner_alias": "schd", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04746
train
v1
Schema: transactions (alias: txn)(type, id, status, value) managers(date, salary, name, id) Task: Find code from transactions where type appears in managers entries with matching code. SQL:
SELECT code FROM transactions AS txn WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.code = txn.code );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "code", "filter_col": "type", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04747
train
v2
Schema: transactions (alias: txn)(level, code, status, id) accounts(type, code, level, date) Task: Find value from transactions where a matching record exists in accounts with the same level. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = txn.level );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "value", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04748
train
v2
Schema: branches (alias: brc)(amount, date, status, code) requests(date, code, status, type) Task: Find code from branches where a matching record exists in requests with the same code. SQL:
SELECT code FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = brc.code );
{ "outer_table": "branches", "inner_table": "requests", "outer_alias": "brc", "inner_alias": "ordr", "proj_col": "code", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04749
train
v1
Schema: transactions (alias: txn)(id, date, salary, value) branches(id, type, name, value) Task: Retrieve value from transactions whose type is found in branches rows where level matches the outer record. SQL:
SELECT value FROM transactions AS txn WHERE type IN ( SELECT type FROM branches AS brc WHERE brc.level = txn.level );
{ "outer_table": "transactions", "inner_table": "branches", "outer_alias": "txn", "inner_alias": "brc", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04750
train
v2
Schema: managers (alias: mgr)(amount, id, code, value) orders(status, id, value, type) Task: Retrieve value from managers that have at least one corresponding entry in orders sharing the same status. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.status = mgr.status );
{ "outer_table": "managers", "inner_table": "orders", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "value", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04751
train
v1
Schema: orders (alias: ord)(level, id, value, amount) sales(amount, date, level, type) Task: Select code from orders where level exists in sales for the same id. SQL:
SELECT code FROM orders AS ord WHERE level IN ( SELECT level FROM sales AS sale WHERE sale.id = ord.id );
{ "outer_table": "orders", "inner_table": "sales", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "code", "filter_col": "level", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04752
train
v3
Schema: tasks (alias: tsk)(level, date, amount, code) accounts(status, name, value, code) Task: Find salary from tasks where salary exceeds the total salary from accounts for the same level. SQL:
SELECT salary FROM tasks AS tsk WHERE salary > ( SELECT SUM(salary) FROM accounts AS acct WHERE acct.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "accounts", "outer_alias": "tsk", "inner_alias": "acct", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04753
train
v1
Schema: projects (alias: prj)(code, type, status, amount) products(salary, id, level, value) Task: Find salary from projects where status appears in products entries with matching status. SQL:
SELECT salary FROM projects AS prj WHERE status IN ( SELECT status FROM products AS prod WHERE prod.status = prj.status );
{ "outer_table": "projects", "inner_table": "products", "outer_alias": "prj", "inner_alias": "prod", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04754
train
v2
Schema: staff (alias: empl)(amount, level, name, id) items(value, name, salary, level) Task: Find value from staff where a matching record exists in items with the same code. SQL:
SELECT value FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = empl.code );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "value", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04755
train
v2
Schema: items (alias: lne)(id, status, date, amount) categories(level, amount, date, type) Task: Retrieve name from items that have at least one corresponding entry in categories sharing the same level. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.level = lne.level );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "name", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04756
train
v3
Schema: customers (alias: cust)(salary, date, code, id) sales(salary, type, code, amount) Task: Find code from customers where salary exceeds the maximum value from sales for the same type. SQL:
SELECT code FROM customers AS cust WHERE salary > ( SELECT MAX(value) FROM sales AS sale WHERE sale.type = cust.type );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04757
train
v1
Schema: categories (alias: catg)(value, code, id, date) regions(type, amount, name, status) Task: Select name from categories where type exists in regions for the same level. SQL:
SELECT name FROM categories AS catg WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.level = catg.level );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04758
train
v2
Schema: requests (alias: ordr)(value, salary, status, level) staff(type, date, id, name) Task: Find value from requests where a matching record exists in staff with the same status. SQL:
SELECT value FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = ordr.status );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "value", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04759
train
v2
Schema: invoices (alias: inv)(id, level, date, code) tasks(id, level, name, salary) Task: Find amount from invoices where a matching record exists in tasks with the same level. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.level = inv.level );
{ "outer_table": "invoices", "inner_table": "tasks", "outer_alias": "inv", "inner_alias": "tsk", "proj_col": "amount", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04760
train
v2
Schema: categories (alias: catg)(id, code, date, status) staff(type, status, level, date) Task: Retrieve salary from categories that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = catg.status );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "salary", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04761
train
v3
Schema: sales (alias: sale)(value, code, date, id) employees(name, value, type, id) Task: Retrieve salary from sales with amount above the MAX(value) of employees rows sharing the same id. SQL:
SELECT salary FROM sales AS sale WHERE amount > ( SELECT MAX(value) FROM employees AS emp WHERE emp.id = sale.id );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04762
train
v2
Schema: shipments (alias: shp)(code, id, type, name) regions(date, amount, name, id) Task: Retrieve salary from shipments that have at least one corresponding entry in regions sharing the same type. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = shp.type );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "salary", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04763
train
v3
Schema: transactions (alias: txn)(level, salary, amount, type) accounts(amount, name, date, type) Task: Retrieve code from transactions with value above the COUNT(value) of accounts rows sharing the same code. SQL:
SELECT code FROM transactions AS txn WHERE value > ( SELECT COUNT(value) FROM accounts AS acct WHERE acct.code = txn.code );
{ "outer_table": "transactions", "inner_table": "accounts", "outer_alias": "txn", "inner_alias": "acct", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04764
train
v2
Schema: accounts (alias: acct)(salary, amount, name, level) regions(code, amount, date, value) Task: Retrieve amount from accounts that have at least one corresponding entry in regions sharing the same type. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = acct.type );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "amount", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04765
train
v1
Schema: regions (alias: rgn)(code, amount, value, status) tasks(code, id, amount, date) Task: Find id from regions where level appears in tasks entries with matching type. SQL:
SELECT id FROM regions AS rgn WHERE level IN ( SELECT level FROM tasks AS tsk WHERE tsk.type = rgn.type );
{ "outer_table": "regions", "inner_table": "tasks", "outer_alias": "rgn", "inner_alias": "tsk", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04766
train
v3
Schema: requests (alias: ordr)(type, amount, date, name) invoices(status, code, salary, type) Task: Find salary from requests where value exceeds the count of value from invoices for the same type. SQL:
SELECT salary FROM requests AS ordr WHERE value > ( SELECT COUNT(value) FROM invoices AS inv WHERE inv.type = ordr.type );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04767
train
v2
Schema: branches (alias: brc)(amount, value, salary, date) customers(salary, value, name, status) Task: Find code from branches where a matching record exists in customers with the same status. SQL:
SELECT code FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = brc.status );
{ "outer_table": "branches", "inner_table": "customers", "outer_alias": "brc", "inner_alias": "cust", "proj_col": "code", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04768
train
v3
Schema: departments (alias: dept)(salary, status, name, date) requests(level, name, date, status) Task: Retrieve amount from departments with value above the SUM(value) of requests rows sharing the same id. SQL:
SELECT amount FROM departments AS dept WHERE value > ( SELECT SUM(value) FROM requests AS ordr WHERE ordr.id = dept.id );
{ "outer_table": "departments", "inner_table": "requests", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04769
train
v1
Schema: shipments (alias: shp)(status, id, salary, type) departments(value, level, amount, code) Task: Select salary from shipments where id exists in departments for the same type. SQL:
SELECT salary FROM shipments AS shp WHERE id IN ( SELECT id 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": "id", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04770
train
v3
Schema: tasks (alias: tsk)(value, type, date, id) accounts(type, name, level, salary) Task: Retrieve id from tasks with value above the SUM(salary) of accounts rows sharing the same level. SQL:
SELECT id FROM tasks AS tsk WHERE value > ( SELECT SUM(salary) FROM accounts AS acct WHERE acct.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "accounts", "outer_alias": "tsk", "inner_alias": "acct", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04771
train
v1
Schema: shipments (alias: shp)(value, id, level, name) departments(status, code, level, name) Task: Retrieve amount from shipments whose type is found in departments rows where id matches the outer record. SQL:
SELECT amount FROM shipments AS shp WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.id = shp.id );
{ "outer_table": "shipments", "inner_table": "departments", "outer_alias": "shp", "inner_alias": "dept", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04772
train
v2
Schema: orders (alias: ord)(level, amount, type, name) shipments(value, level, salary, status) Task: Find salary from orders where a matching record exists in shipments with the same code. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = ord.code );
{ "outer_table": "orders", "inner_table": "shipments", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "salary", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04773
train
v2
Schema: sales (alias: sale)(value, id, code, amount) requests(name, id, date, value) Task: Find value from sales where a matching record exists in requests with the same type. SQL:
SELECT value FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = sale.type );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "value", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04774
train
v2
Schema: regions (alias: rgn)(date, code, salary, type) orders(date, value, name, status) Task: Retrieve salary from regions that have at least one corresponding entry in orders sharing the same type. SQL:
SELECT salary FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.type = rgn.type );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "salary", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04775
train
v1
Schema: orders (alias: ord)(code, salary, id, level) tasks(name, code, status, date) Task: Select name from orders where type exists in tasks for the same id. SQL:
SELECT name FROM orders AS ord WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.id = ord.id );
{ "outer_table": "orders", "inner_table": "tasks", "outer_alias": "ord", "inner_alias": "tsk", "proj_col": "name", "filter_col": "type", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04776
train
v1
Schema: orders (alias: ord)(type, name, salary, id) projects(date, name, status, id) Task: Find value from orders where type appears in projects entries with matching code. SQL:
SELECT value FROM orders AS ord WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.code = ord.code );
{ "outer_table": "orders", "inner_table": "projects", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "value", "filter_col": "type", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04777
train
v3
Schema: items (alias: lne)(id, status, salary, type) regions(type, level, id, salary) Task: Find amount from items where salary exceeds the maximum value from regions for the same status. SQL:
SELECT amount FROM items AS lne WHERE salary > ( SELECT MAX(value) FROM regions AS rgn WHERE rgn.status = lne.status );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04778
train
v3
Schema: invoices (alias: inv)(level, salary, id, code) projects(name, status, code, value) Task: Find value from invoices where value exceeds the maximum amount from projects for the same level. SQL:
SELECT value FROM invoices AS inv WHERE value > ( SELECT MAX(amount) FROM projects AS prj WHERE prj.level = inv.level );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "inv", "inner_alias": "prj", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04779
train
v3
Schema: requests (alias: ordr)(salary, id, date, amount) regions(id, salary, status, level) Task: Retrieve code from requests with amount above the AVG(amount) of regions rows sharing the same level. SQL:
SELECT code FROM requests AS ordr WHERE amount > ( SELECT AVG(amount) FROM regions AS rgn WHERE rgn.level = ordr.level );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04780
train
v1
Schema: items (alias: lne)(level, status, value, type) requests(status, date, value, id) Task: Find code from items where code appears in requests entries with matching level. SQL:
SELECT code FROM items AS lne WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.level = lne.level );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "code", "filter_col": "code", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04781
train
v2
Schema: customers (alias: cust)(code, salary, value, status) accounts(value, status, level, code) Task: Find name from customers where a matching record exists in accounts with the same id. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = cust.id );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "name", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04782
train
v2
Schema: items (alias: lne)(value, date, id, name) branches(value, level, name, amount) Task: Find id from items where a matching record exists in branches with the same level. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.level = lne.level );
{ "outer_table": "items", "inner_table": "branches", "outer_alias": "lne", "inner_alias": "brc", "proj_col": "id", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04783
train
v3
Schema: transactions (alias: txn)(value, date, code, name) products(date, amount, name, id) Task: Retrieve name from transactions with amount above the MIN(value) of products rows sharing the same id. SQL:
SELECT name FROM transactions AS txn WHERE amount > ( SELECT MIN(value) FROM products AS prod WHERE prod.id = txn.id );
{ "outer_table": "transactions", "inner_table": "products", "outer_alias": "txn", "inner_alias": "prod", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04784
train
v1
Schema: products (alias: prod)(id, salary, date, type) employees(status, type, id, value) Task: Select salary from products where type exists in employees for the same level. SQL:
SELECT salary FROM products AS prod WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.level = prod.level );
{ "outer_table": "products", "inner_table": "employees", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "salary", "filter_col": "type", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04785
train
v1
Schema: staff (alias: empl)(code, value, date, amount) regions(salary, status, type, value) Task: Find value from staff where id appears in regions entries with matching status. SQL:
SELECT value FROM staff AS empl WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.status = empl.status );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04786
train
v3
Schema: customers (alias: cust)(type, level, status, amount) products(level, amount, id, date) Task: Find id from customers where amount exceeds the maximum salary from products for the same level. SQL:
SELECT id FROM customers AS cust WHERE amount > ( SELECT MAX(salary) FROM products AS prod WHERE prod.level = cust.level );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04787
train
v3
Schema: regions (alias: rgn)(name, level, value, status) managers(name, salary, value, status) Task: Find id from regions where amount exceeds the total salary from managers for the same id. SQL:
SELECT id FROM regions AS rgn WHERE amount > ( SELECT SUM(salary) FROM managers AS mgr WHERE mgr.id = rgn.id );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04788
train
v2
Schema: regions (alias: rgn)(code, level, amount, id) managers(name, amount, status, value) 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", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04789
train
v3
Schema: items (alias: lne)(value, amount, type, id) staff(id, code, salary, name) Task: Find amount from items where amount exceeds the average value from staff for the same type. SQL:
SELECT amount FROM items AS lne WHERE amount > ( SELECT AVG(value) FROM staff AS empl WHERE empl.type = lne.type );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04790
train
v2
Schema: tasks (alias: tsk)(value, name, salary, status) managers(status, type, level, name) Task: Retrieve amount from tasks that have at least one corresponding entry in managers sharing the same status. SQL:
SELECT amount FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "managers", "outer_alias": "tsk", "inner_alias": "mgr", "proj_col": "amount", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04791
train
v3
Schema: invoices (alias: inv)(id, level, date, amount) projects(type, code, amount, date) Task: Retrieve id from invoices with value above the MIN(value) of projects rows sharing the same code. SQL:
SELECT id FROM invoices AS inv WHERE value > ( SELECT MIN(value) FROM projects AS prj WHERE prj.code = inv.code );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "inv", "inner_alias": "prj", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04792
train
v3
Schema: orders (alias: ord)(date, code, amount, level) projects(level, id, type, amount) Task: Retrieve salary from orders with amount above the SUM(amount) of projects rows sharing the same level. SQL:
SELECT salary FROM orders AS ord WHERE amount > ( SELECT SUM(amount) FROM projects AS prj WHERE prj.level = ord.level );
{ "outer_table": "orders", "inner_table": "projects", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04793
train
v2
Schema: accounts (alias: acct)(salary, level, id, status) orders(code, id, level, type) Task: Retrieve id from accounts that have at least one corresponding entry in orders sharing the same id. SQL:
SELECT id 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": "id", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04794
train
v2
Schema: sales (alias: sale)(date, type, value, status) departments(amount, salary, name, id) Task: Retrieve amount from sales that have at least one corresponding entry in departments sharing the same code. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.code = sale.code );
{ "outer_table": "sales", "inner_table": "departments", "outer_alias": "sale", "inner_alias": "dept", "proj_col": "amount", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04795
train
v3
Schema: managers (alias: mgr)(name, date, level, type) customers(code, status, salary, date) Task: Find amount from managers where value exceeds the average value from customers for the same code. SQL:
SELECT amount FROM managers AS mgr WHERE value > ( SELECT AVG(value) FROM customers AS cust WHERE cust.code = mgr.code );
{ "outer_table": "managers", "inner_table": "customers", "outer_alias": "mgr", "inner_alias": "cust", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04796
train
v1
Schema: employees (alias: emp)(value, status, amount, type) staff(value, name, level, salary) Task: Find salary from employees where id appears in staff entries with matching status. SQL:
SELECT salary FROM employees AS emp WHERE id IN ( SELECT id FROM staff AS empl WHERE empl.status = emp.status );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04797
train
v3
Schema: invoices (alias: inv)(id, code, level, name) customers(amount, date, id, status) Task: Retrieve amount from invoices with salary above the MAX(amount) of customers rows sharing the same type. SQL:
SELECT amount FROM invoices AS inv WHERE salary > ( SELECT MAX(amount) FROM customers AS cust WHERE cust.type = inv.type );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04798
train
v3
Schema: accounts (alias: acct)(code, amount, id, type) departments(date, code, salary, value) Task: Retrieve salary from accounts with value above the AVG(salary) of departments rows sharing the same status. SQL:
SELECT salary FROM accounts AS acct WHERE value > ( SELECT AVG(salary) FROM departments AS dept WHERE dept.status = acct.status );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04799
train