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