Prompt:
Schema:
  attribute_groups (alias: ord)(id, type, name, salary)
  dispatch_queue(amount, id, value, type)
Task: Select salary from attribute_groups that have at least one matching row in dispatch_queue for the same id.
SQL:

SELECT salary FROM attribute_groups AS ord
WHERE EXISTS (
    SELECT 1 FROM dispatch_queue AS shp
    WHERE shp.id = ord.id
);


Prompt:
Schema:
  attribute_groups (alias: dept)(name, amount, id, type)
  personnel_registry(amount, id, value, date)
Task: Select id from attribute_groups that have at least one matching row in personnel_registry for the same type.
SQL:

SELECT id FROM attribute_groups AS dept
WHERE EXISTS (
    SELECT 1 FROM personnel_registry AS emp
    WHERE emp.type = dept.type
);


Prompt:
Schema:
  activity_log (alias: prod)(code, amount, value, date)
  stock_catalog(status, level, amount, code)
Task: Retrieve id from activity_log with value above the MIN(value) of stock_catalog rows sharing the same type.
SQL:

SELECT id FROM activity_log AS prod
WHERE value > (
    SELECT MIN(value) FROM stock_catalog AS prd
    WHERE prd.type = prod.type
);


Prompt:
Schema:
  personnel_registry (alias: inv)(id, name, type, date)
  activity_log(value, type, level, status)
Task: Retrieve amount from personnel_registry with amount above the MAX(salary) of activity_log rows sharing the same type.
SQL:

SELECT amount FROM personnel_registry AS inv
WHERE amount > (
    SELECT MAX(salary) FROM activity_log AS tsk
    WHERE tsk.type = inv.type
);


Prompt:
Schema:
  acquisition_log (alias: empl)(name, id, salary, date)
  engagement_log(type, date, status, value)
Task: Find code from acquisition_log where a matching record exists in engagement_log with the same level.
SQL:

SELECT code FROM acquisition_log AS empl
WHERE EXISTS (
    SELECT 1 FROM engagement_log AS prj
    WHERE prj.level = empl.level
);


Prompt:
Schema:
  journal_entries (alias: empl)(amount, salary, value, code)
  dispatch_queue(code, type, level, id)
Task: Find value from journal_entries where value exceeds the average value from dispatch_queue for the same code.
SQL:

SELECT value FROM journal_entries AS empl
WHERE value > (
    SELECT AVG(value) FROM dispatch_queue AS shp
    WHERE shp.code = empl.code
);


Prompt:
Schema:
  dispatch_queue (alias: usr)(level, code, value, salary)
  attribute_groups(amount, code, id, level)
Task: Retrieve value from dispatch_queue that have at least one corresponding entry in attribute_groups sharing the same code.
SQL:

SELECT value FROM dispatch_queue AS usr
WHERE EXISTS (
    SELECT 1 FROM attribute_groups AS ctg
    WHERE ctg.code = usr.code
);


Prompt:
Schema:
  area_registry (alias: usr)(level, salary, date, value)
  portfolio_index(level, type, date, value)
Task: Select code from area_registry where amount is greater than the maximum of amount in portfolio_index for matching level.
SQL:

SELECT code FROM area_registry AS usr
WHERE amount > (
    SELECT MAX(amount) FROM portfolio_index AS act
    WHERE act.level = usr.level
);


Prompt:
Schema:
  engagement_log (alias: mgr)(level, status, type, id)
  personnel_registry(date, type, salary, status)
Task: Retrieve value from engagement_log with value above the AVG(amount) of personnel_registry rows sharing the same status.
SQL:

SELECT value FROM engagement_log AS mgr
WHERE value > (
    SELECT AVG(amount) FROM personnel_registry AS emp
    WHERE emp.status = mgr.status
);


Prompt:
Schema:
  sales_registry (alias: inv)(code, salary, type, amount)
  sales_queue(level, code, salary, name)
Task: Find code from sales_registry where amount exceeds the minimum value from sales_queue for the same id.
SQL:

SELECT code FROM sales_registry AS inv
WHERE amount > (
    SELECT MIN(value) FROM sales_queue AS ord
    WHERE ord.id = inv.id
);


