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)(type, date, amount, name) managers(type, id, value, name) Task: Find code from schedules where a matching record exists in managers with the same id. SQL:
SELECT code FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = schd.id );
{ "outer_table": "schedules", "inner_table": "managers", "outer_alias": "schd", "inner_alias": "mgr", "proj_col": "code", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04300
train
v2
Schema: customers (alias: cust)(salary, amount, id, date) sales(type, salary, status, value) Task: Find amount from customers where a matching record exists in sales with the same status. SQL:
SELECT amount FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = cust.status );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "amount", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04301
train
v1
Schema: customers (alias: cust)(code, amount, status, date) branches(salary, level, value, id) Task: Select id from customers where status exists in branches for the same code. SQL:
SELECT id FROM customers AS cust WHERE status IN ( SELECT status FROM branches AS brc WHERE brc.code = cust.code );
{ "outer_table": "customers", "inner_table": "branches", "outer_alias": "cust", "inner_alias": "brc", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04302
train
v3
Schema: staff (alias: empl)(level, salary, type, date) managers(level, name, code, id) Task: Find code from staff where amount exceeds the maximum value from managers for the same type. SQL:
SELECT code FROM staff AS empl WHERE amount > ( SELECT MAX(value) FROM managers AS mgr WHERE mgr.type = empl.type );
{ "outer_table": "staff", "inner_table": "managers", "outer_alias": "empl", "inner_alias": "mgr", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_04303
train
v1
Schema: orders (alias: ord)(type, code, salary, amount) sales(name, salary, value, type) Task: Retrieve amount from orders whose code is found in sales rows where type matches the outer record. SQL:
SELECT amount FROM orders AS ord WHERE code IN ( SELECT code 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": "code", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04304
train
v1
Schema: shipments (alias: shp)(value, date, name, level) products(code, id, name, date) Task: Find name from shipments where code appears in products entries with matching status. SQL:
SELECT name FROM shipments AS shp WHERE code IN ( SELECT code FROM products AS prod WHERE prod.status = shp.status );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "shp.status", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04305
train
v2
Schema: schedules (alias: schd)(code, id, name, amount) tasks(code, name, status, date) Task: Retrieve name from schedules that have at least one corresponding entry in tasks sharing the same status. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = schd.status );
{ "outer_table": "schedules", "inner_table": "tasks", "outer_alias": "schd", "inner_alias": "tsk", "proj_col": "name", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04306
train
v2
Schema: categories (alias: catg)(salary, id, date, code) staff(salary, date, type, id) Task: Retrieve code from categories that have at least one corresponding entry in staff sharing the same type. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.type = catg.type );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "code", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04307
train
v1
Schema: transactions (alias: txn)(type, salary, name, value) invoices(status, name, id, date) Task: Find code from transactions where code appears in invoices entries with matching code. SQL:
SELECT code FROM transactions AS txn WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.code = txn.code );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04308
train
v1
Schema: products (alias: prod)(date, code, type, name) categories(name, salary, id, level) Task: Find id from products where status appears in categories entries with matching code. SQL:
SELECT id FROM products AS prod WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.code = prod.code );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "id", "filter_col": "status", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04309
train
v3
Schema: shipments (alias: shp)(date, name, code, salary) products(level, id, salary, date) Task: Find name from shipments where salary exceeds the minimum amount from products for the same code. SQL:
SELECT name FROM shipments AS shp WHERE salary > ( SELECT MIN(amount) FROM products AS prod WHERE prod.code = shp.code );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_04310
train
v1
Schema: projects (alias: prj)(amount, value, status, date) managers(value, date, type, salary) Task: Select salary from projects where level exists in managers for the same level. SQL:
SELECT salary FROM projects AS prj WHERE level IN ( SELECT level FROM managers AS mgr WHERE mgr.level = prj.level );
{ "outer_table": "projects", "inner_table": "managers", "outer_alias": "prj", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "level", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04311
train
v3
Schema: branches (alias: brc)(name, type, id, salary) schedules(name, date, level, value) Task: Find code from branches where amount exceeds the maximum amount from schedules for the same code. SQL:
SELECT code FROM branches AS brc WHERE amount > ( SELECT MAX(amount) FROM schedules AS schd WHERE schd.code = brc.code );
{ "outer_table": "branches", "inner_table": "schedules", "outer_alias": "brc", "inner_alias": "schd", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04312
train
v2
Schema: invoices (alias: inv)(level, name, code, date) customers(code, id, date, salary) Task: Find amount from invoices where a matching record exists in customers with the same level. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = inv.level );
{ "outer_table": "invoices", "inner_table": "customers", "outer_alias": "inv", "inner_alias": "cust", "proj_col": "amount", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04313
train
v3
Schema: orders (alias: ord)(salary, type, value, name) departments(code, name, date, value) Task: Retrieve id from orders with salary above the MIN(value) of departments rows sharing the same code. SQL:
SELECT id FROM orders AS ord WHERE salary > ( SELECT MIN(value) FROM departments AS dept WHERE dept.code = ord.code );
{ "outer_table": "orders", "inner_table": "departments", "outer_alias": "ord", "inner_alias": "dept", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04314
train
v1
Schema: items (alias: lne)(salary, status, code, id) staff(value, status, salary, code) Task: Find code from items where status appears in staff entries with matching code. SQL:
SELECT code FROM items AS lne WHERE status IN ( SELECT status FROM staff AS empl WHERE empl.code = lne.code );
{ "outer_table": "items", "inner_table": "staff", "outer_alias": "lne", "inner_alias": "empl", "proj_col": "code", "filter_col": "status", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04315
train
v3
Schema: branches (alias: brc)(salary, value, code, id) schedules(level, salary, type, code) Task: Retrieve amount from branches with salary above the SUM(amount) of schedules rows sharing the same level. SQL:
SELECT amount FROM branches AS brc WHERE salary > ( SELECT SUM(amount) FROM schedules AS schd WHERE schd.level = brc.level );
{ "outer_table": "branches", "inner_table": "schedules", "outer_alias": "brc", "inner_alias": "schd", "proj_col": "amount", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04316
train
v3
Schema: categories (alias: catg)(status, code, amount, salary) sales(value, id, name, type) Task: Find salary from categories where value exceeds the total amount from sales for the same type. SQL:
SELECT salary FROM categories AS catg WHERE value > ( SELECT SUM(amount) FROM sales AS sale WHERE sale.type = catg.type );
{ "outer_table": "categories", "inner_table": "sales", "outer_alias": "catg", "inner_alias": "sale", "proj_col": "salary", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04317
train
v2
Schema: transactions (alias: txn)(code, id, date, name) sales(value, id, code, date) Task: Find name from transactions where a matching record exists in sales with the same type. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = txn.type );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "name", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04318
train
v2
Schema: orders (alias: ord)(amount, type, id, name) invoices(status, name, type, amount) Task: Find amount from orders where a matching record exists in invoices with the same level. SQL:
SELECT amount FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.level = ord.level );
{ "outer_table": "orders", "inner_table": "invoices", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "amount", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04319
train
v2
Schema: departments (alias: dept)(name, type, status, code) products(id, status, code, type) Task: Retrieve amount from departments that have at least one corresponding entry in products sharing the same id. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.id = dept.id );
{ "outer_table": "departments", "inner_table": "products", "outer_alias": "dept", "inner_alias": "prod", "proj_col": "amount", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04320
train
v1
Schema: products (alias: prod)(level, date, value, type) requests(status, value, name, code) Task: Select code from products where code exists in requests for the same code. SQL:
SELECT code FROM products AS prod WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.code = prod.code );
{ "outer_table": "products", "inner_table": "requests", "outer_alias": "prod", "inner_alias": "ordr", "proj_col": "code", "filter_col": "code", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04321
train
v2
Schema: employees (alias: emp)(status, date, salary, type) customers(code, salary, name, level) Task: Find salary from employees where a matching record exists in customers with the same type. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = emp.type );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "salary", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04322
train
v2
Schema: transactions (alias: txn)(amount, type, status, value) invoices(code, status, salary, type) Task: Find name from transactions where a matching record exists in invoices with the same type. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.type = txn.type );
{ "outer_table": "transactions", "inner_table": "invoices", "outer_alias": "txn", "inner_alias": "inv", "proj_col": "name", "join_col": "type", "correlated_ref": "txn.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04323
train
v2
Schema: tasks (alias: tsk)(name, amount, id, type) employees(value, code, date, amount) Task: Retrieve amount from tasks that have at least one corresponding entry in employees sharing the same level. SQL:
SELECT amount FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "employees", "outer_alias": "tsk", "inner_alias": "emp", "proj_col": "amount", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04324
train
v2
Schema: requests (alias: ordr)(level, code, name, amount) tasks(status, id, date, type) Task: Retrieve amount from requests that have at least one corresponding entry in tasks sharing the same code. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.code = ordr.code );
{ "outer_table": "requests", "inner_table": "tasks", "outer_alias": "ordr", "inner_alias": "tsk", "proj_col": "amount", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04325
train
v2
Schema: items (alias: lne)(name, date, level, salary) departments(name, type, date, level) Task: Find value from items where a matching record exists in departments with the same type. SQL:
SELECT value 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": "value", "join_col": "type", "correlated_ref": "lne.type", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04326
train
v1
Schema: transactions (alias: txn)(date, type, amount, level) employees(salary, status, id, code) Task: Retrieve name from transactions whose level is found in employees rows where status matches the outer record. SQL:
SELECT name FROM transactions AS txn WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.status = txn.status );
{ "outer_table": "transactions", "inner_table": "employees", "outer_alias": "txn", "inner_alias": "emp", "proj_col": "name", "filter_col": "level", "join_col": "status", "correlated_ref": "txn.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04327
train
v2
Schema: projects (alias: prj)(code, amount, date, salary) sales(value, name, level, type) Task: Find id from projects where a matching record exists in sales with the same type. SQL:
SELECT id 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": "id", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04328
train
v1
Schema: departments (alias: dept)(level, value, status, salary) accounts(value, status, name, salary) Task: Retrieve id from departments whose type is found in accounts rows where code matches the outer record. SQL:
SELECT id 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": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04329
train
v1
Schema: managers (alias: mgr)(name, amount, level, salary) departments(salary, type, value, name) Task: Retrieve id from managers whose type is found in departments rows where type matches the outer record. SQL:
SELECT id FROM managers AS mgr WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.type = mgr.type );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "id", "filter_col": "type", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04330
train
v3
Schema: sales (alias: sale)(value, amount, code, id) projects(type, status, code, amount) Task: Find code from sales where salary exceeds the total amount from projects for the same status. SQL:
SELECT code FROM sales AS sale WHERE salary > ( SELECT SUM(amount) FROM projects AS prj WHERE prj.status = sale.status );
{ "outer_table": "sales", "inner_table": "projects", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "code", "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_04331
train
v3
Schema: customers (alias: cust)(status, salary, id, code) items(id, type, amount, name) Task: Find value from customers where salary exceeds the minimum salary from items for the same status. SQL:
SELECT value FROM customers AS cust WHERE salary > ( SELECT MIN(salary) FROM items AS lne WHERE lne.status = cust.status );
{ "outer_table": "customers", "inner_table": "items", "outer_alias": "cust", "inner_alias": "lne", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MIN", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04332
train
v1
Schema: products (alias: prod)(id, amount, salary, value) regions(code, type, level, id) Task: Find amount from products where code appears in regions entries with matching type. SQL:
SELECT amount FROM products AS prod WHERE code IN ( SELECT code FROM regions AS rgn WHERE rgn.type = prod.type );
{ "outer_table": "products", "inner_table": "regions", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04333
train
v1
Schema: branches (alias: brc)(value, salary, date, name) accounts(id, status, level, type) Task: Select salary from branches where code exists in accounts for the same status. SQL:
SELECT salary FROM branches AS brc WHERE code IN ( SELECT code FROM accounts AS acct WHERE acct.status = brc.status );
{ "outer_table": "branches", "inner_table": "accounts", "outer_alias": "brc", "inner_alias": "acct", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04334
train
v3
Schema: customers (alias: cust)(salary, type, date, id) managers(salary, id, level, status) Task: Retrieve code from customers with salary above the COUNT(amount) of managers rows sharing the same id. SQL:
SELECT code FROM customers AS cust WHERE salary > ( SELECT COUNT(amount) FROM managers AS mgr WHERE mgr.id = cust.id );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04335
train
v1
Schema: tasks (alias: tsk)(type, value, status, salary) regions(status, id, type, salary) Task: Select value from tasks where id exists in regions for the same status. SQL:
SELECT value FROM tasks AS tsk WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "regions", "outer_alias": "tsk", "inner_alias": "rgn", "proj_col": "value", "filter_col": "id", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04336
train
v3
Schema: employees (alias: emp)(date, type, amount, code) requests(id, value, salary, amount) Task: Find name from employees where salary exceeds the maximum value from requests for the same level. SQL:
SELECT name FROM employees AS emp WHERE salary > ( SELECT MAX(value) FROM requests AS ordr WHERE ordr.level = emp.level );
{ "outer_table": "employees", "inner_table": "requests", "outer_alias": "emp", "inner_alias": "ordr", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04337
train
v2
Schema: invoices (alias: inv)(type, status, date, name) projects(name, status, salary, code) Task: Find id from invoices where a matching record exists in projects with the same level. SQL:
SELECT id FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.level = inv.level );
{ "outer_table": "invoices", "inner_table": "projects", "outer_alias": "inv", "inner_alias": "prj", "proj_col": "id", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04338
train
v1
Schema: tasks (alias: tsk)(date, amount, salary, type) departments(level, id, date, salary) Task: Retrieve salary from tasks whose level is found in departments rows where code matches the outer record. SQL:
SELECT salary FROM tasks AS tsk WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "departments", "outer_alias": "tsk", "inner_alias": "dept", "proj_col": "salary", "filter_col": "level", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04339
train
v3
Schema: employees (alias: emp)(type, status, amount, name) categories(status, code, type, date) Task: Find value from employees where value exceeds the minimum amount from categories for the same type. SQL:
SELECT value FROM employees AS emp WHERE value > ( SELECT MIN(amount) FROM categories AS catg WHERE catg.type = emp.type );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04340
train
v1
Schema: tasks (alias: tsk)(type, amount, code, name) categories(level, salary, type, id) Task: Retrieve value from tasks whose status is found in categories rows where status matches the outer record. SQL:
SELECT value FROM tasks AS tsk WHERE status IN ( SELECT status FROM categories AS catg WHERE catg.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "categories", "outer_alias": "tsk", "inner_alias": "catg", "proj_col": "value", "filter_col": "status", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04341
train
v3
Schema: requests (alias: ordr)(value, code, salary, type) invoices(amount, name, code, id) Task: Find value from requests where value exceeds the total salary from invoices for the same code. SQL:
SELECT value FROM requests AS ordr WHERE value > ( SELECT SUM(salary) FROM invoices AS inv WHERE inv.code = ordr.code );
{ "outer_table": "requests", "inner_table": "invoices", "outer_alias": "ordr", "inner_alias": "inv", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04342
train
v3
Schema: employees (alias: emp)(date, value, name, status) customers(value, type, date, salary) Task: Retrieve id from employees with amount above the MIN(salary) of customers rows sharing the same level. SQL:
SELECT id FROM employees AS emp WHERE amount > ( SELECT MIN(salary) FROM customers AS cust WHERE cust.level = emp.level );
{ "outer_table": "employees", "inner_table": "customers", "outer_alias": "emp", "inner_alias": "cust", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04343
train
v2
Schema: sales (alias: sale)(amount, code, salary, value) regions(id, type, value, amount) Task: Find salary from sales where a matching record exists in regions with the same status. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = sale.status );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "salary", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04344
train
v3
Schema: schedules (alias: schd)(amount, id, date, code) transactions(type, name, status, code) Task: Retrieve name from schedules with amount above the MAX(value) of transactions rows sharing the same type. SQL:
SELECT name FROM schedules AS schd WHERE amount > ( SELECT MAX(value) FROM transactions AS txn WHERE txn.type = schd.type );
{ "outer_table": "schedules", "inner_table": "transactions", "outer_alias": "schd", "inner_alias": "txn", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04345
train
v1
Schema: invoices (alias: inv)(level, value, date, type) items(date, amount, code, type) Task: Select salary from invoices where code exists in items for the same status. SQL:
SELECT salary FROM invoices AS inv WHERE code IN ( SELECT code FROM items AS lne WHERE lne.status = inv.status );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04346
train
v3
Schema: customers (alias: cust)(code, status, date, name) staff(id, amount, code, salary) Task: Find name from customers where salary exceeds the average amount from staff for the same id. SQL:
SELECT name FROM customers AS cust WHERE salary > ( SELECT AVG(amount) FROM staff AS empl WHERE empl.id = cust.id );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04347
train
v3
Schema: categories (alias: catg)(id, status, name, type) requests(status, amount, id, date) Task: Find code from categories where amount exceeds the count of amount from requests for the same id. SQL:
SELECT code FROM categories AS catg WHERE amount > ( SELECT COUNT(amount) FROM requests AS ordr WHERE ordr.id = catg.id );
{ "outer_table": "categories", "inner_table": "requests", "outer_alias": "catg", "inner_alias": "ordr", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04348
train
v2
Schema: transactions (alias: txn)(id, status, name, level) tasks(type, salary, code, id) Task: Retrieve name from transactions that have at least one corresponding entry in tasks sharing the same code. SQL:
SELECT name FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.code = txn.code );
{ "outer_table": "transactions", "inner_table": "tasks", "outer_alias": "txn", "inner_alias": "tsk", "proj_col": "name", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04349
train
v1
Schema: schedules (alias: schd)(date, id, level, value) branches(code, type, salary, level) Task: Select code from schedules where type exists in branches for the same type. SQL:
SELECT code FROM schedules AS schd WHERE type IN ( SELECT type FROM branches AS brc WHERE brc.type = schd.type );
{ "outer_table": "schedules", "inner_table": "branches", "outer_alias": "schd", "inner_alias": "brc", "proj_col": "code", "filter_col": "type", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04350
train
v1
Schema: items (alias: lne)(id, name, amount, level) sales(salary, value, amount, date) Task: Find name from items where code appears in sales entries with matching id. SQL:
SELECT name FROM items AS lne WHERE code IN ( SELECT code FROM sales AS sale WHERE sale.id = lne.id );
{ "outer_table": "items", "inner_table": "sales", "outer_alias": "lne", "inner_alias": "sale", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04351
train
v2
Schema: managers (alias: mgr)(id, status, date, code) branches(status, type, id, code) Task: Find id from managers where a matching record exists in branches with the same code. SQL:
SELECT id FROM managers AS mgr WHERE EXISTS ( SELECT 1 FROM branches AS brc WHERE brc.code = mgr.code );
{ "outer_table": "managers", "inner_table": "branches", "outer_alias": "mgr", "inner_alias": "brc", "proj_col": "id", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04352
train
v2
Schema: categories (alias: catg)(level, type, status, name) projects(code, name, salary, id) Task: Find code from categories where a matching record exists in projects with the same level. SQL:
SELECT code FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.level = catg.level );
{ "outer_table": "categories", "inner_table": "projects", "outer_alias": "catg", "inner_alias": "prj", "proj_col": "code", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04353
train
v1
Schema: tasks (alias: tsk)(id, date, amount, type) invoices(value, amount, salary, id) Task: Retrieve amount from tasks whose id is found in invoices rows where code matches the outer record. SQL:
SELECT amount FROM tasks AS tsk WHERE id IN ( SELECT id FROM invoices AS inv WHERE inv.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "invoices", "outer_alias": "tsk", "inner_alias": "inv", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04354
train
v1
Schema: schedules (alias: schd)(salary, value, code, level) customers(id, name, amount, code) Task: Retrieve value from schedules whose code is found in customers rows where code matches the outer record. SQL:
SELECT value FROM schedules AS schd WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.code = schd.code );
{ "outer_table": "schedules", "inner_table": "customers", "outer_alias": "schd", "inner_alias": "cust", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04355
train
v2
Schema: tasks (alias: tsk)(date, status, amount, value) employees(value, status, date, code) Task: Find salary from tasks where a matching record exists in employees with the same type. SQL:
SELECT salary FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "employees", "outer_alias": "tsk", "inner_alias": "emp", "proj_col": "salary", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04356
train
v2
Schema: projects (alias: prj)(name, id, salary, amount) departments(date, id, salary, level) Task: Retrieve id from projects that have at least one corresponding entry in departments sharing the same level. SQL:
SELECT id FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM departments AS dept WHERE dept.level = prj.level );
{ "outer_table": "projects", "inner_table": "departments", "outer_alias": "prj", "inner_alias": "dept", "proj_col": "id", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04357
train
v2
Schema: invoices (alias: inv)(salary, amount, value, name) sales(code, type, salary, value) Task: Find amount from invoices where a matching record exists in sales with the same status. SQL:
SELECT amount FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = inv.status );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "amount", "join_col": "status", "correlated_ref": "inv.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04358
train
v2
Schema: requests (alias: ordr)(value, code, name, level) employees(amount, salary, value, code) Task: Retrieve amount from requests that have at least one corresponding entry in employees sharing the same type. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = ordr.type );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "amount", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04359
train
v1
Schema: transactions (alias: txn)(name, amount, salary, type) categories(value, date, amount, code) Task: Select code from transactions where level exists in categories for the same id. SQL:
SELECT code FROM transactions AS txn WHERE level IN ( SELECT level FROM categories AS catg WHERE catg.id = txn.id );
{ "outer_table": "transactions", "inner_table": "categories", "outer_alias": "txn", "inner_alias": "catg", "proj_col": "code", "filter_col": "level", "join_col": "id", "correlated_ref": "txn.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04360
train
v3
Schema: customers (alias: cust)(status, value, name, level) orders(code, id, type, level) Task: Retrieve value from customers with amount above the COUNT(salary) of orders rows sharing the same code. SQL:
SELECT value FROM customers AS cust WHERE amount > ( SELECT COUNT(salary) FROM orders AS ord WHERE ord.code = cust.code );
{ "outer_table": "customers", "inner_table": "orders", "outer_alias": "cust", "inner_alias": "ord", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04361
train
v3
Schema: orders (alias: ord)(amount, salary, value, status) schedules(code, amount, status, salary) Task: Retrieve value from orders with value above the MAX(salary) of schedules rows sharing the same id. SQL:
SELECT value FROM orders AS ord WHERE value > ( SELECT MAX(salary) FROM schedules AS schd WHERE schd.id = ord.id );
{ "outer_table": "orders", "inner_table": "schedules", "outer_alias": "ord", "inner_alias": "schd", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04362
train
v1
Schema: projects (alias: prj)(value, id, level, date) managers(value, code, name, status) Task: Select id from projects where id exists in managers for the same status. SQL:
SELECT id FROM projects AS prj WHERE id IN ( SELECT id FROM managers AS mgr WHERE mgr.status = prj.status );
{ "outer_table": "projects", "inner_table": "managers", "outer_alias": "prj", "inner_alias": "mgr", "proj_col": "id", "filter_col": "id", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04363
train
v2
Schema: schedules (alias: schd)(name, value, type, salary) shipments(value, code, id, type) Task: Retrieve name from schedules that have at least one corresponding entry in shipments sharing the same level. SQL:
SELECT name FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = schd.level );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "name", "join_col": "level", "correlated_ref": "schd.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04364
train
v2
Schema: employees (alias: emp)(name, id, code, amount) categories(code, status, amount, date) Task: Find code from employees where a matching record exists in categories with the same code. SQL:
SELECT code FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM categories AS catg WHERE catg.code = emp.code );
{ "outer_table": "employees", "inner_table": "categories", "outer_alias": "emp", "inner_alias": "catg", "proj_col": "code", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04365
train
v1
Schema: branches (alias: brc)(id, date, name, level) categories(date, code, type, salary) Task: Retrieve value from branches whose code is found in categories rows where id matches the outer record. SQL:
SELECT value FROM branches AS brc WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.id = brc.id );
{ "outer_table": "branches", "inner_table": "categories", "outer_alias": "brc", "inner_alias": "catg", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04366
train
v2
Schema: customers (alias: cust)(name, code, date, level) accounts(value, amount, date, code) Task: Retrieve code from customers that have at least one corresponding entry in accounts sharing the same level. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.level = cust.level );
{ "outer_table": "customers", "inner_table": "accounts", "outer_alias": "cust", "inner_alias": "acct", "proj_col": "code", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04367
train
v1
Schema: categories (alias: catg)(id, status, value, level) invoices(status, date, code, id) Task: Retrieve value from categories whose level is found in invoices rows where id matches the outer record. SQL:
SELECT value FROM categories AS catg WHERE level IN ( SELECT level FROM invoices AS inv WHERE inv.id = catg.id );
{ "outer_table": "categories", "inner_table": "invoices", "outer_alias": "catg", "inner_alias": "inv", "proj_col": "value", "filter_col": "level", "join_col": "id", "correlated_ref": "catg.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04368
train
v1
Schema: schedules (alias: schd)(salary, amount, date, code) customers(name, date, type, level) Task: Select code from schedules where status exists in customers for the same type. SQL:
SELECT code FROM schedules AS schd WHERE status IN ( SELECT status FROM customers AS cust WHERE cust.type = schd.type );
{ "outer_table": "schedules", "inner_table": "customers", "outer_alias": "schd", "inner_alias": "cust", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04369
train
v1
Schema: projects (alias: prj)(id, salary, date, amount) departments(value, type, level, name) Task: Select code from projects where level exists in departments for the same type. SQL:
SELECT code FROM projects AS prj WHERE level IN ( SELECT level FROM departments AS dept WHERE dept.type = prj.type );
{ "outer_table": "projects", "inner_table": "departments", "outer_alias": "prj", "inner_alias": "dept", "proj_col": "code", "filter_col": "level", "join_col": "type", "correlated_ref": "prj.type", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04370
train
v1
Schema: requests (alias: ordr)(salary, value, level, date) tasks(salary, type, code, status) Task: Find value from requests where code appears in tasks entries with matching id. SQL:
SELECT value FROM requests AS ordr WHERE code IN ( SELECT code FROM tasks AS tsk WHERE tsk.id = ordr.id );
{ "outer_table": "requests", "inner_table": "tasks", "outer_alias": "ordr", "inner_alias": "tsk", "proj_col": "value", "filter_col": "code", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04371
train
v1
Schema: schedules (alias: schd)(name, amount, level, type) invoices(name, date, type, value) Task: Retrieve amount from schedules whose type is found in invoices rows where type matches the outer record. SQL:
SELECT amount FROM schedules AS schd WHERE type IN ( SELECT type FROM invoices AS inv WHERE inv.type = schd.type );
{ "outer_table": "schedules", "inner_table": "invoices", "outer_alias": "schd", "inner_alias": "inv", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "schd.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04372
train
v2
Schema: branches (alias: brc)(date, level, id, amount) schedules(id, salary, type, status) Task: Find id from branches where a matching record exists in schedules with the same id. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = brc.id );
{ "outer_table": "branches", "inner_table": "schedules", "outer_alias": "brc", "inner_alias": "schd", "proj_col": "id", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04373
train
v1
Schema: items (alias: lne)(status, salary, value, level) regions(status, name, amount, code) Task: Find name from items where level appears in regions entries with matching id. SQL:
SELECT name FROM items AS lne WHERE level IN ( SELECT level FROM regions AS rgn WHERE rgn.id = lne.id );
{ "outer_table": "items", "inner_table": "regions", "outer_alias": "lne", "inner_alias": "rgn", "proj_col": "name", "filter_col": "level", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04374
train
v2
Schema: invoices (alias: inv)(type, salary, name, value) sales(status, id, level, name) Task: Retrieve code from invoices that have at least one corresponding entry in sales sharing the same id. SQL:
SELECT code FROM invoices AS inv WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.id = inv.id );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "code", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04375
train
v2
Schema: transactions (alias: txn)(amount, code, date, value) sales(status, name, amount, type) Task: Find amount from transactions where a matching record exists in sales with the same level. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.level = txn.level );
{ "outer_table": "transactions", "inner_table": "sales", "outer_alias": "txn", "inner_alias": "sale", "proj_col": "amount", "join_col": "level", "correlated_ref": "txn.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04376
train
v2
Schema: tasks (alias: tsk)(name, status, id, level) invoices(date, code, type, level) Task: Retrieve salary from tasks that have at least one corresponding entry in invoices sharing the same id. SQL:
SELECT salary FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = tsk.id );
{ "outer_table": "tasks", "inner_table": "invoices", "outer_alias": "tsk", "inner_alias": "inv", "proj_col": "salary", "join_col": "id", "correlated_ref": "tsk.id", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04377
train
v2
Schema: requests (alias: ordr)(amount, id, salary, level) shipments(amount, level, value, name) Task: Retrieve salary from requests that have at least one corresponding entry in shipments sharing the same level. SQL:
SELECT salary FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.level = ordr.level );
{ "outer_table": "requests", "inner_table": "shipments", "outer_alias": "ordr", "inner_alias": "shp", "proj_col": "salary", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_04378
train
v1
Schema: projects (alias: prj)(date, salary, value, status) items(status, level, amount, type) Task: Find id from projects where code appears in items entries with matching code. SQL:
SELECT id FROM projects AS prj WHERE code IN ( SELECT code FROM items AS lne WHERE lne.code = prj.code );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "lne", "proj_col": "id", "filter_col": "code", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_04379
train
v2
Schema: schedules (alias: schd)(type, value, amount, date) shipments(type, salary, id, date) Task: Find value from schedules where a matching record exists in shipments with the same id. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = schd.id );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "value", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04380
train
v2
Schema: employees (alias: emp)(value, code, name, type) tasks(level, date, name, value) Task: Retrieve amount from employees that have at least one corresponding entry in tasks sharing the same type. SQL:
SELECT amount FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.type = emp.type );
{ "outer_table": "employees", "inner_table": "tasks", "outer_alias": "emp", "inner_alias": "tsk", "proj_col": "amount", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04381
train
v1
Schema: invoices (alias: inv)(value, type, name, level) branches(date, amount, id, name) Task: Retrieve name from invoices whose type is found in branches rows where code matches the outer record. SQL:
SELECT name FROM invoices AS inv WHERE type IN ( SELECT type FROM branches AS brc WHERE brc.code = inv.code );
{ "outer_table": "invoices", "inner_table": "branches", "outer_alias": "inv", "inner_alias": "brc", "proj_col": "name", "filter_col": "type", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04382
train
v3
Schema: orders (alias: ord)(salary, code, id, type) categories(name, value, code, salary) Task: Retrieve salary from orders with value above the AVG(value) of categories rows sharing the same type. SQL:
SELECT salary FROM orders AS ord WHERE value > ( SELECT AVG(value) FROM categories AS catg WHERE catg.type = ord.type );
{ "outer_table": "orders", "inner_table": "categories", "outer_alias": "ord", "inner_alias": "catg", "proj_col": "salary", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04383
train
v1
Schema: customers (alias: cust)(status, name, value, amount) sales(value, id, name, date) Task: Retrieve code from customers whose id is found in sales rows where id matches the outer record. SQL:
SELECT code FROM customers AS cust WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.id = cust.id );
{ "outer_table": "customers", "inner_table": "sales", "outer_alias": "cust", "inner_alias": "sale", "proj_col": "code", "filter_col": "id", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04384
train
v2
Schema: categories (alias: catg)(status, id, amount, name) customers(value, name, date, salary) Task: Find salary from categories where a matching record exists in customers with the same type. SQL:
SELECT salary FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.type = catg.type );
{ "outer_table": "categories", "inner_table": "customers", "outer_alias": "catg", "inner_alias": "cust", "proj_col": "salary", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04385
train
v3
Schema: customers (alias: cust)(id, name, value, salary) projects(level, value, code, type) Task: Find id from customers where salary exceeds the count of salary from projects for the same code. SQL:
SELECT id FROM customers AS cust WHERE salary > ( SELECT COUNT(salary) FROM projects AS prj WHERE prj.code = cust.code );
{ "outer_table": "customers", "inner_table": "projects", "outer_alias": "cust", "inner_alias": "prj", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04386
train
v1
Schema: invoices (alias: inv)(salary, level, type, amount) requests(type, value, code, level) Task: Select amount from invoices where code exists in requests for the same code. SQL:
SELECT amount FROM invoices AS inv WHERE code IN ( SELECT code FROM requests AS ordr WHERE ordr.code = inv.code );
{ "outer_table": "invoices", "inner_table": "requests", "outer_alias": "inv", "inner_alias": "ordr", "proj_col": "amount", "filter_col": "code", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04387
train
v1
Schema: employees (alias: emp)(level, code, name, amount) items(code, level, salary, id) Task: Select value from employees where level exists in items for the same id. SQL:
SELECT value FROM employees AS emp WHERE level IN ( SELECT level FROM items AS lne WHERE lne.id = emp.id );
{ "outer_table": "employees", "inner_table": "items", "outer_alias": "emp", "inner_alias": "lne", "proj_col": "value", "filter_col": "level", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04388
train
v1
Schema: products (alias: prod)(amount, id, name, level) categories(status, type, name, code) Task: Select value from products where code exists in categories for the same code. SQL:
SELECT value FROM products AS prod WHERE code IN ( SELECT code FROM categories AS catg WHERE catg.code = prod.code );
{ "outer_table": "products", "inner_table": "categories", "outer_alias": "prod", "inner_alias": "catg", "proj_col": "value", "filter_col": "code", "join_col": "code", "correlated_ref": "prod.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04389
train
v3
Schema: branches (alias: brc)(amount, level, code, type) staff(date, value, name, salary) Task: Find value from branches where amount exceeds the count of value from staff for the same type. SQL:
SELECT value FROM branches AS brc WHERE amount > ( SELECT COUNT(value) FROM staff AS empl WHERE empl.type = brc.type );
{ "outer_table": "branches", "inner_table": "staff", "outer_alias": "brc", "inner_alias": "empl", "proj_col": "value", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "brc.type", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_04390
train
v2
Schema: regions (alias: rgn)(id, type, level, value) projects(salary, status, code, name) Task: Find id from regions where a matching record exists in projects with the same id. SQL:
SELECT id FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.id = rgn.id );
{ "outer_table": "regions", "inner_table": "projects", "outer_alias": "rgn", "inner_alias": "prj", "proj_col": "id", "join_col": "id", "correlated_ref": "rgn.id", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04391
train
v2
Schema: regions (alias: rgn)(type, salary, date, value) employees(salary, type, value, code) Task: Find name from regions where a matching record exists in employees with the same type. SQL:
SELECT name FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM employees AS emp WHERE emp.type = rgn.type );
{ "outer_table": "regions", "inner_table": "employees", "outer_alias": "rgn", "inner_alias": "emp", "proj_col": "name", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_04392
train
v3
Schema: tasks (alias: tsk)(code, level, amount, status) customers(amount, type, salary, id) Task: Find id from tasks where amount exceeds the average value from customers for the same type. SQL:
SELECT id FROM tasks AS tsk WHERE amount > ( SELECT AVG(value) FROM customers AS cust WHERE cust.type = tsk.type );
{ "outer_table": "tasks", "inner_table": "customers", "outer_alias": "tsk", "inner_alias": "cust", "proj_col": "id", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "tsk.type", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_04393
train
v3
Schema: sales (alias: sale)(value, level, type, status) items(name, type, id, salary) Task: Retrieve amount from sales with value above the SUM(salary) of items rows sharing the same status. SQL:
SELECT amount FROM sales AS sale WHERE value > ( SELECT SUM(salary) FROM items AS lne WHERE lne.status = sale.status );
{ "outer_table": "sales", "inner_table": "items", "outer_alias": "sale", "inner_alias": "lne", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "sale.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04394
train
v2
Schema: customers (alias: cust)(code, name, amount, status) managers(name, type, salary, id) Task: Retrieve id from customers that have at least one corresponding entry in managers sharing the same id. SQL:
SELECT id FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = cust.id );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "id", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04395
train
v1
Schema: orders (alias: ord)(salary, id, code, date) sales(salary, type, id, value) Task: Select code from orders where id exists in sales for the same id. SQL:
SELECT code FROM orders AS ord WHERE id IN ( SELECT id FROM sales AS sale WHERE sale.id = ord.id );
{ "outer_table": "orders", "inner_table": "sales", "outer_alias": "ord", "inner_alias": "sale", "proj_col": "code", "filter_col": "id", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04396
train
v3
Schema: schedules (alias: schd)(id, date, level, amount) staff(date, level, status, name) Task: Find salary from schedules where salary exceeds the average salary from staff for the same id. SQL:
SELECT salary FROM schedules AS schd WHERE salary > ( SELECT AVG(salary) FROM staff AS empl WHERE empl.id = schd.id );
{ "outer_table": "schedules", "inner_table": "staff", "outer_alias": "schd", "inner_alias": "empl", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "schd.id", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_04397
train
v3
Schema: items (alias: lne)(level, type, name, amount) employees(status, amount, name, code) Task: Retrieve amount from items with amount above the MAX(amount) of employees rows sharing the same status. SQL:
SELECT amount FROM items AS lne WHERE amount > ( SELECT MAX(amount) FROM employees AS emp WHERE emp.status = lne.status );
{ "outer_table": "items", "inner_table": "employees", "outer_alias": "lne", "inner_alias": "emp", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "lne.status", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_04398
train
v1
Schema: sales (alias: sale)(amount, value, code, type) projects(type, code, amount, level) Task: Select salary from sales where status exists in projects for the same level. SQL:
SELECT salary FROM sales AS sale WHERE status IN ( SELECT status FROM projects AS prj WHERE prj.level = sale.level );
{ "outer_table": "sales", "inner_table": "projects", "outer_alias": "sale", "inner_alias": "prj", "proj_col": "salary", "filter_col": "status", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_04399
train