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: schedules (alias: schd)(status, amount, id, name) transactions(id, name, date, value) Task: Find code from schedules where a matching record exists in transactions with the same code. SQL:
SELECT code FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.code = schd.code );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "code", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_08300
train
v2
Schema: customers (alias: cust)(id, value, name, date) departments(code, type, name, status) Task: Retrieve code from customers that have at least one corresponding entry in departments sharing the same type. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = cust.type );
{ "outer_table": "customers", "inner_table": "departments", "outer_alias": "cust", "inner_alias": "dept", "proj_col": "code", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08301
train
v3
Schema: regions (alias: rgn)(type, level, id, value) sales(type, amount, name, level) Task: Find value from regions where amount exceeds the total salary from sales for the same level. SQL:
SELECT value FROM regions AS rgn WHERE amount > ( SELECT SUM(salary) FROM sales AS sale WHERE sale.level = rgn.level );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_08302
train
v1
Schema: invoices (alias: inv)(name, value, salary, date) projects(amount, code, value, level) Task: Retrieve salary from invoices whose code is found in projects rows where id matches the outer record. SQL:
SELECT salary FROM invoices AS inv WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.id = inv.id );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "inv", "inner_alias": "prj", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08303
train
v3
Schema: staff (alias: empl)(type, level, date, value) sales(name, id, value, amount) Task: Find code from staff where amount exceeds the maximum salary from sales for the same level. SQL:
SELECT code FROM staff AS empl WHERE amount > ( SELECT MAX(salary) FROM sales AS sale WHERE sale.level = empl.level );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "code", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_08304
train
v1
Schema: employees (alias: emp)(status, value, salary, date) projects(salary, value, level, code) Task: Select value from employees where type exists in projects for the same status. SQL:
SELECT value FROM employees AS emp WHERE type IN ( SELECT type FROM projects AS prj WHERE prj.status = emp.status );
{ "outer_table": "employees", "inner_table": "projects", "outer_alias": "emp", "inner_alias": "prj", "proj_col": "value", "filter_col": "type", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08305
train
v2
Schema: customers (alias: cust)(id, amount, salary, status) invoices(status, level, code, type) Task: Retrieve name from customers that have at least one corresponding entry in invoices sharing the same status. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.status = cust.status );
{ "outer_table": "customers", "inner_table": "invoices", "outer_alias": "cust", "inner_alias": "inv", "proj_col": "name", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08306
train
v3
Schema: tasks (alias: tsk)(value, name, amount, id) managers(amount, status, date, salary) Task: Retrieve amount from tasks with value above the SUM(value) of managers rows sharing the same level. SQL:
SELECT amount FROM tasks AS tsk WHERE value > ( SELECT SUM(value) FROM managers AS mgr WHERE mgr.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "managers", "outer_alias": "tsk", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_08307
train
v2
Schema: sales (alias: sale)(code, status, amount, name) orders(id, type, code, value) Task: Find name from sales where a matching record exists in orders with the same code. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = sale.code );
{ "outer_table": "sales", "inner_table": "orders", "outer_alias": "sale", "inner_alias": "ord", "proj_col": "name", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08308
train
v2
Schema: categories (alias: catg)(name, salary, date, status) invoices(level, date, status, salary) Task: Find value from categories where a matching record exists in invoices with the same level. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = catg.level );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "value", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_08309
train
v3
Schema: invoices (alias: inv)(value, date, code, status) regions(date, id, salary, level) Task: Retrieve salary from invoices with salary above the SUM(salary) of regions rows sharing the same type. SQL:
SELECT salary FROM invoices AS inv WHERE salary > ( SELECT SUM(salary) FROM regions AS rgn WHERE rgn.type = inv.type );
{ "outer_table": "invoices", "inner_table": "regions", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08310
train
v1
Schema: managers (alias: mgr)(salary, level, value, id) products(status, name, amount, id) Task: Select code from managers where id exists in products for the same type. SQL:
SELECT code FROM managers AS mgr WHERE id IN ( SELECT id FROM products AS prod WHERE prod.type = mgr.type );
{ "outer_table": "managers", "inner_table": "products", "outer_alias": "mgr", "inner_alias": "prod", "proj_col": "code", "filter_col": "id", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08311
train
v3
Schema: products (alias: prod)(name, amount, type, salary) managers(id, name, code, status) Task: Find code from products where value exceeds the total amount from managers for the same code. SQL:
SELECT code FROM products AS prod WHERE value > ( SELECT SUM(amount) FROM managers AS mgr WHERE mgr.code = prod.code );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08312
train
v1
Schema: regions (alias: rgn)(value, level, id, status) tasks(name, date, level, type) Task: Find name from regions where status appears in tasks entries with matching code. SQL:
SELECT name FROM regions AS rgn WHERE status IN ( SELECT status FROM tasks AS tsk WHERE tsk.code = rgn.code );
{ "outer_table": "regions", "inner_table": "tasks", "outer_alias": "rgn", "inner_alias": "tsk", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_08313
train
v3
Schema: invoices (alias: inv)(value, code, amount, status) schedules(amount, name, level, type) Task: Find name from invoices where value exceeds the count of amount from schedules for the same type. SQL:
SELECT name FROM invoices AS inv WHERE value > ( SELECT COUNT(amount) FROM schedules AS schd WHERE schd.type = inv.type );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "name", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08314
train
v3
Schema: regions (alias: rgn)(value, salary, type, id) departments(amount, status, id, value) Task: Find salary from regions where amount exceeds the average salary from departments for the same code. SQL:
SELECT salary FROM regions AS rgn WHERE amount > ( SELECT AVG(salary) FROM departments AS dept WHERE dept.code = rgn.code );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_08315
train
v2
Schema: projects (alias: prj)(id, date, code, amount) customers(name, value, amount, salary) Task: Find value from projects where a matching record exists in customers with the same status. SQL:
SELECT value FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.status = prj.status );
{ "outer_table": "projects", "inner_table": "customers", "outer_alias": "prj", "inner_alias": "cust", "proj_col": "value", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_08316
train
v3
Schema: accounts (alias: acct)(value, id, salary, amount) tasks(date, type, amount, code) Task: Retrieve id from accounts with value above the MIN(salary) of tasks rows sharing the same id. SQL:
SELECT id FROM accounts AS acct WHERE value > ( SELECT MIN(salary) FROM tasks AS tsk WHERE tsk.id = acct.id );
{ "outer_table": "accounts", "inner_table": "tasks", "outer_alias": "acct", "inner_alias": "tsk", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "acct.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08317
train
v2
Schema: orders (alias: ord)(id, status, type, amount) staff(level, date, id, salary) Task: Find id from orders where a matching record exists in staff with the same id. SQL:
SELECT id 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": "id", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08318
train
v3
Schema: managers (alias: mgr)(amount, type, name, status) schedules(date, name, amount, level) Task: Retrieve salary from managers with salary above the AVG(salary) of schedules rows sharing the same id. SQL:
SELECT salary FROM managers AS mgr WHERE salary > ( SELECT AVG(salary) FROM schedules AS schd WHERE schd.id = mgr.id );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08319
train
v3
Schema: schedules (alias: schd)(salary, date, amount, value) departments(amount, value, code, date) Task: Find id from schedules where value exceeds the average salary from departments for the same level. SQL:
SELECT id FROM schedules AS schd WHERE value > ( SELECT AVG(salary) 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": "value", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_08320
train
v2
Schema: departments (alias: dept)(code, salary, amount, name) transactions(code, level, value, amount) Task: Find id from departments where a matching record exists in transactions with the same type. SQL:
SELECT id FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = dept.type );
{ "outer_table": "departments", "inner_table": "transactions", "outer_alias": "dept", "inner_alias": "txn", "proj_col": "id", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08321
train
v2
Schema: customers (alias: cust)(code, value, name, date) employees(amount, salary, date, level) Task: Retrieve code from customers that have at least one corresponding entry in employees sharing the same level. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = cust.level );
{ "outer_table": "customers", "inner_table": "employees", "outer_alias": "cust", "inner_alias": "emp", "proj_col": "code", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08322
train
v3
Schema: categories (alias: catg)(level, name, code, salary) branches(status, type, value, amount) Task: Retrieve id from categories with amount above the AVG(value) of branches rows sharing the same level. SQL:
SELECT id FROM categories AS catg WHERE amount > ( SELECT AVG(value) FROM branches AS brc WHERE brc.level = catg.level );
{ "outer_table": "categories", "inner_table": "branches", "outer_alias": "catg", "inner_alias": "brc", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_08323
train
v3
Schema: products (alias: prod)(status, salary, value, name) managers(salary, name, amount, status) Task: Retrieve value from products with amount above the SUM(amount) of managers rows sharing the same code. SQL:
SELECT value FROM products AS prod WHERE amount > ( SELECT SUM(amount) FROM managers AS mgr WHERE mgr.code = prod.code );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "value", "filter_col": "amount", "agg_col": "amount", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08324
train
v1
Schema: invoices (alias: inv)(status, value, id, date) schedules(type, date, salary, level) Task: Select name from invoices where id exists in schedules for the same code. SQL:
SELECT name FROM invoices AS inv WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.code = inv.code );
{ "outer_table": "invoices", "inner_table": "schedules", "outer_alias": "inv", "inner_alias": "schd", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08325
train
v2
Schema: regions (alias: rgn)(type, amount, salary, date) items(code, amount, type, level) Task: Retrieve id from regions that have at least one corresponding entry in items sharing the same code. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = rgn.code );
{ "outer_table": "regions", "inner_table": "items", "outer_alias": "rgn", "inner_alias": "lne", "proj_col": "id", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_08326
train
v3
Schema: products (alias: prod)(type, code, amount, id) schedules(salary, level, type, value) Task: Find code from products where salary exceeds the minimum value from schedules for the same id. SQL:
SELECT code FROM products AS prod WHERE salary > ( SELECT MIN(value) FROM schedules AS schd WHERE schd.id = prod.id );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08327
train
v3
Schema: regions (alias: rgn)(name, status, type, value) shipments(level, date, status, code) Task: Retrieve amount from regions with amount above the COUNT(amount) of shipments rows sharing the same id. SQL:
SELECT amount FROM regions AS rgn WHERE amount > ( SELECT COUNT(amount) FROM shipments AS shp WHERE shp.id = rgn.id );
{ "outer_table": "regions", "inner_table": "shipments", "outer_alias": "rgn", "inner_alias": "shp", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_08328
train
v3
Schema: items (alias: lne)(id, level, date, amount) customers(type, code, value, amount) Task: Retrieve id from items with salary above the MAX(value) of customers rows sharing the same type. SQL:
SELECT id FROM items AS lne WHERE salary > ( SELECT MAX(value) FROM customers AS cust WHERE cust.type = lne.type );
{ "outer_table": "items", "inner_table": "customers", "outer_alias": "lne", "inner_alias": "cust", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_08329
train
v2
Schema: categories (alias: catg)(name, amount, level, type) requests(type, status, code, date) Task: Retrieve value from categories that have at least one corresponding entry in requests sharing the same id. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = catg.id );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "value", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_08330
train
v1
Schema: transactions (alias: txn)(id, value, name, amount) invoices(type, code, id, status) Task: Find id from transactions where type appears in invoices entries with matching level. SQL:
SELECT id FROM transactions AS txn WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.level = txn.level );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "id", "filter_col": "type", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08331
train
v1
Schema: regions (alias: rgn)(code, level, name, type) orders(name, value, code, type) Task: Select salary from regions where type exists in orders for the same id. SQL:
SELECT salary FROM regions AS rgn WHERE type IN ( SELECT type FROM orders AS ord WHERE ord.id = rgn.id );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "salary", "filter_col": "type", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_08332
train
v2
Schema: orders (alias: ord)(salary, type, name, code) staff(code, level, salary, amount) Task: Retrieve code from orders that have at least one corresponding entry in staff sharing the same code. SQL:
SELECT code FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.code = ord.code );
{ "outer_table": "orders", "inner_table": "staff", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "code", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08333
train
v2
Schema: branches (alias: brc)(date, salary, amount, level) invoices(amount, id, salary, code) Task: Find salary from branches where a matching record exists in invoices with the same code. SQL:
SELECT salary 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": "salary", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_08334
train
v1
Schema: requests (alias: ordr)(code, level, name, type) accounts(amount, name, status, value) Task: Select name from requests where level exists in accounts for the same level. SQL:
SELECT name FROM requests AS ordr WHERE level IN ( SELECT level FROM accounts AS acct WHERE acct.level = ordr.level );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "name", "filter_col": "level", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_08335
train
v2
Schema: categories (alias: catg)(level, value, status, name) customers(name, date, type, status) Task: Find name from categories where a matching record exists in customers with the same level. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = catg.level );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "name", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_08336
train
v2
Schema: products (alias: prod)(date, salary, type, status) managers(amount, date, id, value) Task: Find salary from products where a matching record exists in managers with the same type. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.type = prod.type );
{ "outer_table": "products", "inner_table": "managers", "outer_alias": "prod", "inner_alias": "mgr", "proj_col": "salary", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08337
train
v3
Schema: staff (alias: empl)(salary, name, code, date) sales(salary, value, status, type) Task: Retrieve value from staff with salary above the SUM(amount) of sales rows sharing the same level. SQL:
SELECT value FROM staff AS empl WHERE salary > ( SELECT SUM(amount) FROM sales AS sale WHERE sale.level = empl.level );
{ "outer_table": "staff", "inner_table": "sales", "outer_alias": "empl", "inner_alias": "sale", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_08338
train
v2
Schema: employees (alias: emp)(status, salary, amount, date) departments(name, value, salary, level) Task: Find salary from employees where a matching record exists in departments with the same type. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.type = emp.type );
{ "outer_table": "employees", "inner_table": "departments", "outer_alias": "emp", "inner_alias": "dept", "proj_col": "salary", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08339
train
v2
Schema: departments (alias: dept)(status, date, value, id) employees(amount, name, status, type) Task: Retrieve code from departments that have at least one corresponding entry in employees sharing the same id. SQL:
SELECT code FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.id = dept.id );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "code", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08340
train
v3
Schema: projects (alias: prj)(salary, status, type, amount) items(level, type, name, value) Task: Find salary from projects where value exceeds the minimum amount from items for the same type. SQL:
SELECT salary FROM projects AS prj WHERE value > ( SELECT MIN(amount) FROM items AS lne WHERE lne.type = prj.type );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "lne", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_08341
train
v2
Schema: invoices (alias: inv)(amount, name, code, type) transactions(code, amount, type, salary) Task: Retrieve id from invoices that have at least one corresponding entry in transactions sharing the same type. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = inv.type );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "id", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08342
train
v3
Schema: transactions (alias: txn)(status, code, id, date) sales(id, level, name, date) Task: Retrieve name from transactions with amount above the SUM(salary) of sales rows sharing the same status. SQL:
SELECT name FROM transactions AS txn WHERE amount > ( SELECT SUM(salary) 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": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08343
train
v2
Schema: managers (alias: mgr)(level, date, status, salary) schedules(level, amount, code, id) Task: Find salary from managers where a matching record exists in schedules with the same id. SQL:
SELECT salary FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = mgr.id );
{ "outer_table": "managers", "inner_table": "schedules", "outer_alias": "mgr", "inner_alias": "schd", "proj_col": "salary", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08344
train
v1
Schema: orders (alias: ord)(amount, date, name, type) projects(level, id, name, value) Task: Select salary from orders where id exists in projects for the same status. SQL:
SELECT salary FROM orders AS ord WHERE id IN ( SELECT id 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": "id", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08345
train
v2
Schema: schedules (alias: schd)(code, status, value, amount) sales(salary, name, id, status) Task: Find salary from schedules where a matching record exists in sales with the same type. SQL:
SELECT salary FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = schd.type );
{ "outer_table": "schedules", "inner_table": "sales", "outer_alias": "schd", "inner_alias": "sale", "proj_col": "salary", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_08346
train
v1
Schema: sales (alias: sale)(value, type, id, name) accounts(amount, code, value, date) Task: Find value from sales where status appears in accounts entries with matching code. SQL:
SELECT value FROM sales AS sale WHERE status IN ( SELECT status FROM accounts AS acct WHERE acct.code = sale.code );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "value", "filter_col": "status", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08347
train
v1
Schema: branches (alias: brc)(id, value, amount, code) categories(status, id, name, level) Task: Find code from branches where type appears in categories entries with matching level. SQL:
SELECT code FROM branches AS brc WHERE type IN ( SELECT type FROM categories AS catg WHERE catg.level = brc.level );
{ "outer_table": "branches", "inner_table": "categories", "outer_alias": "brc", "inner_alias": "catg", "proj_col": "code", "filter_col": "type", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_08348
train
v3
Schema: regions (alias: rgn)(salary, status, level, date) invoices(value, amount, code, date) Task: Retrieve name from regions with value above the MAX(salary) of invoices rows sharing the same id. SQL:
SELECT name FROM regions AS rgn WHERE value > ( SELECT MAX(salary) FROM invoices AS inv WHERE inv.id = rgn.id );
{ "outer_table": "regions", "inner_table": "invoices", "outer_alias": "rgn", "inner_alias": "inv", "proj_col": "name", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_08349
train
v3
Schema: regions (alias: rgn)(amount, value, date, status) tasks(level, code, id, name) Task: Find code from regions where salary exceeds the total salary from tasks for the same code. SQL:
SELECT code FROM regions AS rgn WHERE salary > ( SELECT SUM(salary) FROM tasks AS tsk WHERE tsk.code = rgn.code );
{ "outer_table": "regions", "inner_table": "tasks", "outer_alias": "rgn", "inner_alias": "tsk", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_08350
train
v1
Schema: shipments (alias: shp)(name, status, level, value) employees(id, name, level, salary) Task: Retrieve code from shipments whose type is found in employees rows where id matches the outer record. SQL:
SELECT code FROM shipments AS shp WHERE type IN ( SELECT type FROM employees AS emp WHERE emp.id = shp.id );
{ "outer_table": "shipments", "inner_table": "employees", "outer_alias": "shp", "inner_alias": "emp", "proj_col": "code", "filter_col": "type", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_08351
train
v1
Schema: regions (alias: rgn)(salary, type, amount, id) schedules(value, type, code, status) Task: Select amount from regions where status exists in schedules for the same code. SQL:
SELECT amount FROM regions AS rgn WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.code = rgn.code );
{ "outer_table": "regions", "inner_table": "schedules", "outer_alias": "rgn", "inner_alias": "schd", "proj_col": "amount", "filter_col": "status", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_08352
train
v2
Schema: regions (alias: rgn)(status, level, name, date) categories(amount, type, salary, code) Task: Retrieve id from regions that have at least one corresponding entry in categories sharing the same code. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = rgn.code );
{ "outer_table": "regions", "inner_table": "categories", "outer_alias": "rgn", "inner_alias": "catg", "proj_col": "id", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_08353
train
v2
Schema: accounts (alias: acct)(name, code, type, amount) sales(amount, status, level, name) Task: Find code from accounts where a matching record exists in sales with the same status. SQL:
SELECT code 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": "code", "join_col": "status", "correlated_ref": "acct.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08354
train
v1
Schema: transactions (alias: txn)(date, amount, code, level) managers(status, code, amount, name) Task: Select salary from transactions where level exists in managers for the same code. SQL:
SELECT salary FROM transactions AS txn WHERE level IN ( SELECT level 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": "level", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08355
train
v2
Schema: employees (alias: emp)(type, value, date, name) products(code, amount, status, id) Task: Find name from employees where a matching record exists in products with the same code. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.code = emp.code );
{ "outer_table": "employees", "inner_table": "products", "outer_alias": "emp", "inner_alias": "prod", "proj_col": "name", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08356
train
v1
Schema: shipments (alias: shp)(status, level, name, id) regions(type, date, amount, status) Task: Retrieve name from shipments whose id is found in regions rows where code matches the outer record. SQL:
SELECT name FROM shipments AS shp WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.code = shp.code );
{ "outer_table": "shipments", "inner_table": "regions", "outer_alias": "shp", "inner_alias": "rgn", "proj_col": "name", "filter_col": "id", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_08357
train
v2
Schema: transactions (alias: txn)(amount, date, value, status) employees(id, level, type, salary) Task: Retrieve amount from transactions that have at least one corresponding entry in employees sharing the same level. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = txn.level );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "amount", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08358
train
v1
Schema: managers (alias: mgr)(date, id, level, salary) accounts(type, name, id, amount) Task: Select salary from managers where id exists in accounts for the same status. SQL:
SELECT salary FROM managers AS mgr WHERE id IN ( SELECT id FROM accounts AS acct WHERE acct.status = mgr.status );
{ "outer_table": "managers", "inner_table": "accounts", "outer_alias": "mgr", "inner_alias": "acct", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08359
train
v1
Schema: products (alias: prod)(salary, status, level, value) staff(status, type, name, date) Task: Find name from products where type appears in staff entries with matching level. SQL:
SELECT name FROM products AS prod WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.level = prod.level );
{ "outer_table": "products", "inner_table": "staff", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08360
train
v2
Schema: branches (alias: brc)(name, salary, value, id) sales(code, name, date, level) Task: Find code from branches where a matching record exists in sales with the same status. SQL:
SELECT code FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = brc.status );
{ "outer_table": "branches", "inner_table": "sales", "outer_alias": "brc", "inner_alias": "sale", "proj_col": "code", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_08361
train
v2
Schema: shipments (alias: shp)(salary, amount, type, date) accounts(value, salary, level, code) Task: Retrieve code from shipments that have at least one corresponding entry in accounts sharing the same id. SQL:
SELECT code FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = shp.id );
{ "outer_table": "shipments", "inner_table": "accounts", "outer_alias": "shp", "inner_alias": "acct", "proj_col": "code", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_08362
train
v1
Schema: accounts (alias: acct)(id, salary, status, amount) categories(id, salary, value, amount) Task: Select id from accounts where level exists in categories for the same level. SQL:
SELECT id FROM accounts AS acct WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.level = acct.level );
{ "outer_table": "accounts", "inner_table": "categories", "outer_alias": "acct", "inner_alias": "catg", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08363
train
v1
Schema: sales (alias: sale)(id, salary, amount, status) items(amount, level, id, salary) Task: Retrieve amount from sales whose level is found in items rows where id matches the outer record. SQL:
SELECT amount FROM sales AS sale WHERE level IN ( SELECT level FROM items AS lne WHERE lne.id = sale.id );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08364
train
v3
Schema: products (alias: prod)(type, level, value, code) orders(code, amount, date, salary) Task: Find id from products where amount exceeds the average amount from orders for the same id. SQL:
SELECT id FROM products AS prod WHERE amount > ( SELECT AVG(amount) FROM orders AS ord WHERE ord.id = prod.id );
{ "outer_table": "products", "inner_table": "orders", "outer_alias": "prod", "inner_alias": "ord", "proj_col": "id", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08365
train
v2
Schema: categories (alias: catg)(type, value, date, name) transactions(date, level, id, status) Task: Find name from categories where a matching record exists in transactions with the same type. SQL:
SELECT name FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = catg.type );
{ "outer_table": "categories", "inner_table": "transactions", "outer_alias": "catg", "inner_alias": "txn", "proj_col": "name", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_08366
train
v3
Schema: customers (alias: cust)(status, name, id, type) products(level, id, amount, type) Task: Retrieve name from customers with salary above the COUNT(amount) of products rows sharing the same type. SQL:
SELECT name FROM customers AS cust WHERE salary > ( SELECT COUNT(amount) FROM products AS prod WHERE prod.type = cust.type );
{ "outer_table": "customers", "inner_table": "products", "outer_alias": "cust", "inner_alias": "prod", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08367
train
v2
Schema: shipments (alias: shp)(value, level, code, name) projects(code, status, type, id) Task: Retrieve id from shipments that have at least one corresponding entry in projects sharing the same level. SQL:
SELECT id FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.level = shp.level );
{ "outer_table": "shipments", "inner_table": "projects", "outer_alias": "shp", "inner_alias": "prj", "proj_col": "id", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_08368
train
v3
Schema: managers (alias: mgr)(name, amount, id, salary) staff(date, level, value, amount) Task: Find value from managers where salary exceeds the total salary from staff for the same id. SQL:
SELECT value FROM managers AS mgr WHERE salary > ( SELECT SUM(salary) FROM staff AS empl WHERE empl.id = mgr.id );
{ "outer_table": "managers", "inner_table": "staff", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08369
train
v2
Schema: staff (alias: empl)(value, amount, name, date) projects(value, type, name, id) Task: Find name from staff where a matching record exists in projects with the same status. SQL:
SELECT name FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = empl.status );
{ "outer_table": "staff", "inner_table": "projects", "outer_alias": "empl", "inner_alias": "prj", "proj_col": "name", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_08370
train
v2
Schema: products (alias: prod)(date, type, salary, status) accounts(type, status, salary, date) Task: Retrieve salary from products that have at least one corresponding entry in accounts sharing the same id. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = prod.id );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "salary", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08371
train
v2
Schema: staff (alias: empl)(salary, code, name, status) shipments(id, amount, status, type) Task: Find code from staff where a matching record exists in shipments with the same status. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = empl.status );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "code", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_08372
train
v3
Schema: regions (alias: rgn)(amount, type, name, id) departments(date, status, level, code) Task: Find amount from regions where amount exceeds the maximum amount from departments for the same type. SQL:
SELECT amount FROM regions AS rgn WHERE amount > ( SELECT MAX(amount) FROM departments AS dept WHERE dept.type = rgn.type );
{ "outer_table": "regions", "inner_table": "departments", "outer_alias": "rgn", "inner_alias": "dept", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_08373
train
v1
Schema: employees (alias: emp)(type, amount, level, code) shipments(salary, status, value, id) Task: Find amount from employees where status appears in shipments entries with matching type. SQL:
SELECT amount FROM employees AS emp WHERE status IN ( SELECT status FROM shipments AS shp WHERE shp.type = emp.type );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "amount", "filter_col": "status", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08374
train
v2
Schema: products (alias: prod)(date, value, status, salary) regions(level, type, amount, value) Task: Retrieve id from products that have at least one corresponding entry in regions sharing the same status. SQL:
SELECT id FROM products AS prod WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = prod.status );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "id", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08375
train
v2
Schema: schedules (alias: schd)(name, date, level, code) products(type, amount, salary, date) Task: Find name from schedules where a matching record exists in products with the same type. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.type = schd.type );
{ "outer_table": "schedules", "inner_table": "products", "outer_alias": "schd", "inner_alias": "prod", "proj_col": "name", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_08376
train
v3
Schema: regions (alias: rgn)(salary, amount, id, date) requests(salary, date, type, level) Task: Retrieve salary from regions with value above the COUNT(value) of requests rows sharing the same level. SQL:
SELECT salary FROM regions AS rgn WHERE value > ( SELECT COUNT(value) FROM requests AS ordr WHERE ordr.level = rgn.level );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_08377
train
v2
Schema: shipments (alias: shp)(code, name, value, status) orders(type, amount, id, status) Task: Find name from shipments where a matching record exists in orders with the same id. SQL:
SELECT name FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.id = shp.id );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "name", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_08378
train
v1
Schema: requests (alias: ordr)(type, salary, id, level) departments(amount, date, code, value) Task: Select name from requests where level exists in departments for the same id. SQL:
SELECT name FROM requests AS ordr WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.id = ordr.id );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "name", "filter_col": "level", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_08379
train
v2
Schema: regions (alias: rgn)(value, amount, name, type) requests(code, status, type, amount) Task: Retrieve value from regions that have at least one corresponding entry in requests sharing the same type. SQL:
SELECT value FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.type = rgn.type );
{ "outer_table": "regions", "inner_table": "requests", "outer_alias": "rgn", "inner_alias": "ordr", "proj_col": "value", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_08380
train
v1
Schema: customers (alias: cust)(amount, value, status, level) requests(date, type, salary, id) Task: Retrieve name from customers whose id is found in requests rows where status matches the outer record. SQL:
SELECT name FROM customers AS cust WHERE id IN ( SELECT id FROM requests AS ordr WHERE ordr.status = cust.status );
{ "outer_table": "customers", "inner_table": "requests", "outer_alias": "cust", "inner_alias": "ordr", "proj_col": "name", "filter_col": "id", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08381
train
v3
Schema: staff (alias: empl)(level, amount, status, name) items(value, id, salary, name) Task: Retrieve code from staff with salary above the MIN(value) of items rows sharing the same id. SQL:
SELECT code FROM staff AS empl WHERE salary > ( SELECT MIN(value) FROM items AS lne WHERE lne.id = empl.id );
{ "outer_table": "staff", "inner_table": "items", "outer_alias": "empl", "inner_alias": "lne", "proj_col": "code", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_08382
train
v2
Schema: branches (alias: brc)(amount, id, name, type) accounts(value, amount, code, date) Task: Find code from branches where a matching record exists in accounts with the same id. SQL:
SELECT code FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = brc.id );
{ "outer_table": "branches", "inner_table": "accounts", "outer_alias": "brc", "inner_alias": "acct", "proj_col": "code", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_08383
train
v1
Schema: transactions (alias: txn)(salary, level, id, value) schedules(salary, code, name, level) Task: Retrieve salary from transactions whose code is found in schedules rows where code matches the outer record. SQL:
SELECT salary FROM transactions AS txn WHERE code IN ( SELECT code FROM schedules AS schd WHERE schd.code = txn.code );
{ "outer_table": "transactions", "inner_table": "schedules", "outer_alias": "txn", "inner_alias": "schd", "proj_col": "salary", "filter_col": "code", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08384
train
v2
Schema: employees (alias: emp)(code, type, date, salary) products(type, code, date, amount) Task: Retrieve amount from employees that have at least one corresponding entry in products sharing the same id. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = emp.id );
{ "outer_table": "employees", "inner_table": "products", "outer_alias": "emp", "inner_alias": "prod", "proj_col": "amount", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08385
train
v2
Schema: transactions (alias: txn)(status, name, code, amount) orders(level, amount, date, value) Task: Retrieve code from transactions that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT code 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": "code", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08386
train
v3
Schema: sales (alias: sale)(name, type, amount, id) invoices(amount, level, value, code) Task: Retrieve code from sales with amount above the COUNT(value) of invoices rows sharing the same code. SQL:
SELECT code FROM sales AS sale WHERE amount > ( SELECT COUNT(value) FROM invoices AS inv WHERE inv.code = sale.code );
{ "outer_table": "sales", "inner_table": "invoices", "outer_alias": "sale", "inner_alias": "inv", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08387
train
v1
Schema: branches (alias: brc)(date, level, amount, salary) projects(type, level, date, id) Task: Find amount from branches where code appears in projects entries with matching code. SQL:
SELECT amount FROM branches AS brc WHERE code IN ( SELECT code FROM projects AS prj WHERE prj.code = brc.code );
{ "outer_table": "branches", "inner_table": "projects", "outer_alias": "brc", "inner_alias": "prj", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_08388
train
v3
Schema: regions (alias: rgn)(code, salary, amount, type) employees(amount, date, status, level) Task: Find salary from regions where salary exceeds the total value from employees for the same code. SQL:
SELECT salary FROM regions AS rgn WHERE salary > ( SELECT SUM(value) FROM employees AS emp WHERE emp.code = rgn.code );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "salary", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "rgn.code", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_08389
train
v1
Schema: requests (alias: ordr)(level, date, name, status) categories(id, name, type, date) Task: Retrieve value from requests whose id is found in categories rows where level matches the outer record. SQL:
SELECT value FROM requests AS ordr WHERE id IN ( SELECT id FROM categories AS catg WHERE catg.level = ordr.level );
{ "outer_table": "requests", "inner_table": "categories", "outer_alias": "ordr", "inner_alias": "catg", "proj_col": "value", "filter_col": "id", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_08390
train
v1
Schema: sales (alias: sale)(value, status, name, type) staff(amount, type, value, status) Task: Find value from sales where status appears in staff entries with matching code. SQL:
SELECT value FROM sales AS sale WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.code = sale.code );
{ "outer_table": "sales", "inner_table": "staff", "outer_alias": "sale", "inner_alias": "empl", "proj_col": "value", "filter_col": "status", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08391
train
v1
Schema: projects (alias: prj)(date, salary, value, id) regions(value, code, id, level) Task: Select code from projects where status exists in regions for the same status. SQL:
SELECT code FROM projects AS prj WHERE status IN ( SELECT status FROM regions AS rgn WHERE rgn.status = prj.status );
{ "outer_table": "projects", "inner_table": "regions", "outer_alias": "prj", "inner_alias": "rgn", "proj_col": "code", "filter_col": "status", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_08392
train
v3
Schema: employees (alias: emp)(date, name, salary, type) orders(value, id, amount, date) Task: Find id from employees where salary exceeds the maximum value from orders for the same type. SQL:
SELECT id FROM employees AS emp WHERE salary > ( SELECT MAX(value) FROM orders AS ord WHERE ord.type = emp.type );
{ "outer_table": "employees", "inner_table": "orders", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08393
train
v2
Schema: customers (alias: cust)(name, amount, code, type) items(status, id, date, name) Task: Retrieve name from customers that have at least one corresponding entry in items sharing the same status. SQL:
SELECT name 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": "name", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08394
train
v3
Schema: customers (alias: cust)(status, type, date, amount) sales(status, id, name, type) Task: Find code from customers where value exceeds the average amount from sales for the same level. SQL:
SELECT code FROM customers AS cust WHERE value > ( SELECT AVG(amount) FROM sales AS sale WHERE sale.level = cust.level );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08395
train
v1
Schema: branches (alias: brc)(code, amount, name, id) regions(value, id, level, salary) Task: Retrieve salary from branches whose code is found in regions rows where level matches the outer record. SQL:
SELECT salary FROM branches AS brc WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.level = brc.level );
{ "outer_table": "branches", "inner_table": "regions", "outer_alias": "brc", "inner_alias": "rgn", "proj_col": "salary", "filter_col": "code", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_08396
train
v1
Schema: regions (alias: rgn)(amount, id, code, value) tasks(value, name, salary, status) Task: Retrieve code from regions whose code is found in tasks rows where id matches the outer record. SQL:
SELECT code FROM regions AS rgn WHERE code IN ( SELECT code FROM tasks AS tsk WHERE tsk.id = rgn.id );
{ "outer_table": "regions", "inner_table": "tasks", "outer_alias": "rgn", "inner_alias": "tsk", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_08397
train
v2
Schema: products (alias: prod)(salary, code, type, id) accounts(level, date, status, type) Task: Find amount from products where a matching record exists in accounts with the same id. SQL:
SELECT amount FROM products AS prod WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = prod.id );
{ "outer_table": "products", "inner_table": "accounts", "outer_alias": "prod", "inner_alias": "acct", "proj_col": "amount", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08398
train
v3
Schema: products (alias: prod)(id, code, name, status) invoices(code, type, name, id) Task: Find id from products where salary exceeds the count of value from invoices for the same status. SQL:
SELECT id FROM products AS prod WHERE salary > ( SELECT COUNT(value) FROM invoices AS inv WHERE inv.status = prod.status );
{ "outer_table": "products", "inner_table": "invoices", "outer_alias": "prod", "inner_alias": "inv", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_08399
train