Prompt:
Schema:
  activity_log (alias: prod)(code, value, name, salary)
  stock_catalog(code, type, level, id)
Task: Find amount from activity_log where salary exceeds the total amount from stock_catalog for the same id.
SQL:

SELECT amount FROM activity_log AS prod
WHERE salary > (
    SELECT SUM(amount) FROM stock_catalog AS prd
    WHERE prd.id = prod.id
);


Prompt:
Schema:
  journal_entries (alias: usr)(status, code, id, type)
  sales_registry(type, date, salary, code)
Task: Find code from journal_entries where level appears in sales_registry entries with matching id.
SQL:

SELECT code FROM journal_entries AS usr
WHERE level IN (
    SELECT level FROM sales_registry AS cst
    WHERE cst.id = usr.id
);


Prompt:
Schema:
  engagement_log (alias: mgr)(level, code, type, amount)
  sales_registry(date, status, salary, type)
Task: Find value from engagement_log where a matching record exists in sales_registry with the same id.
SQL:

SELECT value FROM engagement_log AS mgr
WHERE EXISTS (
    SELECT 1 FROM sales_registry AS cst
    WHERE cst.id = mgr.id
);


Prompt:
Schema:
  stock_catalog (alias: emp)(status, type, value, level)
  facility_registry(amount, code, type, value)
Task: Select id from stock_catalog where level exists in facility_registry for the same status.
SQL:

SELECT id FROM stock_catalog AS emp
WHERE level IN (
    SELECT level FROM facility_registry AS brc
    WHERE brc.status = emp.status
);


Prompt:
Schema:
  cost_centers (alias: prod)(code, date, type, value)
  acquisition_log(id, type, code, level)
Task: Find name from cost_centers where a matching record exists in acquisition_log with the same status.
SQL:

SELECT name FROM cost_centers AS prod
WHERE EXISTS (
    SELECT 1 FROM acquisition_log AS ordr
    WHERE ordr.status = prod.status
);


Prompt:
Schema:
  receivables_log (alias: mgr)(amount, id, date, code)
  cost_centers(type, level, code, name)
Task: Select value from receivables_log where value is greater than the count of of salary in cost_centers for matching status.
SQL:

SELECT value FROM receivables_log AS mgr
WHERE value > (
    SELECT COUNT(salary) FROM cost_centers AS dpt
    WHERE dpt.status = mgr.status
);


Prompt:
Schema:
  dispatch_queue (alias: inv)(level, type, id, status)
  sales_queue(salary, code, level, id)
Task: Select amount from dispatch_queue where level exists in sales_queue for the same type.
SQL:

SELECT amount FROM dispatch_queue AS inv
WHERE level IN (
    SELECT level FROM sales_queue AS ord
    WHERE ord.type = inv.type
);


Prompt:
Schema:
  portfolio_index (alias: emp)(id, code, salary, amount)
  stock_catalog(status, date, id, level)
Task: Find amount from portfolio_index where level appears in stock_catalog entries with matching type.
SQL:

SELECT amount FROM portfolio_index AS emp
WHERE level IN (
    SELECT level FROM stock_catalog AS prd
    WHERE prd.type = emp.type
);


Prompt:
Schema:
  journal_entries (alias: mgr)(status, level, type, amount)
  acquisition_log(value, level, salary, id)
Task: Select id from journal_entries where amount is greater than the total of amount in acquisition_log for matching type.
SQL:

SELECT id FROM journal_entries AS mgr
WHERE amount > (
    SELECT SUM(amount) FROM acquisition_log AS ordr
    WHERE ordr.type = mgr.type
);


Prompt:
Schema:
  engagement_log (alias: usr)(date, amount, id, salary)
  stocking_sites(type, amount, date, salary)
Task: Find amount from engagement_log where a matching record exists in stocking_sites with the same type.
SQL:

SELECT amount FROM engagement_log AS usr
WHERE EXISTS (
    SELECT 1 FROM stocking_sites AS whs
    WHERE whs.type = usr.type
);


Prompt:
Schema:
  facility_registry (alias: prod)(value, amount, code, status)
  sales_registry(type, status, date, salary)
