variant
stringclasses
3 values
prompt
stringlengths
185
261
sql
stringlengths
115
154
metadata
unknown
v2
Schema: facility_registry (alias: dept)(salary, type, name, level) sales_queue(amount, type, salary, level) Task: Select value from facility_registry that have at least one matching row in sales_queue for the same level. SQL:
SELECT value FROM facility_registry AS dept WHERE EXISTS ( SELECT 1 FROM sales_queue AS ord WHERE ord.level = dept.level );
{ "outer_table": "facility_registry", "inner_table": "sales_queue", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "value", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
v2
Schema: attribute_groups (alias: ord)(id, date, code, status) area_registry(value, id, code, name) Task: Select name from attribute_groups that have at least one matching row in area_registry for the same level. SQL:
SELECT name FROM attribute_groups AS ord WHERE EXISTS ( SELECT 1 FROM area_registry AS rgn WHERE rgn.level = ord.level );
{ "outer_table": "attribute_groups", "inner_table": "area_registry", "outer_alias": "ord", "inner_alias": "rgn", "proj_col": "name", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T2", "fan_out": 60 }
v3
Schema: workforce_data (alias: mgr)(id, salary, code, amount) receivables_log(level, name, id, date) Task: Select salary from workforce_data where salary is greater than the average of amount in receivables_log for matching type. SQL:
SELECT salary FROM workforce_data AS mgr WHERE salary > ( SELECT AVG(amount) FROM receivables_log AS inv WHERE inv.type = mgr.type );
{ "outer_table": "workforce_data", "inner_table": "receivables_log", "outer_alias": "mgr", "inner_alias": "inv", "proj_col": "salary", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
v3
Schema: area_registry (alias: emp)(id, amount, status, level) activity_log(value, status, amount, id) Task: Find amount from area_registry where amount exceeds the average salary from activity_log for the same status. SQL:
SELECT amount FROM area_registry AS emp WHERE amount > ( SELECT AVG(salary) FROM activity_log AS tsk WHERE tsk.status = emp.status );
{ "outer_table": "area_registry", "inner_table": "activity_log", "outer_alias": "emp", "inner_alias": "tsk", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T2", "fan_out": 55 }
v3
Schema: attribute_groups (alias: ord)(id, date, amount, value) workforce_data(name, type, status, salary) Task: Find code from attribute_groups where value exceeds the total value from workforce_data for the same id. SQL:
SELECT code FROM attribute_groups AS ord WHERE value > ( SELECT SUM(value) FROM workforce_data AS empl WHERE empl.id = ord.id );
{ "outer_table": "attribute_groups", "inner_table": "workforce_data", "outer_alias": "ord", "inner_alias": "empl", "proj_col": "code", "filter_col": "value", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T2", "fan_out": 110 }
v2
Schema: personnel_registry (alias: mgr)(salary, type, amount, date) activity_log(id, level, code, status) Task: Find name from personnel_registry where a matching record exists in activity_log with the same code. SQL:
SELECT name FROM personnel_registry AS mgr WHERE EXISTS ( SELECT 1 FROM activity_log AS tsk WHERE tsk.code = mgr.code );
{ "outer_table": "personnel_registry", "inner_table": "activity_log", "outer_alias": "mgr", "inner_alias": "tsk", "proj_col": "name", "join_col": "code", "correlated_ref": "mgr.code", "token_group": "T2", "fan_out": 55 }
v3
Schema: portfolio_index (alias: prod)(type, level, id, status) cost_centers(status, level, date, id) Task: Find code from portfolio_index where salary exceeds the maximum amount from cost_centers for the same status. SQL:
SELECT code FROM portfolio_index AS prod WHERE salary > ( SELECT MAX(amount) FROM cost_centers AS dpt WHERE dpt.status = prod.status );
{ "outer_table": "portfolio_index", "inner_table": "cost_centers", "outer_alias": "prod", "inner_alias": "dpt", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T2", "fan_out": 70 }
v2
Schema: activity_log (alias: ord)(date, amount, level, id) facility_registry(salary, type, name, status) Task: Select value from activity_log that have at least one matching row in facility_registry for the same type. SQL:
SELECT value FROM activity_log AS ord WHERE EXISTS ( SELECT 1 FROM facility_registry AS brc WHERE brc.type = ord.type );
{ "outer_table": "activity_log", "inner_table": "facility_registry", "outer_alias": "ord", "inner_alias": "brc", "proj_col": "value", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T2", "fan_out": 50 }
v2
Schema: receivables_log (alias: mgr)(value, id, level, name) acquisition_log(id, status, value, type) Task: Find code from receivables_log where a matching record exists in acquisition_log with the same id. SQL:
SELECT code FROM receivables_log AS mgr WHERE EXISTS ( SELECT 1 FROM acquisition_log AS ordr WHERE ordr.id = mgr.id );
{ "outer_table": "receivables_log", "inner_table": "acquisition_log", "outer_alias": "mgr", "inner_alias": "ordr", "proj_col": "code", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T2", "fan_out": 95 }
v2
Schema: attribute_groups (alias: mgr)(level, status, type, id) stock_catalog(date, type, salary, id) Task: Find name from attribute_groups where a matching record exists in stock_catalog with the same id. SQL:
SELECT name FROM attribute_groups AS mgr WHERE EXISTS ( SELECT 1 FROM stock_catalog AS prd WHERE prd.id = mgr.id );
{ "outer_table": "attribute_groups", "inner_table": "stock_catalog", "outer_alias": "mgr", "inner_alias": "prd", "proj_col": "name", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T2", "fan_out": 90 }
v1
Schema: receivables_log (alias: prod)(code, salary, name, id) personnel_registry(status, level, id, value) Task: Find salary from receivables_log where status appears in personnel_registry entries with matching status. SQL:
SELECT salary FROM receivables_log AS prod WHERE status IN ( SELECT status FROM personnel_registry AS emp WHERE emp.status = prod.status );
{ "outer_table": "receivables_log", "inner_table": "personnel_registry", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "salary", "filter_col": "status", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
v3
Schema: engagement_log (alias: dept)(value, id, date, amount) cost_centers(code, status, amount, salary) Task: Select code from engagement_log where amount is greater than the maximum of amount in cost_centers for matching status. SQL:
SELECT code FROM engagement_log AS dept WHERE amount > ( SELECT MAX(amount) FROM cost_centers AS dpt WHERE dpt.status = dept.status );
{ "outer_table": "engagement_log", "inner_table": "cost_centers", "outer_alias": "dept", "inner_alias": "dpt", "proj_col": "code", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MAX", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T2", "fan_out": 70 }
v3
Schema: personnel_registry (alias: ord)(date, code, salary, status) sourcing_list(code, level, value, date) Task: Select amount from personnel_registry where value is greater than the minimum of amount in sourcing_list for matching type. SQL:
SELECT amount FROM personnel_registry AS ord WHERE value > ( SELECT MIN(amount) FROM sourcing_list AS spl WHERE spl.type = ord.type );
{ "outer_table": "personnel_registry", "inner_table": "sourcing_list", "outer_alias": "ord", "inner_alias": "spl", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "MIN", "join_col": "type", "correlated_ref": "ord.type", "token_group": "T1", "fan_out": 1 }
v1
Schema: cost_centers (alias: dept)(type, value, amount, date) stocking_sites(amount, status, value, name) Task: Retrieve id from cost_centers whose level is found in stocking_sites rows where type matches the outer record. SQL:
SELECT id FROM cost_centers AS dept WHERE level IN ( SELECT level FROM stocking_sites AS whs WHERE whs.type = dept.type );
{ "outer_table": "cost_centers", "inner_table": "stocking_sites", "outer_alias": "dept", "inner_alias": "whs", "proj_col": "id", "filter_col": "level", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T2", "fan_out": 65 }
v1
Schema: area_registry (alias: dept)(value, type, salary, date) sourcing_list(amount, name, date, level) Task: Find name from area_registry where level appears in sourcing_list entries with matching type. SQL:
SELECT name FROM area_registry AS dept WHERE level IN ( SELECT level FROM sourcing_list AS spl WHERE spl.type = dept.type );
{ "outer_table": "area_registry", "inner_table": "sourcing_list", "outer_alias": "dept", "inner_alias": "spl", "proj_col": "name", "filter_col": "level", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
v2
Schema: sales_queue (alias: usr)(amount, level, id, status) portfolio_index(value, salary, level, amount) Task: Retrieve id from sales_queue that have at least one corresponding entry in portfolio_index sharing the same code. SQL:
SELECT id FROM sales_queue AS usr WHERE EXISTS ( SELECT 1 FROM portfolio_index AS act WHERE act.code = usr.code );
{ "outer_table": "sales_queue", "inner_table": "portfolio_index", "outer_alias": "usr", "inner_alias": "act", "proj_col": "id", "join_col": "code", "correlated_ref": "usr.code", "token_group": "T1", "fan_out": 1 }
v2
Schema: sales_registry (alias: mgr)(level, date, type, value) attribute_groups(name, amount, value, id) Task: Retrieve id from sales_registry that have at least one corresponding entry in attribute_groups sharing the same id. SQL:
SELECT id FROM sales_registry AS mgr WHERE EXISTS ( SELECT 1 FROM attribute_groups AS ctg WHERE ctg.id = mgr.id );
{ "outer_table": "sales_registry", "inner_table": "attribute_groups", "outer_alias": "mgr", "inner_alias": "ctg", "proj_col": "id", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T2", "fan_out": 80 }
v1
Schema: journal_entries (alias: dept)(level, date, name, type) personnel_registry(code, status, type, date) Task: Find code from journal_entries where level appears in personnel_registry entries with matching id. SQL:
SELECT code FROM journal_entries AS dept WHERE level IN ( SELECT level FROM personnel_registry AS emp WHERE emp.id = dept.id );
{ "outer_table": "journal_entries", "inner_table": "personnel_registry", "outer_alias": "dept", "inner_alias": "emp", "proj_col": "code", "filter_col": "level", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T1", "fan_out": 1 }
v1
Schema: sales_registry (alias: prod)(type, name, amount, code) attribute_groups(level, salary, id, code) Task: Retrieve code from sales_registry whose status is found in attribute_groups rows where level matches the outer record. SQL:
SELECT code FROM sales_registry AS prod WHERE status IN ( SELECT status FROM attribute_groups AS ctg WHERE ctg.level = prod.level );
{ "outer_table": "sales_registry", "inner_table": "attribute_groups", "outer_alias": "prod", "inner_alias": "ctg", "proj_col": "code", "filter_col": "status", "join_col": "level", "correlated_ref": "prod.level", "token_group": "T2", "fan_out": 80 }
v1
Schema: journal_entries (alias: usr)(status, name, type, code) sourcing_list(code, type, date, name) Task: Find amount from journal_entries where type appears in sourcing_list entries with matching id. SQL:
SELECT amount FROM journal_entries AS usr WHERE type IN ( SELECT type FROM sourcing_list AS spl WHERE spl.id = usr.id );
{ "outer_table": "journal_entries", "inner_table": "sourcing_list", "outer_alias": "usr", "inner_alias": "spl", "proj_col": "amount", "filter_col": "type", "join_col": "id", "correlated_ref": "usr.id", "token_group": "T1", "fan_out": 1 }
v3
Schema: personnel_registry (alias: inv)(id, type, level, status) workforce_data(id, name, level, code) Task: Find code from personnel_registry where amount exceeds the maximum value from workforce_data for the same type. SQL:
SELECT code FROM personnel_registry AS inv WHERE amount > ( SELECT MAX(value) FROM workforce_data AS empl WHERE empl.type = inv.type );
{ "outer_table": "personnel_registry", "inner_table": "workforce_data", "outer_alias": "inv", "inner_alias": "empl", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "inv.type", "token_group": "T2", "fan_out": 110 }
v1
Schema: sales_registry (alias: usr)(salary, code, value, id) stocking_sites(level, type, amount, value) Task: Find amount from sales_registry where id appears in stocking_sites entries with matching code. SQL:
SELECT amount FROM sales_registry AS usr WHERE id IN ( SELECT id FROM stocking_sites AS whs WHERE whs.code = usr.code );
{ "outer_table": "sales_registry", "inner_table": "stocking_sites", "outer_alias": "usr", "inner_alias": "whs", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "usr.code", "token_group": "T2", "fan_out": 65 }
v2
Schema: cost_centers (alias: prod)(name, code, type, value) facility_registry(value, type, salary, level) Task: Retrieve id from cost_centers that have at least one corresponding entry in facility_registry sharing the same type. SQL:
SELECT id FROM cost_centers AS prod WHERE EXISTS ( SELECT 1 FROM facility_registry AS brc WHERE brc.type = prod.type );
{ "outer_table": "cost_centers", "inner_table": "facility_registry", "outer_alias": "prod", "inner_alias": "brc", "proj_col": "id", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T2", "fan_out": 50 }
v2
Schema: dispatch_queue (alias: empl)(status, id, type, code) engagement_log(level, amount, value, status) Task: Retrieve name from dispatch_queue that have at least one corresponding entry in engagement_log sharing the same code. SQL:
SELECT name FROM dispatch_queue AS empl WHERE EXISTS ( SELECT 1 FROM engagement_log AS prj WHERE prj.code = empl.code );
{ "outer_table": "dispatch_queue", "inner_table": "engagement_log", "outer_alias": "empl", "inner_alias": "prj", "proj_col": "name", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 90 }
v1
Schema: personnel_registry (alias: mgr)(status, id, value, date) cost_centers(type, amount, value, status) Task: Select id from personnel_registry where type exists in cost_centers for the same type. SQL:
SELECT id FROM personnel_registry AS mgr WHERE type IN ( SELECT type FROM cost_centers AS dpt WHERE dpt.type = mgr.type );
{ "outer_table": "personnel_registry", "inner_table": "cost_centers", "outer_alias": "mgr", "inner_alias": "dpt", "proj_col": "id", "filter_col": "type", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T2", "fan_out": 70 }
v1
Schema: stocking_sites (alias: usr)(code, status, name, id) workforce_data(status, type, level, name) Task: Retrieve value from stocking_sites whose level is found in workforce_data rows where type matches the outer record. SQL:
SELECT value FROM stocking_sites AS usr WHERE level IN ( SELECT level FROM workforce_data AS empl WHERE empl.type = usr.type );
{ "outer_table": "stocking_sites", "inner_table": "workforce_data", "outer_alias": "usr", "inner_alias": "empl", "proj_col": "value", "filter_col": "level", "join_col": "type", "correlated_ref": "usr.type", "token_group": "T2", "fan_out": 110 }
v3
Schema: stock_catalog (alias: inv)(amount, level, date, name) sales_queue(amount, name, date, status) Task: Retrieve code from stock_catalog with value above the AVG(amount) of sales_queue rows sharing the same level. SQL:
SELECT code FROM stock_catalog AS inv WHERE value > ( SELECT AVG(amount) FROM sales_queue AS ord WHERE ord.level = inv.level );
{ "outer_table": "stock_catalog", "inner_table": "sales_queue", "outer_alias": "inv", "inner_alias": "ord", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
v3
Schema: journal_entries (alias: inv)(salary, id, level, date) attribute_groups(level, type, name, salary) Task: Select amount from journal_entries where amount is greater than the average of salary in attribute_groups for matching level. SQL:
SELECT amount FROM journal_entries AS inv WHERE amount > ( SELECT AVG(salary) FROM attribute_groups AS ctg WHERE ctg.level = inv.level );
{ "outer_table": "journal_entries", "inner_table": "attribute_groups", "outer_alias": "inv", "inner_alias": "ctg", "proj_col": "amount", "filter_col": "amount", "agg_col": "salary", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T2", "fan_out": 80 }
v2
Schema: acquisition_log (alias: mgr)(type, salary, name, date) facility_registry(amount, value, id, status) Task: Find name from acquisition_log where a matching record exists in facility_registry with the same type. SQL:
SELECT name FROM acquisition_log AS mgr WHERE EXISTS ( SELECT 1 FROM facility_registry AS brc WHERE brc.type = mgr.type );
{ "outer_table": "acquisition_log", "inner_table": "facility_registry", "outer_alias": "mgr", "inner_alias": "brc", "proj_col": "name", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T2", "fan_out": 50 }
v3
Schema: sourcing_list (alias: emp)(value, code, name, type) sales_queue(salary, amount, level, id) Task: Find salary from sourcing_list where amount exceeds the minimum amount from sales_queue for the same id. SQL:
SELECT salary FROM sourcing_list AS emp WHERE amount > ( SELECT MIN(amount) FROM sales_queue AS ord WHERE ord.id = emp.id );
{ "outer_table": "sourcing_list", "inner_table": "sales_queue", "outer_alias": "emp", "inner_alias": "ord", "proj_col": "salary", "filter_col": "amount", "agg_col": "amount", "agg_fn": "MIN", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
v1
Schema: dispatch_queue (alias: inv)(amount, value, status, level) sourcing_list(status, salary, amount, level) Task: Retrieve name from dispatch_queue whose code is found in sourcing_list rows where id matches the outer record. SQL:
SELECT name FROM dispatch_queue AS inv WHERE code IN ( SELECT code FROM sourcing_list AS spl WHERE spl.id = inv.id );
{ "outer_table": "dispatch_queue", "inner_table": "sourcing_list", "outer_alias": "inv", "inner_alias": "spl", "proj_col": "name", "filter_col": "code", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T1", "fan_out": 1 }
v1
Schema: sales_registry (alias: dept)(amount, type, id, date) acquisition_log(status, value, level, amount) Task: Find salary from sales_registry where status appears in acquisition_log entries with matching type. SQL:
SELECT salary FROM sales_registry AS dept WHERE status IN ( SELECT status FROM acquisition_log AS ordr WHERE ordr.type = dept.type );
{ "outer_table": "sales_registry", "inner_table": "acquisition_log", "outer_alias": "dept", "inner_alias": "ordr", "proj_col": "salary", "filter_col": "status", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T2", "fan_out": 95 }
v2
Schema: facility_registry (alias: dept)(status, name, type, date) sales_queue(amount, type, salary, status) Task: Retrieve salary from facility_registry that have at least one corresponding entry in sales_queue sharing the same type. SQL:
SELECT salary FROM facility_registry AS dept WHERE EXISTS ( SELECT 1 FROM sales_queue AS ord WHERE ord.type = dept.type );
{ "outer_table": "facility_registry", "inner_table": "sales_queue", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "salary", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T1", "fan_out": 1 }
v2
Schema: portfolio_index (alias: inv)(status, level, amount, date) area_registry(value, name, id, date) Task: Select name from portfolio_index that have at least one matching row in area_registry for the same level. SQL:
SELECT name FROM portfolio_index AS inv WHERE EXISTS ( SELECT 1 FROM area_registry AS rgn WHERE rgn.level = inv.level );
{ "outer_table": "portfolio_index", "inner_table": "area_registry", "outer_alias": "inv", "inner_alias": "rgn", "proj_col": "name", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T2", "fan_out": 60 }
v3
Schema: activity_log (alias: prod)(name, code, salary, value) personnel_registry(status, id, amount, name) Task: Find amount from activity_log where value exceeds the count of amount from personnel_registry for the same status. SQL:
SELECT amount FROM activity_log AS prod WHERE value > ( SELECT COUNT(amount) FROM personnel_registry AS emp WHERE emp.status = prod.status );
{ "outer_table": "activity_log", "inner_table": "personnel_registry", "outer_alias": "prod", "inner_alias": "emp", "proj_col": "amount", "filter_col": "value", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "prod.status", "token_group": "T1", "fan_out": 1 }
v1
Schema: stock_catalog (alias: mgr)(level, code, date, salary) personnel_registry(id, amount, code, status) Task: Retrieve amount from stock_catalog whose code is found in personnel_registry rows where level matches the outer record. SQL:
SELECT amount FROM stock_catalog AS mgr WHERE code IN ( SELECT code FROM personnel_registry AS emp WHERE emp.level = mgr.level );
{ "outer_table": "stock_catalog", "inner_table": "personnel_registry", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
v2
Schema: stocking_sites (alias: ord)(status, value, amount, id) receivables_log(code, level, value, salary) Task: Select salary from stocking_sites that have at least one matching row in receivables_log for the same id. SQL:
SELECT salary FROM stocking_sites AS ord WHERE EXISTS ( SELECT 1 FROM receivables_log AS inv WHERE inv.id = ord.id );
{ "outer_table": "stocking_sites", "inner_table": "receivables_log", "outer_alias": "ord", "inner_alias": "inv", "proj_col": "salary", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T1", "fan_out": 1 }
v1
Schema: sourcing_list (alias: dept)(type, id, value, code) workforce_data(type, status, id, amount) Task: Select id from sourcing_list where id exists in workforce_data for the same code. SQL:
SELECT id FROM sourcing_list AS dept WHERE id IN ( SELECT id FROM workforce_data AS empl WHERE empl.code = dept.code );
{ "outer_table": "sourcing_list", "inner_table": "workforce_data", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "id", "filter_col": "id", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T2", "fan_out": 110 }
v2
Schema: journal_entries (alias: mgr)(amount, type, status, salary) stocking_sites(code, date, status, name) Task: Find name from journal_entries where a matching record exists in stocking_sites with the same id. SQL:
SELECT name FROM journal_entries AS mgr WHERE EXISTS ( SELECT 1 FROM stocking_sites AS whs WHERE whs.id = mgr.id );
{ "outer_table": "journal_entries", "inner_table": "stocking_sites", "outer_alias": "mgr", "inner_alias": "whs", "proj_col": "name", "join_col": "id", "correlated_ref": "mgr.id", "token_group": "T2", "fan_out": 65 }
v1
Schema: activity_log (alias: emp)(status, amount, id, type) receivables_log(status, id, type, date) Task: Find salary from activity_log where type appears in receivables_log entries with matching status. SQL:
SELECT salary FROM activity_log AS emp WHERE type IN ( SELECT type FROM receivables_log AS inv WHERE inv.status = emp.status );
{ "outer_table": "activity_log", "inner_table": "receivables_log", "outer_alias": "emp", "inner_alias": "inv", "proj_col": "salary", "filter_col": "type", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T1", "fan_out": 1 }
v3
Schema: sales_queue (alias: dept)(salary, value, code, name) workforce_data(value, code, salary, amount) Task: Retrieve salary from sales_queue with amount above the SUM(value) of workforce_data rows sharing the same status. SQL:
SELECT salary FROM sales_queue AS dept WHERE amount > ( SELECT SUM(value) FROM workforce_data AS empl WHERE empl.status = dept.status );
{ "outer_table": "sales_queue", "inner_table": "workforce_data", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "SUM", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T2", "fan_out": 110 }
v1
Schema: engagement_log (alias: empl)(type, level, status, date) activity_log(date, code, salary, level) Task: Select code from engagement_log where code exists in activity_log for the same id. SQL:
SELECT code FROM engagement_log AS empl WHERE code IN ( SELECT code FROM activity_log AS tsk WHERE tsk.id = empl.id );
{ "outer_table": "engagement_log", "inner_table": "activity_log", "outer_alias": "empl", "inner_alias": "tsk", "proj_col": "code", "filter_col": "code", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T2", "fan_out": 55 }
v1
Schema: acquisition_log (alias: mgr)(date, level, name, code) personnel_registry(salary, level, value, id) Task: Retrieve amount from acquisition_log whose status is found in personnel_registry rows where status matches the outer record. SQL:
SELECT amount FROM acquisition_log AS mgr WHERE status IN ( SELECT status FROM personnel_registry AS emp WHERE emp.status = mgr.status );
{ "outer_table": "acquisition_log", "inner_table": "personnel_registry", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T1", "fan_out": 1 }
v1
Schema: stock_catalog (alias: usr)(value, type, status, name) stocking_sites(value, id, type, code) Task: Find value from stock_catalog where code appears in stocking_sites entries with matching level. SQL:
SELECT value FROM stock_catalog AS usr WHERE code IN ( SELECT code FROM stocking_sites AS whs WHERE whs.level = usr.level );
{ "outer_table": "stock_catalog", "inner_table": "stocking_sites", "outer_alias": "usr", "inner_alias": "whs", "proj_col": "value", "filter_col": "code", "join_col": "level", "correlated_ref": "usr.level", "token_group": "T2", "fan_out": 65 }
v3
Schema: sourcing_list (alias: usr)(value, code, amount, name) portfolio_index(id, level, value, salary) Task: Retrieve code from sourcing_list with salary above the AVG(amount) of portfolio_index rows sharing the same code. SQL:
SELECT code FROM sourcing_list AS usr WHERE salary > ( SELECT AVG(amount) FROM portfolio_index AS act WHERE act.code = usr.code );
{ "outer_table": "sourcing_list", "inner_table": "portfolio_index", "outer_alias": "usr", "inner_alias": "act", "proj_col": "code", "filter_col": "salary", "agg_col": "amount", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "usr.code", "token_group": "T1", "fan_out": 1 }
v3
Schema: area_registry (alias: empl)(value, id, salary, type) personnel_registry(value, date, id, amount) Task: Select value from area_registry where amount is greater than the count of of salary in personnel_registry for matching code. SQL:
SELECT value FROM area_registry AS empl WHERE amount > ( SELECT COUNT(salary) FROM personnel_registry AS emp WHERE emp.code = empl.code );
{ "outer_table": "area_registry", "inner_table": "personnel_registry", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "value", "filter_col": "amount", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T1", "fan_out": 1 }
v1
Schema: dispatch_queue (alias: inv)(id, amount, date, code) journal_entries(amount, salary, level, id) Task: Find amount from dispatch_queue where type appears in journal_entries entries with matching level. SQL:
SELECT amount FROM dispatch_queue AS inv WHERE type IN ( SELECT type FROM journal_entries AS txn WHERE txn.level = inv.level );
{ "outer_table": "dispatch_queue", "inner_table": "journal_entries", "outer_alias": "inv", "inner_alias": "txn", "proj_col": "amount", "filter_col": "type", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T1", "fan_out": 1 }
v1
Schema: cost_centers (alias: ord)(code, date, type, level) activity_log(id, type, date, status) Task: Retrieve code from cost_centers whose id is found in activity_log rows where id matches the outer record. SQL:
SELECT code FROM cost_centers AS ord WHERE id IN ( SELECT id FROM activity_log AS tsk WHERE tsk.id = ord.id );
{ "outer_table": "cost_centers", "inner_table": "activity_log", "outer_alias": "ord", "inner_alias": "tsk", "proj_col": "code", "filter_col": "id", "join_col": "id", "correlated_ref": "ord.id", "token_group": "T2", "fan_out": 55 }
v1
Schema: activity_log (alias: prod)(code, level, date, salary) workforce_data(name, amount, level, code) Task: Find value from activity_log where id appears in workforce_data entries with matching id. SQL:
SELECT value FROM activity_log AS prod WHERE id IN ( SELECT id FROM workforce_data AS empl WHERE empl.id = prod.id );
{ "outer_table": "activity_log", "inner_table": "workforce_data", "outer_alias": "prod", "inner_alias": "empl", "proj_col": "value", "filter_col": "id", "join_col": "id", "correlated_ref": "prod.id", "token_group": "T2", "fan_out": 110 }
v1
Schema: attribute_groups (alias: dept)(type, amount, level, id) engagement_log(date, id, status, code) Task: Select name from attribute_groups where code exists in engagement_log for the same status. SQL:
SELECT name FROM attribute_groups AS dept WHERE code IN ( SELECT code FROM engagement_log AS prj WHERE prj.status = dept.status );
{ "outer_table": "attribute_groups", "inner_table": "engagement_log", "outer_alias": "dept", "inner_alias": "prj", "proj_col": "name", "filter_col": "code", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T2", "fan_out": 90 }
v1
Schema: workforce_data (alias: ord)(name, status, amount, salary) engagement_log(salary, status, name, amount) Task: Find id from workforce_data where id appears in engagement_log entries with matching code. SQL:
SELECT id FROM workforce_data AS ord WHERE id IN ( SELECT id FROM engagement_log AS prj WHERE prj.code = ord.code );
{ "outer_table": "workforce_data", "inner_table": "engagement_log", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "id", "filter_col": "id", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T2", "fan_out": 90 }
v2
Schema: workforce_data (alias: usr)(amount, level, type, date) stock_catalog(salary, status, code, id) Task: Retrieve id from workforce_data that have at least one corresponding entry in stock_catalog sharing the same type. SQL:
SELECT id FROM workforce_data AS usr WHERE EXISTS ( SELECT 1 FROM stock_catalog AS prd WHERE prd.type = usr.type );
{ "outer_table": "workforce_data", "inner_table": "stock_catalog", "outer_alias": "usr", "inner_alias": "prd", "proj_col": "id", "join_col": "type", "correlated_ref": "usr.type", "token_group": "T2", "fan_out": 90 }
v1
Schema: attribute_groups (alias: empl)(id, code, level, date) personnel_registry(code, value, salary, status) Task: Retrieve amount from attribute_groups whose code is found in personnel_registry rows where level matches the outer record. SQL:
SELECT amount FROM attribute_groups AS empl WHERE code IN ( SELECT code FROM personnel_registry AS emp WHERE emp.level = empl.level );
{ "outer_table": "attribute_groups", "inner_table": "personnel_registry", "outer_alias": "empl", "inner_alias": "emp", "proj_col": "amount", "filter_col": "code", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T1", "fan_out": 1 }
v2
Schema: sourcing_list (alias: empl)(name, level, salary, type) facility_registry(code, status, salary, date) Task: Find id from sourcing_list where a matching record exists in facility_registry with the same type. SQL:
SELECT id FROM sourcing_list AS empl WHERE EXISTS ( SELECT 1 FROM facility_registry AS brc WHERE brc.type = empl.type );
{ "outer_table": "sourcing_list", "inner_table": "facility_registry", "outer_alias": "empl", "inner_alias": "brc", "proj_col": "id", "join_col": "type", "correlated_ref": "empl.type", "token_group": "T2", "fan_out": 50 }
v3
Schema: stocking_sites (alias: dept)(code, value, date, type) receivables_log(status, name, amount, level) Task: Select id from stocking_sites where salary is greater than the maximum of amount in receivables_log for matching level. SQL:
SELECT id FROM stocking_sites AS dept WHERE salary > ( SELECT MAX(amount) FROM receivables_log AS inv WHERE inv.level = dept.level );
{ "outer_table": "stocking_sites", "inner_table": "receivables_log", "outer_alias": "dept", "inner_alias": "inv", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
v2
Schema: activity_log (alias: mgr)(level, salary, status, code) personnel_registry(status, date, level, id) Task: Select amount from activity_log that have at least one matching row in personnel_registry for the same level. SQL:
SELECT amount FROM activity_log AS mgr WHERE EXISTS ( SELECT 1 FROM personnel_registry AS emp WHERE emp.level = mgr.level );
{ "outer_table": "activity_log", "inner_table": "personnel_registry", "outer_alias": "mgr", "inner_alias": "emp", "proj_col": "amount", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
v2
Schema: engagement_log (alias: emp)(amount, status, date, value) cost_centers(salary, level, status, date) Task: Find code from engagement_log where a matching record exists in cost_centers with the same type. SQL:
SELECT code FROM engagement_log AS emp WHERE EXISTS ( SELECT 1 FROM cost_centers AS dpt WHERE dpt.type = emp.type );
{ "outer_table": "engagement_log", "inner_table": "cost_centers", "outer_alias": "emp", "inner_alias": "dpt", "proj_col": "code", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T2", "fan_out": 70 }
v3
Schema: area_registry (alias: ord)(date, salary, status, name) engagement_log(code, level, name, amount) Task: Find id from area_registry where salary exceeds the count of amount from engagement_log for the same status. SQL:
SELECT id FROM area_registry AS ord WHERE salary > ( SELECT COUNT(amount) FROM engagement_log AS prj WHERE prj.status = ord.status );
{ "outer_table": "area_registry", "inner_table": "engagement_log", "outer_alias": "ord", "inner_alias": "prj", "proj_col": "id", "filter_col": "salary", "agg_col": "amount", "agg_fn": "COUNT", "join_col": "status", "correlated_ref": "ord.status", "token_group": "T2", "fan_out": 90 }
v3
Schema: cost_centers (alias: emp)(status, date, level, salary) sourcing_list(value, amount, level, salary) Task: Retrieve value from cost_centers with value above the MAX(value) of sourcing_list rows sharing the same id. SQL:
SELECT value FROM cost_centers AS emp WHERE value > ( SELECT MAX(value) FROM sourcing_list AS spl WHERE spl.id = emp.id );
{ "outer_table": "cost_centers", "inner_table": "sourcing_list", "outer_alias": "emp", "inner_alias": "spl", "proj_col": "value", "filter_col": "value", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T1", "fan_out": 1 }
v2
Schema: sales_queue (alias: usr)(value, amount, date, status) stock_catalog(value, type, name, id) Task: Select salary from sales_queue that have at least one matching row in stock_catalog for the same status. SQL:
SELECT salary FROM sales_queue AS usr WHERE EXISTS ( SELECT 1 FROM stock_catalog AS prd WHERE prd.status = usr.status );
{ "outer_table": "sales_queue", "inner_table": "stock_catalog", "outer_alias": "usr", "inner_alias": "prd", "proj_col": "salary", "join_col": "status", "correlated_ref": "usr.status", "token_group": "T2", "fan_out": 90 }
v3
Schema: dispatch_queue (alias: empl)(id, status, value, level) area_registry(code, salary, level, type) Task: Select code from dispatch_queue where salary is greater than the average of salary in area_registry for matching code. SQL:
SELECT code FROM dispatch_queue AS empl WHERE salary > ( SELECT AVG(salary) FROM area_registry AS rgn WHERE rgn.code = empl.code );
{ "outer_table": "dispatch_queue", "inner_table": "area_registry", "outer_alias": "empl", "inner_alias": "rgn", "proj_col": "code", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "empl.code", "token_group": "T2", "fan_out": 60 }
v1
Schema: area_registry (alias: emp)(name, type, value, id) activity_log(salary, amount, name, type) Task: Find salary from area_registry where id appears in activity_log entries with matching id. SQL:
SELECT salary FROM area_registry AS emp WHERE id IN ( SELECT id FROM activity_log AS tsk WHERE tsk.id = emp.id );
{ "outer_table": "area_registry", "inner_table": "activity_log", "outer_alias": "emp", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "id", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T2", "fan_out": 55 }
v1
Schema: stock_catalog (alias: emp)(type, amount, code, value) sales_registry(value, type, level, code) Task: Retrieve name from stock_catalog whose type is found in sales_registry rows where type matches the outer record. SQL:
SELECT name FROM stock_catalog AS emp WHERE type IN ( SELECT type FROM sales_registry AS cst WHERE cst.type = emp.type );
{ "outer_table": "stock_catalog", "inner_table": "sales_registry", "outer_alias": "emp", "inner_alias": "cst", "proj_col": "name", "filter_col": "type", "join_col": "type", "correlated_ref": "emp.type", "token_group": "T1", "fan_out": 1 }
v2
Schema: cost_centers (alias: usr)(level, value, salary, type) facility_registry(amount, value, id, salary) Task: Retrieve amount from cost_centers that have at least one corresponding entry in facility_registry sharing the same status. SQL:
SELECT amount FROM cost_centers AS usr WHERE EXISTS ( SELECT 1 FROM facility_registry AS brc WHERE brc.status = usr.status );
{ "outer_table": "cost_centers", "inner_table": "facility_registry", "outer_alias": "usr", "inner_alias": "brc", "proj_col": "amount", "join_col": "status", "correlated_ref": "usr.status", "token_group": "T2", "fan_out": 50 }
v2
Schema: workforce_data (alias: empl)(code, id, type, date) journal_entries(type, salary, code, amount) Task: Select name from workforce_data that have at least one matching row in journal_entries for the same status. SQL:
SELECT name FROM workforce_data AS empl WHERE EXISTS ( SELECT 1 FROM journal_entries AS txn WHERE txn.status = empl.status );
{ "outer_table": "workforce_data", "inner_table": "journal_entries", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "name", "join_col": "status", "correlated_ref": "empl.status", "token_group": "T1", "fan_out": 1 }
v1
Schema: receivables_log (alias: dept)(value, status, name, id) sales_queue(code, amount, type, date) Task: Retrieve amount from receivables_log whose status is found in sales_queue rows where status matches the outer record. SQL:
SELECT amount FROM receivables_log AS dept WHERE status IN ( SELECT status FROM sales_queue AS ord WHERE ord.status = dept.status );
{ "outer_table": "receivables_log", "inner_table": "sales_queue", "outer_alias": "dept", "inner_alias": "ord", "proj_col": "amount", "filter_col": "status", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T1", "fan_out": 1 }
v3
Schema: stock_catalog (alias: inv)(code, salary, date, id) engagement_log(salary, value, type, amount) Task: Find name from stock_catalog where salary exceeds the maximum amount from engagement_log for the same level. SQL:
SELECT name FROM stock_catalog AS inv WHERE salary > ( SELECT MAX(amount) FROM engagement_log AS prj WHERE prj.level = inv.level );
{ "outer_table": "stock_catalog", "inner_table": "engagement_log", "outer_alias": "inv", "inner_alias": "prj", "proj_col": "name", "filter_col": "salary", "agg_col": "amount", "agg_fn": "MAX", "join_col": "level", "correlated_ref": "inv.level", "token_group": "T2", "fan_out": 90 }
v1
Schema: personnel_registry (alias: usr)(code, id, date, amount) journal_entries(name, type, code, status) Task: Retrieve amount from personnel_registry whose level is found in journal_entries rows where id matches the outer record. SQL:
SELECT amount FROM personnel_registry AS usr WHERE level IN ( SELECT level FROM journal_entries AS txn WHERE txn.id = usr.id );
{ "outer_table": "personnel_registry", "inner_table": "journal_entries", "outer_alias": "usr", "inner_alias": "txn", "proj_col": "amount", "filter_col": "level", "join_col": "id", "correlated_ref": "usr.id", "token_group": "T1", "fan_out": 1 }
v2
Schema: attribute_groups (alias: mgr)(date, status, type, id) sales_queue(date, level, name, code) Task: Find name from attribute_groups where a matching record exists in sales_queue with the same level. SQL:
SELECT name FROM attribute_groups AS mgr WHERE EXISTS ( SELECT 1 FROM sales_queue AS ord WHERE ord.level = mgr.level );
{ "outer_table": "attribute_groups", "inner_table": "sales_queue", "outer_alias": "mgr", "inner_alias": "ord", "proj_col": "name", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T1", "fan_out": 1 }
v3
Schema: sales_queue (alias: ord)(date, status, id, code) personnel_registry(type, salary, amount, status) Task: Select value from sales_queue where value is greater than the count of of salary in personnel_registry for matching level. SQL:
SELECT value FROM sales_queue AS ord WHERE value > ( SELECT COUNT(salary) FROM personnel_registry AS emp WHERE emp.level = ord.level );
{ "outer_table": "sales_queue", "inner_table": "personnel_registry", "outer_alias": "ord", "inner_alias": "emp", "proj_col": "value", "filter_col": "value", "agg_col": "salary", "agg_fn": "COUNT", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T1", "fan_out": 1 }
v3
Schema: facility_registry (alias: mgr)(date, status, value, salary) stock_catalog(level, salary, type, amount) Task: Retrieve value from facility_registry with value above the MAX(amount) of stock_catalog rows sharing the same type. SQL:
SELECT value FROM facility_registry AS mgr WHERE value > ( SELECT MAX(amount) FROM stock_catalog AS prd WHERE prd.type = mgr.type );
{ "outer_table": "facility_registry", "inner_table": "stock_catalog", "outer_alias": "mgr", "inner_alias": "prd", "proj_col": "value", "filter_col": "value", "agg_col": "amount", "agg_fn": "MAX", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T2", "fan_out": 90 }
v1
Schema: acquisition_log (alias: usr)(name, status, amount, level) area_registry(salary, status, level, type) Task: Retrieve name from acquisition_log whose code is found in area_registry rows where level matches the outer record. SQL:
SELECT name FROM acquisition_log AS usr WHERE code IN ( SELECT code FROM area_registry AS rgn WHERE rgn.level = usr.level );
{ "outer_table": "acquisition_log", "inner_table": "area_registry", "outer_alias": "usr", "inner_alias": "rgn", "proj_col": "name", "filter_col": "code", "join_col": "level", "correlated_ref": "usr.level", "token_group": "T2", "fan_out": 60 }
v3
Schema: stock_catalog (alias: ord)(value, status, date, code) dispatch_queue(date, code, level, amount) Task: Retrieve id from stock_catalog with amount above the SUM(salary) of dispatch_queue rows sharing the same level. SQL:
SELECT id FROM stock_catalog AS ord WHERE amount > ( SELECT SUM(salary) FROM dispatch_queue AS shp WHERE shp.level = ord.level );
{ "outer_table": "stock_catalog", "inner_table": "dispatch_queue", "outer_alias": "ord", "inner_alias": "shp", "proj_col": "id", "filter_col": "amount", "agg_col": "salary", "agg_fn": "SUM", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T2", "fan_out": 85 }
v3
Schema: facility_registry (alias: inv)(status, value, id, date) activity_log(status, value, level, id) Task: Select code from facility_registry where value is greater than the total of salary in activity_log for matching id. SQL:
SELECT code FROM facility_registry AS inv WHERE value > ( SELECT SUM(salary) FROM activity_log AS tsk WHERE tsk.id = inv.id );
{ "outer_table": "facility_registry", "inner_table": "activity_log", "outer_alias": "inv", "inner_alias": "tsk", "proj_col": "code", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T2", "fan_out": 55 }
v2
Schema: receivables_log (alias: mgr)(date, status, id, code) stocking_sites(amount, value, salary, level) Task: Select value from receivables_log that have at least one matching row in stocking_sites for the same level. SQL:
SELECT value FROM receivables_log AS mgr WHERE EXISTS ( SELECT 1 FROM stocking_sites AS whs WHERE whs.level = mgr.level );
{ "outer_table": "receivables_log", "inner_table": "stocking_sites", "outer_alias": "mgr", "inner_alias": "whs", "proj_col": "value", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T2", "fan_out": 65 }
v3
Schema: engagement_log (alias: emp)(id, date, salary, level) activity_log(status, date, value, level) Task: Retrieve code from engagement_log with value above the SUM(amount) of activity_log rows sharing the same id. SQL:
SELECT code FROM engagement_log AS emp WHERE value > ( SELECT SUM(amount) FROM activity_log AS tsk WHERE tsk.id = emp.id );
{ "outer_table": "engagement_log", "inner_table": "activity_log", "outer_alias": "emp", "inner_alias": "tsk", "proj_col": "code", "filter_col": "value", "agg_col": "amount", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "emp.id", "token_group": "T2", "fan_out": 55 }
v2
Schema: cost_centers (alias: mgr)(type, status, salary, code) stock_catalog(value, date, amount, id) Task: Retrieve code from cost_centers that have at least one corresponding entry in stock_catalog sharing the same status. SQL:
SELECT code FROM cost_centers AS mgr WHERE EXISTS ( SELECT 1 FROM stock_catalog AS prd WHERE prd.status = mgr.status );
{ "outer_table": "cost_centers", "inner_table": "stock_catalog", "outer_alias": "mgr", "inner_alias": "prd", "proj_col": "code", "join_col": "status", "correlated_ref": "mgr.status", "token_group": "T2", "fan_out": 90 }
v3
Schema: sales_registry (alias: prod)(value, name, level, type) activity_log(name, value, salary, date) Task: Select salary from sales_registry where amount is greater than the average of value in activity_log for matching type. SQL:
SELECT salary FROM sales_registry AS prod WHERE amount > ( SELECT AVG(value) FROM activity_log AS tsk WHERE tsk.type = prod.type );
{ "outer_table": "sales_registry", "inner_table": "activity_log", "outer_alias": "prod", "inner_alias": "tsk", "proj_col": "salary", "filter_col": "amount", "agg_col": "value", "agg_fn": "AVG", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T2", "fan_out": 55 }
v2
Schema: facility_registry (alias: emp)(name, salary, value, type) area_registry(id, date, code, level) Task: Find id from facility_registry where a matching record exists in area_registry with the same level. SQL:
SELECT id FROM facility_registry AS emp WHERE EXISTS ( SELECT 1 FROM area_registry AS rgn WHERE rgn.level = emp.level );
{ "outer_table": "facility_registry", "inner_table": "area_registry", "outer_alias": "emp", "inner_alias": "rgn", "proj_col": "id", "join_col": "level", "correlated_ref": "emp.level", "token_group": "T2", "fan_out": 60 }
v2
Schema: activity_log (alias: emp)(salary, code, date, status) dispatch_queue(amount, id, status, type) Task: Select name from activity_log that have at least one matching row in dispatch_queue for the same status. SQL:
SELECT name FROM activity_log AS emp WHERE EXISTS ( SELECT 1 FROM dispatch_queue AS shp WHERE shp.status = emp.status );
{ "outer_table": "activity_log", "inner_table": "dispatch_queue", "outer_alias": "emp", "inner_alias": "shp", "proj_col": "name", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T2", "fan_out": 85 }
v2
Schema: stock_catalog (alias: ord)(value, level, name, type) cost_centers(status, amount, code, id) Task: Select id from stock_catalog that have at least one matching row in cost_centers for the same level. SQL:
SELECT id FROM stock_catalog AS ord WHERE EXISTS ( SELECT 1 FROM cost_centers AS dpt WHERE dpt.level = ord.level );
{ "outer_table": "stock_catalog", "inner_table": "cost_centers", "outer_alias": "ord", "inner_alias": "dpt", "proj_col": "id", "join_col": "level", "correlated_ref": "ord.level", "token_group": "T2", "fan_out": 70 }
v3
Schema: sales_registry (alias: ord)(type, amount, date, value) journal_entries(code, level, id, value) Task: Retrieve salary from sales_registry with salary above the AVG(salary) of journal_entries rows sharing the same code. SQL:
SELECT salary FROM sales_registry AS ord WHERE salary > ( SELECT AVG(salary) FROM journal_entries AS txn WHERE txn.code = ord.code );
{ "outer_table": "sales_registry", "inner_table": "journal_entries", "outer_alias": "ord", "inner_alias": "txn", "proj_col": "salary", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T1", "fan_out": 1 }
v2
Schema: stocking_sites (alias: emp)(date, status, level, name) activity_log(code, name, type, salary) Task: Retrieve id from stocking_sites that have at least one corresponding entry in activity_log sharing the same status. SQL:
SELECT id FROM stocking_sites AS emp WHERE EXISTS ( SELECT 1 FROM activity_log AS tsk WHERE tsk.status = emp.status );
{ "outer_table": "stocking_sites", "inner_table": "activity_log", "outer_alias": "emp", "inner_alias": "tsk", "proj_col": "id", "join_col": "status", "correlated_ref": "emp.status", "token_group": "T2", "fan_out": 55 }
v3
Schema: journal_entries (alias: inv)(value, name, status, type) activity_log(level, amount, status, salary) Task: Find value from journal_entries where salary exceeds the total value from activity_log for the same id. SQL:
SELECT value FROM journal_entries AS inv WHERE salary > ( SELECT SUM(value) FROM activity_log AS tsk WHERE tsk.id = inv.id );
{ "outer_table": "journal_entries", "inner_table": "activity_log", "outer_alias": "inv", "inner_alias": "tsk", "proj_col": "value", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "id", "correlated_ref": "inv.id", "token_group": "T2", "fan_out": 55 }
v3
Schema: sales_queue (alias: dept)(name, salary, status, value) workforce_data(value, date, code, id) Task: Find id from sales_queue where salary exceeds the average salary from workforce_data for the same status. SQL:
SELECT id FROM sales_queue AS dept WHERE salary > ( SELECT AVG(salary) FROM workforce_data AS empl WHERE empl.status = dept.status );
{ "outer_table": "sales_queue", "inner_table": "workforce_data", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "id", "filter_col": "salary", "agg_col": "salary", "agg_fn": "AVG", "join_col": "status", "correlated_ref": "dept.status", "token_group": "T2", "fan_out": 110 }
v3
Schema: sales_registry (alias: ord)(id, type, salary, amount) facility_registry(value, salary, id, level) Task: Retrieve amount from sales_registry with value above the SUM(salary) of facility_registry rows sharing the same code. SQL:
SELECT amount FROM sales_registry AS ord WHERE value > ( SELECT SUM(salary) FROM facility_registry AS brc WHERE brc.code = ord.code );
{ "outer_table": "sales_registry", "inner_table": "facility_registry", "outer_alias": "ord", "inner_alias": "brc", "proj_col": "amount", "filter_col": "value", "agg_col": "salary", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T2", "fan_out": 50 }
v3
Schema: workforce_data (alias: inv)(id, type, name, date) dispatch_queue(level, value, status, type) Task: Select id from workforce_data where salary is greater than the total of value in dispatch_queue for matching code. SQL:
SELECT id FROM workforce_data AS inv WHERE salary > ( SELECT SUM(value) FROM dispatch_queue AS shp WHERE shp.code = inv.code );
{ "outer_table": "workforce_data", "inner_table": "dispatch_queue", "outer_alias": "inv", "inner_alias": "shp", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "SUM", "join_col": "code", "correlated_ref": "inv.code", "token_group": "T2", "fan_out": 85 }
v1
Schema: area_registry (alias: empl)(level, amount, date, salary) journal_entries(code, salary, amount, value) Task: Select amount from area_registry where code exists in journal_entries for the same id. SQL:
SELECT amount FROM area_registry AS empl WHERE code IN ( SELECT code FROM journal_entries AS txn WHERE txn.id = empl.id );
{ "outer_table": "area_registry", "inner_table": "journal_entries", "outer_alias": "empl", "inner_alias": "txn", "proj_col": "amount", "filter_col": "code", "join_col": "id", "correlated_ref": "empl.id", "token_group": "T1", "fan_out": 1 }
v1
Schema: area_registry (alias: ord)(status, name, code, amount) stocking_sites(date, salary, code, value) Task: Find amount from area_registry where id appears in stocking_sites entries with matching code. SQL:
SELECT amount FROM area_registry AS ord WHERE id IN ( SELECT id FROM stocking_sites AS whs WHERE whs.code = ord.code );
{ "outer_table": "area_registry", "inner_table": "stocking_sites", "outer_alias": "ord", "inner_alias": "whs", "proj_col": "amount", "filter_col": "id", "join_col": "code", "correlated_ref": "ord.code", "token_group": "T2", "fan_out": 65 }
v1
Schema: personnel_registry (alias: empl)(id, salary, level, status) stock_catalog(id, name, code, value) Task: Retrieve salary from personnel_registry whose code is found in stock_catalog rows where level matches the outer record. SQL:
SELECT salary FROM personnel_registry AS empl WHERE code IN ( SELECT code FROM stock_catalog AS prd WHERE prd.level = empl.level );
{ "outer_table": "personnel_registry", "inner_table": "stock_catalog", "outer_alias": "empl", "inner_alias": "prd", "proj_col": "salary", "filter_col": "code", "join_col": "level", "correlated_ref": "empl.level", "token_group": "T2", "fan_out": 90 }
v1
Schema: journal_entries (alias: dept)(level, id, type, date) workforce_data(level, date, status, amount) Task: Select id from journal_entries where type exists in workforce_data for the same code. SQL:
SELECT id FROM journal_entries AS dept WHERE type IN ( SELECT type FROM workforce_data AS empl WHERE empl.code = dept.code );
{ "outer_table": "journal_entries", "inner_table": "workforce_data", "outer_alias": "dept", "inner_alias": "empl", "proj_col": "id", "filter_col": "type", "join_col": "code", "correlated_ref": "dept.code", "token_group": "T2", "fan_out": 110 }
v2
Schema: receivables_log (alias: usr)(value, name, level, amount) activity_log(level, amount, salary, status) Task: Retrieve code from receivables_log that have at least one corresponding entry in activity_log sharing the same level. SQL:
SELECT code FROM receivables_log AS usr WHERE EXISTS ( SELECT 1 FROM activity_log AS tsk WHERE tsk.level = usr.level );
{ "outer_table": "receivables_log", "inner_table": "activity_log", "outer_alias": "usr", "inner_alias": "tsk", "proj_col": "code", "join_col": "level", "correlated_ref": "usr.level", "token_group": "T2", "fan_out": 55 }
v1
Schema: dispatch_queue (alias: mgr)(id, type, date, salary) portfolio_index(date, amount, name, id) Task: Find salary from dispatch_queue where level appears in portfolio_index entries with matching type. SQL:
SELECT salary FROM dispatch_queue AS mgr WHERE level IN ( SELECT level FROM portfolio_index AS act WHERE act.type = mgr.type );
{ "outer_table": "dispatch_queue", "inner_table": "portfolio_index", "outer_alias": "mgr", "inner_alias": "act", "proj_col": "salary", "filter_col": "level", "join_col": "type", "correlated_ref": "mgr.type", "token_group": "T1", "fan_out": 1 }
v1
Schema: cost_centers (alias: dept)(status, name, date, id) dispatch_queue(code, value, level, name) Task: Retrieve salary from cost_centers whose code is found in dispatch_queue rows where id matches the outer record. SQL:
SELECT salary FROM cost_centers AS dept WHERE code IN ( SELECT code FROM dispatch_queue AS shp WHERE shp.id = dept.id );
{ "outer_table": "cost_centers", "inner_table": "dispatch_queue", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "salary", "filter_col": "code", "join_col": "id", "correlated_ref": "dept.id", "token_group": "T2", "fan_out": 85 }
v1
Schema: portfolio_index (alias: prod)(level, salary, id, type) area_registry(amount, code, date, value) Task: Select code from portfolio_index where status exists in area_registry for the same type. SQL:
SELECT code FROM portfolio_index AS prod WHERE status IN ( SELECT status FROM area_registry AS rgn WHERE rgn.type = prod.type );
{ "outer_table": "portfolio_index", "inner_table": "area_registry", "outer_alias": "prod", "inner_alias": "rgn", "proj_col": "code", "filter_col": "status", "join_col": "type", "correlated_ref": "prod.type", "token_group": "T2", "fan_out": 60 }
v3
Schema: sales_queue (alias: dept)(value, type, date, level) sales_registry(level, id, amount, type) Task: Select amount from sales_queue where amount is greater than the average of amount in sales_registry for matching level. SQL:
SELECT amount FROM sales_queue AS dept WHERE amount > ( SELECT AVG(amount) FROM sales_registry AS cst WHERE cst.level = dept.level );
{ "outer_table": "sales_queue", "inner_table": "sales_registry", "outer_alias": "dept", "inner_alias": "cst", "proj_col": "amount", "filter_col": "amount", "agg_col": "amount", "agg_fn": "AVG", "join_col": "level", "correlated_ref": "dept.level", "token_group": "T1", "fan_out": 1 }
v1
Schema: facility_registry (alias: mgr)(salary, name, level, amount) workforce_data(level, date, status, amount) Task: Find salary from facility_registry where level appears in workforce_data entries with matching level. SQL:
SELECT salary FROM facility_registry AS mgr WHERE level IN ( SELECT level FROM workforce_data AS empl WHERE empl.level = mgr.level );
{ "outer_table": "facility_registry", "inner_table": "workforce_data", "outer_alias": "mgr", "inner_alias": "empl", "proj_col": "salary", "filter_col": "level", "join_col": "level", "correlated_ref": "mgr.level", "token_group": "T2", "fan_out": 110 }
v1
Schema: stock_catalog (alias: dept)(date, level, amount, status) dispatch_queue(type, name, salary, value) Task: Find salary from stock_catalog where id appears in dispatch_queue entries with matching type. SQL:
SELECT salary FROM stock_catalog AS dept WHERE id IN ( SELECT id FROM dispatch_queue AS shp WHERE shp.type = dept.type );
{ "outer_table": "stock_catalog", "inner_table": "dispatch_queue", "outer_alias": "dept", "inner_alias": "shp", "proj_col": "salary", "filter_col": "id", "join_col": "type", "correlated_ref": "dept.type", "token_group": "T2", "fan_out": 85 }
v3
Schema: area_registry (alias: emp)(status, date, id, salary) activity_log(status, salary, amount, level) Task: Retrieve id from area_registry with salary above the COUNT(value) of activity_log rows sharing the same code. SQL:
SELECT id FROM area_registry AS emp WHERE salary > ( SELECT COUNT(value) FROM activity_log AS tsk WHERE tsk.code = emp.code );
{ "outer_table": "area_registry", "inner_table": "activity_log", "outer_alias": "emp", "inner_alias": "tsk", "proj_col": "id", "filter_col": "salary", "agg_col": "value", "agg_fn": "COUNT", "join_col": "code", "correlated_ref": "emp.code", "token_group": "T2", "fan_out": 55 }
v3
Schema: stock_catalog (alias: usr)(level, code, status, id) receivables_log(name, date, level, salary) Task: Find code from stock_catalog where amount exceeds the maximum value from receivables_log for the same id. SQL:
SELECT code FROM stock_catalog AS usr WHERE amount > ( SELECT MAX(value) FROM receivables_log AS inv WHERE inv.id = usr.id );
{ "outer_table": "stock_catalog", "inner_table": "receivables_log", "outer_alias": "usr", "inner_alias": "inv", "proj_col": "code", "filter_col": "amount", "agg_col": "value", "agg_fn": "MAX", "join_col": "id", "correlated_ref": "usr.id", "token_group": "T1", "fan_out": 1 }