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
v2
Schema: items (alias: lne)(amount, code, date, level) invoices(level, salary, amount, id) Task: Find id from items where a matching record exists in invoices with the same type. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = lne.type );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "id", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_02500
train
v3
Schema: employees (alias: emp)(id, type, value, amount) accounts(code, name, amount, status) Task: Retrieve salary from employees with amount above the SUM(salary) of accounts rows sharing the same level. SQL:
SELECT salary FROM employees AS emp WHERE amount > ( SELECT SUM(salary) FROM accounts AS acct WHERE acct.level = emp.level );
{ "outer_table": "employees", "inner_table": "accounts", "outer_alias": "emp", "inner_alias": "acct", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02501
train
v2
Schema: departments (alias: dept)(name, status, type, id) staff(id, level, code, type) Task: Retrieve amount from departments that have at least one corresponding entry in staff sharing the same id. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = dept.id );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "amount", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02502
train
v1
Schema: projects (alias: prj)(name, level, value, amount) departments(id, amount, code, name) Task: Select value from projects where level exists in departments for the same id. SQL:
SELECT value FROM projects AS prj WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.id = prj.id );
{ "outer_table": "projects", "inner_table": "departments", "outer_alias": "prj", "inner_alias": "dept", "proj_col": "value", "filter_col": "level", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_02503
train
v3
Schema: accounts (alias: acct)(id, value, salary, level) branches(amount, code, id, level) Task: Retrieve id from accounts with amount above the MAX(salary) of branches rows sharing the same type. SQL:
SELECT id FROM accounts AS acct WHERE amount > ( SELECT MAX(salary) FROM branches AS brc WHERE brc.type = acct.type );
{ "outer_table": "accounts", "inner_table": "branches", "outer_alias": "acct", "inner_alias": "brc", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02504
train
v1
Schema: schedules (alias: schd)(salary, type, name, level) accounts(amount, value, level, code) Task: Find id from schedules where code appears in accounts entries with matching type. SQL:
SELECT id FROM schedules AS schd WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.type = schd.type );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "id", "filter_col": "code", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_02505
train
v2
Schema: transactions (alias: txn)(level, type, code, name) orders(id, name, value, level) Task: Retrieve value from transactions that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = txn.code );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "value", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02506
train
v1
Schema: customers (alias: cust)(date, value, amount, type) transactions(level, amount, status, code) Task: Select salary from customers where code exists in transactions for the same code. SQL:
SELECT salary FROM customers AS cust WHERE code IN ( SELECT code FROM transactions AS txn WHERE txn.code = cust.code );
{ "outer_table": "customers", "inner_table": "transactions", "outer_alias": "cust", "inner_alias": "txn", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02507
train
v3
Schema: transactions (alias: txn)(name, salary, id, date) sales(code, level, status, date) Task: Retrieve name from transactions with amount above the AVG(amount) of sales rows sharing the same status. SQL:
SELECT name FROM transactions AS txn WHERE amount > ( SELECT AVG(amount) FROM sales AS sale WHERE sale.status = txn.status );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02508
train
v1
Schema: branches (alias: brc)(date, amount, code, level) products(type, status, amount, date) Task: Select name from branches where type exists in products for the same id. SQL:
SELECT name FROM branches AS brc WHERE type IN ( SELECT type FROM products AS prod WHERE prod.id = brc.id );
{ "outer_table": "branches", "inner_table": "products", "outer_alias": "brc", "inner_alias": "prod", "proj_col": "name", "filter_col": "type", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_02509
train
v3
Schema: transactions (alias: txn)(level, amount, id, status) orders(code, name, id, status) Task: Retrieve id from transactions with salary above the AVG(salary) of orders rows sharing the same id. SQL:
SELECT id FROM transactions AS txn WHERE salary > ( SELECT AVG(salary) FROM orders AS ord WHERE ord.id = txn.id );
{ "outer_table": "transactions", "inner_table": "orders", "outer_alias": "txn", "inner_alias": "ord", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02510
train
v1
Schema: shipments (alias: shp)(salary, type, value, id) customers(salary, status, date, id) Task: Select amount from shipments where id exists in customers for the same status. SQL:
SELECT amount FROM shipments AS shp WHERE id IN ( SELECT id FROM customers AS cust WHERE cust.status = shp.status );
{ "outer_table": "shipments", "inner_table": "customers", "outer_alias": "shp", "inner_alias": "cust", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_02511
train
v2
Schema: accounts (alias: acct)(level, status, type, name) shipments(code, amount, value, salary) Task: Retrieve name from accounts that have at least one corresponding entry in shipments sharing the same status. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = acct.status );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "name", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02512
train
v1
Schema: departments (alias: dept)(salary, code, value, level) tasks(value, code, id, amount) Task: Retrieve value from departments whose level is found in tasks rows where status matches the outer record. SQL:
SELECT value FROM departments AS dept WHERE level IN ( SELECT level FROM tasks AS tsk WHERE tsk.status = dept.status );
{ "outer_table": "departments", "inner_table": "tasks", "outer_alias": "dept", "inner_alias": "tsk", "proj_col": "value", "filter_col": "level", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02513
train
v2
Schema: transactions (alias: txn)(code, id, status, amount) customers(id, level, date, salary) Task: Find salary from transactions where a matching record exists in customers with the same level. SQL:
SELECT salary FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = txn.level );
{ "outer_table": "transactions", "inner_table": "customers", "outer_alias": "txn", "inner_alias": "cust", "proj_col": "salary", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02514
train
v2
Schema: sales (alias: sale)(status, amount, code, level) staff(type, date, status, level) Task: Retrieve amount from sales that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT amount FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = sale.type );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "amount", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02515
train
v3
Schema: regions (alias: rgn)(level, salary, code, id) customers(status, name, date, code) Task: Retrieve value from regions with amount above the SUM(salary) of customers rows sharing the same type. SQL:
SELECT value FROM regions AS rgn WHERE amount > ( SELECT SUM(salary) FROM customers AS cust WHERE cust.type = rgn.type );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_02516
train
v3
Schema: tasks (alias: tsk)(name, date, type, salary) sales(type, code, date, amount) Task: Retrieve code from tasks with amount above the AVG(value) of sales rows sharing the same status. SQL:
SELECT code FROM tasks AS tsk WHERE amount > ( SELECT AVG(value) FROM sales AS sale WHERE sale.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "sales", "outer_alias": "tsk", "inner_alias": "sale", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_02517
train
v2
Schema: employees (alias: emp)(amount, value, level, salary) staff(amount, name, level, date) Task: Retrieve id from employees that have at least one corresponding entry in staff sharing the same code. SQL:
SELECT id FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = emp.code );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "id", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02518
train
v1
Schema: tasks (alias: tsk)(status, name, type, id) transactions(level, salary, date, status) Task: Find amount from tasks where id appears in transactions entries with matching code. SQL:
SELECT amount FROM tasks AS tsk WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "transactions", "outer_alias": "tsk", "inner_alias": "txn", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_02519
train
v3
Schema: branches (alias: brc)(name, date, type, id) sales(salary, amount, id, name) Task: Find code from branches where salary exceeds the average value from sales for the same code. SQL:
SELECT code FROM branches AS brc WHERE salary > ( SELECT AVG(value) FROM sales AS sale WHERE sale.code = brc.code );
{ "outer_table": "branches", "inner_table": "sales", "outer_alias": "brc", "inner_alias": "sale", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_02520
train
v1
Schema: schedules (alias: schd)(value, name, salary, id) employees(amount, code, value, type) Task: Select code from schedules where id exists in employees for the same type. SQL:
SELECT code FROM schedules AS schd WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.type = schd.type );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "code", "filter_col": "id", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_02521
train
v1
Schema: items (alias: lne)(id, salary, name, status) categories(amount, level, type, name) Task: Select amount from items where code exists in categories for the same id. SQL:
SELECT amount FROM items AS lne WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.id = lne.id );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "amount", "filter_col": "code", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_02522
train
v1
Schema: regions (alias: rgn)(name, value, amount, level) shipments(value, salary, amount, date) Task: Select id from regions where status exists in shipments for the same code. SQL:
SELECT id FROM regions AS rgn WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.code = rgn.code );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_02523
train
v2
Schema: orders (alias: ord)(name, id, salary, amount) accounts(name, type, id, value) Task: Retrieve code from orders that have at least one corresponding entry in accounts sharing the same code. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.code = ord.code );
{ "outer_table": "orders", "inner_table": "accounts", "outer_alias": "ord", "inner_alias": "acct", "proj_col": "code", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02524
train
v2
Schema: departments (alias: dept)(name, id, date, type) accounts(date, name, id, salary) Task: Retrieve amount from departments that have at least one corresponding entry in accounts sharing the same id. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = dept.id );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "amount", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02525
train
v2
Schema: transactions (alias: txn)(amount, status, date, name) shipments(id, level, status, date) Task: Retrieve value from transactions that have at least one corresponding entry in shipments sharing the same id. SQL:
SELECT value FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = txn.id );
{ "outer_table": "transactions", "inner_table": "shipments", "outer_alias": "txn", "inner_alias": "shp", "proj_col": "value", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02526
train
v3
Schema: customers (alias: cust)(code, date, id, status) accounts(level, salary, date, status) Task: Retrieve name from customers with amount above the SUM(value) of accounts rows sharing the same code. SQL:
SELECT name FROM customers AS cust WHERE amount > ( SELECT SUM(value) FROM accounts AS acct WHERE acct.code = cust.code );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02527
train
v2
Schema: employees (alias: emp)(code, type, date, salary) customers(id, value, amount, type) Task: Find amount from employees where a matching record exists in customers with the same type. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = emp.type );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "amount", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02528
train
v3
Schema: departments (alias: dept)(status, code, level, amount) employees(type, id, code, amount) Task: Find id from departments where salary exceeds the count of amount from employees for the same id. SQL:
SELECT id FROM departments AS dept WHERE salary > ( SELECT COUNT(amount) FROM employees AS emp WHERE emp.id = dept.id );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02529
train
v1
Schema: tasks (alias: tsk)(value, date, code, status) customers(date, type, value, salary) Task: Find name from tasks where code appears in customers entries with matching level. SQL:
SELECT name FROM tasks AS tsk WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "customers", "outer_alias": "tsk", "inner_alias": "cust", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_02530
train
v2
Schema: items (alias: lne)(id, status, name, type) orders(amount, salary, status, value) Task: Retrieve salary from items that have at least one corresponding entry in orders sharing the same id. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = lne.id );
{ "outer_table": "items", "inner_table": "orders", "outer_alias": "lne", "inner_alias": "ord", "proj_col": "salary", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_02531
train
v1
Schema: accounts (alias: acct)(date, name, code, salary) categories(type, level, name, salary) Task: Select amount from accounts where level exists in categories for the same status. SQL:
SELECT amount FROM accounts AS acct WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.status = acct.status );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02532
train
v1
Schema: schedules (alias: schd)(date, status, id, level) employees(value, date, name, status) Task: Retrieve salary from schedules whose status is found in employees rows where level matches the outer record. SQL:
SELECT salary FROM schedules AS schd WHERE status IN ( SELECT status FROM employees AS emp WHERE emp.level = schd.level );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_02533
train
v1
Schema: tasks (alias: tsk)(type, status, salary, amount) orders(id, salary, date, level) Task: Find name from tasks where code appears in orders entries with matching level. SQL:
SELECT name FROM tasks AS tsk WHERE code IN ( SELECT code FROM orders AS ord WHERE ord.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "orders", "outer_alias": "tsk", "inner_alias": "ord", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_02534
train
v2
Schema: items (alias: lne)(salary, type, code, value) categories(status, date, id, amount) Task: Retrieve id from items that have at least one corresponding entry in categories sharing the same type. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.type = lne.type );
{ "outer_table": "items", "inner_table": "categories", "outer_alias": "lne", "inner_alias": "catg", "proj_col": "id", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_02535
train
v3
Schema: departments (alias: dept)(status, salary, type, level) managers(status, amount, value, code) Task: Retrieve amount from departments with value above the MAX(amount) of managers rows sharing the same type. SQL:
SELECT amount FROM departments AS dept WHERE value > ( SELECT MAX(amount) FROM managers AS mgr WHERE mgr.type = dept.type );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02536
train
v2
Schema: staff (alias: empl)(date, status, level, type) sales(code, type, level, value) Task: Find name from staff where a matching record exists in sales with the same level. SQL:
SELECT name FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = empl.level );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "name", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_02537
train
v2
Schema: sales (alias: sale)(amount, level, date, salary) employees(status, type, name, code) Task: Retrieve code from sales that have at least one corresponding entry in employees sharing the same code. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = sale.code );
{ "outer_table": "sales", "inner_table": "employees", "outer_alias": "sale", "inner_alias": "emp", "proj_col": "code", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02538
train
v2
Schema: branches (alias: brc)(value, salary, level, type) invoices(status, id, salary, value) Task: Retrieve id from branches that have at least one corresponding entry in invoices sharing the same code. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = brc.code );
{ "outer_table": "branches", "inner_table": "invoices", "outer_alias": "brc", "inner_alias": "inv", "proj_col": "id", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_02539
train
v3
Schema: employees (alias: emp)(code, value, level, date) items(name, amount, id, code) Task: Find salary from employees where salary exceeds the maximum salary from items for the same type. SQL:
SELECT salary FROM employees AS emp WHERE salary > ( SELECT MAX(salary) FROM items AS lne WHERE lne.type = emp.type );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02540
train
v1
Schema: shipments (alias: shp)(value, salary, date, type) departments(value, date, salary, code) Task: Find salary from shipments where code appears in departments entries with matching status. SQL:
SELECT salary FROM shipments AS shp WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.status = shp.status );
{ "outer_table": "shipments", "inner_table": "departments", "outer_alias": "shp", "inner_alias": "dept", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_02541
train
v3
Schema: sales (alias: sale)(value, date, salary, status) customers(salary, value, amount, level) Task: Retrieve salary from sales with value above the MIN(salary) of customers rows sharing the same type. SQL:
SELECT salary FROM sales AS sale WHERE value > ( SELECT MIN(salary) FROM customers AS cust WHERE cust.type = sale.type );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02542
train
v2
Schema: accounts (alias: acct)(value, id, amount, type) sales(level, amount, id, code) Task: Retrieve code from accounts that have at least one corresponding entry in sales sharing the same level. SQL:
SELECT code FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = acct.level );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "code", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02543
train
v3
Schema: employees (alias: emp)(code, id, type, level) invoices(status, level, name, code) Task: Find code from employees where value exceeds the average amount from invoices for the same status. SQL:
SELECT code FROM employees AS emp WHERE value > ( SELECT AVG(amount) FROM invoices AS inv WHERE inv.status = emp.status );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02544
train
v3
Schema: tasks (alias: tsk)(id, code, date, status) transactions(name, code, status, value) Task: Find name from tasks where amount exceeds the average value from transactions for the same id. SQL:
SELECT name FROM tasks AS tsk WHERE amount > ( SELECT AVG(value) FROM transactions AS txn WHERE txn.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "transactions", "outer_alias": "tsk", "inner_alias": "txn", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_02545
train
v3
Schema: categories (alias: catg)(level, status, date, code) employees(status, amount, level, type) Task: Retrieve salary from categories with amount above the SUM(amount) of employees rows sharing the same type. SQL:
SELECT salary FROM categories AS catg WHERE amount > ( SELECT SUM(amount) FROM employees AS emp WHERE emp.type = catg.type );
{ "outer_table": "categories", "inner_table": "employees", "outer_alias": "catg", "inner_alias": "emp", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_02546
train
v3
Schema: orders (alias: ord)(amount, salary, id, value) projects(level, name, date, salary) Task: Retrieve salary from orders with amount above the AVG(amount) of projects rows sharing the same status. SQL:
SELECT salary FROM orders AS ord WHERE amount > ( SELECT AVG(amount) FROM projects AS prj WHERE prj.status = ord.status );
{ "outer_table": "orders", "inner_table": "projects", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02547
train
v1
Schema: accounts (alias: acct)(id, salary, date, value) orders(salary, level, value, code) Task: Select salary from accounts where id exists in orders for the same id. SQL:
SELECT salary FROM accounts AS acct WHERE id IN ( SELECT id FROM orders AS ord WHERE ord.id = acct.id );
{ "outer_table": "accounts", "inner_table": "orders", "outer_alias": "acct", "inner_alias": "ord", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02548
train
v3
Schema: branches (alias: brc)(status, salary, type, date) customers(id, code, status, level) Task: Retrieve salary from branches with value above the AVG(value) of customers rows sharing the same id. SQL:
SELECT salary FROM branches AS brc WHERE value > ( SELECT AVG(value) FROM customers AS cust WHERE cust.id = brc.id );
{ "outer_table": "branches", "inner_table": "customers", "outer_alias": "brc", "inner_alias": "cust", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_02549
train
v3
Schema: products (alias: prod)(level, date, type, salary) items(status, level, salary, code) Task: Find amount from products where amount exceeds the count of salary from items for the same type. SQL:
SELECT amount FROM products AS prod WHERE amount > ( SELECT COUNT(salary) FROM items AS lne WHERE lne.type = prod.type );
{ "outer_table": "products", "inner_table": "items", "outer_alias": "prod", "inner_alias": "lne", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02550
train
v2
Schema: accounts (alias: acct)(salary, id, amount, name) employees(id, name, status, type) Task: Find name from accounts where a matching record exists in employees with the same status. SQL:
SELECT name FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = acct.status );
{ "outer_table": "accounts", "inner_table": "employees", "outer_alias": "acct", "inner_alias": "emp", "proj_col": "name", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02551
train
v2
Schema: shipments (alias: shp)(name, id, level, salary) accounts(salary, value, id, date) Task: Find code from shipments where a matching record exists in accounts with the same status. SQL:
SELECT code FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = shp.status );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "code", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_02552
train
v3
Schema: accounts (alias: acct)(id, name, amount, salary) tasks(date, value, code, status) Task: Retrieve value from accounts with salary above the SUM(salary) of tasks rows sharing the same code. SQL:
SELECT value FROM accounts AS acct WHERE salary > ( SELECT SUM(salary) FROM tasks AS tsk WHERE tsk.code = acct.code );
{ "outer_table": "accounts", "inner_table": "tasks", "outer_alias": "acct", "inner_alias": "tsk", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02553
train
v3
Schema: orders (alias: ord)(date, id, type, value) items(code, id, date, type) Task: Find value from orders where value exceeds the minimum amount from items for the same level. SQL:
SELECT value FROM orders AS ord WHERE value > ( SELECT MIN(amount) FROM items AS lne WHERE lne.level = ord.level );
{ "outer_table": "orders", "inner_table": "items", "outer_alias": "ord", "inner_alias": "lne", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02554
train
v1
Schema: transactions (alias: txn)(code, value, level, salary) managers(amount, salary, code, level) Task: Retrieve amount from transactions whose level is found in managers rows where status matches the outer record. SQL:
SELECT amount FROM transactions AS txn WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.status = txn.status );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "level", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02555
train
v1
Schema: shipments (alias: shp)(level, type, code, name) transactions(salary, date, status, id) Task: Select value from shipments where id exists in transactions for the same id. SQL:
SELECT value FROM shipments AS shp WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.id = shp.id );
{ "outer_table": "shipments", "inner_table": "transactions", "outer_alias": "shp", "inner_alias": "txn", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_02556
train
v2
Schema: schedules (alias: schd)(type, status, id, code) projects(level, salary, code, status) Task: Retrieve value from schedules that have at least one corresponding entry in projects sharing the same code. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.code = schd.code );
{ "outer_table": "schedules", "inner_table": "projects", "outer_alias": "schd", "inner_alias": "prj", "proj_col": "value", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_02557
train
v2
Schema: staff (alias: empl)(level, date, value, status) requests(id, amount, type, status) Task: Find salary from staff where a matching record exists in requests with the same id. SQL:
SELECT salary FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = empl.id );
{ "outer_table": "staff", "inner_table": "requests", "outer_alias": "empl", "inner_alias": "ordr", "proj_col": "salary", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_02558
train
v1
Schema: schedules (alias: schd)(amount, status, salary, code) departments(name, type, amount, date) Task: Select code from schedules where type exists in departments for the same id. SQL:
SELECT code FROM schedules AS schd WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.id = schd.id );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "code", "filter_col": "type", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_02559
train
v3
Schema: transactions (alias: txn)(salary, level, code, amount) managers(name, id, status, amount) Task: Find salary from transactions where amount exceeds the minimum salary from managers for the same code. SQL:
SELECT salary FROM transactions AS txn WHERE amount > ( SELECT MIN(salary) FROM managers AS mgr WHERE mgr.code = txn.code );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02560
train
v2
Schema: projects (alias: prj)(name, level, id, code) items(level, salary, amount, status) Task: Find value from projects where a matching record exists in items with the same code. SQL:
SELECT value FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = prj.code );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "lne", "proj_col": "value", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_02561
train
v2
Schema: items (alias: lne)(code, type, level, salary) accounts(code, level, type, salary) Task: Find name from items where a matching record exists in accounts with the same id. SQL:
SELECT name FROM items AS lne WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = lne.id );
{ "outer_table": "items", "inner_table": "accounts", "outer_alias": "lne", "inner_alias": "acct", "proj_col": "name", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_02562
train
v2
Schema: sales (alias: sale)(date, type, salary, name) managers(type, name, date, id) Task: Retrieve salary from sales that have at least one corresponding entry in managers sharing the same type. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = sale.type );
{ "outer_table": "sales", "inner_table": "managers", "outer_alias": "sale", "inner_alias": "mgr", "proj_col": "salary", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02563
train
v3
Schema: regions (alias: rgn)(status, type, value, name) products(level, amount, value, code) Task: Retrieve id from regions with value above the MAX(value) of products rows sharing the same level. SQL:
SELECT id FROM regions AS rgn WHERE value > ( SELECT MAX(value) FROM products AS prod WHERE prod.level = rgn.level );
{ "outer_table": "regions", "inner_table": "products", "outer_alias": "rgn", "inner_alias": "prod", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_02564
train
v2
Schema: regions (alias: rgn)(salary, value, amount, type) managers(amount, type, code, name) Task: Retrieve code from regions that have at least one corresponding entry in managers sharing the same id. SQL:
SELECT code 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": "code", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_02565
train
v3
Schema: categories (alias: catg)(type, level, salary, name) departments(status, type, code, salary) Task: Find amount from categories where salary exceeds the total amount from departments for the same level. SQL:
SELECT amount FROM categories AS catg WHERE salary > ( SELECT SUM(amount) FROM departments AS dept WHERE dept.level = catg.level );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_02566
train
v1
Schema: orders (alias: ord)(salary, value, date, name) categories(code, salary, name, status) Task: Select name from orders where code exists in categories for the same code. SQL:
SELECT name FROM orders AS ord WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.code = ord.code );
{ "outer_table": "orders", "inner_table": "categories", "outer_alias": "ord", "inner_alias": "catg", "proj_col": "name", "filter_col": "code", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02567
train
v2
Schema: orders (alias: ord)(code, type, salary, status) employees(value, date, id, salary) Task: Retrieve value from orders that have at least one corresponding entry in employees sharing the same status. SQL:
SELECT value FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.status = ord.status );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "value", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02568
train
v1
Schema: projects (alias: prj)(level, status, name, amount) staff(value, date, code, level) Task: Select value from projects where level exists in staff for the same code. SQL:
SELECT value FROM projects AS prj WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.code = prj.code );
{ "outer_table": "projects", "inner_table": "staff", "outer_alias": "prj", "inner_alias": "empl", "proj_col": "value", "filter_col": "level", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_02569
train
v2
Schema: requests (alias: ordr)(code, salary, name, date) regions(code, name, level, date) Task: Retrieve code from requests that have at least one corresponding entry in regions sharing the same status. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = ordr.status );
{ "outer_table": "requests", "inner_table": "regions", "outer_alias": "ordr", "inner_alias": "rgn", "proj_col": "code", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_02570
train
v1
Schema: sales (alias: sale)(type, date, status, amount) shipments(id, value, salary, date) Task: Select name from sales where status exists in shipments for the same code. SQL:
SELECT name FROM sales AS sale WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.code = sale.code );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02571
train
v3
Schema: shipments (alias: shp)(amount, level, name, status) managers(level, code, type, amount) Task: Retrieve name from shipments with amount above the AVG(value) of managers rows sharing the same id. SQL:
SELECT name FROM shipments AS shp WHERE amount > ( SELECT AVG(value) FROM managers AS mgr WHERE mgr.id = shp.id );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_02572
train
v2
Schema: products (alias: prod)(name, date, level, code) tasks(level, status, salary, date) Task: Retrieve salary from products that have at least one corresponding entry in tasks sharing the same id. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.id = prod.id );
{ "outer_table": "products", "inner_table": "tasks", "outer_alias": "prod", "inner_alias": "tsk", "proj_col": "salary", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02573
train
v1
Schema: schedules (alias: schd)(level, name, amount, code) accounts(code, level, amount, type) Task: Find amount from schedules where level appears in accounts entries with matching level. SQL:
SELECT amount FROM schedules AS schd WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.level = schd.level );
{ "outer_table": "schedules", "inner_table": "accounts", "outer_alias": "schd", "inner_alias": "acct", "proj_col": "amount", "filter_col": "level", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_02574
train
v1
Schema: shipments (alias: shp)(id, status, salary, value) items(id, salary, name, date) Task: Find id from shipments where code appears in items entries with matching type. SQL:
SELECT id FROM shipments AS shp WHERE code IN ( SELECT code FROM items AS lne WHERE lne.type = shp.type );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "id", "filter_col": "code", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_02575
train
v3
Schema: employees (alias: emp)(salary, name, status, amount) requests(value, code, type, status) Task: Retrieve value from employees with salary above the COUNT(amount) of requests rows sharing the same type. SQL:
SELECT value FROM employees AS emp WHERE salary > ( SELECT COUNT(amount) FROM requests AS ordr WHERE ordr.type = emp.type );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02576
train
v1
Schema: shipments (alias: shp)(value, level, type, name) requests(amount, date, salary, id) Task: Retrieve salary from shipments whose status is found in requests rows where status matches the outer record. SQL:
SELECT salary FROM shipments AS shp WHERE status IN ( SELECT status FROM requests AS ordr WHERE ordr.status = shp.status );
{ "outer_table": "shipments", "inner_table": "requests", "outer_alias": "shp", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_02577
train
v3
Schema: staff (alias: empl)(code, type, name, value) employees(code, date, status, level) Task: Retrieve id from staff with amount above the COUNT(amount) of employees rows sharing the same type. SQL:
SELECT id FROM staff AS empl WHERE amount > ( SELECT COUNT(amount) FROM employees AS emp WHERE emp.type = empl.type );
{ "outer_table": "staff", "inner_table": "employees", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_02578
train
v2
Schema: categories (alias: catg)(name, value, amount, status) regions(status, id, date, code) Task: Retrieve id from categories that have at least one corresponding entry in regions sharing the same type. SQL:
SELECT id FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.type = catg.type );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "id", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_02579
train
v2
Schema: managers (alias: mgr)(salary, date, amount, value) tasks(code, type, date, level) Task: Retrieve value from managers that have at least one corresponding entry in tasks sharing the same code. SQL:
SELECT value FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.code = mgr.code );
{ "outer_table": "managers", "inner_table": "tasks", "outer_alias": "mgr", "inner_alias": "tsk", "proj_col": "value", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02580
train
v1
Schema: regions (alias: rgn)(id, name, level, code) customers(amount, date, level, id) Task: Select amount from regions where code exists in customers for the same level. SQL:
SELECT amount FROM regions AS rgn WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.level = rgn.level );
{ "outer_table": "regions", "inner_table": "customers", "outer_alias": "rgn", "inner_alias": "cust", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_02581
train
v1
Schema: accounts (alias: acct)(date, status, name, salary) customers(date, id, code, amount) Task: Select name from accounts where level exists in customers for the same code. SQL:
SELECT name FROM accounts AS acct WHERE level IN ( SELECT level FROM customers AS cust WHERE cust.code = acct.code );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "name", "filter_col": "level", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02582
train
v1
Schema: departments (alias: dept)(value, code, type, salary) products(type, salary, id, level) Task: Select value from departments where id exists in products for the same type. SQL:
SELECT value FROM departments AS dept WHERE id IN ( SELECT id FROM products AS prod WHERE prod.type = dept.type );
{ "outer_table": "departments", "inner_table": "products", "outer_alias": "dept", "inner_alias": "prod", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02583
train
v1
Schema: categories (alias: catg)(level, type, value, status) branches(code, date, amount, id) Task: Find amount from categories where status appears in branches entries with matching id. SQL:
SELECT amount FROM categories AS catg WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.id = catg.id );
{ "outer_table": "categories", "inner_table": "branches", "outer_alias": "catg", "inner_alias": "brc", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_02584
train
v3
Schema: sales (alias: sale)(name, value, type, date) orders(name, level, value, code) Task: Find id from sales where amount exceeds the maximum salary from orders for the same level. SQL:
SELECT id FROM sales AS sale WHERE amount > ( SELECT MAX(salary) FROM orders AS ord WHERE ord.level = sale.level );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02585
train
v3
Schema: managers (alias: mgr)(id, type, amount, value) shipments(name, code, date, type) Task: Find name from managers where salary exceeds the maximum amount from shipments for the same type. SQL:
SELECT name FROM managers AS mgr WHERE salary > ( SELECT MAX(amount) FROM shipments AS shp WHERE shp.type = mgr.type );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02586
train
v2
Schema: branches (alias: brc)(level, date, id, value) products(status, code, level, salary) Task: Retrieve salary from branches that have at least one corresponding entry in products sharing the same type. SQL:
SELECT salary FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = brc.type );
{ "outer_table": "branches", "inner_table": "products", "outer_alias": "brc", "inner_alias": "prod", "proj_col": "salary", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_02587
train
v3
Schema: accounts (alias: acct)(code, type, amount, value) regions(id, level, status, code) Task: Find salary from accounts where value exceeds the average value from regions for the same status. SQL:
SELECT salary FROM accounts AS acct WHERE value > ( SELECT AVG(value) FROM regions AS rgn WHERE rgn.status = acct.status );
{ "outer_table": "accounts", "inner_table": "regions", "outer_alias": "acct", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02588
train
v3
Schema: schedules (alias: schd)(level, date, salary, status) departments(value, id, code, date) Task: Retrieve id from schedules with salary above the AVG(value) of departments rows sharing the same level. SQL:
SELECT id FROM schedules AS schd WHERE salary > ( SELECT AVG(value) FROM departments AS dept WHERE dept.level = schd.level );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_02589
train
v3
Schema: projects (alias: prj)(salary, type, date, code) tasks(date, value, amount, id) Task: Find amount from projects where salary exceeds the total amount from tasks for the same status. SQL:
SELECT amount FROM projects AS prj WHERE salary > ( SELECT SUM(amount) FROM tasks AS tsk WHERE tsk.status = prj.status );
{ "outer_table": "projects", "inner_table": "tasks", "outer_alias": "prj", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_02590
train
v2
Schema: requests (alias: ordr)(salary, name, code, level) sales(salary, id, status, value) Task: Find code from requests where a matching record exists in sales with the same id. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = ordr.id );
{ "outer_table": "requests", "inner_table": "sales", "outer_alias": "ordr", "inner_alias": "sale", "proj_col": "code", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_02591
train
v2
Schema: staff (alias: empl)(code, value, level, salary) items(status, code, name, date) Task: Find amount from staff where a matching record exists in items with the same code. SQL:
SELECT amount 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": "amount", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_02592
train
v3
Schema: tasks (alias: tsk)(status, code, name, amount) employees(code, id, level, name) Task: Retrieve amount from tasks with value above the MIN(amount) of employees rows sharing the same type. SQL:
SELECT amount FROM tasks AS tsk WHERE value > ( SELECT MIN(amount) FROM employees AS emp WHERE emp.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "employees", "outer_alias": "tsk", "inner_alias": "emp", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_02593
train
v3
Schema: categories (alias: catg)(value, status, date, name) transactions(salary, type, amount, level) Task: Retrieve amount from categories with amount above the MAX(value) of transactions rows sharing the same status. SQL:
SELECT amount FROM categories AS catg WHERE amount > ( SELECT MAX(value) FROM transactions AS txn WHERE txn.status = catg.status );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_02594
train
v3
Schema: requests (alias: ordr)(date, amount, id, status) products(code, salary, status, value) Task: Retrieve code from requests with value above the MAX(amount) of products rows sharing the same code. SQL:
SELECT code FROM requests AS ordr WHERE value > ( SELECT MAX(amount) FROM products AS prod WHERE prod.code = ordr.code );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_02595
train
v3
Schema: categories (alias: catg)(level, type, name, id) accounts(level, id, amount, status) Task: Find name from categories where salary exceeds the maximum salary from accounts for the same level. SQL:
SELECT name FROM categories AS catg WHERE salary > ( SELECT MAX(salary) FROM accounts AS acct WHERE acct.level = catg.level );
{ "outer_table": "categories", "inner_table": "accounts", "outer_alias": "catg", "inner_alias": "acct", "proj_col": "name", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_02596
train
v3
Schema: items (alias: lne)(status, value, date, name) products(value, salary, type, code) Task: Find code from items where amount exceeds the average amount from products for the same level. SQL:
SELECT code FROM items AS lne WHERE amount > ( SELECT AVG(amount) FROM products AS prod WHERE prod.level = lne.level );
{ "outer_table": "items", "inner_table": "products", "outer_alias": "lne", "inner_alias": "prod", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_02597
train
v2
Schema: transactions (alias: txn)(amount, name, type, status) tasks(salary, id, level, type) Task: Find name from transactions where a matching record exists in tasks with the same id. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.id = txn.id );
{ "outer_table": "transactions", "inner_table": "tasks", "outer_alias": "txn", "inner_alias": "tsk", "proj_col": "name", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02598
train
v1
Schema: sales (alias: sale)(level, salary, status, id) products(id, name, amount, level) Task: Find code from sales where type appears in products entries with matching level. SQL:
SELECT code FROM sales AS sale WHERE type IN ( SELECT type FROM products AS prod WHERE prod.level = sale.level );
{ "outer_table": "sales", "inner_table": "products", "outer_alias": "sale", "inner_alias": "prod", "proj_col": "code", "filter_col": "type", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_02599
train