Task: Find code from facility_registry where type appears in sales_registry entries with matching type.
SQL:

SELECT code FROM facility_registry AS prod
WHERE type IN (
    SELECT type FROM sales_registry AS cst
    WHERE cst.type = prod.type
);


Prompt:
Schema:
  sales_queue (alias: prod)(value, code, name, salary)
  personnel_registry(level, amount, salary, value)
Task: Select amount from sales_queue that have at least one matching row in personnel_registry for the same level.
SQL:

SELECT amount FROM sales_queue AS prod
WHERE EXISTS (
    SELECT 1 FROM personnel_registry AS emp
    WHERE emp.level = prod.level
);


Prompt:
Schema:
  area_registry (alias: dept)(name, status, level, type)
  cost_centers(code, type, amount, name)
Task: Find amount from area_registry where a matching record exists in cost_centers with the same status.
SQL:

SELECT amount FROM area_registry AS dept
WHERE EXISTS (
    SELECT 1 FROM cost_centers AS dpt
    WHERE dpt.status = dept.status
);


Prompt:
Schema:
  journal_entries (alias: emp)(level, date, name, status)
  portfolio_index(status, type, date, code)
Task: Select name from journal_entries where value is greater than the maximum of salary in portfolio_index for matching code.
SQL:

SELECT name FROM journal_entries AS emp
WHERE value > (
    SELECT MAX(salary) FROM portfolio_index AS act
    WHERE act.code = emp.code
);


Prompt:
Schema:
  stocking_sites (alias: empl)(status, salary, date, type)
  journal_entries(status, code, amount, type)
Task: Find name from stocking_sites where salary exceeds the total salary from journal_entries for the same status.
SQL:

SELECT name FROM stocking_sites AS empl
WHERE salary > (
    SELECT SUM(salary) FROM journal_entries AS txn
    WHERE txn.status = empl.status
);


Prompt:
Schema:
  personnel_registry (alias: mgr)(name, salary, value, date)
  acquisition_log(date, amount, name, id)
Task: Find salary from personnel_registry where a matching record exists in acquisition_log with the same id.
SQL:

SELECT salary FROM personnel_registry AS mgr
WHERE EXISTS (
    SELECT 1 FROM acquisition_log AS ordr
    WHERE ordr.id = mgr.id
);


Prompt:
Schema:
  sales_registry (alias: dept)(name, date, level, id)
  stocking_sites(name, amount, level, status)
Task: Select id from sales_registry where id exists in stocking_sites for the same status.
SQL:

SELECT id FROM sales_registry AS dept
WHERE id IN (
    SELECT id FROM stocking_sites AS whs
    WHERE whs.status = dept.status
);


Prompt:
Schema:
  workforce_data (alias: usr)(id, value, status, date)
  stock_catalog(level, id, amount, date)
Task: Find name from workforce_data where status appears in stock_catalog entries with matching id.
SQL:

SELECT name FROM workforce_data AS usr
WHERE status IN (
    SELECT status FROM stock_catalog AS prd
    WHERE prd.id = usr.id
);


Prompt:
Schema:
  engagement_log (alias: dept)(type, amount, name, id)
  personnel_registry(salary, value, date, code)
Task: Find salary from engagement_log where status appears in personnel_registry entries with matching type.
SQL:

SELECT salary FROM engagement_log AS dept
WHERE status IN (
    SELECT status FROM personnel_registry AS emp
    WHERE emp.type = dept.type
);


Prompt:
Schema:
  stock_catalog (alias: mgr)(salary, code, id, type)
  receivables_log(id, level, name, value)
Task: Find name from stock_catalog where code appears in receivables_log entries with matching level.
SQL:

SELECT name FROM stock_catalog AS mgr
WHERE code IN (
    SELECT code FROM receivables_log AS inv
    WHERE inv.level = mgr.level
);


Prompt:
Schema:
  sales_queue (alias: dept)(amount, code, status, salary)
  dispatch_queue(type, name, value, code)
Task: Select value from sales_queue that have at least one matching row in dispatch_queue for the same status.
SQL:

SELECT value FROM sales_queue AS dept
WHERE EXISTS (
    SELECT 1 FROM dispatch_queue AS shp
    WHERE shp.status = dept.status
);


