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