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