Prompt:
Schema:
  sales_registry (alias: mgr)(id, level, type, status)
  cost_centers(name, level, status, code)
Task: Find id from sales_registry where type appears in cost_centers entries with matching level.
SQL:

SELECT id FROM sales_registry AS mgr
WHERE type IN (
    SELECT type FROM cost_centers AS dpt
    WHERE dpt.level = mgr.level
);


Prompt:
Schema:
  sourcing_list (alias: mgr)(code, amount, level, type)
  engagement_log(name, id, level, salary)
Task: Find name from sourcing_list where a matching record exists in engagement_log with the same status.
SQL:

SELECT name FROM sourcing_list AS mgr
WHERE EXISTS (
    SELECT 1 FROM engagement_log AS prj
    WHERE prj.status = mgr.status
);


Prompt:
Schema:
  journal_entries (alias: usr)(amount, value, id, code)
  area_registry(name, type, level, id)
Task: Select code from journal_entries that have at least one matching row in area_registry for the same code.
SQL:

SELECT code FROM journal_entries AS usr
WHERE EXISTS (
    SELECT 1 FROM area_registry AS rgn
    WHERE rgn.code = usr.code
);


Prompt:
Schema:
  receivables_log (alias: prod)(date, amount, value, level)
  personnel_registry(status, amount, id, salary)
Task: Retrieve code from receivables_log that have at least one corresponding entry in personnel_registry sharing the same type.
SQL:

SELECT code FROM receivables_log AS prod
WHERE EXISTS (
    SELECT 1 FROM personnel_registry AS emp
    WHERE emp.type = prod.type
);


Prompt:
Schema:
  personnel_registry (alias: emp)(amount, status, type, name)
  stocking_sites(salary, amount, date, id)
Task: Select id from personnel_registry where value is greater than the maximum of value in stocking_sites for matching id.
SQL:

SELECT id FROM personnel_registry AS emp
WHERE value > (
    SELECT MAX(value) FROM stocking_sites AS whs
    WHERE whs.id = emp.id
);


Prompt:
Schema:
  stocking_sites (alias: dept)(date, code, amount, level)
  workforce_data(name, code, date, type)
Task: Find name from stocking_sites where code appears in workforce_data entries with matching status.
SQL:

SELECT name FROM stocking_sites AS dept
WHERE code IN (
    SELECT code FROM workforce_data AS empl
    WHERE empl.status = dept.status
);


Prompt:
Schema:
  stock_catalog (alias: empl)(date, status, id, type)
  area_registry(type, level, status, value)
Task: Retrieve value from stock_catalog that have at least one corresponding entry in area_registry sharing the same code.
SQL:

SELECT value FROM stock_catalog AS empl
WHERE EXISTS (
    SELECT 1 FROM area_registry AS rgn
    WHERE rgn.code = empl.code
);


Prompt:
Schema:
  facility_registry (alias: ord)(amount, name, type, salary)
  attribute_groups(name, code, id, type)
Task: Find code from facility_registry where code appears in attribute_groups entries with matching status.
SQL:

SELECT code FROM facility_registry AS ord
WHERE code IN (
    SELECT code FROM attribute_groups AS ctg
    WHERE ctg.status = ord.status
);


Prompt:
Schema:
  attribute_groups (alias: inv)(date, status, amount, name)
  engagement_log(status, name, code, amount)
Task: Find value from attribute_groups where a matching record exists in engagement_log with the same code.
SQL:

SELECT value FROM attribute_groups AS inv
WHERE EXISTS (
    SELECT 1 FROM engagement_log AS prj
    WHERE prj.code = inv.code
);


Prompt:
Schema:
  stocking_sites (alias: empl)(level, name, salary, amount)
  acquisition_log(code, type, status, value)
Task: Retrieve code from stocking_sites whose code is found in acquisition_log rows where code matches the outer record.
SQL:

SELECT code FROM stocking_sites AS empl
WHERE code IN (
    SELECT code FROM acquisition_log AS ordr
    WHERE ordr.code = empl.code
);


Prompt:
Schema:
  journal_entries (alias: emp)(level, type, status, amount)
  dispatch_queue(name, status, type, id)
