variant
stringclasses
3 values
prompt
stringlengths
160
237
sql
stringlengths
102
141
metadata
unknown
token_group
stringclasses
2 values
id
stringlengths
24
24
split
stringclasses
1 value
v3
Schema: customers (alias: cust)(code, salary, id, amount) regions(amount, id, date, type) Task: Retrieve name from customers with salary above the MAX(amount) of regions rows sharing the same id. SQL:
SELECT name FROM customers AS cust WHERE salary > ( SELECT MAX(amount) FROM regions AS rgn WHERE rgn.id = cust.id );
{ "outer_table": "customers", "inner_table": "regions", "outer_alias": "cust", "inner_alias": "rgn", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00600
train
v3
Schema: staff (alias: empl)(type, level, name, date) regions(date, amount, level, id) Task: Find id from staff where value exceeds the total salary from regions for the same id. SQL:
SELECT id FROM staff AS empl WHERE value > ( SELECT SUM(salary) FROM regions AS rgn WHERE rgn.id = empl.id );
{ "outer_table": "staff", "inner_table": "regions", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_00601
train
v1
Schema: sales (alias: sale)(id, date, amount, code) customers(level, date, type, value) Task: Select code from sales where code exists in customers for the same level. SQL:
SELECT code FROM sales AS sale WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.level = sale.level );
{ "outer_table": "sales", "inner_table": "customers", "outer_alias": "sale", "inner_alias": "cust", "proj_col": "code", "filter_col": "code", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00602
train
v1
Schema: products (alias: prod)(amount, salary, type, value) departments(name, type, date, amount) Task: Retrieve name from products whose code is found in departments rows where status matches the outer record. SQL:
SELECT name FROM products AS prod WHERE code IN ( SELECT code FROM departments AS dept WHERE dept.status = prod.status );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00603
train
v1
Schema: regions (alias: rgn)(code, type, salary, value) transactions(code, status, id, amount) Task: Select name from regions where type exists in transactions for the same level. SQL:
SELECT name FROM regions AS rgn WHERE type IN ( SELECT type FROM transactions AS txn WHERE txn.level = rgn.level );
{ "outer_table": "regions", "inner_table": "transactions", "outer_alias": "rgn", "inner_alias": "txn", "proj_col": "name", "filter_col": "type", "join_col": "level", "correlated_ref": "rgn.level", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_00604
train
v3
Schema: customers (alias: cust)(value, amount, type, code) staff(type, level, name, status) Task: Find salary from customers where value exceeds the count of salary from staff for the same id. SQL:
SELECT salary FROM customers AS cust WHERE value > ( SELECT COUNT(salary) FROM staff AS empl WHERE empl.id = cust.id );
{ "outer_table": "customers", "inner_table": "staff", "outer_alias": "cust", "inner_alias": "empl", "proj_col": "salary", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "cust.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00605
train
v2
Schema: regions (alias: rgn)(salary, value, date, level) sales(type, date, code, salary) Task: Find value from regions where a matching record exists in sales with the same type. SQL:
SELECT value FROM regions AS rgn WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.type = rgn.type );
{ "outer_table": "regions", "inner_table": "sales", "outer_alias": "rgn", "inner_alias": "sale", "proj_col": "value", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_00606
train
v2
Schema: orders (alias: ord)(type, date, salary, value) transactions(code, amount, value, id) Task: Retrieve name from orders that have at least one corresponding entry in transactions sharing the same type. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM transactions AS txn WHERE txn.type = ord.type );
{ "outer_table": "orders", "inner_table": "transactions", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "name", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00607
train
v3
Schema: managers (alias: mgr)(salary, code, name, id) employees(status, date, id, amount) Task: Find value from managers where salary exceeds the average salary from employees for the same status. SQL:
SELECT value FROM managers AS mgr WHERE salary > ( SELECT AVG(salary) FROM employees AS emp WHERE emp.status = mgr.status );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "value", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00608
train
v1
Schema: sales (alias: sale)(status, date, type, id) regions(amount, code, date, type) Task: Select code from sales where id exists in regions for the same type. SQL:
SELECT code FROM sales AS sale WHERE id IN ( SELECT id FROM regions AS rgn WHERE rgn.type = sale.type );
{ "outer_table": "sales", "inner_table": "regions", "outer_alias": "sale", "inner_alias": "rgn", "proj_col": "code", "filter_col": "id", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00609
train
v1
Schema: invoices (alias: inv)(date, id, amount, level) items(salary, value, amount, date) Task: Find id from invoices where level appears in items entries with matching level. SQL:
SELECT id FROM invoices AS inv WHERE level IN ( SELECT level FROM items AS lne WHERE lne.level = inv.level );
{ "outer_table": "invoices", "inner_table": "items", "outer_alias": "inv", "inner_alias": "lne", "proj_col": "id", "filter_col": "level", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00610
train
v1
Schema: shipments (alias: shp)(value, amount, code, type) managers(code, level, name, id) Task: Find salary from shipments where type appears in managers entries with matching code. SQL:
SELECT salary FROM shipments AS shp WHERE type IN ( SELECT type FROM managers AS mgr WHERE mgr.code = shp.code );
{ "outer_table": "shipments", "inner_table": "managers", "outer_alias": "shp", "inner_alias": "mgr", "proj_col": "salary", "filter_col": "type", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00611
train
v2
Schema: items (alias: lne)(code, amount, value, salary) tasks(amount, code, id, status) Task: Find salary from items where a matching record exists in tasks with the same code. SQL:
SELECT salary FROM items AS lne WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.code = lne.code );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "salary", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00612
train
v1
Schema: orders (alias: ord)(salary, date, level, code) employees(status, salary, id, level) Task: Retrieve salary from orders whose level is found in employees rows where code matches the outer record. SQL:
SELECT salary FROM orders AS ord WHERE level IN ( SELECT level FROM employees AS emp WHERE emp.code = ord.code );
{ "outer_table": "orders", "inner_table": "employees", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "salary", "filter_col": "level", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00613
train
v2
Schema: requests (alias: ordr)(value, status, id, salary) projects(amount, type, status, id) Task: Retrieve id from requests that have at least one corresponding entry in projects sharing the same type. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = ordr.type );
{ "outer_table": "requests", "inner_table": "projects", "outer_alias": "ordr", "inner_alias": "prj", "proj_col": "id", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_00614
train
v1
Schema: departments (alias: dept)(level, name, date, type) employees(code, amount, id, value) Task: Select id from departments where code exists in employees for the same level. SQL:
SELECT id FROM departments AS dept WHERE code IN ( SELECT code FROM employees AS emp WHERE emp.level = dept.level );
{ "outer_table": "departments", "inner_table": "employees", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "id", "filter_col": "code", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00615
train
v1
Schema: staff (alias: empl)(type, date, code, value) transactions(level, status, date, id) Task: Find id from staff where level appears in transactions entries with matching type. SQL:
SELECT id FROM staff AS empl WHERE level IN ( SELECT level FROM transactions AS txn WHERE txn.type = empl.type );
{ "outer_table": "staff", "inner_table": "transactions", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_00616
train
v2
Schema: tasks (alias: tsk)(name, type, amount, level) staff(salary, id, name, value) Task: Find value from tasks where a matching record exists in staff with the same level. SQL:
SELECT value FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.level = tsk.level );
{ "outer_table": "tasks", "inner_table": "staff", "outer_alias": "tsk", "inner_alias": "empl", "proj_col": "value", "join_col": "level", "correlated_ref": "tsk.level", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_00617
train
v2
Schema: sales (alias: sale)(amount, type, date, salary) requests(code, date, type, amount) Task: Retrieve name from sales that have at least one corresponding entry in requests sharing the same id. SQL:
SELECT name FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.id = sale.id );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "name", "join_col": "id", "correlated_ref": "sale.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00618
train
v3
Schema: requests (alias: ordr)(type, code, salary, amount) staff(code, value, date, id) Task: Find name from requests where amount exceeds the minimum amount from staff for the same code. SQL:
SELECT name FROM requests AS ordr WHERE amount > ( SELECT MIN(amount) FROM staff AS empl WHERE empl.code = ordr.code );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_00619
train
v1
Schema: tasks (alias: tsk)(type, date, code, level) staff(name, code, id, status) Task: Retrieve salary from tasks whose code is found in staff rows where status matches the outer record. SQL:
SELECT salary FROM tasks AS tsk WHERE code IN ( SELECT code FROM staff AS empl WHERE empl.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "staff", "outer_alias": "tsk", "inner_alias": "empl", "proj_col": "salary", "filter_col": "code", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_00620
train
v3
Schema: accounts (alias: acct)(status, name, amount, code) items(date, value, amount, salary) Task: Retrieve code from accounts with amount above the MIN(value) of items rows sharing the same code. SQL:
SELECT code FROM accounts AS acct WHERE amount > ( SELECT MIN(value) FROM items AS lne WHERE lne.code = acct.code );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MIN", "join_col": "code", "correlated_ref": "acct.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00621
train
v2
Schema: schedules (alias: schd)(salary, code, name, id) transactions(salary, value, code, date) Task: Retrieve name from schedules that have at least one corresponding entry in transactions sharing the same code. SQL:
SELECT name 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": "name", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00622
train
v2
Schema: orders (alias: ord)(value, level, status, date) projects(amount, date, name, code) Task: Retrieve salary from orders that have at least one corresponding entry in projects sharing the same type. SQL:
SELECT salary FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.type = ord.type );
{ "outer_table": "orders", "inner_table": "projects", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "salary", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00623
train
v1
Schema: projects (alias: prj)(level, code, type, date) invoices(status, amount, name, salary) Task: Select name from projects where code exists in invoices for the same status. SQL:
SELECT name FROM projects AS prj WHERE code IN ( SELECT code FROM invoices AS inv WHERE inv.status = prj.status );
{ "outer_table": "projects", "inner_table": "invoices", "outer_alias": "prj", "inner_alias": "inv", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "prj.status", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_00624
train
v3
Schema: sales (alias: sale)(id, code, status, amount) requests(amount, id, value, code) Task: Retrieve id from sales with value above the AVG(value) of requests rows sharing the same code. SQL:
SELECT id FROM sales AS sale WHERE value > ( SELECT AVG(value) FROM requests AS ordr WHERE ordr.code = sale.code );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "id", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "sale.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00625
train
v3
Schema: invoices (alias: inv)(status, amount, value, code) employees(status, type, level, amount) Task: Retrieve salary from invoices with amount above the COUNT(salary) of employees rows sharing the same type. SQL:
SELECT salary FROM invoices AS inv WHERE amount > ( SELECT COUNT(salary) FROM employees AS emp WHERE emp.type = inv.type );
{ "outer_table": "invoices", "inner_table": "employees", "outer_alias": "inv", "inner_alias": "emp", "proj_col": "salary", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00626
train
v3
Schema: tasks (alias: tsk)(value, date, type, code) invoices(code, amount, type, date) Task: Find name from tasks where salary exceeds the maximum amount from invoices for the same code. SQL:
SELECT name FROM tasks AS tsk WHERE salary > ( SELECT MAX(amount) FROM invoices AS inv WHERE inv.code = tsk.code );
{ "outer_table": "tasks", "inner_table": "invoices", "outer_alias": "tsk", "inner_alias": "inv", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "tsk.code", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_00627
train
v1
Schema: departments (alias: dept)(status, date, salary, id) products(value, amount, id, type) Task: Retrieve value from departments whose code is found in products rows where status matches the outer record. SQL:
SELECT value FROM departments AS dept WHERE code IN ( SELECT code FROM products AS prod WHERE prod.status = dept.status );
{ "outer_table": "departments", "inner_table": "products", "outer_alias": "dept", "inner_alias": "prod", "proj_col": "value", "filter_col": "code", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00628
train
v2
Schema: tasks (alias: tsk)(salary, id, code, type) regions(id, status, amount, type) Task: Find id from tasks where a matching record exists in regions with the same status. SQL:
SELECT id FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "regions", "outer_alias": "tsk", "inner_alias": "rgn", "proj_col": "id", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_00629
train
v2
Schema: orders (alias: ord)(date, level, status, id) tasks(level, salary, amount, id) Task: Find name from orders where a matching record exists in tasks with the same status. SQL:
SELECT name FROM orders AS ord WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.status = ord.status );
{ "outer_table": "orders", "inner_table": "tasks", "outer_alias": "ord", "inner_alias": "tsk", "proj_col": "name", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00630
train
v3
Schema: products (alias: prod)(id, level, status, value) branches(value, type, id, name) Task: Retrieve amount from products with value above the AVG(value) of branches rows sharing the same status. SQL:
SELECT amount FROM products AS prod WHERE value > ( SELECT AVG(value) FROM branches AS brc WHERE brc.status = prod.status );
{ "outer_table": "products", "inner_table": "branches", "outer_alias": "prod", "inner_alias": "brc", "proj_col": "amount", "filter_col": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00631
train
v2
Schema: items (alias: lne)(id, salary, status, type) invoices(code, id, name, type) Task: Find amount from items where a matching record exists in invoices with the same code. SQL:
SELECT amount FROM items AS lne WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.code = lne.code );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "amount", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00632
train
v1
Schema: orders (alias: ord)(value, name, amount, level) products(status, salary, code, level) Task: Retrieve amount from orders whose id is found in products rows where type matches the outer record. SQL:
SELECT amount FROM orders AS ord WHERE id IN ( SELECT id FROM products AS prod WHERE prod.type = ord.type );
{ "outer_table": "orders", "inner_table": "products", "outer_alias": "ord", "inner_alias": "prod", "proj_col": "amount", "filter_col": "id", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00633
train
v1
Schema: schedules (alias: schd)(salary, id, amount, code) employees(value, amount, status, salary) Task: Retrieve code from schedules whose id is found in employees rows where code matches the outer record. SQL:
SELECT code FROM schedules AS schd WHERE id IN ( SELECT id FROM employees AS emp WHERE emp.code = schd.code );
{ "outer_table": "schedules", "inner_table": "employees", "outer_alias": "schd", "inner_alias": "emp", "proj_col": "code", "filter_col": "id", "join_col": "code", "correlated_ref": "schd.code", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00634
train
v1
Schema: departments (alias: dept)(salary, id, type, name) customers(date, level, salary, amount) Task: Select salary from departments where code exists in customers for the same id. SQL:
SELECT salary FROM departments AS dept WHERE code IN ( SELECT code FROM customers AS cust WHERE cust.id = dept.id );
{ "outer_table": "departments", "inner_table": "customers", "outer_alias": "dept", "inner_alias": "cust", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00635
train
v2
Schema: customers (alias: cust)(date, amount, salary, code) tasks(date, salary, amount, name) Task: Find code from customers where a matching record exists in tasks with the same type. SQL:
SELECT code FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.type = cust.type );
{ "outer_table": "customers", "inner_table": "tasks", "outer_alias": "cust", "inner_alias": "tsk", "proj_col": "code", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00636
train
v2
Schema: products (alias: prod)(code, amount, value, status) sales(level, value, name, amount) Task: Find salary from products where a matching record exists in sales with the same status. SQL:
SELECT salary FROM products AS prod WHERE EXISTS ( SELECT 1 FROM sales AS sale WHERE sale.status = prod.status );
{ "outer_table": "products", "inner_table": "sales", "outer_alias": "prod", "inner_alias": "sale", "proj_col": "salary", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00637
train
v2
Schema: sales (alias: sale)(salary, status, name, id) accounts(type, salary, code, id) Task: Retrieve salary from sales that have at least one corresponding entry in accounts sharing the same type. SQL:
SELECT salary FROM sales AS sale WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.type = sale.type );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "salary", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00638
train
v2
Schema: schedules (alias: schd)(type, value, salary, code) shipments(amount, value, code, salary) Task: Find value from schedules where a matching record exists in shipments with the same status. SQL:
SELECT value FROM schedules AS schd WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.status = schd.status );
{ "outer_table": "schedules", "inner_table": "shipments", "outer_alias": "schd", "inner_alias": "shp", "proj_col": "value", "join_col": "status", "correlated_ref": "schd.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00639
train
v1
Schema: shipments (alias: shp)(level, status, code, type) tasks(code, date, amount, type) Task: Select amount from shipments where type exists in tasks for the same level. SQL:
SELECT amount FROM shipments AS shp WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.level = shp.level );
{ "outer_table": "shipments", "inner_table": "tasks", "outer_alias": "shp", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00640
train
v2
Schema: requests (alias: ordr)(id, code, salary, level) schedules(id, level, code, value) Task: Retrieve id from requests that have at least one corresponding entry in schedules sharing the same id. SQL:
SELECT id FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.id = ordr.id );
{ "outer_table": "requests", "inner_table": "schedules", "outer_alias": "ordr", "inner_alias": "schd", "proj_col": "id", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_00641
train
v1
Schema: products (alias: prod)(name, amount, id, date) tasks(code, id, type, salary) Task: Find salary from products where id appears in tasks entries with matching status. SQL:
SELECT salary FROM products AS prod WHERE id IN ( SELECT id FROM tasks AS tsk WHERE tsk.status = prod.status );
{ "outer_table": "products", "inner_table": "tasks", "outer_alias": "prod", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "id", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00642
train
v3
Schema: requests (alias: ordr)(id, status, code, salary) employees(status, level, type, name) Task: Retrieve name from requests with salary above the MAX(value) of employees rows sharing the same code. SQL:
SELECT name FROM requests AS ordr WHERE salary > ( SELECT MAX(value) FROM employees AS emp WHERE emp.code = ordr.code );
{ "outer_table": "requests", "inner_table": "employees", "outer_alias": "ordr", "inner_alias": "emp", "proj_col": "name", "filter_col": "salary", "agg_col": "value", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_00643
train
v2
Schema: departments (alias: dept)(id, level, amount, salary) managers(name, type, level, salary) Task: Retrieve amount from departments that have at least one corresponding entry in managers sharing the same id. SQL:
SELECT amount FROM departments AS dept WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.id = dept.id );
{ "outer_table": "departments", "inner_table": "managers", "outer_alias": "dept", "inner_alias": "mgr", "proj_col": "amount", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00644
train
v2
Schema: requests (alias: ordr)(value, type, salary, status) products(salary, status, date, type) Task: Find code from requests where a matching record exists in products with the same status. SQL:
SELECT code FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM products AS prod WHERE prod.status = ordr.status );
{ "outer_table": "requests", "inner_table": "products", "outer_alias": "ordr", "inner_alias": "prod", "proj_col": "code", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_00645
train
v3
Schema: items (alias: lne)(level, id, amount, type) requests(code, date, type, status) Task: Retrieve salary from items with salary above the AVG(salary) of requests rows sharing the same id. SQL:
SELECT salary FROM items AS lne WHERE salary > ( SELECT AVG(salary) FROM requests AS ordr WHERE ordr.id = lne.id );
{ "outer_table": "items", "inner_table": "requests", "outer_alias": "lne", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "lne.id", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00646
train
v3
Schema: products (alias: prod)(level, value, status, date) departments(value, code, id, date) Task: Retrieve amount from products with amount above the AVG(amount) of departments rows sharing the same level. SQL:
SELECT amount FROM products AS prod WHERE amount > ( SELECT AVG(amount) FROM departments AS dept WHERE dept.level = prod.level );
{ "outer_table": "products", "inner_table": "departments", "outer_alias": "prod", "inner_alias": "dept", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00647
train
v1
Schema: invoices (alias: inv)(id, level, status, amount) sales(salary, amount, id, value) Task: Find amount from invoices where status appears in sales entries with matching id. SQL:
SELECT amount FROM invoices AS inv WHERE status IN ( SELECT status FROM sales AS sale WHERE sale.id = inv.id );
{ "outer_table": "invoices", "inner_table": "sales", "outer_alias": "inv", "inner_alias": "sale", "proj_col": "amount", "filter_col": "status", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00648
train
v1
Schema: requests (alias: ordr)(type, status, id, date) items(code, salary, id, name) Task: Select salary from requests where code exists in items for the same type. SQL:
SELECT salary FROM requests AS ordr WHERE code IN ( SELECT code FROM items AS lne WHERE lne.type = ordr.type );
{ "outer_table": "requests", "inner_table": "items", "outer_alias": "ordr", "inner_alias": "lne", "proj_col": "salary", "filter_col": "code", "join_col": "type", "correlated_ref": "ordr.type", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_00649
train
v2
Schema: transactions (alias: txn)(salary, date, amount, status) managers(amount, name, code, status) Task: Retrieve amount from transactions that have at least one corresponding entry in managers sharing the same code. SQL:
SELECT amount FROM transactions AS txn WHERE EXISTS ( SELECT 1 FROM managers AS mgr WHERE mgr.code = txn.code );
{ "outer_table": "transactions", "inner_table": "managers", "outer_alias": "txn", "inner_alias": "mgr", "proj_col": "amount", "join_col": "code", "correlated_ref": "txn.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00650
train
v2
Schema: projects (alias: prj)(type, status, salary, id) requests(value, code, salary, status) Task: Find id from projects where a matching record exists in requests with the same code. SQL:
SELECT id FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM requests AS ordr WHERE ordr.code = prj.code );
{ "outer_table": "projects", "inner_table": "requests", "outer_alias": "prj", "inner_alias": "ordr", "proj_col": "id", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_00651
train
v3
Schema: requests (alias: ordr)(id, salary, code, level) transactions(id, salary, amount, value) Task: Find name from requests where value exceeds the count of value from transactions for the same id. SQL:
SELECT name FROM requests AS ordr WHERE value > ( SELECT COUNT(value) FROM transactions AS txn WHERE txn.id = ordr.id );
{ "outer_table": "requests", "inner_table": "transactions", "outer_alias": "ordr", "inner_alias": "txn", "proj_col": "name", "filter_col": "value", "agg_col": "value", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_00652
train
v2
Schema: employees (alias: emp)(type, name, value, id) shipments(amount, value, salary, level) Task: Find name from employees where a matching record exists in shipments with the same id. SQL:
SELECT name FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.id = emp.id );
{ "outer_table": "employees", "inner_table": "shipments", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "name", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00653
train
v1
Schema: regions (alias: rgn)(type, amount, value, status) orders(type, value, amount, salary) Task: Select id from regions where status exists in orders for the same type. SQL:
SELECT id FROM regions AS rgn WHERE status IN ( SELECT status FROM orders AS ord WHERE ord.type = rgn.type );
{ "outer_table": "regions", "inner_table": "orders", "outer_alias": "rgn", "inner_alias": "ord", "proj_col": "id", "filter_col": "status", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_00654
train
v3
Schema: sales (alias: sale)(level, type, code, date) requests(code, name, id, date) Task: Retrieve id from sales with salary above the COUNT(amount) of requests rows sharing the same type. SQL:
SELECT id FROM sales AS sale WHERE salary > ( SELECT COUNT(amount) FROM requests AS ordr WHERE ordr.type = sale.type );
{ "outer_table": "sales", "inner_table": "requests", "outer_alias": "sale", "inner_alias": "ordr", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "sale.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00655
train
v1
Schema: branches (alias: brc)(level, code, date, amount) products(value, date, salary, level) Task: Find amount from branches where code appears in products entries with matching status. SQL:
SELECT amount FROM branches AS brc WHERE code IN ( SELECT code FROM products AS prod WHERE prod.status = brc.status );
{ "outer_table": "branches", "inner_table": "products", "outer_alias": "brc", "inner_alias": "prod", "proj_col": "amount", "filter_col": "code", "join_col": "status", "correlated_ref": "brc.status", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_00656
train
v2
Schema: projects (alias: prj)(salary, value, code, type) items(name, id, value, status) Task: Retrieve value from projects that have at least one corresponding entry in items sharing the same code. SQL:
SELECT value FROM projects AS prj WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = prj.code );
{ "outer_table": "projects", "inner_table": "items", "outer_alias": "prj", "inner_alias": "lne", "proj_col": "value", "join_col": "code", "correlated_ref": "prj.code", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_00657
train
v1
Schema: categories (alias: catg)(status, date, name, salary) staff(date, value, level, name) Task: Retrieve amount from categories whose type is found in staff rows where type matches the outer record. SQL:
SELECT amount FROM categories AS catg WHERE type IN ( SELECT type FROM staff AS empl WHERE empl.type = catg.type );
{ "outer_table": "categories", "inner_table": "staff", "outer_alias": "catg", "inner_alias": "empl", "proj_col": "amount", "filter_col": "type", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00658
train
v2
Schema: requests (alias: ordr)(code, value, date, level) staff(type, amount, code, name) Task: Retrieve name from requests that have at least one corresponding entry in staff sharing the same status. SQL:
SELECT name FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM staff AS empl WHERE empl.status = ordr.status );
{ "outer_table": "requests", "inner_table": "staff", "outer_alias": "ordr", "inner_alias": "empl", "proj_col": "name", "join_col": "status", "correlated_ref": "ordr.status", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_00659
train
v2
Schema: accounts (alias: acct)(value, amount, name, level) tasks(level, code, value, status) Task: Retrieve id from accounts that have at least one corresponding entry in tasks sharing the same level. SQL:
SELECT id FROM accounts AS acct WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.level = acct.level );
{ "outer_table": "accounts", "inner_table": "tasks", "outer_alias": "acct", "inner_alias": "tsk", "proj_col": "id", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00660
train
v1
Schema: departments (alias: dept)(name, type, salary, id) shipments(salary, level, code, status) Task: Find id from departments where type appears in shipments entries with matching status. SQL:
SELECT id FROM departments AS dept WHERE type IN ( SELECT type FROM shipments AS shp WHERE shp.status = dept.status );
{ "outer_table": "departments", "inner_table": "shipments", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "id", "filter_col": "type", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00661
train
v2
Schema: categories (alias: catg)(level, status, value, type) projects(id, type, level, date) Task: Retrieve value from categories that have at least one corresponding entry in projects sharing the same status. SQL:
SELECT value FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = catg.status );
{ "outer_table": "categories", "inner_table": "projects", "outer_alias": "catg", "inner_alias": "prj", "proj_col": "value", "join_col": "status", "correlated_ref": "catg.status", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00662
train
v3
Schema: shipments (alias: shp)(type, salary, id, date) branches(salary, amount, value, id) Task: Retrieve id from shipments with amount above the COUNT(salary) of branches rows sharing the same code. SQL:
SELECT id FROM shipments AS shp WHERE amount > ( SELECT COUNT(salary) FROM branches AS brc WHERE brc.code = shp.code );
{ "outer_table": "shipments", "inner_table": "branches", "outer_alias": "shp", "inner_alias": "brc", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00663
train
v2
Schema: employees (alias: emp)(status, value, code, salary) invoices(name, value, salary, date) Task: Find value from employees where a matching record exists in invoices with the same id. SQL:
SELECT value FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM invoices AS inv WHERE inv.id = emp.id );
{ "outer_table": "employees", "inner_table": "invoices", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "value", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00664
train
v2
Schema: employees (alias: emp)(salary, id, value, status) projects(level, id, value, date) Task: Find salary from employees where a matching record exists in projects with the same status. SQL:
SELECT salary FROM employees AS emp WHERE EXISTS ( SELECT 1 FROM projects AS prj WHERE prj.status = emp.status );
{ "outer_table": "employees", "inner_table": "projects", "outer_alias": "emp", "inner_alias": "prj", "proj_col": "salary", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00665
train
v2
Schema: shipments (alias: shp)(type, level, value, code) schedules(level, date, id, amount) Task: Retrieve salary from shipments that have at least one corresponding entry in schedules sharing the same code. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM schedules AS schd WHERE schd.code = shp.code );
{ "outer_table": "shipments", "inner_table": "schedules", "outer_alias": "shp", "inner_alias": "schd", "proj_col": "salary", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00666
train
v1
Schema: invoices (alias: inv)(salary, amount, id, status) transactions(type, code, amount, value) Task: Retrieve name from invoices whose id is found in transactions rows where type matches the outer record. SQL:
SELECT name FROM invoices AS inv WHERE id IN ( SELECT id FROM transactions AS txn WHERE txn.type = inv.type );
{ "outer_table": "invoices", "inner_table": "transactions", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "name", "filter_col": "id", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00667
train
v2
Schema: branches (alias: brc)(date, level, value, code) customers(level, name, status, id) Task: Find amount from branches where a matching record exists in customers with the same level. SQL:
SELECT amount FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM customers AS cust WHERE cust.level = brc.level );
{ "outer_table": "branches", "inner_table": "customers", "outer_alias": "brc", "inner_alias": "cust", "proj_col": "amount", "join_col": "level", "correlated_ref": "brc.level", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_00668
train
v1
Schema: requests (alias: ordr)(level, salary, name, code) departments(type, id, code, value) Task: Select id from requests where type exists in departments for the same id. SQL:
SELECT id FROM requests AS ordr WHERE type IN ( SELECT type FROM departments AS dept WHERE dept.id = ordr.id );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "id", "filter_col": "type", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_00669
train
v3
Schema: projects (alias: prj)(amount, type, level, code) orders(salary, code, date, status) Task: Retrieve code from projects with value above the SUM(amount) of orders rows sharing the same id. SQL:
SELECT code FROM projects AS prj WHERE value > ( SELECT SUM(amount) FROM orders AS ord WHERE ord.id = prj.id );
{ "outer_table": "projects", "inner_table": "orders", "outer_alias": "prj", "inner_alias": "ord", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "prj.id", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_00670
train
v1
Schema: sales (alias: sale)(id, name, date, salary) accounts(level, salary, value, type) Task: Retrieve amount from sales whose type is found in accounts rows where level matches the outer record. SQL:
SELECT amount FROM sales AS sale WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.level = sale.level );
{ "outer_table": "sales", "inner_table": "accounts", "outer_alias": "sale", "inner_alias": "acct", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "sale.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00671
train
v1
Schema: categories (alias: catg)(code, amount, salary, name) products(name, date, code, type) Task: Select value from categories where status exists in products for the same type. SQL:
SELECT value FROM categories AS catg WHERE status IN ( SELECT status FROM products AS prod WHERE prod.type = catg.type );
{ "outer_table": "categories", "inner_table": "products", "outer_alias": "catg", "inner_alias": "prod", "proj_col": "value", "filter_col": "status", "join_col": "type", "correlated_ref": "catg.type", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00672
train
v3
Schema: items (alias: lne)(status, amount, level, id) tasks(value, status, date, id) Task: Retrieve name from items with amount above the MAX(amount) of tasks rows sharing the same code. SQL:
SELECT name FROM items AS lne WHERE amount > ( SELECT MAX(amount) FROM tasks AS tsk WHERE tsk.code = lne.code );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "name", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00673
train
v3
Schema: accounts (alias: acct)(name, salary, code, amount) items(name, id, code, date) Task: Retrieve amount from accounts with value above the MIN(amount) of items rows sharing the same level. SQL:
SELECT amount FROM accounts AS acct WHERE value > ( SELECT MIN(amount) FROM items AS lne WHERE lne.level = acct.level );
{ "outer_table": "accounts", "inner_table": "items", "outer_alias": "acct", "inner_alias": "lne", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "level", "correlated_ref": "acct.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00674
train
v1
Schema: products (alias: prod)(value, type, name, salary) schedules(name, date, code, id) Task: Find id from products where status appears in schedules entries with matching level. SQL:
SELECT id FROM products AS prod WHERE status IN ( SELECT status FROM schedules AS schd WHERE schd.level = prod.level );
{ "outer_table": "products", "inner_table": "schedules", "outer_alias": "prod", "inner_alias": "schd", "proj_col": "id", "filter_col": "status", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00675
train
v2
Schema: shipments (alias: shp)(id, amount, date, salary) orders(name, date, value, status) Task: Find salary from shipments where a matching record exists in orders with the same code. SQL:
SELECT salary FROM shipments AS shp WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = shp.code );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "salary", "join_col": "code", "correlated_ref": "shp.code", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00676
train
v3
Schema: branches (alias: brc)(amount, salary, name, status) categories(date, type, amount, status) Task: Retrieve value from branches with value above the AVG(value) of categories rows sharing the same id. SQL:
SELECT value FROM branches AS brc WHERE value > ( SELECT AVG(value) 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": "value", "agg_col": "value", "agg_fn": "AVG", "join_col": "id", "correlated_ref": "brc.id", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_00677
train
v3
Schema: managers (alias: mgr)(name, salary, level, value) shipments(salary, code, status, type) Task: Retrieve salary from managers with salary above the MAX(salary) of shipments rows sharing the same id. SQL:
SELECT salary FROM managers AS mgr WHERE salary > ( SELECT MAX(salary) FROM shipments AS shp WHERE shp.id = mgr.id );
{ "outer_table": "managers", "inner_table": "shipments", "outer_alias": "mgr", "inner_alias": "shp", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00678
train
v2
Schema: customers (alias: cust)(name, type, salary, code) tasks(value, name, type, code) Task: Retrieve name from customers that have at least one corresponding entry in tasks sharing the same level. SQL:
SELECT name FROM customers AS cust WHERE EXISTS ( SELECT 1 FROM tasks AS tsk WHERE tsk.level = cust.level );
{ "outer_table": "customers", "inner_table": "tasks", "outer_alias": "cust", "inner_alias": "tsk", "proj_col": "name", "join_col": "level", "correlated_ref": "cust.level", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00679
train
v2
Schema: branches (alias: brc)(name, type, date, salary) items(type, value, code, amount) Task: Find id from branches where a matching record exists in items with the same code. SQL:
SELECT id FROM branches AS brc WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.code = brc.code );
{ "outer_table": "branches", "inner_table": "items", "outer_alias": "brc", "inner_alias": "lne", "proj_col": "id", "join_col": "code", "correlated_ref": "brc.code", "token_group": "T2", "fan_out": 1329 }
T2
cs8_fixed_v4_train_00680
train
v1
Schema: customers (alias: cust)(id, salary, date, name) tasks(id, name, code, level) Task: Select id from customers where type exists in tasks for the same code. SQL:
SELECT id FROM customers AS cust WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.code = cust.code );
{ "outer_table": "customers", "inner_table": "tasks", "outer_alias": "cust", "inner_alias": "tsk", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "cust.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00681
train
v1
Schema: customers (alias: cust)(value, id, type, name) schedules(date, level, value, amount) Task: Select amount from customers where id exists in schedules for the same status. SQL:
SELECT amount FROM customers AS cust WHERE id IN ( SELECT id FROM schedules AS schd WHERE schd.status = cust.status );
{ "outer_table": "customers", "inner_table": "schedules", "outer_alias": "cust", "inner_alias": "schd", "proj_col": "amount", "filter_col": "id", "join_col": "status", "correlated_ref": "cust.status", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00682
train
v3
Schema: managers (alias: mgr)(type, amount, value, status) employees(level, type, code, date) Task: Retrieve value from managers with salary above the SUM(amount) of employees rows sharing the same type. SQL:
SELECT value FROM managers AS mgr WHERE salary > ( SELECT SUM(amount) FROM employees AS emp WHERE emp.type = mgr.type );
{ "outer_table": "managers", "inner_table": "employees", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "value", "filter_col": "salary", "agg_col": "amount", "agg_fn": "SUM", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00683
train
v3
Schema: managers (alias: mgr)(amount, salary, date, id) departments(level, value, type, id) Task: Retrieve value from managers with salary above the SUM(value) of departments rows sharing the same code. SQL:
SELECT value FROM managers AS mgr WHERE salary > ( SELECT SUM(value) FROM departments AS dept WHERE dept.code = mgr.code );
{ "outer_table": "managers", "inner_table": "departments", "outer_alias": "mgr", "inner_alias": "dept", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00684
train
v1
Schema: regions (alias: rgn)(salary, status, value, type) managers(salary, code, type, date) Task: Retrieve value from regions whose status is found in managers rows where type matches the outer record. SQL:
SELECT value FROM regions AS rgn WHERE status IN ( SELECT status FROM managers AS mgr WHERE mgr.type = rgn.type );
{ "outer_table": "regions", "inner_table": "managers", "outer_alias": "rgn", "inner_alias": "mgr", "proj_col": "value", "filter_col": "status", "join_col": "type", "correlated_ref": "rgn.type", "token_group": "T2", "fan_out": 1534 }
T2
cs8_fixed_v4_train_00685
train
v3
Schema: shipments (alias: shp)(level, name, salary, code) orders(amount, code, level, name) Task: Find id from shipments where value exceeds the count of salary from orders for the same id. SQL:
SELECT id FROM shipments AS shp WHERE value > ( SELECT COUNT(salary) FROM orders AS ord WHERE ord.id = shp.id );
{ "outer_table": "shipments", "inner_table": "orders", "outer_alias": "shp", "inner_alias": "ord", "proj_col": "id", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "id", "correlated_ref": "shp.id", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00686
train
v2
Schema: requests (alias: ordr)(amount, type, code, level) accounts(date, amount, value, type) Task: Retrieve amount from requests that have at least one corresponding entry in accounts sharing the same id. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM accounts AS acct WHERE acct.id = ordr.id );
{ "outer_table": "requests", "inner_table": "accounts", "outer_alias": "ordr", "inner_alias": "acct", "proj_col": "amount", "join_col": "id", "correlated_ref": "ordr.id", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_00687
train
v2
Schema: categories (alias: catg)(type, name, level, value) regions(value, code, salary, name) Task: Retrieve amount from categories that have at least one corresponding entry in regions sharing the same level. SQL:
SELECT amount FROM categories AS catg WHERE EXISTS ( SELECT 1 FROM regions AS rgn WHERE rgn.level = catg.level );
{ "outer_table": "categories", "inner_table": "regions", "outer_alias": "catg", "inner_alias": "rgn", "proj_col": "amount", "join_col": "level", "correlated_ref": "catg.level", "token_group": "T2", "fan_out": 36 }
T2
cs8_fixed_v4_train_00688
train
v3
Schema: shipments (alias: shp)(salary, code, id, status) products(value, level, status, amount) Task: Retrieve name from shipments with amount above the COUNT(value) of products rows sharing the same level. SQL:
SELECT name FROM shipments AS shp WHERE amount > ( SELECT COUNT(value) FROM products AS prod WHERE prod.level = shp.level );
{ "outer_table": "shipments", "inner_table": "products", "outer_alias": "shp", "inner_alias": "prod", "proj_col": "name", "filter_col": "amount", "agg_col": "value", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "shp.level", "token_group": "T2", "fan_out": 30 }
T2
cs8_fixed_v4_train_00689
train
v3
Schema: departments (alias: dept)(name, type, date, amount) products(code, date, salary, level) Task: Find value from departments where value exceeds the count of amount from products for the same type. SQL:
SELECT value FROM departments AS dept WHERE value > ( SELECT COUNT(amount) FROM products AS prod WHERE prod.type = dept.type );
{ "outer_table": "departments", "inner_table": "products", "outer_alias": "dept", "inner_alias": "prod", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00690
train
v1
Schema: requests (alias: ordr)(amount, name, level, code) departments(code, id, name, level) Task: Select amount from requests where id exists in departments for the same level. SQL:
SELECT amount FROM requests AS ordr WHERE id IN ( SELECT id FROM departments AS dept WHERE dept.level = ordr.level );
{ "outer_table": "requests", "inner_table": "departments", "outer_alias": "ordr", "inner_alias": "dept", "proj_col": "amount", "filter_col": "id", "join_col": "level", "correlated_ref": "ordr.level", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_00691
train
v2
Schema: tasks (alias: tsk)(salary, name, amount, level) items(amount, value, status, name) Task: Retrieve code from tasks that have at least one corresponding entry in items sharing the same status. SQL:
SELECT code FROM tasks AS tsk WHERE EXISTS ( SELECT 1 FROM items AS lne WHERE lne.status = tsk.status );
{ "outer_table": "tasks", "inner_table": "items", "outer_alias": "tsk", "inner_alias": "lne", "proj_col": "code", "join_col": "status", "correlated_ref": "tsk.status", "token_group": "T2", "fan_out": 1586 }
T2
cs8_fixed_v4_train_00692
train
v1
Schema: items (alias: lne)(code, type, date, value) invoices(code, type, status, level) Task: Select name from items where status exists in invoices for the same code. SQL:
SELECT name FROM items AS lne WHERE status IN ( SELECT status FROM invoices AS inv WHERE inv.code = lne.code );
{ "outer_table": "items", "inner_table": "invoices", "outer_alias": "lne", "inner_alias": "inv", "proj_col": "name", "filter_col": "status", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00693
train
v1
Schema: customers (alias: cust)(value, status, level, salary) managers(status, id, salary, type) Task: Find amount from customers where code appears in managers entries with matching type. SQL:
SELECT amount FROM customers AS cust WHERE code IN ( SELECT code FROM managers AS mgr WHERE mgr.type = cust.type );
{ "outer_table": "customers", "inner_table": "managers", "outer_alias": "cust", "inner_alias": "mgr", "proj_col": "amount", "filter_col": "code", "join_col": "type", "correlated_ref": "cust.type", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00694
train
v1
Schema: items (alias: lne)(amount, code, id, salary) tasks(value, salary, date, amount) Task: Find amount from items where type appears in tasks entries with matching code. SQL:
SELECT amount FROM items AS lne WHERE type IN ( SELECT type FROM tasks AS tsk WHERE tsk.code = lne.code );
{ "outer_table": "items", "inner_table": "tasks", "outer_alias": "lne", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "type", "join_col": "code", "correlated_ref": "lne.code", "token_group": "T2", "fan_out": 883 }
T2
cs8_fixed_v4_train_00695
train
v2
Schema: staff (alias: empl)(code, name, salary, status) shipments(level, status, type, amount) Task: Find code from staff where a matching record exists in shipments with the same code. SQL:
SELECT code FROM staff AS empl WHERE EXISTS ( SELECT 1 FROM shipments AS shp WHERE shp.code = empl.code );
{ "outer_table": "staff", "inner_table": "shipments", "outer_alias": "empl", "inner_alias": "shp", "proj_col": "code", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 110 }
T2
cs8_fixed_v4_train_00696
train
v1
Schema: projects (alias: prj)(name, value, status, salary) tasks(type, id, value, status) Task: Select name from projects where code exists in tasks for the same level. SQL:
SELECT name FROM projects AS prj WHERE code IN ( SELECT code FROM tasks AS tsk WHERE tsk.level = prj.level );
{ "outer_table": "projects", "inner_table": "tasks", "outer_alias": "prj", "inner_alias": "tsk", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "prj.level", "token_group": "T2", "fan_out": 712 }
T2
cs8_fixed_v4_train_00697
train
v2
Schema: requests (alias: ordr)(value, name, salary, status) orders(salary, value, date, status) Task: Retrieve amount from requests that have at least one corresponding entry in orders sharing the same code. SQL:
SELECT amount FROM requests AS ordr WHERE EXISTS ( SELECT 1 FROM orders AS ord WHERE ord.code = ordr.code );
{ "outer_table": "requests", "inner_table": "orders", "outer_alias": "ordr", "inner_alias": "ord", "proj_col": "amount", "join_col": "code", "correlated_ref": "ordr.code", "token_group": "T2", "fan_out": 95 }
T2
cs8_fixed_v4_train_00698
train
v1
Schema: departments (alias: dept)(status, salary, type, id) accounts(value, type, status, date) Task: Find salary from departments where type appears in accounts entries with matching id. SQL:
SELECT salary FROM departments AS dept WHERE type IN ( SELECT type FROM accounts AS acct WHERE acct.id = dept.id );
{ "outer_table": "departments", "inner_table": "accounts", "outer_alias": "dept", "inner_alias": "acct", "proj_col": "salary", "filter_col": "type", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
T1
cs8_fixed_v4_train_00699
train