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: branches (alias: brc)(name, value, status, salary) accounts(type, amount, id, value) Task: Find amount from branches where a matching record exists in accounts with the same type. SQL:
SELECT amount FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = brc.type );
{ "outer_table": "branches", "inner_table": "accounts", "outer_alias": "brc", "inner_alias": "acct", "proj_col": "amount", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_10400
train
v3
Schema: branches (alias: brc)(id, value, status, code) projects(salary, value, type, code) Task: Find code from branches where amount exceeds the minimum amount from projects for the same code. SQL:
SELECT code FROM branches AS brc WHERE amount > ( SELECT MIN(amount) FROM projects AS prj WHERE prj.code = brc.code );
{ "outer_table": "branches", "inner_table": "projects", "outer_alias": "brc", "inner_alias": "prj", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_10401
train
v2
Schema: projects (alias: prj)(name, status, id, type) sales(id, status, date, name) Task: Find value from projects where a matching record exists in sales with the same type. SQL:
SELECT value FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = prj.type );
{ "outer_table": "projects", "inner_table": "sales", "outer_alias": "prj", "inner_alias": "sale", "proj_col": "value", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_10402
train
v1
Schema: products (alias: prod)(value, type, name, code) transactions(amount, value, code, type) Task: Select salary from products where level exists in transactions for the same id. SQL:
SELECT salary FROM products AS prod WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.id = prod.id );
{ "outer_table": "products", "inner_table": "transactions", "outer_alias": "prod", "inner_alias": "txn", "proj_col": "salary", "filter_col": "level", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10403
train
v3
Schema: employees (alias: emp)(value, code, name, id) projects(id, type, status, date) Task: Find name from employees where salary exceeds the minimum amount from projects for the same code. SQL:
SELECT name FROM employees AS emp WHERE salary > ( SELECT MIN(amount) FROM projects AS prj WHERE prj.code = emp.code );
{ "outer_table": "employees", "inner_table": "projects", "outer_alias": "emp", "inner_alias": "prj", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10404
train
v2
Schema: orders (alias: ord)(code, type, salary, date) staff(amount, level, date, status) Task: Retrieve salary from orders that have at least one corresponding entry in staff sharing the same id. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.id = ord.id );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "salary", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10405
train
v3
Schema: orders (alias: ord)(level, id, value, type) sales(status, amount, salary, id) Task: Retrieve amount from orders with salary above the COUNT(value) of sales rows sharing the same type. SQL:
SELECT amount FROM orders AS ord WHERE salary > ( SELECT COUNT(value) FROM sales AS sale WHERE sale.type = ord.type );
{ "outer_table": "orders", "inner_table": "sales", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10406
train
v2
Schema: shipments (alias: shp)(name, level, date, amount) schedules(name, code, id, date) Task: Retrieve name from shipments that have at least one corresponding entry in schedules sharing the same status. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.status = shp.status );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "name", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_10407
train
v2
Schema: regions (alias: rgn)(type, name, code, value) projects(level, date, salary, type) Task: Retrieve name from regions that have at least one corresponding entry in projects sharing the same type. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = rgn.type );
{ "outer_table": "regions", "inner_table": "projects", "outer_alias": "rgn", "inner_alias": "prj", "proj_col": "name", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_10408
train
v1
Schema: invoices (alias: inv)(salary, id, level, status) departments(id, salary, status, level) Task: Select amount from invoices where status exists in departments for the same id. SQL:
SELECT amount FROM invoices AS inv WHERE status IN ( SELECT status FROM departments AS dept WHERE dept.id = inv.id );
{ "outer_table": "invoices", "inner_table": "departments", "outer_alias": "inv", "inner_alias": "dept", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10409
train
v2
Schema: accounts (alias: acct)(name, salary, status, id) customers(amount, type, salary, level) Task: Find id from accounts where a matching record exists in customers with the same code. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.code = acct.code );
{ "outer_table": "accounts", "inner_table": "customers", "outer_alias": "acct", "inner_alias": "cust", "proj_col": "id", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10410
train
v2
Schema: managers (alias: mgr)(code, amount, date, level) products(type, code, id, level) Task: Find name from managers where a matching record exists in products with the same code. SQL:
SELECT name FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = mgr.code );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "name", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10411
train
v2
Schema: departments (alias: dept)(type, code, amount, date) items(salary, amount, name, type) Task: Find value from departments where a matching record exists in items with the same id. SQL:
SELECT value FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.id = dept.id );
{ "outer_table": "departments", "inner_table": "items", "outer_alias": "dept", "inner_alias": "lne", "proj_col": "value", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10412
train
v1
Schema: staff (alias: empl)(date, name, salary, value) projects(date, id, status, code) Task: Find value from staff where level appears in projects entries with matching level. SQL:
SELECT value FROM staff AS empl WHERE level IN ( SELECT level FROM projects AS prj WHERE prj.level = empl.level );
{ "outer_table": "staff", "inner_table": "projects", "outer_alias": "empl", "inner_alias": "prj", "proj_col": "value", "filter_col": "level", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_10413
train
v1
Schema: products (alias: prod)(amount, id, date, status) sales(name, date, type, salary) Task: Find amount from products where code appears in sales entries with matching type. SQL:
SELECT amount FROM products AS prod WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.type = prod.type );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10414
train
v2
Schema: tasks (alias: tsk)(type, salary, name, id) regions(code, status, date, type) Task: Retrieve code from tasks that have at least one corresponding entry in regions sharing the same status. SQL:
SELECT code FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "regions", "outer_alias": "tsk", "inner_alias": "rgn", "proj_col": "code", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_10415
train
v3
Schema: transactions (alias: txn)(value, level, code, salary) departments(status, id, salary, level) Task: Find value from transactions where value exceeds the total amount from departments for the same code. SQL:
SELECT value FROM transactions AS txn WHERE value > ( SELECT SUM(amount) FROM departments AS dept WHERE dept.code = txn.code );
{ "outer_table": "transactions", "inner_table": "departments", "outer_alias": "txn", "inner_alias": "dept", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10416
train
v3
Schema: products (alias: prod)(value, code, type, amount) staff(level, salary, amount, status) Task: Retrieve value from products with salary above the MAX(value) of staff rows sharing the same level. SQL:
SELECT value FROM products AS prod WHERE salary > ( SELECT MAX(value) FROM staff AS empl WHERE empl.level = prod.level );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10417
train
v1
Schema: shipments (alias: shp)(code, date, amount, value) staff(level, status, value, id) Task: Retrieve name from shipments whose level is found in staff rows where type matches the outer record. SQL:
SELECT name FROM shipments AS shp WHERE level IN ( SELECT level FROM staff AS empl WHERE empl.type = shp.type );
{ "outer_table": "shipments", "inner_table": "staff", "outer_alias": "shp", "inner_alias": "empl", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "shp.type", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_10418
train
v2
Schema: accounts (alias: acct)(name, value, level, date) sales(salary, code, level, id) Task: Retrieve amount from accounts that have at least one corresponding entry in sales sharing the same status. SQL:
SELECT amount FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = acct.status );
{ "outer_table": "accounts", "inner_table": "sales", "outer_alias": "acct", "inner_alias": "sale", "proj_col": "amount", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10419
train
v3
Schema: products (alias: prod)(status, name, level, date) tasks(type, name, level, value) Task: Retrieve id from products with amount above the MIN(salary) of tasks rows sharing the same type. SQL:
SELECT id FROM products AS prod WHERE amount > ( SELECT MIN(salary) FROM tasks AS tsk WHERE tsk.type = prod.type );
{ "outer_table": "products", "inner_table": "tasks", "outer_alias": "prod", "inner_alias": "tsk", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10420
train
v2
Schema: managers (alias: mgr)(id, value, salary, code) tasks(code, date, level, salary) Task: Find id from managers where a matching record exists in tasks with the same code. SQL:
SELECT id 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": "id", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10421
train
v3
Schema: projects (alias: prj)(id, type, amount, code) invoices(code, level, value, name) Task: Retrieve amount from projects with value above the AVG(value) of invoices rows sharing the same status. SQL:
SELECT amount FROM projects AS prj WHERE value > ( SELECT AVG(value) FROM invoices AS inv WHERE inv.status = prj.status );
{ "outer_table": "projects", "inner_table": "invoices", "outer_alias": "prj", "inner_alias": "inv", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_10422
train
v3
Schema: schedules (alias: schd)(name, date, amount, code) branches(date, value, id, name) Task: Find salary from schedules where salary exceeds the average value from branches for the same code. SQL:
SELECT salary FROM schedules AS schd WHERE salary > ( SELECT AVG(value) FROM branches AS brc WHERE brc.code = schd.code );
{ "outer_table": "schedules", "inner_table": "branches", "outer_alias": "schd", "inner_alias": "brc", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10423
train
v3
Schema: invoices (alias: inv)(amount, code, status, name) accounts(status, salary, type, code) Task: Find id from invoices where amount exceeds the total amount from accounts for the same id. SQL:
SELECT id FROM invoices AS inv WHERE amount > ( SELECT SUM(amount) FROM accounts AS acct WHERE acct.id = inv.id );
{ "outer_table": "invoices", "inner_table": "accounts", "outer_alias": "inv", "inner_alias": "acct", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10424
train
v3
Schema: sales (alias: sale)(amount, type, date, value) shipments(salary, code, amount, id) Task: Find amount from sales where amount exceeds the minimum value from shipments for the same status. SQL:
SELECT amount FROM sales AS sale WHERE amount > ( SELECT MIN(value) FROM shipments AS shp WHERE shp.status = sale.status );
{ "outer_table": "sales", "inner_table": "shipments", "outer_alias": "sale", "inner_alias": "shp", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10425
train
v2
Schema: products (alias: prod)(value, type, name, date) accounts(id, date, amount, salary) Task: Retrieve code from products that have at least one corresponding entry in accounts sharing the same status. SQL:
SELECT code FROM products AS prod WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.status = prod.status );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "code", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10426
train
v2
Schema: customers (alias: cust)(code, level, type, name) items(id, name, level, amount) Task: Find id from customers where a matching record exists in items with the same status. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = cust.status );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "id", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10427
train
v3
Schema: sales (alias: sale)(salary, level, name, value) requests(amount, level, status, date) Task: Retrieve salary from sales with value above the COUNT(value) of requests rows sharing the same id. SQL:
SELECT salary FROM sales AS sale WHERE value > ( SELECT COUNT(value) FROM requests AS ordr WHERE ordr.id = sale.id );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10428
train
v2
Schema: customers (alias: cust)(amount, type, code, date) branches(level, name, salary, status) Task: Find name from customers where a matching record exists in branches with the same level. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.level = cust.level );
{ "outer_table": "customers", "inner_table": "branches", "outer_alias": "cust", "inner_alias": "brc", "proj_col": "name", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10429
train
v2
Schema: items (alias: lne)(type, name, id, amount) staff(level, amount, id, type) Task: Retrieve id from items that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = lne.status );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "id", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_10430
train
v2
Schema: employees (alias: emp)(amount, level, type, date) requests(status, value, id, type) Task: Find amount from employees where a matching record exists in requests with the same type. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = emp.type );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "amount", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10431
train
v1
Schema: tasks (alias: tsk)(date, id, status, salary) regions(salary, name, status, level) Task: Select salary from tasks where code exists in regions for the same code. SQL:
SELECT salary FROM tasks AS tsk WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "regions", "outer_alias": "tsk", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_10432
train
v2
Schema: projects (alias: prj)(salary, type, level, code) categories(id, salary, code, level) Task: Retrieve value from projects that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT value FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = prj.code );
{ "outer_table": "projects", "inner_table": "categories", "outer_alias": "prj", "inner_alias": "catg", "proj_col": "value", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_10433
train
v2
Schema: employees (alias: emp)(type, name, code, id) branches(type, code, salary, id) Task: Retrieve name from employees that have at least one corresponding entry in branches sharing the same type. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.type = emp.type );
{ "outer_table": "employees", "inner_table": "branches", "outer_alias": "emp", "inner_alias": "brc", "proj_col": "name", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10434
train
v2
Schema: orders (alias: ord)(amount, date, type, value) employees(id, code, name, level) Task: Find name from orders where a matching record exists in employees with the same status. SQL:
SELECT name 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": "name", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10435
train
v1
Schema: departments (alias: dept)(id, value, amount, type) accounts(status, level, code, value) Task: Retrieve salary from departments whose type is found in accounts rows where code matches the outer record. SQL:
SELECT salary FROM departments AS dept WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.code = dept.code );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "salary", "filter_col": "type", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10436
train
v3
Schema: branches (alias: brc)(name, id, type, value) tasks(level, salary, amount, id) Task: Find id from branches where salary exceeds the average salary from tasks for the same type. SQL:
SELECT id FROM branches AS brc WHERE salary > ( SELECT AVG(salary) FROM tasks AS tsk WHERE tsk.type = brc.type );
{ "outer_table": "branches", "inner_table": "tasks", "outer_alias": "brc", "inner_alias": "tsk", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_10437
train
v3
Schema: sales (alias: sale)(name, date, salary, amount) invoices(id, status, amount, code) Task: Retrieve value from sales with salary above the SUM(amount) of invoices rows sharing the same status. SQL:
SELECT value FROM sales AS sale WHERE salary > ( SELECT SUM(amount) FROM invoices AS inv WHERE inv.status = sale.status );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10438
train
v3
Schema: regions (alias: rgn)(date, level, salary, value) staff(status, level, code, amount) Task: Retrieve salary from regions with value above the SUM(salary) of staff rows sharing the same level. SQL:
SELECT salary FROM regions AS rgn WHERE value > ( SELECT SUM(salary) FROM staff AS empl WHERE empl.level = rgn.level );
{ "outer_table": "regions", "inner_table": "staff", "outer_alias": "rgn", "inner_alias": "empl", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_10439
train
v3
Schema: departments (alias: dept)(value, name, date, level) staff(value, name, salary, type) Task: Find amount from departments where salary exceeds the average amount from staff for the same type. SQL:
SELECT amount FROM departments AS dept WHERE salary > ( SELECT AVG(amount) FROM staff AS empl WHERE empl.type = dept.type );
{ "outer_table": "departments", "inner_table": "staff", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10440
train
v3
Schema: schedules (alias: schd)(type, code, name, amount) customers(date, type, salary, amount) Task: Retrieve name from schedules with amount above the SUM(amount) of customers rows sharing the same status. SQL:
SELECT name FROM schedules AS schd WHERE amount > ( SELECT SUM(amount) FROM customers AS cust WHERE cust.status = schd.status );
{ "outer_table": "schedules", "inner_table": "customers", "outer_alias": "schd", "inner_alias": "cust", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10441
train
v3
Schema: branches (alias: brc)(salary, status, id, date) staff(name, id, salary, type) Task: Find value from branches where amount exceeds the minimum salary from staff for the same status. SQL:
SELECT value FROM branches AS brc WHERE amount > ( SELECT MIN(salary) FROM staff AS empl WHERE empl.status = brc.status );
{ "outer_table": "branches", "inner_table": "staff", "outer_alias": "brc", "inner_alias": "empl", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_10442
train
v2
Schema: branches (alias: brc)(name, level, salary, type) items(level, code, id, status) Task: Find id from branches where a matching record exists in items with the same code. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = brc.code );
{ "outer_table": "branches", "inner_table": "items", "outer_alias": "brc", "inner_alias": "lne", "proj_col": "id", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_10443
train
v2
Schema: employees (alias: emp)(status, date, salary, id) shipments(level, status, type, salary) Task: Find salary from employees where a matching record exists in shipments with the same id. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = emp.id );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "salary", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10444
train
v3
Schema: transactions (alias: txn)(amount, value, type, level) requests(type, status, id, amount) Task: Retrieve salary from transactions with amount above the MIN(salary) of requests rows sharing the same status. SQL:
SELECT salary FROM transactions AS txn WHERE amount > ( SELECT MIN(salary) FROM requests AS ordr WHERE ordr.status = txn.status );
{ "outer_table": "transactions", "inner_table": "requests", "outer_alias": "txn", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10445
train
v3
Schema: products (alias: prod)(date, amount, type, level) regions(level, name, id, salary) Task: Find name from products where value exceeds the count of salary from regions for the same code. SQL:
SELECT name FROM products AS prod WHERE value > ( SELECT COUNT(salary) FROM regions AS rgn WHERE rgn.code = prod.code );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10446
train
v2
Schema: regions (alias: rgn)(value, name, salary, date) categories(status, code, name, level) Task: Retrieve name from regions that have at least one corresponding entry in categories sharing the same id. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.id = rgn.id );
{ "outer_table": "regions", "inner_table": "categories", "outer_alias": "rgn", "inner_alias": "catg", "proj_col": "name", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_10447
train
v1
Schema: items (alias: lne)(name, amount, salary, level) sales(amount, name, status, type) Task: Retrieve value from items whose status is found in sales rows where status matches the outer record. SQL:
SELECT value FROM items AS lne WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.status = lne.status );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_10448
train
v1
Schema: invoices (alias: inv)(level, date, amount, status) regions(status, level, id, amount) Task: Select amount from invoices where type exists in regions for the same type. SQL:
SELECT amount FROM invoices AS inv WHERE type IN ( SELECT type FROM regions AS rgn WHERE rgn.type = inv.type );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10449
train
v3
Schema: requests (alias: ordr)(name, date, level, code) customers(value, type, date, status) Task: Find id from requests where value exceeds the minimum value from customers for the same type. SQL:
SELECT id FROM requests AS ordr WHERE value > ( SELECT MIN(value) FROM customers AS cust WHERE cust.type = ordr.type );
{ "outer_table": "requests", "inner_table": "customers", "outer_alias": "ordr", "inner_alias": "cust", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_10450
train
v1
Schema: tasks (alias: tsk)(id, amount, date, type) regions(date, type, amount, value) Task: Select value from tasks where id exists in regions for the same type. SQL:
SELECT value FROM tasks AS tsk WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "regions", "outer_alias": "tsk", "inner_alias": "rgn", "proj_col": "value", "filter_col": "id", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_10451
train
v2
Schema: items (alias: lne)(code, level, id, amount) managers(value, id, type, level) Task: Retrieve id from items that have at least one corresponding entry in managers sharing the same level. SQL:
SELECT id FROM items AS lne WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = lne.level );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "id", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_10452
train
v3
Schema: items (alias: lne)(name, level, id, code) employees(level, salary, code, status) Task: Retrieve id from items with amount above the COUNT(amount) of employees rows sharing the same code. SQL:
SELECT id FROM items AS lne WHERE amount > ( SELECT COUNT(amount) FROM employees AS emp WHERE emp.code = lne.code );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_10453
train
v1
Schema: orders (alias: ord)(code, value, status, name) projects(date, salary, code, level) Task: Retrieve name from orders whose status is found in projects rows where code matches the outer record. SQL:
SELECT name FROM orders AS ord WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.code = ord.code );
{ "outer_table": "orders", "inner_table": "projects", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10454
train
v1
Schema: orders (alias: ord)(id, code, type, amount) staff(code, level, id, amount) Task: Select amount from orders where type exists in staff for the same status. SQL:
SELECT amount FROM orders AS ord WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.status = ord.status );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "amount", "filter_col": "type", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10455
train
v3
Schema: employees (alias: emp)(date, amount, code, level) products(status, level, date, value) Task: Retrieve value from employees with amount above the SUM(salary) of products rows sharing the same level. SQL:
SELECT value FROM employees AS emp WHERE amount > ( SELECT SUM(salary) FROM products AS prod WHERE prod.level = emp.level );
{ "outer_table": "employees", "inner_table": "products", "outer_alias": "emp", "inner_alias": "prod", "proj_col": "value", "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_10456
train
v3
Schema: schedules (alias: schd)(level, salary, code, amount) products(value, date, id, amount) Task: Retrieve id from schedules with salary above the SUM(amount) of products rows sharing the same type. SQL:
SELECT id FROM schedules AS schd WHERE salary > ( SELECT SUM(amount) FROM products AS prod WHERE prod.type = schd.type );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10457
train
v1
Schema: departments (alias: dept)(name, salary, value, id) managers(value, salary, name, status) Task: Find value from departments where code appears in managers entries with matching type. SQL:
SELECT value FROM departments AS dept WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.type = dept.type );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10458
train
v1
Schema: branches (alias: brc)(salary, value, code, name) sales(salary, type, amount, value) Task: Find amount from branches where status appears in sales entries with matching level. SQL:
SELECT amount FROM branches AS brc WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.level = brc.level );
{ "outer_table": "branches", "inner_table": "sales", "outer_alias": "brc", "inner_alias": "sale", "proj_col": "amount", "filter_col": "status", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_10459
train
v2
Schema: schedules (alias: schd)(name, id, status, type) departments(status, amount, value, type) Task: Retrieve name from schedules that have at least one corresponding entry in departments sharing the same status. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.status = schd.status );
{ "outer_table": "schedules", "inner_table": "departments", "outer_alias": "schd", "inner_alias": "dept", "proj_col": "name", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10460
train
v2
Schema: branches (alias: brc)(value, code, amount, type) employees(type, code, level, value) Task: Retrieve code from branches that have at least one corresponding entry in employees sharing the same code. SQL:
SELECT code FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.code = brc.code );
{ "outer_table": "branches", "inner_table": "employees", "outer_alias": "brc", "inner_alias": "emp", "proj_col": "code", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_10461
train
v1
Schema: requests (alias: ordr)(date, salary, value, status) shipments(code, date, status, type) Task: Retrieve value from requests whose type is found in shipments rows where level matches the outer record. SQL:
SELECT value FROM requests AS ordr WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.level = ordr.level );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "value", "filter_col": "type", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_10462
train
v1
Schema: requests (alias: ordr)(id, status, name, salary) staff(level, date, name, amount) Task: Retrieve value from requests whose code is found in staff rows where type matches the outer record. SQL:
SELECT value FROM requests AS ordr WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.type = ordr.type );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "value", "filter_col": "code", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_10463
train
v3
Schema: products (alias: prod)(name, date, amount, code) customers(salary, type, date, id) Task: Retrieve value from products with amount above the MAX(value) of customers rows sharing the same code. SQL:
SELECT value FROM products AS prod WHERE amount > ( SELECT MAX(value) FROM customers AS cust WHERE cust.code = prod.code );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10464
train
v2
Schema: items (alias: lne)(name, date, amount, id) managers(salary, type, date, code) Task: Retrieve amount from items that have at least one corresponding entry in managers sharing the same level. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.level = lne.level );
{ "outer_table": "items", "inner_table": "managers", "outer_alias": "lne", "inner_alias": "mgr", "proj_col": "amount", "join_col": "level", "correlated_ref": "lne.level", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_10465
train
v2
Schema: employees (alias: emp)(status, amount, value, id) projects(code, type, amount, date) Task: Find salary from employees where a matching record exists in projects with the same status. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = emp.status );
{ "outer_table": "employees", "inner_table": "projects", "outer_alias": "emp", "inner_alias": "prj", "proj_col": "salary", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10466
train
v3
Schema: sales (alias: sale)(name, id, date, code) categories(date, level, type, id) Task: Find id from sales where salary exceeds the maximum amount from categories for the same id. SQL:
SELECT id FROM sales AS sale WHERE salary > ( SELECT MAX(amount) FROM categories AS catg WHERE catg.id = sale.id );
{ "outer_table": "sales", "inner_table": "categories", "outer_alias": "sale", "inner_alias": "catg", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10467
train
v3
Schema: products (alias: prod)(status, name, code, type) customers(value, amount, date, code) Task: Find code from products where value exceeds the minimum salary from customers for the same status. SQL:
SELECT code FROM products AS prod WHERE value > ( SELECT MIN(salary) FROM customers AS cust WHERE cust.status = prod.status );
{ "outer_table": "products", "inner_table": "customers", "outer_alias": "prod", "inner_alias": "cust", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10468
train
v3
Schema: shipments (alias: shp)(value, date, level, amount) sales(id, type, salary, code) Task: Retrieve salary from shipments with amount above the COUNT(value) of sales rows sharing the same code. SQL:
SELECT salary FROM shipments AS shp WHERE amount > ( SELECT COUNT(value) FROM sales AS sale WHERE sale.code = shp.code );
{ "outer_table": "shipments", "inner_table": "sales", "outer_alias": "shp", "inner_alias": "sale", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_10469
train
v3
Schema: projects (alias: prj)(id, level, date, type) accounts(status, id, value, salary) Task: Find amount from projects where salary exceeds the minimum salary from accounts for the same code. SQL:
SELECT amount FROM projects AS prj WHERE salary > ( SELECT MIN(salary) FROM accounts AS acct WHERE acct.code = prj.code );
{ "outer_table": "projects", "inner_table": "accounts", "outer_alias": "prj", "inner_alias": "acct", "proj_col": "amount", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_10470
train
v3
Schema: employees (alias: emp)(code, name, id, type) schedules(type, level, id, name) Task: Find salary from employees where amount exceeds the maximum amount from schedules for the same status. SQL:
SELECT salary FROM employees AS emp WHERE amount > ( SELECT MAX(amount) FROM schedules AS schd WHERE schd.status = emp.status );
{ "outer_table": "employees", "inner_table": "schedules", "outer_alias": "emp", "inner_alias": "schd", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10471
train
v3
Schema: shipments (alias: shp)(level, code, amount, name) employees(level, date, status, value) Task: Retrieve code from shipments with salary above the COUNT(amount) of employees rows sharing the same level. SQL:
SELECT code FROM shipments AS shp WHERE salary > ( SELECT COUNT(amount) FROM employees AS emp WHERE emp.level = shp.level );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_10472
train
v3
Schema: categories (alias: catg)(salary, id, status, name) customers(id, value, status, code) Task: Find salary from categories where amount exceeds the count of value from customers for the same type. SQL:
SELECT salary FROM categories AS catg WHERE amount > ( SELECT COUNT(value) FROM customers AS cust WHERE cust.type = catg.type );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10473
train
v1
Schema: regions (alias: rgn)(code, date, amount, level) requests(status, id, date, value) Task: Select code from regions where level exists in requests for the same id. SQL:
SELECT code FROM regions AS rgn WHERE level IN ( SELECT level FROM requests AS ordr WHERE ordr.id = rgn.id );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "code", "filter_col": "level", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_10474
train
v2
Schema: categories (alias: catg)(id, name, value, amount) departments(id, amount, name, level) Task: Find value from categories where a matching record exists in departments with the same id. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.id = catg.id );
{ "outer_table": "categories", "inner_table": "departments", "outer_alias": "catg", "inner_alias": "dept", "proj_col": "value", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_10475
train
v2
Schema: items (alias: lne)(type, salary, status, code) categories(type, salary, amount, date) 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_10476
train
v1
Schema: customers (alias: cust)(level, type, name, status) sales(amount, name, code, id) Task: Find value from customers where status appears in sales entries with matching status. SQL:
SELECT value FROM customers AS cust WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.status = cust.status );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10477
train
v2
Schema: requests (alias: ordr)(amount, date, status, name) orders(salary, amount, level, status) Task: Retrieve name from requests that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = ordr.code );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "name", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_10478
train
v2
Schema: items (alias: lne)(code, name, type, value) accounts(date, status, salary, code) Task: Retrieve code from items that have at least one corresponding entry in accounts sharing the same id. SQL:
SELECT code 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": "code", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_10479
train
v3
Schema: branches (alias: brc)(type, level, date, salary) managers(type, name, date, value) Task: Find amount from branches where salary exceeds the total value from managers for the same id. SQL:
SELECT amount FROM branches AS brc WHERE salary > ( SELECT SUM(value) FROM managers AS mgr WHERE mgr.id = brc.id );
{ "outer_table": "branches", "inner_table": "managers", "outer_alias": "brc", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_10480
train
v2
Schema: accounts (alias: acct)(id, level, code, status) tasks(code, name, type, amount) Task: Retrieve salary from accounts that have at least one corresponding entry in tasks sharing the same type. SQL:
SELECT salary FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.type = acct.type );
{ "outer_table": "accounts", "inner_table": "tasks", "outer_alias": "acct", "inner_alias": "tsk", "proj_col": "salary", "join_col": "type", "correlated_ref": "acct.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10481
train
v1
Schema: requests (alias: ordr)(salary, value, date, name) staff(code, type, date, salary) Task: Retrieve code from requests whose code is found in staff rows where id matches the outer record. SQL:
SELECT code FROM requests AS ordr WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.id = ordr.id );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_10482
train
v3
Schema: customers (alias: cust)(amount, id, type, name) products(status, type, id, value) Task: Retrieve amount from customers with value above the SUM(salary) of products rows sharing the same level. SQL:
SELECT amount FROM customers AS cust WHERE value > ( SELECT SUM(salary) FROM products AS prod WHERE prod.level = cust.level );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10483
train
v3
Schema: employees (alias: emp)(level, salary, amount, name) staff(id, date, name, amount) Task: Find value from employees where salary exceeds the maximum salary from staff for the same type. SQL:
SELECT value FROM employees AS emp WHERE salary > ( SELECT MAX(salary) FROM staff AS empl WHERE empl.type = emp.type );
{ "outer_table": "employees", "inner_table": "staff", "outer_alias": "emp", "inner_alias": "empl", "proj_col": "value", "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_10484
train
v2
Schema: regions (alias: rgn)(code, status, amount, salary) accounts(id, code, level, amount) Task: Find amount from regions where a matching record exists in accounts with the same id. SQL:
SELECT amount FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = rgn.id );
{ "outer_table": "regions", "inner_table": "accounts", "outer_alias": "rgn", "inner_alias": "acct", "proj_col": "amount", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_10485
train
v3
Schema: transactions (alias: txn)(id, date, name, type) schedules(type, name, status, salary) Task: Find value from transactions where value exceeds the count of salary from schedules for the same level. SQL:
SELECT value FROM transactions AS txn WHERE value > ( SELECT COUNT(salary) FROM schedules AS schd WHERE schd.level = txn.level );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10486
train
v2
Schema: sales (alias: sale)(code, name, status, level) tasks(name, salary, status, type) Task: Find code from sales where a matching record exists in tasks with the same status. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = sale.status );
{ "outer_table": "sales", "inner_table": "tasks", "outer_alias": "sale", "inner_alias": "tsk", "proj_col": "code", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10487
train
v1
Schema: accounts (alias: acct)(id, salary, status, code) departments(code, date, id, name) Task: Find name from accounts where code appears in departments entries with matching status. SQL:
SELECT name FROM accounts AS acct WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.status = acct.status );
{ "outer_table": "accounts", "inner_table": "departments", "outer_alias": "acct", "inner_alias": "dept", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10488
train
v1
Schema: accounts (alias: acct)(level, date, value, code) shipments(salary, name, date, type) Task: Find code from accounts where level appears in shipments entries with matching code. SQL:
SELECT code FROM accounts AS acct WHERE level IN ( SELECT level FROM shipments AS shp WHERE shp.code = acct.code );
{ "outer_table": "accounts", "inner_table": "shipments", "outer_alias": "acct", "inner_alias": "shp", "proj_col": "code", "filter_col": "level", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10489
train
v3
Schema: staff (alias: empl)(status, code, name, level) accounts(level, date, salary, status) Task: Find id from staff where amount exceeds the maximum amount from accounts for the same type. SQL:
SELECT id FROM staff AS empl WHERE amount > ( SELECT MAX(amount) FROM accounts AS acct WHERE acct.type = empl.type );
{ "outer_table": "staff", "inner_table": "accounts", "outer_alias": "empl", "inner_alias": "acct", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_10490
train
v1
Schema: sales (alias: sale)(amount, salary, type, level) accounts(amount, id, date, status) Task: Retrieve id from sales whose type is found in accounts rows where id matches the outer record. SQL:
SELECT id FROM sales AS sale WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.id = sale.id );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10491
train
v2
Schema: sales (alias: sale)(date, id, type, level) branches(type, value, amount, salary) Task: Retrieve code from sales that have at least one corresponding entry in branches sharing the same status. SQL:
SELECT code FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.status = sale.status );
{ "outer_table": "sales", "inner_table": "branches", "outer_alias": "sale", "inner_alias": "brc", "proj_col": "code", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10492
train
v3
Schema: regions (alias: rgn)(level, salary, status, date) tasks(date, value, type, salary) Task: Retrieve amount from regions with amount above the AVG(value) of tasks rows sharing the same level. SQL:
SELECT amount FROM regions AS rgn WHERE amount > ( SELECT AVG(value) FROM tasks AS tsk WHERE tsk.level = rgn.level );
{ "outer_table": "regions", "inner_table": "tasks", "outer_alias": "rgn", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_10493
train
v3
Schema: sales (alias: sale)(value, date, id, status) transactions(status, level, value, amount) Task: Find amount from sales where value exceeds the average salary from transactions for the same id. SQL:
SELECT amount FROM sales AS sale WHERE value > ( SELECT AVG(salary) FROM transactions AS txn WHERE txn.id = sale.id );
{ "outer_table": "sales", "inner_table": "transactions", "outer_alias": "sale", "inner_alias": "txn", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10494
train
v3
Schema: invoices (alias: inv)(level, date, amount, id) staff(amount, status, name, salary) Task: Find amount from invoices where value exceeds the total salary from staff for the same id. SQL:
SELECT amount FROM invoices AS inv WHERE value > ( SELECT SUM(salary) FROM staff AS empl WHERE empl.id = inv.id );
{ "outer_table": "invoices", "inner_table": "staff", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10495
train
v1
Schema: shipments (alias: shp)(salary, value, name, amount) items(code, salary, amount, name) Task: Retrieve salary from shipments whose code is found in items rows where id matches the outer record. SQL:
SELECT salary FROM shipments AS shp WHERE code IN ( SELECT code FROM items AS lne WHERE lne.id = shp.id );
{ "outer_table": "shipments", "inner_table": "items", "outer_alias": "shp", "inner_alias": "lne", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_10496
train
v2
Schema: customers (alias: cust)(name, salary, level, id) items(name, salary, amount, value) Task: Find amount from customers where a matching record exists in items with the same status. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = cust.status );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "amount", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_10497
train
v2
Schema: items (alias: lne)(level, amount, salary, status) departments(date, code, type, name) Task: Retrieve salary from items that have at least one corresponding entry in departments sharing the same type. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = lne.type );
{ "outer_table": "items", "inner_table": "departments", "outer_alias": "lne", "inner_alias": "dept", "proj_col": "salary", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_10498
train
v3
Schema: items (alias: lne)(value, level, code, name) sales(type, salary, amount, id) Task: Retrieve id from items with salary above the MIN(salary) of sales rows sharing the same id. SQL:
SELECT id FROM items AS lne WHERE salary > ( SELECT MIN(salary) FROM sales AS sale WHERE sale.id = lne.id );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_10499
train