Task: Select amount from journal_entries where id exists in dispatch_queue for the same status.
SQL:

SELECT amount FROM journal_entries AS emp
WHERE id IN (
    SELECT id FROM dispatch_queue AS shp
    WHERE shp.status = emp.status
);


Prompt:
Schema:
  personnel_registry (alias: emp)(name, type, code, date)
  area_registry(value, id, level, status)
Task: Retrieve salary from personnel_registry with value above the MAX(salary) of area_registry rows sharing the same id.
SQL:

SELECT salary FROM personnel_registry AS emp
WHERE value > (
    SELECT MAX(salary) FROM area_registry AS rgn
    WHERE rgn.id = emp.id
);


Prompt:
Schema:
  stock_catalog (alias: mgr)(date, id, level, type)
  sales_registry(date, status, value, id)
Task: Retrieve code from stock_catalog that have at least one corresponding entry in sales_registry sharing the same code.
SQL:

SELECT code FROM stock_catalog AS mgr
WHERE EXISTS (
    SELECT 1 FROM sales_registry AS cst
    WHERE cst.code = mgr.code
);


Prompt:
Schema:
  stock_catalog (alias: ord)(status, code, salary, value)
  stocking_sites(status, name, type, salary)
Task: Find code from stock_catalog where id appears in stocking_sites entries with matching code.
SQL:

SELECT code FROM stock_catalog AS ord
WHERE id IN (
    SELECT id FROM stocking_sites AS whs
    WHERE whs.code = ord.code
);


Prompt:
Schema:
  attribute_groups (alias: empl)(name, value, amount, id)
  personnel_registry(amount, name, code, status)
Task: Find amount from attribute_groups where a matching record exists in personnel_registry with the same id.
SQL:

SELECT amount FROM attribute_groups AS empl
WHERE EXISTS (
    SELECT 1 FROM personnel_registry AS emp
    WHERE emp.id = empl.id
);


Prompt:
Schema:
  sales_registry (alias: empl)(salary, value, level, type)
  stocking_sites(date, name, value, code)
Task: Select value from sales_registry where value is greater than the average of amount in stocking_sites for matching id.
SQL:

SELECT value FROM sales_registry AS empl
WHERE value > (
    SELECT AVG(amount) FROM stocking_sites AS whs
    WHERE whs.id = empl.id
);


Prompt:
Schema:
  sourcing_list (alias: prod)(code, name, id, type)
  area_registry(status, code, level, id)
Task: Retrieve salary from sourcing_list with value above the MIN(amount) of area_registry rows sharing the same status.
SQL:

SELECT salary FROM sourcing_list AS prod
WHERE value > (
    SELECT MIN(amount) FROM area_registry AS rgn
    WHERE rgn.status = prod.status
);


Prompt:
Schema:
  sourcing_list (alias: inv)(id, type, amount, status)
  dispatch_queue(date, amount, status, id)
Task: Retrieve name from sourcing_list whose code is found in dispatch_queue rows where type matches the outer record.
SQL:

SELECT name FROM sourcing_list AS inv
WHERE code IN (
    SELECT code FROM dispatch_queue AS shp
    WHERE shp.type = inv.type
);


Prompt:
Schema:
  engagement_log (alias: inv)(status, level, code, type)
  personnel_registry(status, id, value, name)
Task: Retrieve value from engagement_log whose id is found in personnel_registry rows where level matches the outer record.
SQL:

SELECT value FROM engagement_log AS inv
WHERE id IN (
    SELECT id FROM personnel_registry AS emp
    WHERE emp.level = inv.level
);


Prompt:
Schema:
  acquisition_log (alias: ord)(code, level, salary, status)
  facility_registry(amount, type, id, status)
Task: Retrieve salary from acquisition_log that have at least one corresponding entry in facility_registry sharing the same code.
SQL:

SELECT salary FROM acquisition_log AS ord
WHERE EXISTS (
    SELECT 1 FROM facility_registry AS brc
    WHERE brc.code = ord.code
);


Prompt:
Schema:
  journal_entries (alias: empl)(salary, amount, type, id)
  personnel_registry(salary, id, value, level)
