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