Task: Select salary from journal_entries where salary is greater than the minimum of amount in personnel_registry for matching level.
SQL:

SELECT salary FROM journal_entries AS empl
WHERE salary > (
    SELECT MIN(amount) FROM personnel_registry AS emp
    WHERE emp.level = empl.level
);


Prompt:
Schema:
  activity_log (alias: prod)(code, value, name, level)
  workforce_data(id, status, name, salary)
Task: Find id from activity_log where status appears in workforce_data entries with matching type.
SQL:

SELECT id FROM activity_log AS prod
WHERE status IN (
    SELECT status FROM workforce_data AS empl
    WHERE empl.type = prod.type
);


Prompt:
Schema:
  facility_registry (alias: mgr)(date, name, amount, level)
  portfolio_index(value, date, code, id)
Task: Retrieve name from facility_registry whose level is found in portfolio_index rows where type matches the outer record.
SQL:

SELECT name FROM facility_registry AS mgr
WHERE level IN (
    SELECT level FROM portfolio_index AS act
    WHERE act.type = mgr.type
);


Prompt:
Schema:
  workforce_data (alias: inv)(type, amount, date, salary)
  sales_queue(id, code, salary, date)
Task: Find salary from workforce_data where a matching record exists in sales_queue with the same code.
SQL:

SELECT salary FROM workforce_data AS inv
WHERE EXISTS (
    SELECT 1 FROM sales_queue AS ord
    WHERE ord.code = inv.code
);


Prompt:
Schema:
  sales_queue (alias: dept)(level, status, date, value)
  receivables_log(value, status, amount, date)
Task: Retrieve amount from sales_queue that have at least one corresponding entry in receivables_log sharing the same status.
SQL:

SELECT amount FROM sales_queue AS dept
WHERE EXISTS (
    SELECT 1 FROM receivables_log AS inv
    WHERE inv.status = dept.status
);


Prompt:
Schema:
  engagement_log (alias: empl)(status, salary, date, value)
  dispatch_queue(id, value, code, salary)
Task: Retrieve amount from engagement_log whose code is found in dispatch_queue rows where status matches the outer record.
SQL:

SELECT amount FROM engagement_log AS empl
WHERE code IN (
    SELECT code FROM dispatch_queue AS shp
    WHERE shp.status = empl.status
);


Prompt:
Schema:
  stocking_sites (alias: ord)(type, code, level, status)
  sourcing_list(date, value, level, id)
Task: Find amount from stocking_sites where salary exceeds the average salary from sourcing_list for the same code.
SQL:

SELECT amount FROM stocking_sites AS ord
WHERE salary > (
    SELECT AVG(salary) FROM sourcing_list AS spl
    WHERE spl.code = ord.code
);


Prompt:
Schema:
  personnel_registry (alias: inv)(date, id, salary, amount)
  sales_queue(value, level, id, status)
Task: Find value from personnel_registry where a matching record exists in sales_queue with the same id.
SQL:

SELECT value FROM personnel_registry AS inv
WHERE EXISTS (
    SELECT 1 FROM sales_queue AS ord
    WHERE ord.id = inv.id
);


Prompt:
Schema:
  acquisition_log (alias: emp)(salary, amount, code, level)
  receivables_log(value, status, date, salary)
Task: Select value from acquisition_log where type exists in receivables_log for the same level.
SQL:

SELECT value FROM acquisition_log AS emp
WHERE type IN (
    SELECT type FROM receivables_log AS inv
    WHERE inv.level = emp.level
);


Prompt:
Schema:
  dispatch_queue (alias: emp)(status, name, code, value)
  acquisition_log(date, amount, salary, value)
Task: Find salary from dispatch_queue where amount exceeds the count of value from acquisition_log for the same status.
SQL:

SELECT salary FROM dispatch_queue AS emp
WHERE amount > (
    SELECT COUNT(value) FROM acquisition_log AS ordr
    WHERE ordr.status = emp.status
);


Prompt:
Schema:
  sales_registry (alias: inv)(name, code, amount, salary)
  activity_log(id, amount, date, salary)
Task: Find name from sales_registry where a matching record exists in activity_log with the same status.
SQL:

SELECT name FROM sales_registry AS inv
WHERE EXISTS (
    SELECT 1 FROM activity_log AS tsk
    WHERE tsk.status = inv.status
);


Prompt:
Schema:
  sourcing_list (alias: inv)(date, type, level, status)
  area_registry(amount, name, code, date)
Task: Retrieve amount from sourcing_list with salary above the COUNT(value) of area_registry rows sharing the same type.
SQL:

SELECT amount FROM sourcing_list AS inv
WHERE salary > (
    SELECT COUNT(value) FROM area_registry AS rgn
    WHERE rgn.type = inv.type
);


Prompt:
Schema:
  facility_registry (alias: inv)(amount, value, type, date)
  portfolio_index(value, id, name, date)
Task: Select id from facility_registry that have at least one matching row in portfolio_index for the same status.
SQL:

SELECT id FROM facility_registry AS inv
WHERE EXISTS (
    SELECT 1 FROM portfolio_index AS act
    WHERE act.status = inv.status
);


Prompt:
Schema:
  journal_entries (alias: dept)(status, salary, level, amount)
  engagement_log(value, amount, code, salary)
Task: Select salary from journal_entries that have at least one matching row in engagement_log for the same type.
SQL:

SELECT salary FROM journal_entries AS dept
WHERE EXISTS (
    SELECT 1 FROM engagement_log AS prj
    WHERE prj.type = dept.type
);


Prompt:
Schema:
  journal_entries (alias: mgr)(name, amount, id, status)
  sourcing_list(date, level, id, amount)
Task: Find code from journal_entries where code appears in sourcing_list entries with matching level.
SQL:

SELECT code FROM journal_entries AS mgr
WHERE code IN (
    SELECT code FROM sourcing_list AS spl
    WHERE spl.level = mgr.level
);


Prompt:
Schema:
  personnel_registry (alias: emp)(date, type, level, status)
  journal_entries(id, salary, level, value)
Task: Find salary from personnel_registry where id appears in journal_entries entries with matching id.
SQL:

SELECT salary FROM personnel_registry AS emp
WHERE id IN (
    SELECT id FROM journal_entries AS txn
    WHERE txn.id = emp.id
);


Prompt:
Schema:
  sales_queue (alias: inv)(value, type, name, date)
  facility_registry(status, id, value, name)
Task: Retrieve id from sales_queue that have at least one corresponding entry in facility_registry sharing the same type.
SQL:

SELECT id FROM sales_queue AS inv
WHERE EXISTS (
    SELECT 1 FROM facility_registry AS brc
    WHERE brc.type = inv.type
);


Prompt:
Schema:
  workforce_data (alias: usr)(type, amount, value, name)
  dispatch_queue(status, id, salary, amount)
Task: Retrieve id from workforce_data that have at least one corresponding entry in dispatch_queue sharing the same type.
SQL:

SELECT id FROM workforce_data AS usr
WHERE EXISTS (
    SELECT 1 FROM dispatch_queue AS shp
    WHERE shp.type = usr.type
);


Prompt:
Schema:
  journal_entries (alias: empl)(name, salary, date, type)
  sales_queue(name, value, id, status)
Task: Find salary from journal_entries where status appears in sales_queue entries with matching status.
SQL:

SELECT salary FROM journal_entries AS empl
WHERE status IN (
    SELECT status FROM sales_queue AS ord
    WHERE ord.status = empl.status
);


Prompt:
Schema:
  portfolio_index (alias: mgr)(date, type, status, level)
  acquisition_log(name, type, salary, code)
Task: Retrieve value from portfolio_index that have at least one corresponding entry in acquisition_log sharing the same id.
SQL:

SELECT value FROM portfolio_index AS mgr
WHERE EXISTS (
    SELECT 1 FROM acquisition_log AS ordr
    WHERE ordr.id = mgr.id
);


Prompt:
Schema:
  sales_registry (alias: inv)(value, type, code, id)
  sales_queue(type, name, date, level)
Task: Find name from sales_registry where level appears in sales_queue entries with matching code.
SQL:

SELECT name FROM sales_registry AS inv
WHERE level IN (
    SELECT level FROM sales_queue AS ord
    WHERE ord.code = inv.code
);


Prompt:
Schema:
  activity_log (alias: mgr)(value, salary, status, code)
  acquisition_log(type, amount, code, date)
Task: Retrieve name from activity_log with value above the MIN(salary) of acquisition_log rows sharing the same code.
SQL:

SELECT name FROM activity_log AS mgr
WHERE value > (
    SELECT MIN(salary) FROM acquisition_log AS ordr
    WHERE ordr.code = mgr.code
);


Prompt:
Schema:
  sales_queue (alias: prod)(name, status, code, value)
  acquisition_log(level, id, code, status)
Task: Retrieve id from sales_queue with amount above the MAX(value) of acquisition_log rows sharing the same code.
SQL:

SELECT id FROM sales_queue AS prod
WHERE amount > (
    SELECT MAX(value) FROM acquisition_log AS ordr
    WHERE ordr.code = prod.code
);


Prompt:
Schema:
  sales_queue (alias: empl)(name, salary, date, type)
  cost_centers(code, name, type, salary)
Task: Retrieve code from sales_queue with salary above the SUM(salary) of cost_centers rows sharing the same status.
SQL:

SELECT code FROM sales_queue AS empl
WHERE salary > (
    SELECT SUM(salary) FROM cost_centers AS dpt
    WHERE dpt.status = empl.status
);


Prompt:
Schema:
  stock_catalog (alias: prod)(type, date, id, salary)
  sales_registry(name, code, amount, id)
Task: Retrieve value from stock_catalog with value above the AVG(amount) of sales_registry rows sharing the same type.
SQL:

SELECT value FROM stock_catalog AS prod
WHERE value > (
    SELECT AVG(amount) FROM sales_registry AS cst
    WHERE cst.type = prod.type
);


Prompt:
Schema:
  receivables_log (alias: dept)(name, id, code, salary)
  stocking_sites(status, amount, type, date)
Task: Find name from receivables_log where a matching record exists in stocking_sites with the same code.
SQL:

SELECT name FROM receivables_log AS dept
WHERE EXISTS (
    SELECT 1 FROM stocking_sites AS whs
    WHERE whs.code = dept.code
);


Prompt:
Schema:
  portfolio_index (alias: mgr)(status, name, amount, code)
  workforce_data(amount, value, salary, status)
Task: Retrieve code from portfolio_index whose status is found in workforce_data rows where level matches the outer record.
SQL:

SELECT code FROM portfolio_index AS mgr
WHERE status IN (
    SELECT status FROM workforce_data AS empl
    WHERE empl.level = mgr.level
);


Prompt:
Schema:
  area_registry (alias: mgr)(level, type, id, name)
  sales_queue(value, id, level, date)
Task: Retrieve amount from area_registry that have at least one corresponding entry in sales_queue sharing the same id.
SQL:

SELECT amount FROM area_registry AS mgr
WHERE EXISTS (
    SELECT 1 FROM sales_queue AS ord
    WHERE ord.id = mgr.id
);


Prompt:
Schema:
  dispatch_queue (alias: prod)(date, status, salary, name)
  acquisition_log(type, level, date, status)
Task: Find salary from dispatch_queue where type appears in acquisition_log entries with matching id.
SQL:

SELECT salary FROM dispatch_queue AS prod
WHERE type IN (
    SELECT type FROM acquisition_log AS ordr
    WHERE ordr.id = prod.id
);


Prompt:
Schema:
  sales_queue (alias: dept)(name, type, level, status)
  stocking_sites(status, type, salary, date)
Task: Retrieve salary from sales_queue that have at least one corresponding entry in stocking_sites sharing the same type.
SQL:

SELECT salary FROM sales_queue AS dept
WHERE EXISTS (
    SELECT 1 FROM stocking_sites AS whs
    WHERE whs.type = dept.type
);


Prompt:
Schema:
  stock_catalog (alias: dept)(id, status, code, type)
  stocking_sites(level, date, name, type)
Task: Find salary from stock_catalog where type appears in stocking_sites entries with matching status.
SQL:

SELECT salary FROM stock_catalog AS dept
WHERE type IN (
    SELECT type FROM stocking_sites AS whs
    WHERE whs.status = dept.status
);