Prompt:
Schema:
  sales_queue (alias: ord)(level, name, amount, status)
  stocking_sites(level, code, salary, name)
Task: Find salary from sales_queue where amount exceeds the minimum amount from stocking_sites for the same level.
SQL:

SELECT salary FROM sales_queue AS ord
WHERE amount > (
    SELECT MIN(amount) FROM stocking_sites AS prd
    WHERE prd.level = ord.level
);


Prompt:
Schema:
  personnel_registry (alias: emp)(type, level, code, value)
  stocking_sites(status, level, id, name)
Task: Select salary from personnel_registry that have at least one matching row in stocking_sites for the same level.
SQL:

SELECT salary FROM personnel_registry AS emp
WHERE EXISTS (
    SELECT 1 FROM stocking_sites AS cst
    WHERE cst.level = emp.level
);


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

SELECT salary FROM receivables_log AS inv
WHERE code IN (
    SELECT code FROM engagement_log AS whs
    WHERE whs.status = inv.status
);


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

SELECT id FROM personnel_registry AS emp
WHERE type IN (
    SELECT type FROM area_registry AS empl
    WHERE empl.status = emp.status
);


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

SELECT code FROM sales_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM journal_entries AS emp
    WHERE emp.type = ord.type
);


Prompt:
Schema:
  engagement_log (alias: mgr)(status, salary, level, code)
  portfolio_index(level, id, salary, amount)
Task: Select value from engagement_log where level exists in portfolio_index for the same type.
SQL:

SELECT value FROM engagement_log AS mgr
WHERE level IN (
    SELECT level FROM portfolio_index AS act
    WHERE act.type = mgr.type
);


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

SELECT id FROM personnel_registry AS emp
WHERE amount > (
    SELECT SUM(salary) FROM stocking_sites AS prd
    WHERE prd.id = emp.id
);


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

SELECT value FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM area_registry AS ctg
    WHERE ctg.id = prod.id
);


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

SELECT id FROM sales_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM receivables_log AS inv
    WHERE inv.status = ord.status
);


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

SELECT name FROM workforce_data AS empl
WHERE EXISTS (
    SELECT 1 FROM sales_queue AS ctg
    WHERE ctg.code = empl.code
);


Prompt:
Schema:
  stock_catalog (alias: prod)(level, value, date, status)
  workforce_data(name, type, value, date)
Task: Select name from stock_catalog where salary is greater than the minimum of value in workforce_data for matching status.
SQL:

SELECT name FROM stock_catalog AS prod
WHERE salary > (
    SELECT MIN(value) FROM workforce_data AS whs
    WHERE whs.status = prod.status
);


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

SELECT value FROM workforce_data AS empl
WHERE EXISTS (
    SELECT 1 FROM sales_queue AS ordr
    WHERE ordr.status = empl.status
);


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

SELECT amount FROM personnel_registry AS emp
WHERE salary > (
    SELECT MAX(value) FROM facility_registry AS txn
    WHERE txn.status = emp.status
);


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

SELECT salary FROM engagement_log AS mgr
WHERE id IN (
    SELECT id FROM sourcing_list AS ord
    WHERE ord.status = mgr.status
);


Prompt:
Schema:
  workforce_data (alias: empl)(value, salary, id, level)
  dispatch_queue(amount, name, type, level)
Task: Find id from workforce_data where a matching record exists in dispatch_queue with the same level.
SQL:

SELECT id FROM workforce_data AS empl
WHERE EXISTS (
    SELECT 1 FROM dispatch_queue AS cst
    WHERE cst.level = empl.level
);


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

SELECT code FROM receivables_log AS inv
WHERE type IN (
    SELECT type FROM sales_queue AS cst
    WHERE cst.code = inv.code
);


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

SELECT id FROM personnel_registry AS emp
WHERE EXISTS (
    SELECT 1 FROM activity_log AS txn
    WHERE txn.level = emp.level
);


Prompt:
Schema:
  sales_registry (alias: usr)(date, level, salary, status)
  journal_entries(name, status, id, level)
Task: Select id from sales_registry where salary is greater than the average of salary in journal_entries for matching type.
SQL:

SELECT id FROM sales_registry AS usr
WHERE salary > (
    SELECT AVG(salary) FROM journal_entries AS ord
    WHERE ord.type = usr.type
);


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

SELECT id FROM workforce_data AS empl
WHERE salary > (
    SELECT SUM(amount) FROM activity_log AS emp
    WHERE emp.status = empl.status
);


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

SELECT value FROM engagement_log AS mgr
WHERE id IN (
    SELECT id FROM portfolio_index AS ctg
    WHERE ctg.id = mgr.id
);


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

SELECT name FROM stock_catalog AS prod
WHERE code IN (
    SELECT code FROM facility_registry AS inv
    WHERE inv.type = prod.type
);


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

SELECT value FROM receivables_log AS inv
WHERE type IN (
    SELECT type FROM stock_catalog AS act
    WHERE act.id = inv.id
);


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

SELECT id FROM sales_registry AS usr
WHERE EXISTS (
    SELECT 1 FROM personnel_registry AS brc
    WHERE brc.level = usr.level
);


Prompt:
Schema:
  sales_registry (alias: usr)(code, salary, value, status)
  cost_centers(level, type, date, value)
Task: Retrieve code from sales_registry whose level is found in cost_centers rows where status matches the outer record.
SQL:

SELECT code FROM sales_registry AS usr
WHERE level IN (
    SELECT level FROM cost_centers AS whs
    WHERE whs.status = usr.status
);


Prompt:
Schema:
  engagement_log (alias: mgr)(value, status, id, amount)
  portfolio_index(id, status, name, salary)
Task: Select value from engagement_log where type exists in portfolio_index for the same level.
SQL:

SELECT value FROM engagement_log AS mgr
WHERE type IN (
    SELECT type FROM portfolio_index AS ctg
    WHERE ctg.level = mgr.level
);


Prompt:
Schema:
  sales_queue (alias: ord)(salary, level, id, type)
  activity_log(id, value, date, type)
Task: Find id from sales_queue where salary exceeds the count of value from activity_log for the same level.
SQL:

SELECT id FROM sales_queue AS ord
WHERE salary > (
    SELECT COUNT(value) FROM activity_log AS prj
    WHERE prj.level = ord.level
);


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

SELECT name FROM receivables_log AS inv
WHERE code IN (
    SELECT code FROM stock_catalog AS ord
    WHERE ord.id = inv.id
);


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

SELECT code FROM personnel_registry AS emp
WHERE id IN (
    SELECT id FROM acquisition_log AS whs
    WHERE whs.level = emp.level
);


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

SELECT code FROM sales_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM receivables_log AS shp
    WHERE shp.code = ord.code
);


Prompt:
Schema:
  receivables_log (alias: inv)(date, amount, level, value)
  attribute_groups(date, name, amount, salary)
Task: Select salary from receivables_log where value is greater than the maximum of salary in attribute_groups for matching level.
SQL:

SELECT salary FROM receivables_log AS inv
WHERE value > (
    SELECT MAX(salary) FROM attribute_groups AS prj
    WHERE prj.level = inv.level
);


Prompt:
Schema:
  sales_registry (alias: usr)(id, code, type, level)
  portfolio_index(name, level, type, status)
Task: Find id from sales_registry where a matching record exists in portfolio_index with the same type.
SQL:

SELECT id FROM sales_registry AS usr
WHERE EXISTS (
    SELECT 1 FROM portfolio_index AS prj
    WHERE prj.type = usr.type
);


Prompt:
Schema:
  receivables_log (alias: inv)(amount, id, salary, type)
  sales_registry(code, status, type, id)
Task: Select id from receivables_log that have at least one matching row in sales_registry for the same code.
SQL:

SELECT id FROM receivables_log AS inv
WHERE EXISTS (
    SELECT 1 FROM sales_registry AS tsk
    WHERE tsk.code = inv.code
);


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

SELECT id FROM engagement_log AS mgr
WHERE salary > (
    SELECT MAX(salary) FROM cost_centers AS ctg
    WHERE ctg.id = mgr.id
);


Prompt:
Schema:
  workforce_data (alias: empl)(salary, amount, date, value)
  acquisition_log(amount, date, name, type)
Task: Find salary from workforce_data where level appears in acquisition_log entries with matching id.
SQL:

SELECT salary FROM workforce_data AS empl
WHERE level IN (
    SELECT level FROM acquisition_log AS emp
    WHERE emp.id = empl.id
);


Prompt:
Schema:
  workforce_data (alias: empl)(level, name, status, value)
  receivables_log(salary, type, id, status)
Task: Find id from workforce_data where value exceeds the total salary from receivables_log for the same type.
SQL:

SELECT id FROM workforce_data AS empl
WHERE value > (
    SELECT SUM(salary) FROM receivables_log AS emp
    WHERE emp.type = empl.type
);


Prompt:
Schema:
  workforce_data (alias: empl)(level, amount, name, code)
  acquisition_log(name, type, id, salary)
Task: Retrieve code from workforce_data with salary above the AVG(value) of acquisition_log rows sharing the same status.
SQL:

SELECT code FROM workforce_data AS empl
WHERE salary > (
    SELECT AVG(value) FROM acquisition_log AS emp
    WHERE emp.status = empl.status
);


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

SELECT code FROM cost_centers AS dept
WHERE type IN (
    SELECT type FROM portfolio_index AS tsk
    WHERE tsk.type = dept.type
);


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

SELECT salary FROM receivables_log AS inv
WHERE amount > (
    SELECT MIN(amount) FROM sales_registry AS tsk
    WHERE tsk.status = inv.status
);


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

SELECT value FROM personnel_registry AS emp
WHERE level IN (
    SELECT level FROM sales_registry AS prj
    WHERE prj.id = emp.id
);


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

SELECT amount FROM sales_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM personnel_registry AS cst
    WHERE cst.status = ord.status
);


Prompt:
Schema:
  receivables_log (alias: inv)(level, value, amount, status)
  portfolio_index(amount, name, type, id)
Task: Select amount from receivables_log where value is greater than the average of salary in portfolio_index for matching level.
SQL:

SELECT amount FROM receivables_log AS inv
WHERE value > (
    SELECT AVG(salary) FROM portfolio_index AS ord
    WHERE ord.level = inv.level
);


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

SELECT name FROM engagement_log AS mgr
WHERE salary > (
    SELECT MAX(value) FROM activity_log AS rgn
    WHERE rgn.id = mgr.id
);


Prompt:
Schema:
  receivables_log (alias: inv)(status, type, salary, date)
  sales_queue(salary, id, amount, status)
Task: Find salary from receivables_log where salary exceeds the count of salary from sales_queue for the same level.
SQL:

SELECT salary FROM receivables_log AS inv
WHERE salary > (
    SELECT COUNT(salary) FROM sales_queue AS prj
    WHERE prj.level = inv.level
);


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

SELECT code FROM receivables_log AS inv
WHERE salary > (
    SELECT SUM(value) FROM cost_centers AS ordr
    WHERE ordr.level = inv.level
);


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

SELECT amount FROM engagement_log AS mgr
WHERE EXISTS (
    SELECT 1 FROM acquisition_log AS ctg
    WHERE ctg.code = mgr.code
);


Prompt:
Schema:
  sales_registry (alias: usr)(code, amount, value, date)
  dispatch_queue(salary, amount, date, status)
Task: Retrieve value from sales_registry with amount above the MAX(amount) of dispatch_queue rows sharing the same code.
SQL:

SELECT value FROM sales_registry AS usr
WHERE amount > (
    SELECT MAX(amount) FROM dispatch_queue AS inv
    WHERE inv.code = usr.code
);


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

SELECT id FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM sales_queue AS rgn
    WHERE rgn.type = prod.type
);


Prompt:
Schema:
  sales_queue (alias: ord)(status, name, id, code)
  cost_centers(name, id, date, type)
Task: Select name from sales_queue where code exists in cost_centers for the same id.
SQL:

SELECT name FROM sales_queue AS ord
WHERE code IN (
    SELECT code FROM cost_centers AS tsk
    WHERE tsk.id = ord.id
);


Prompt:
Schema:
  cost_centers (alias: dept)(amount, date, level, type)
  sales_queue(date, status, level, type)
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 dept
WHERE EXISTS (
    SELECT 1 FROM sales_queue AS prd
    WHERE prd.id = dept.id
);


Prompt:
Schema:
  sales_queue (alias: ord)(value, date, amount, id)
  portfolio_index(value, date, salary, id)
Task: Select code from sales_queue where value is greater than the total of salary in portfolio_index for matching level.
SQL:

SELECT code FROM sales_queue AS ord
WHERE value > (
    SELECT SUM(salary) FROM portfolio_index AS act
    WHERE act.level = ord.level
);


Prompt:
Schema:
  engagement_log (alias: mgr)(code, amount, type, date)
  cost_centers(level, date, status, salary)
Task: Retrieve code from engagement_log that have at least one corresponding entry in cost_centers sharing the same status.
SQL:

SELECT code FROM engagement_log AS mgr
WHERE EXISTS (
    SELECT 1 FROM cost_centers AS whs
    WHERE whs.status = mgr.status
);


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

SELECT salary FROM receivables_log AS inv
WHERE value > (
    SELECT MAX(salary) FROM area_registry AS emp
    WHERE emp.code = inv.code
);


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

SELECT code FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM portfolio_index AS dpt
    WHERE dpt.level = prod.level
);


Prompt:
Schema:
  sales_registry (alias: usr)(code, type, id, value)
  stocking_sites(type, name, code, status)
Task: Find amount from sales_registry where salary exceeds the maximum salary from stocking_sites for the same type.
SQL:

SELECT amount FROM sales_registry AS usr
WHERE salary > (
    SELECT MAX(salary) FROM stocking_sites AS ordr
    WHERE ordr.type = usr.type
);


Prompt:
Schema:
  stock_catalog (alias: prod)(code, amount, salary, level)
  workforce_data(type, salary, status, name)
Task: Select value from stock_catalog where level exists in workforce_data for the same level.
SQL:

SELECT value FROM stock_catalog AS prod
WHERE level IN (
    SELECT level FROM workforce_data AS txn
    WHERE txn.level = prod.level
);


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

SELECT name FROM engagement_log AS mgr
WHERE EXISTS (
    SELECT 1 FROM attribute_groups AS brc
    WHERE brc.type = mgr.type
);


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

SELECT id FROM cost_centers AS dept
WHERE status IN (
    SELECT status FROM sales_queue AS prd
    WHERE prd.level = dept.level
);


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

SELECT id FROM engagement_log AS mgr
WHERE salary > (
    SELECT AVG(salary) FROM sales_registry AS txn
    WHERE txn.id = mgr.id
);


Prompt:
Schema:
  stock_catalog (alias: prod)(salary, status, code, level)
  sales_queue(id, code, level, amount)
Task: Find amount from stock_catalog where salary exceeds the minimum amount from sales_queue for the same code.
SQL:

SELECT amount FROM stock_catalog AS prod
WHERE salary > (
    SELECT MIN(amount) FROM sales_queue AS prj
    WHERE prj.code = prod.code
);


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

SELECT amount FROM sales_registry AS usr
WHERE status IN (
    SELECT status FROM workforce_data AS ord
    WHERE ord.id = usr.id
);


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

SELECT value FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM portfolio_index AS txn
    WHERE txn.type = prod.type
);


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

SELECT salary FROM receivables_log AS inv
WHERE amount > (
    SELECT MAX(value) FROM journal_entries AS tsk
    WHERE tsk.id = inv.id
);


Prompt:
Schema:
  receivables_log (alias: inv)(amount, salary, status, type)
  workforce_data(level, name, date, id)
Task: Find code from receivables_log where amount exceeds the maximum amount from workforce_data for the same level.
SQL:

SELECT code FROM receivables_log AS inv
WHERE amount > (
    SELECT MAX(amount) FROM workforce_data AS act
    WHERE act.level = inv.level
);


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

SELECT id FROM cost_centers AS dept
WHERE EXISTS (
    SELECT 1 FROM personnel_registry AS tsk
    WHERE tsk.type = dept.type
);


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

SELECT value FROM workforce_data AS empl
WHERE code IN (
    SELECT code FROM personnel_registry AS rgn
    WHERE rgn.id = empl.id
);


Prompt:
Schema:
  workforce_data (alias: empl)(id, salary, date, code)
  activity_log(name, code, status, date)
Task: Find id from workforce_data where amount exceeds the average salary from activity_log for the same code.
SQL:

SELECT id FROM workforce_data AS empl
WHERE amount > (
    SELECT AVG(salary) FROM activity_log AS brc
    WHERE brc.code = empl.code
);


Prompt:
Schema:
  receivables_log (alias: inv)(level, amount, status, name)
  acquisition_log(type, id, code, value)
Task: Find amount from receivables_log where id appears in acquisition_log entries with matching code.
SQL:

SELECT amount FROM receivables_log AS inv
WHERE id IN (
    SELECT id FROM acquisition_log AS empl
    WHERE empl.code = inv.code
);


Prompt:
Schema:
  engagement_log (alias: mgr)(date, value, code, status)
  attribute_groups(name, type, code, salary)
Task: Select name from engagement_log that have at least one matching row in attribute_groups for the same id.
SQL:

SELECT name FROM engagement_log AS mgr
WHERE EXISTS (
    SELECT 1 FROM attribute_groups AS brc
    WHERE brc.id = mgr.id
);


Prompt:
Schema:
  engagement_log (alias: mgr)(date, value, code, status)
  activity_log(name, date, status, level)
Task: Select salary from engagement_log that have at least one matching row in activity_log for the same code.
SQL:

SELECT salary FROM engagement_log AS mgr
WHERE EXISTS (
    SELECT 1 FROM activity_log AS cst
    WHERE cst.code = mgr.code
);


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

SELECT salary FROM workforce_data AS empl
WHERE EXISTS (
    SELECT 1 FROM dispatch_queue AS dpt
    WHERE dpt.code = empl.code
);


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

SELECT code FROM sales_registry AS usr
WHERE level IN (
    SELECT level FROM dispatch_queue AS dpt
    WHERE dpt.type = usr.type
);


Prompt:
Schema:
  workforce_data (alias: empl)(amount, name, salary, code)
  facility_registry(date, salary, id, status)
Task: Select id from workforce_data where type exists in facility_registry for the same level.
SQL:

SELECT id FROM workforce_data AS empl
WHERE type IN (
    SELECT type FROM facility_registry AS spl
    WHERE spl.level = empl.level
);


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

SELECT id FROM sales_queue AS ord
WHERE type IN (
    SELECT type FROM engagement_log AS ctg
    WHERE ctg.status = ord.status
);


Prompt:
Schema:
  cost_centers (alias: dept)(code, amount, date, id)
  activity_log(type, code, value, amount)
Task: Retrieve code from cost_centers that have at least one corresponding entry in activity_log sharing the same status.
SQL:

SELECT code FROM cost_centers AS dept
WHERE EXISTS (
    SELECT 1 FROM activity_log AS ord
    WHERE ord.status = dept.status
);


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

SELECT name FROM cost_centers AS dept
WHERE code IN (
    SELECT code FROM facility_registry AS empl
    WHERE empl.level = dept.level
);


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

SELECT value FROM sales_registry AS usr
WHERE EXISTS (
    SELECT 1 FROM attribute_groups AS txn
    WHERE txn.id = usr.id
);


Prompt:
Schema:
  receivables_log (alias: inv)(id, status, amount, date)
  area_registry(amount, code, date, name)
Task: Find name from receivables_log where salary exceeds the maximum amount from area_registry for the same id.
SQL:

SELECT name FROM receivables_log AS inv
WHERE salary > (
    SELECT MAX(amount) FROM area_registry AS rgn
    WHERE rgn.id = inv.id
);


Prompt:
Schema:
  sales_queue (alias: ord)(status, salary, code, id)
  attribute_groups(type, date, level, amount)
Task: Retrieve id from sales_queue with salary above the COUNT(salary) of attribute_groups rows sharing the same status.
SQL:

SELECT id FROM sales_queue AS ord
WHERE salary > (
    SELECT COUNT(salary) FROM attribute_groups AS ordr
    WHERE ordr.status = ord.status
);


Prompt:
Schema:
  receivables_log (alias: inv)(code, status, amount, salary)
  activity_log(date, name, type, status)
Task: Find salary from receivables_log where salary exceeds the count of salary from activity_log for the same level.
SQL:

SELECT salary FROM receivables_log AS inv
WHERE salary > (
    SELECT COUNT(salary) FROM activity_log AS prj
    WHERE prj.level = inv.level
);


Prompt:
Schema:
  sales_queue (alias: ord)(type, name, level, value)
  cost_centers(date, name, level, salary)
Task: Retrieve salary from sales_queue whose type is found in cost_centers rows where level matches the outer record.
SQL:

SELECT salary FROM sales_queue AS ord
WHERE type IN (
    SELECT type FROM cost_centers AS prj
    WHERE prj.level = ord.level
);


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

SELECT name FROM cost_centers AS dept
WHERE type IN (
    SELECT type FROM personnel_registry AS cst
    WHERE cst.level = dept.level
);


Prompt:
Schema:
  sales_registry (alias: usr)(type, date, salary, id)
  attribute_groups(salary, name, id, level)
Task: Retrieve salary from sales_registry whose status is found in attribute_groups rows where code matches the outer record.
SQL:

SELECT salary FROM sales_registry AS usr
WHERE status IN (
    SELECT status FROM attribute_groups AS inv
    WHERE inv.code = usr.code
);


Prompt:
Schema:
  sales_queue (alias: ord)(type, status, value, salary)
  attribute_groups(status, name, level, id)
Task: Find name from sales_queue where a matching record exists in attribute_groups with the same status.
SQL:

SELECT name FROM sales_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM attribute_groups AS shp
    WHERE shp.status = ord.status
);


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

SELECT salary FROM personnel_registry AS emp
WHERE value > (
    SELECT MIN(salary) FROM facility_registry AS rgn
    WHERE rgn.type = emp.type
);


Prompt:
Schema:
  sales_queue (alias: ord)(date, status, value, id)
  workforce_data(status, code, name, value)
Task: Find name from sales_queue where amount exceeds the total amount from workforce_data for the same type.
SQL:

SELECT name FROM sales_queue AS ord
WHERE amount > (
    SELECT SUM(amount) FROM workforce_data AS tsk
    WHERE tsk.type = ord.type
);


Prompt:
Schema:
  personnel_registry (alias: emp)(type, status, code, level)
  attribute_groups(level, status, id, amount)
Task: Find code from personnel_registry where amount exceeds the minimum salary from attribute_groups for the same id.
SQL:

SELECT code FROM personnel_registry AS emp
WHERE amount > (
    SELECT MIN(salary) FROM attribute_groups AS rgn
    WHERE rgn.id = emp.id
);


Prompt:
Schema:
  receivables_log (alias: inv)(salary, type, level, code)
  sales_registry(salary, type, level, status)
Task: Retrieve value from receivables_log with value above the AVG(value) of sales_registry rows sharing the same type.
SQL:

SELECT value FROM receivables_log AS inv
WHERE value > (
    SELECT AVG(value) FROM sales_registry AS rgn
    WHERE rgn.type = inv.type
);


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

SELECT salary FROM sales_queue AS ord
WHERE salary > (
    SELECT SUM(amount) FROM sales_registry AS brc
    WHERE brc.id = ord.id
);


Prompt:
Schema:
  personnel_registry (alias: emp)(amount, salary, type, id)
  journal_entries(status, salary, date, type)
Task: Find code from personnel_registry where value exceeds the count of salary from journal_entries for the same level.
SQL:

SELECT code FROM personnel_registry AS emp
WHERE value > (
    SELECT COUNT(salary) FROM journal_entries AS act
    WHERE act.level = emp.level
);


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

SELECT code FROM sales_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM workforce_data AS empl
    WHERE empl.id = ord.id
);


Prompt:
Schema:
  sales_queue (alias: ord)(type, id, level, date)
  receivables_log(code, type, value, date)
Task: Find code from sales_queue where salary exceeds the total value from receivables_log for the same id.
SQL:

SELECT code FROM sales_queue AS ord
WHERE salary > (
    SELECT SUM(value) FROM receivables_log AS rgn
    WHERE rgn.id = ord.id
);


Prompt:
Schema:
  workforce_data (alias: empl)(status, type, amount, level)
  sourcing_list(id, amount, value, code)
Task: Find value from workforce_data where status appears in sourcing_list entries with matching code.
SQL:

SELECT value FROM workforce_data AS empl
WHERE status IN (
    SELECT status FROM sourcing_list AS ord
    WHERE ord.code = empl.code
);


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

SELECT value FROM receivables_log AS inv
WHERE salary > (
    SELECT AVG(salary) FROM workforce_data AS txn
    WHERE txn.code = inv.code
);


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

SELECT name FROM receivables_log AS inv
WHERE EXISTS (
    SELECT 1 FROM attribute_groups AS ord
    WHERE ord.level = inv.level
);


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

SELECT name FROM sales_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM cost_centers AS tsk
    WHERE tsk.type = ord.type
);


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

SELECT code FROM cost_centers AS dept
WHERE amount > (
    SELECT AVG(value) FROM portfolio_index AS whs
    WHERE whs.type = dept.type
);


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

SELECT amount FROM receivables_log AS inv
WHERE EXISTS (
    SELECT 1 FROM personnel_registry AS shp
    WHERE shp.code = inv.code
);


Prompt:
Schema:
  cost_centers (alias: dept)(amount, type, name, date)
  activity_log(type, code, id, salary)
Task: Select amount from cost_centers where amount is greater than the maximum of amount in activity_log for matching code.
SQL:

SELECT amount FROM cost_centers AS dept
WHERE amount > (
    SELECT MAX(amount) FROM activity_log AS empl
    WHERE empl.code = dept.code
);


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

SELECT amount FROM personnel_registry AS emp
WHERE EXISTS (
    SELECT 1 FROM attribute_groups AS whs
    WHERE whs.level = emp.level
);


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

SELECT amount FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM sourcing_list AS tsk
    WHERE tsk.code = prod.code
);


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

SELECT value FROM receivables_log AS inv
WHERE EXISTS (
    SELECT 1 FROM engagement_log AS prd
    WHERE prd.level = inv.level
);


Prompt:
Schema:
  engagement_log (alias: mgr)(code, level, salary, status)
  acquisition_log(status, name, date, code)
Task: Retrieve id from engagement_log whose status is found in acquisition_log rows where code matches the outer record.
SQL:

SELECT id FROM engagement_log AS mgr
WHERE status IN (
    SELECT status FROM acquisition_log AS ordr
    WHERE ordr.code = mgr.code
);


Prompt:
Schema:
  engagement_log (alias: mgr)(date, name, type, amount)
  journal_entries(salary, date, type, status)
Task: Find amount from engagement_log where value exceeds the maximum salary from journal_entries for the same status.
SQL:

SELECT amount FROM engagement_log AS mgr
WHERE value > (
    SELECT MAX(salary) FROM journal_entries AS rgn
    WHERE rgn.status = mgr.status
);


Prompt:
Schema:
  receivables_log (alias: inv)(code, value, type, name)
  workforce_data(name, status, value, code)
Task: Find id from receivables_log where a matching record exists in workforce_data with the same code.
SQL:

SELECT id FROM receivables_log AS inv
WHERE EXISTS (
    SELECT 1 FROM workforce_data AS act
    WHERE act.code = inv.code
);


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

SELECT amount FROM sales_queue AS ord
WHERE type IN (
    SELECT type FROM dispatch_queue AS emp
    WHERE emp.status = ord.status
);


Prompt:
Schema:
  sales_queue (alias: ord)(salary, id, name, status)
  engagement_log(amount, type, id, salary)
Task: Find value from sales_queue where salary exceeds the total salary from engagement_log for the same type.
SQL:

SELECT value FROM sales_queue AS ord
WHERE salary > (
    SELECT SUM(salary) FROM engagement_log AS txn
    WHERE txn.type = ord.type
);


Prompt:
Schema:
  engagement_log (alias: mgr)(salary, id, name, code)
  sourcing_list(date, name, status, id)
Task: Select amount from engagement_log where status exists in sourcing_list for the same code.
SQL:

SELECT amount FROM engagement_log AS mgr
WHERE status IN (
    SELECT status FROM sourcing_list AS spl
    WHERE spl.code = mgr.code
);


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

SELECT amount FROM receivables_log AS inv
WHERE EXISTS (
    SELECT 1 FROM sales_registry AS ordr
    WHERE ordr.level = inv.level
);


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

SELECT salary FROM receivables_log AS inv
WHERE status IN (
    SELECT status FROM journal_entries AS brc
    WHERE brc.code = inv.code
);


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

SELECT name FROM personnel_registry AS emp
WHERE level IN (
    SELECT level FROM attribute_groups AS tsk
    WHERE tsk.status = emp.status
);


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

SELECT name FROM cost_centers AS dept
WHERE EXISTS (
    SELECT 1 FROM dispatch_queue AS act
    WHERE act.level = dept.level
);


Prompt:
Schema:
  stock_catalog (alias: prod)(level, type, name, salary)
  facility_registry(status, type, name, level)
Task: Find code from stock_catalog where a matching record exists in facility_registry with the same code.
SQL:

SELECT code FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM facility_registry AS act
    WHERE act.code = prod.code
);


Prompt:
Schema:
  stock_catalog (alias: prod)(date, name, amount, id)
  workforce_data(id, code, status, date)
Task: Retrieve amount from stock_catalog that have at least one corresponding entry in workforce_data sharing the same id.
SQL:

SELECT amount FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM workforce_data AS act
    WHERE act.id = prod.id
);


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

SELECT name FROM cost_centers AS dept
WHERE type IN (
    SELECT type FROM engagement_log AS dpt
    WHERE dpt.code = dept.code
);


Prompt:
Schema:
  workforce_data (alias: empl)(name, value, code, status)
  receivables_log(amount, type, name, id)
Task: Select value from workforce_data where type exists in receivables_log for the same id.
SQL:

SELECT value FROM workforce_data AS empl
WHERE type IN (
    SELECT type FROM receivables_log AS inv
    WHERE inv.id = empl.id
);


Prompt:
Schema:
  workforce_data (alias: empl)(amount, name, level, date)
  sales_registry(date, level, type, code)
Task: Find code from workforce_data where a matching record exists in sales_registry with the same status.
SQL:

SELECT code FROM workforce_data AS empl
WHERE EXISTS (
    SELECT 1 FROM sales_registry AS whs
    WHERE whs.status = empl.status
);


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

SELECT id FROM stock_catalog AS prod
WHERE level IN (
    SELECT level FROM sourcing_list AS dpt
    WHERE dpt.level = prod.level
);


Prompt:
Schema:
  stock_catalog (alias: prod)(salary, amount, date, level)
  attribute_groups(id, amount, salary, level)
Task: Select amount from stock_catalog that have at least one matching row in attribute_groups for the same level.
SQL:

SELECT amount FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM attribute_groups AS dpt
    WHERE dpt.level = prod.level
);


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

SELECT salary FROM stock_catalog AS prod
WHERE type IN (
    SELECT type FROM sales_queue AS rgn
    WHERE rgn.type = prod.type
);


Prompt:
Schema:
  personnel_registry (alias: emp)(status, name, value, code)
  attribute_groups(status, salary, date, amount)
Task: Find salary from personnel_registry where value exceeds the minimum salary from attribute_groups for the same status.
SQL:

SELECT salary FROM personnel_registry AS emp
WHERE value > (
    SELECT MIN(salary) FROM attribute_groups AS whs
    WHERE whs.status = emp.status
);


Prompt:
Schema:
  personnel_registry (alias: emp)(type, date, amount, name)
  receivables_log(amount, level, value, name)
Task: Select name from personnel_registry where type exists in receivables_log for the same id.
SQL:

SELECT name FROM personnel_registry AS emp
WHERE type IN (
    SELECT type FROM receivables_log AS whs
    WHERE whs.id = emp.id
);


Prompt:
Schema:
  workforce_data (alias: empl)(type, amount, code, date)
  sales_registry(value, name, status, id)
Task: Retrieve id from workforce_data with value above the SUM(value) of sales_registry rows sharing the same id.
SQL:

SELECT id FROM workforce_data AS empl
WHERE value > (
    SELECT SUM(value) FROM sales_registry AS prd
    WHERE prd.id = empl.id
);


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

SELECT id FROM sales_queue AS ord
WHERE code IN (
    SELECT code FROM stock_catalog AS spl
    WHERE spl.level = ord.level
);


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

SELECT id FROM sales_queue AS ord
WHERE code IN (
    SELECT code FROM dispatch_queue AS brc
    WHERE brc.id = ord.id
);


Prompt:
Schema:
  personnel_registry (alias: emp)(type, value, amount, date)
  stock_catalog(level, code, amount, type)
Task: Select value from personnel_registry where value is greater than the average of amount in stock_catalog for matching type.
SQL:

SELECT value FROM personnel_registry AS emp
WHERE value > (
    SELECT AVG(amount) FROM stock_catalog AS ord
    WHERE ord.type = emp.type
);


Prompt:
Schema:
  sales_queue (alias: ord)(type, status, date, name)
  area_registry(value, date, code, amount)
Task: Retrieve code from sales_queue with amount above the SUM(value) of area_registry rows sharing the same id.
SQL:

SELECT code FROM sales_queue AS ord
WHERE amount > (
    SELECT SUM(value) FROM area_registry AS prj
    WHERE prj.id = ord.id
);


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

SELECT amount FROM cost_centers AS dept
WHERE value > (
    SELECT COUNT(amount) FROM area_registry AS whs
    WHERE whs.code = dept.code
);


Prompt:
Schema:
  sales_registry (alias: usr)(amount, name, id, date)
  receivables_log(status, value, date, type)
Task: Find name from sales_registry where amount exceeds the count of salary from receivables_log for the same level.
SQL:

SELECT name FROM sales_registry AS usr
WHERE amount > (
    SELECT COUNT(salary) FROM receivables_log AS tsk
    WHERE tsk.level = usr.level
);


Prompt:
Schema:
  sales_queue (alias: ord)(salary, code, date, status)
  journal_entries(value, date, salary, id)
Task: Find value from sales_queue where amount exceeds the total salary from journal_entries for the same code.
SQL:

SELECT value FROM sales_queue AS ord
WHERE amount > (
    SELECT SUM(salary) FROM journal_entries AS txn
    WHERE txn.code = ord.code
);


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

SELECT amount FROM engagement_log AS mgr
WHERE status IN (
    SELECT status FROM stock_catalog AS emp
    WHERE emp.id = mgr.id
);


Prompt:
Schema:
  receivables_log (alias: inv)(value, status, name, type)
  sales_queue(status, date, type, amount)
Task: Find amount from receivables_log where salary exceeds the maximum amount from sales_queue for the same type.
SQL:

SELECT amount FROM receivables_log AS inv
WHERE salary > (
    SELECT MAX(amount) FROM sales_queue AS shp
    WHERE shp.type = inv.type
);


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

SELECT name FROM workforce_data AS empl
WHERE status IN (
    SELECT status FROM receivables_log AS dpt
    WHERE dpt.status = empl.status
);


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

SELECT name FROM sales_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM cost_centers AS inv
    WHERE inv.status = ord.status
);


Prompt:
Schema:
  stock_catalog (alias: prod)(date, amount, salary, code)
  area_registry(date, salary, level, name)
Task: Retrieve salary from stock_catalog whose type is found in area_registry rows where id matches the outer record.
SQL:

SELECT salary FROM stock_catalog AS prod
WHERE type IN (
    SELECT type FROM area_registry AS prd
    WHERE prd.id = prod.id
);


Prompt:
Schema:
  personnel_registry (alias: emp)(type, name, id, code)
  dispatch_queue(value, name, level, date)
Task: Find name from personnel_registry where value exceeds the minimum amount from dispatch_queue for the same id.
SQL:

SELECT name FROM personnel_registry AS emp
WHERE value > (
    SELECT MIN(amount) FROM dispatch_queue AS txn
    WHERE txn.id = emp.id
);


Prompt:
Schema:
  workforce_data (alias: empl)(amount, name, code, id)
  portfolio_index(code, salary, status, amount)
Task: Select amount from workforce_data where id exists in portfolio_index for the same type.
SQL:

SELECT amount FROM workforce_data AS empl
WHERE id IN (
    SELECT id FROM portfolio_index AS txn
    WHERE txn.type = empl.type
);


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

SELECT name FROM sales_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM cost_centers AS emp
    WHERE emp.level = ord.level
);


Prompt:
Schema:
  sales_registry (alias: usr)(type, code, name, amount)
  journal_entries(value, salary, status, level)
Task: Find value from sales_registry where value exceeds the count of value from journal_entries for the same level.
SQL:

SELECT value FROM sales_registry AS usr
WHERE value > (
    SELECT COUNT(value) FROM journal_entries AS prd
    WHERE prd.level = usr.level
);


Prompt:
Schema:
  workforce_data (alias: empl)(name, type, status, code)
  receivables_log(level, type, amount, code)
Task: Find name from workforce_data where amount exceeds the average value from receivables_log for the same level.
SQL:

SELECT name FROM workforce_data AS empl
WHERE amount > (
    SELECT AVG(value) FROM receivables_log AS shp
    WHERE shp.level = empl.level
);


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

SELECT amount FROM cost_centers AS dept
WHERE EXISTS (
    SELECT 1 FROM attribute_groups AS ordr
    WHERE ordr.id = dept.id
);


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

SELECT amount FROM engagement_log AS mgr
WHERE EXISTS (
    SELECT 1 FROM personnel_registry AS tsk
    WHERE tsk.type = mgr.type
);


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

SELECT value FROM cost_centers AS dept
WHERE EXISTS (
    SELECT 1 FROM receivables_log AS ordr
    WHERE ordr.code = dept.code
);


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

SELECT name FROM receivables_log AS inv
WHERE level IN (
    SELECT level FROM stock_catalog AS brc
    WHERE brc.status = inv.status
);


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

SELECT value FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM dispatch_queue AS txn
    WHERE txn.code = prod.code
);


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

SELECT code FROM sales_registry AS usr
WHERE level IN (
    SELECT level FROM cost_centers AS shp
    WHERE shp.type = usr.type
);


Prompt:
Schema:
  personnel_registry (alias: emp)(status, date, level, code)
  sales_registry(status, name, value, date)
Task: Retrieve salary from personnel_registry that have at least one corresponding entry in sales_registry sharing the same code.
SQL:

SELECT salary FROM personnel_registry AS emp
WHERE EXISTS (
    SELECT 1 FROM sales_registry AS spl
    WHERE spl.code = emp.code
);


Prompt:
Schema:
  cost_centers (alias: dept)(id, value, status, salary)
  receivables_log(status, salary, amount, value)
Task: Select id from cost_centers that have at least one matching row in receivables_log for the same status.
SQL:

SELECT id FROM cost_centers AS dept
WHERE EXISTS (
    SELECT 1 FROM receivables_log AS cst
    WHERE cst.status = dept.status
);


Prompt:
Schema:
  sales_registry (alias: usr)(code, type, status, level)
  portfolio_index(date, value, status, name)
Task: Select salary from sales_registry that have at least one matching row in portfolio_index for the same level.
SQL:

SELECT salary FROM sales_registry AS usr
WHERE EXISTS (
    SELECT 1 FROM portfolio_index AS ordr
    WHERE ordr.level = usr.level
);


Prompt:
Schema:
  stock_catalog (alias: prod)(type, salary, date, value)
  cost_centers(value, type, code, salary)
Task: Retrieve value from stock_catalog with amount above the COUNT(value) of cost_centers rows sharing the same level.
SQL:

SELECT value FROM stock_catalog AS prod
WHERE amount > (
    SELECT COUNT(value) FROM cost_centers AS tsk
    WHERE tsk.level = prod.level
);


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

SELECT amount FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM area_registry AS prj
    WHERE prj.status = prod.status
);


Prompt:
Schema:
  cost_centers (alias: dept)(type, code, value, name)
  stock_catalog(salary, date, value, type)
Task: Retrieve name from cost_centers with amount above the SUM(salary) of stock_catalog rows sharing the same type.
SQL:

SELECT name FROM cost_centers AS dept
WHERE amount > (
    SELECT SUM(salary) FROM stock_catalog AS ctg
    WHERE ctg.type = dept.type
);


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

SELECT code FROM workforce_data AS empl
WHERE value > (
    SELECT MIN(value) FROM acquisition_log AS inv
    WHERE inv.code = empl.code
);


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

SELECT salary FROM sales_registry AS usr
WHERE id IN (
    SELECT id FROM journal_entries AS tsk
    WHERE tsk.id = usr.id
);


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

SELECT salary FROM engagement_log AS mgr
WHERE EXISTS (
    SELECT 1 FROM stock_catalog AS txn
    WHERE txn.type = mgr.type
);


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

SELECT name FROM sales_queue AS ord
WHERE type IN (
    SELECT type FROM personnel_registry AS txn
    WHERE txn.status = ord.status
);


Prompt:
Schema:
  sales_registry (alias: usr)(amount, code, date, level)
  dispatch_queue(id, value, salary, name)
Task: Retrieve value from sales_registry with amount above the SUM(value) of dispatch_queue rows sharing the same level.
SQL:

SELECT value FROM sales_registry AS usr
WHERE amount > (
    SELECT SUM(value) FROM dispatch_queue AS ordr
    WHERE ordr.level = usr.level
);


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

SELECT amount FROM sales_registry AS usr
WHERE code IN (
    SELECT code FROM sales_queue AS emp
    WHERE emp.type = usr.type
);


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

SELECT amount FROM cost_centers AS dept
WHERE EXISTS (
    SELECT 1 FROM workforce_data AS prd
    WHERE prd.status = dept.status
);


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

SELECT amount FROM engagement_log AS mgr
WHERE EXISTS (
    SELECT 1 FROM workforce_data AS emp
    WHERE emp.code = mgr.code
);


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

SELECT amount FROM engagement_log AS mgr
WHERE salary > (
    SELECT SUM(value) FROM personnel_registry AS rgn
    WHERE rgn.type = mgr.type
);


Prompt:
Schema:
  engagement_log (alias: mgr)(salary, amount, date, code)
  stock_catalog(status, type, salary, code)
Task: Find code from engagement_log where value exceeds the minimum value from stock_catalog for the same type.
SQL:

SELECT code FROM engagement_log AS mgr
WHERE value > (
    SELECT MIN(value) FROM stock_catalog AS cst
    WHERE cst.type = mgr.type
);


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

SELECT code FROM personnel_registry AS emp
WHERE id IN (
    SELECT id FROM stock_catalog AS empl
    WHERE empl.level = emp.level
);


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

SELECT value FROM workforce_data AS empl
WHERE status IN (
    SELECT status FROM activity_log AS spl
    WHERE spl.level = empl.level
);


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

SELECT name FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM sales_queue AS cst
    WHERE cst.code = prod.code
);


Prompt:
Schema:
  workforce_data (alias: empl)(name, id, level, date)
  acquisition_log(name, status, amount, type)
Task: Select value from workforce_data where status exists in acquisition_log for the same type.
SQL:

SELECT value FROM workforce_data AS empl
WHERE status IN (
    SELECT status FROM acquisition_log AS emp
    WHERE emp.type = empl.type
);


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

SELECT salary FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM sourcing_list AS cst
    WHERE cst.code = prod.code
);


Prompt:
Schema:
  cost_centers (alias: dept)(code, value, id, salary)
  activity_log(name, type, code, id)
Task: Select amount from cost_centers where type exists in activity_log for the same code.
SQL:

SELECT amount FROM cost_centers AS dept
WHERE type IN (
    SELECT type FROM activity_log AS ordr
    WHERE ordr.code = dept.code
);


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

SELECT value FROM personnel_registry AS emp
WHERE amount > (
    SELECT MAX(salary) FROM engagement_log AS act
    WHERE act.level = emp.level
);


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

SELECT id FROM cost_centers AS dept
WHERE EXISTS (
    SELECT 1 FROM workforce_data AS dpt
    WHERE dpt.code = dept.code
);


Prompt:
Schema:
  workforce_data (alias: empl)(salary, amount, id, status)
  facility_registry(type, amount, level, salary)
Task: Retrieve value from workforce_data with amount above the MAX(value) of facility_registry rows sharing the same level.
SQL:

SELECT value FROM workforce_data AS empl
WHERE amount > (
    SELECT MAX(value) FROM facility_registry AS prd
    WHERE prd.level = empl.level
);


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

SELECT code FROM cost_centers AS dept
WHERE code IN (
    SELECT code FROM sales_queue AS shp
    WHERE shp.status = dept.status
);


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

SELECT id FROM engagement_log AS mgr
WHERE code IN (
    SELECT code FROM acquisition_log AS prj
    WHERE prj.type = mgr.type
);


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

SELECT value FROM sales_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM stock_catalog AS shp
    WHERE shp.status = ord.status
);


Prompt:
Schema:
  cost_centers (alias: dept)(id, level, type, code)
  personnel_registry(salary, value, date, status)
Task: Find name from cost_centers where value exceeds the minimum amount from personnel_registry for the same type.
SQL:

SELECT name FROM cost_centers AS dept
WHERE value > (
    SELECT MIN(amount) FROM personnel_registry AS spl
    WHERE spl.type = dept.type
);


Prompt:
Schema:
  receivables_log (alias: inv)(date, code, id, value)
  engagement_log(value, salary, date, name)
Task: Select name from receivables_log that have at least one matching row in engagement_log for the same code.
SQL:

SELECT name FROM receivables_log AS inv
WHERE EXISTS (
    SELECT 1 FROM engagement_log AS ctg
    WHERE ctg.code = inv.code
);


Prompt:
Schema:
  workforce_data (alias: empl)(code, salary, status, name)
  sales_queue(code, type, salary, date)
Task: Find code from workforce_data where salary exceeds the minimum amount from sales_queue for the same level.
SQL:

SELECT code FROM workforce_data AS empl
WHERE salary > (
    SELECT MIN(amount) FROM sales_queue AS prj
    WHERE prj.level = empl.level
);


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

SELECT id FROM receivables_log AS inv
WHERE salary > (
    SELECT COUNT(salary) FROM sales_queue AS cst
    WHERE cst.type = inv.type
);


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

SELECT salary FROM engagement_log AS mgr
WHERE EXISTS (
    SELECT 1 FROM stocking_sites AS whs
    WHERE whs.level = mgr.level
);


Prompt:
Schema:
  stock_catalog (alias: prod)(amount, salary, name, date)
  portfolio_index(level, code, salary, date)
Task: Find id from stock_catalog where amount exceeds the minimum salary from portfolio_index for the same code.
SQL:

SELECT id FROM stock_catalog AS prod
WHERE amount > (
    SELECT MIN(salary) FROM portfolio_index AS empl
    WHERE empl.code = prod.code
);


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

SELECT id FROM cost_centers AS dept
WHERE code IN (
    SELECT code FROM journal_entries AS prj
    WHERE prj.level = dept.level
);


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

SELECT value FROM engagement_log AS mgr
WHERE EXISTS (
    SELECT 1 FROM facility_registry AS tsk
    WHERE tsk.type = mgr.type
);


Prompt:
Schema:
  engagement_log (alias: mgr)(level, amount, status, salary)
  receivables_log(date, name, level, status)
Task: Find code from engagement_log where amount exceeds the total amount from receivables_log for the same id.
SQL:

SELECT code FROM engagement_log AS mgr
WHERE amount > (
    SELECT SUM(amount) FROM receivables_log AS tsk
    WHERE tsk.id = mgr.id
);


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

SELECT value FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM acquisition_log AS ctg
    WHERE ctg.type = prod.type
);


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

SELECT code FROM engagement_log AS mgr
WHERE EXISTS (
    SELECT 1 FROM receivables_log AS act
    WHERE act.status = mgr.status
);


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

SELECT code FROM sales_registry AS usr
WHERE EXISTS (
    SELECT 1 FROM sourcing_list AS ctg
    WHERE ctg.level = usr.level
);


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

SELECT code FROM cost_centers AS dept
WHERE status IN (
    SELECT status FROM engagement_log AS prd
    WHERE prd.id = dept.id
);


Prompt:
Schema:
  sales_registry (alias: usr)(value, id, date, type)
  activity_log(amount, code, value, type)
Task: Select code from sales_registry where value is greater than the total of value in activity_log for matching code.
SQL:

SELECT code FROM sales_registry AS usr
WHERE value > (
    SELECT SUM(value) FROM activity_log AS dpt
    WHERE dpt.code = usr.code
);


Prompt:
Schema:
  receivables_log (alias: inv)(salary, name, level, id)
  area_registry(value, type, status, id)
Task: Select id from receivables_log that have at least one matching row in area_registry for the same id.
SQL:

SELECT id FROM receivables_log AS inv
WHERE EXISTS (
    SELECT 1 FROM area_registry AS prd
    WHERE prd.id = inv.id
);


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

SELECT code FROM engagement_log AS mgr
WHERE EXISTS (
    SELECT 1 FROM stock_catalog AS prj
    WHERE prj.level = mgr.level
);


Prompt:
Schema:
  receivables_log (alias: inv)(amount, code, value, level)
  workforce_data(value, date, code, amount)
Task: Retrieve id from receivables_log whose id is found in workforce_data rows where level matches the outer record.
SQL:

SELECT id FROM receivables_log AS inv
WHERE id IN (
    SELECT id FROM workforce_data AS cst
    WHERE cst.level = inv.level
);


Prompt:
Schema:
  sales_queue (alias: ord)(code, value, date, amount)
  facility_registry(level, salary, code, date)
Task: Find code from sales_queue where id appears in facility_registry entries with matching id.
SQL:

SELECT code FROM sales_queue AS ord
WHERE id IN (
    SELECT id FROM facility_registry AS whs
    WHERE whs.id = ord.id
);


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

SELECT code FROM engagement_log AS mgr
WHERE id IN (
    SELECT id FROM activity_log AS ordr
    WHERE ordr.code = mgr.code
);


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

SELECT name FROM sales_queue AS ord
WHERE value > (
    SELECT COUNT(amount) FROM receivables_log AS cst
    WHERE cst.status = ord.status
);


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

SELECT id FROM workforce_data AS empl
WHERE id IN (
    SELECT id FROM personnel_registry AS prj
    WHERE prj.level = empl.level
);


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

SELECT amount FROM sales_queue AS ord
WHERE value > (
    SELECT MIN(amount) FROM activity_log AS prd
    WHERE prd.status = ord.status
);


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

SELECT value FROM stock_catalog AS prod
WHERE id IN (
    SELECT id FROM facility_registry AS tsk
    WHERE tsk.id = prod.id
);


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

SELECT id FROM receivables_log AS inv
WHERE EXISTS (
    SELECT 1 FROM portfolio_index AS empl
    WHERE empl.code = inv.code
);


Prompt:
Schema:
  sales_registry (alias: usr)(type, amount, salary, status)
  acquisition_log(status, id, date, level)
Task: Retrieve value from sales_registry with amount above the COUNT(value) of acquisition_log rows sharing the same level.
SQL:

SELECT value FROM sales_registry AS usr
WHERE amount > (
    SELECT COUNT(value) FROM acquisition_log AS cst
    WHERE cst.level = usr.level
);


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

SELECT amount FROM personnel_registry AS emp
WHERE EXISTS (
    SELECT 1 FROM receivables_log AS ctg
    WHERE ctg.type = emp.type
);


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

SELECT value FROM workforce_data AS empl
WHERE type IN (
    SELECT type FROM area_registry AS dpt
    WHERE dpt.code = empl.code
);


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

SELECT salary FROM sales_registry AS usr
WHERE level IN (
    SELECT level FROM stocking_sites AS cst
    WHERE cst.status = usr.status
);


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

SELECT amount FROM sales_registry AS usr
WHERE EXISTS (
    SELECT 1 FROM cost_centers AS rgn
    WHERE rgn.code = usr.code
);


Prompt:
Schema:
  receivables_log (alias: inv)(code, level, salary, amount)
  attribute_groups(value, type, id, status)
Task: Find code from receivables_log where value exceeds the total salary from attribute_groups for the same level.
SQL:

SELECT code FROM receivables_log AS inv
WHERE value > (
    SELECT SUM(salary) FROM attribute_groups AS dpt
    WHERE dpt.level = inv.level
);


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

SELECT id FROM sales_registry AS usr
WHERE EXISTS (
    SELECT 1 FROM stocking_sites AS shp
    WHERE shp.type = usr.type
);


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

SELECT salary FROM workforce_data AS empl
WHERE type IN (
    SELECT type FROM sales_queue AS rgn
    WHERE rgn.type = empl.type
);


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

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


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

SELECT id FROM receivables_log AS inv
WHERE EXISTS (
    SELECT 1 FROM portfolio_index AS empl
    WHERE empl.status = inv.status
);


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

SELECT value FROM workforce_data AS empl
WHERE EXISTS (
    SELECT 1 FROM engagement_log AS act
    WHERE act.id = empl.id
);


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

SELECT salary FROM personnel_registry AS emp
WHERE EXISTS (
    SELECT 1 FROM dispatch_queue AS cst
    WHERE cst.code = emp.code
);


Prompt:
Schema:
  workforce_data (alias: empl)(level, name, type, code)
  area_registry(amount, id, level, date)
Task: Select code from workforce_data where code exists in area_registry for the same type.
SQL:

SELECT code FROM workforce_data AS empl
WHERE code IN (
    SELECT code FROM area_registry AS prj
    WHERE prj.type = empl.type
);


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

SELECT id FROM sales_registry AS usr
WHERE EXISTS (
    SELECT 1 FROM stock_catalog AS prj
    WHERE prj.code = usr.code
);


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

SELECT id FROM sales_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM activity_log AS tsk
    WHERE tsk.level = ord.level
);


Prompt:
Schema:
  cost_centers (alias: dept)(id, type, amount, code)
  attribute_groups(amount, date, level, code)
Task: Retrieve id from cost_centers that have at least one corresponding entry in attribute_groups sharing the same status.
SQL:

SELECT id FROM cost_centers AS dept
WHERE EXISTS (
    SELECT 1 FROM attribute_groups AS empl
    WHERE empl.status = dept.status
);


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

SELECT code FROM engagement_log AS mgr
WHERE EXISTS (
    SELECT 1 FROM receivables_log AS ord
    WHERE ord.code = mgr.code
);


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

SELECT name FROM sales_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM sourcing_list AS empl
    WHERE empl.level = ord.level
);


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

SELECT amount FROM cost_centers AS dept
WHERE EXISTS (
    SELECT 1 FROM attribute_groups AS act
    WHERE act.status = dept.status
);


Prompt:
Schema:
  workforce_data (alias: empl)(amount, type, name, id)
  sales_queue(level, id, status, amount)
Task: Select salary from workforce_data where salary is greater than the average of salary in sales_queue for matching type.
SQL:

SELECT salary FROM workforce_data AS empl
WHERE salary > (
    SELECT AVG(salary) FROM sales_queue AS inv
    WHERE inv.type = empl.type
);


Prompt:
Schema:
  stock_catalog (alias: prod)(code, type, value, level)
  journal_entries(amount, type, date, salary)
Task: Retrieve value from stock_catalog whose status is found in journal_entries rows where code matches the outer record.
SQL:

SELECT value FROM stock_catalog AS prod
WHERE status IN (
    SELECT status FROM journal_entries AS act
    WHERE act.code = prod.code
);


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

SELECT amount FROM cost_centers AS dept
WHERE EXISTS (
    SELECT 1 FROM journal_entries AS ord
    WHERE ord.code = dept.code
);


Prompt:
Schema:
  engagement_log (alias: mgr)(amount, code, date, salary)
  facility_registry(salary, level, value, type)
Task: Find name from engagement_log where amount exceeds the minimum value from facility_registry for the same id.
SQL:

SELECT name FROM engagement_log AS mgr
WHERE amount > (
    SELECT MIN(value) FROM facility_registry AS ctg
    WHERE ctg.id = mgr.id
);


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

SELECT name FROM sales_registry AS usr
WHERE type IN (
    SELECT type FROM engagement_log AS spl
    WHERE spl.level = usr.level
);


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

SELECT name FROM workforce_data AS empl
WHERE status IN (
    SELECT status FROM sourcing_list AS ord
    WHERE ord.status = empl.status
);


Prompt:
Schema:
  stock_catalog (alias: prod)(date, salary, level, amount)
  area_registry(id, status, salary, code)
Task: Find salary from stock_catalog where salary exceeds the minimum value from area_registry for the same type.
SQL:

SELECT salary FROM stock_catalog AS prod
WHERE salary > (
    SELECT MIN(value) FROM area_registry AS spl
    WHERE spl.type = prod.type
);


Prompt:
Schema:
  personnel_registry (alias: emp)(date, salary, id, name)
  attribute_groups(date, id, amount, type)
Task: Find salary from personnel_registry where salary exceeds the total salary from attribute_groups for the same status.
SQL:

SELECT salary FROM personnel_registry AS emp
WHERE salary > (
    SELECT SUM(salary) FROM attribute_groups AS brc
    WHERE brc.status = emp.status
);


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

SELECT amount FROM cost_centers AS dept
WHERE EXISTS (
    SELECT 1 FROM area_registry AS whs
    WHERE whs.code = dept.code
);


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

SELECT name FROM receivables_log AS inv
WHERE EXISTS (
    SELECT 1 FROM attribute_groups AS emp
    WHERE emp.id = inv.id
);


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

SELECT name FROM workforce_data AS empl
WHERE EXISTS (
    SELECT 1 FROM engagement_log AS emp
    WHERE emp.id = empl.id
);


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

SELECT id FROM engagement_log AS mgr
WHERE EXISTS (
    SELECT 1 FROM stocking_sites AS cst
    WHERE cst.type = mgr.type
);


Prompt:
Schema:
  workforce_data (alias: empl)(value, status, name, amount)
  sales_registry(date, salary, code, status)
Task: Retrieve code from workforce_data that have at least one corresponding entry in sales_registry sharing the same status.
SQL:

SELECT code FROM workforce_data AS empl
WHERE EXISTS (
    SELECT 1 FROM sales_registry AS prd
    WHERE prd.status = empl.status
);


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

SELECT name FROM engagement_log AS mgr
WHERE amount > (
    SELECT MAX(amount) FROM portfolio_index AS act
    WHERE act.code = mgr.code
);


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

SELECT code FROM sales_queue AS ord
WHERE salary > (
    SELECT AVG(value) FROM cost_centers AS txn
    WHERE txn.id = ord.id
);


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

SELECT amount FROM workforce_data AS empl
WHERE EXISTS (
    SELECT 1 FROM acquisition_log AS inv
    WHERE inv.id = empl.id
);


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

SELECT value FROM sales_registry AS usr
WHERE type IN (
    SELECT type FROM engagement_log AS rgn
    WHERE rgn.id = usr.id
);


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

SELECT amount FROM receivables_log AS inv
WHERE EXISTS (
    SELECT 1 FROM workforce_data AS txn
    WHERE txn.type = inv.type
);


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

SELECT code FROM receivables_log AS inv
WHERE type IN (
    SELECT type FROM sourcing_list AS whs
    WHERE whs.code = inv.code
);


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

SELECT id FROM receivables_log AS inv
WHERE value > (
    SELECT COUNT(value) FROM portfolio_index AS spl
    WHERE spl.type = inv.type
);


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

SELECT name FROM personnel_registry AS emp
WHERE amount > (
    SELECT SUM(value) FROM sourcing_list AS ord
    WHERE ord.id = emp.id
);


Prompt:
Schema:
  cost_centers (alias: dept)(amount, code, id, salary)
  activity_log(id, salary, code, name)
Task: Find value from cost_centers where value exceeds the average amount from activity_log for the same status.
SQL:

SELECT value FROM cost_centers AS dept
WHERE value > (
    SELECT AVG(amount) FROM activity_log AS emp
    WHERE emp.status = dept.status
);


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

SELECT value FROM receivables_log AS inv
WHERE EXISTS (
    SELECT 1 FROM personnel_registry AS whs
    WHERE whs.code = inv.code
);


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

SELECT salary FROM sales_registry AS usr
WHERE type IN (
    SELECT type FROM workforce_data AS spl
    WHERE spl.status = usr.status
);


Prompt:
Schema:
  receivables_log (alias: inv)(salary, name, amount, date)
  dispatch_queue(amount, salary, code, type)
Task: Find id from receivables_log where code appears in dispatch_queue entries with matching type.
SQL:

SELECT id FROM receivables_log AS inv
WHERE code IN (
    SELECT code FROM dispatch_queue AS txn
    WHERE txn.type = inv.type
);


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

SELECT id FROM engagement_log AS mgr
WHERE EXISTS (
    SELECT 1 FROM activity_log AS shp
    WHERE shp.status = mgr.status
);


Prompt:
Schema:
  cost_centers (alias: dept)(salary, value, date, type)
  sourcing_list(name, type, code, salary)
Task: Retrieve id from cost_centers whose id is found in sourcing_list rows where id matches the outer record.
SQL:

SELECT id FROM cost_centers AS dept
WHERE id IN (
    SELECT id FROM sourcing_list AS whs
    WHERE whs.id = dept.id
);


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

SELECT value FROM sales_registry AS usr
WHERE EXISTS (
    SELECT 1 FROM dispatch_queue AS whs
    WHERE whs.status = usr.status
);


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

SELECT salary FROM workforce_data AS empl
WHERE level IN (
    SELECT level FROM stocking_sites AS spl
    WHERE spl.status = empl.status
);


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

SELECT id FROM cost_centers AS dept
WHERE EXISTS (
    SELECT 1 FROM acquisition_log AS spl
    WHERE spl.type = dept.type
);


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

SELECT amount FROM cost_centers AS dept
WHERE id IN (
    SELECT id FROM receivables_log AS shp
    WHERE shp.code = dept.code
);


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

SELECT amount FROM sales_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM facility_registry AS whs
    WHERE whs.type = ord.type
);


Prompt:
Schema:
  sales_registry (alias: usr)(name, date, type, level)
  personnel_registry(amount, code, type, level)
Task: Retrieve amount from sales_registry with value above the MAX(amount) of personnel_registry rows sharing the same type.
SQL:

SELECT amount FROM sales_registry AS usr
WHERE value > (
    SELECT MAX(amount) FROM personnel_registry AS whs
    WHERE whs.type = usr.type
);


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

SELECT salary FROM sales_registry AS usr
WHERE EXISTS (
    SELECT 1 FROM portfolio_index AS cst
    WHERE cst.status = usr.status
);


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

SELECT code FROM engagement_log AS mgr
WHERE id IN (
    SELECT id FROM activity_log AS prj
    WHERE prj.type = mgr.type
);


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

SELECT code FROM workforce_data AS empl
WHERE salary > (
    SELECT AVG(value) FROM engagement_log AS ctg
    WHERE ctg.code = empl.code
);


Prompt:
Schema:
  receivables_log (alias: inv)(value, status, code, date)
  sales_registry(amount, value, level, name)
Task: Select salary from receivables_log that have at least one matching row in sales_registry for the same type.
SQL:

SELECT salary FROM receivables_log AS inv
WHERE EXISTS (
    SELECT 1 FROM sales_registry AS whs
    WHERE whs.type = inv.type
);


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

SELECT id FROM sales_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM activity_log AS ordr
    WHERE ordr.level = ord.level
);


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

SELECT name FROM workforce_data AS empl
WHERE level IN (
    SELECT level FROM personnel_registry AS prj
    WHERE prj.code = empl.code
);


Prompt:
Schema:
  workforce_data (alias: empl)(id, date, name, status)
  acquisition_log(date, value, salary, code)
Task: Select name from workforce_data where amount is greater than the total of value in acquisition_log for matching id.
SQL:

SELECT name FROM workforce_data AS empl
WHERE amount > (
    SELECT SUM(value) FROM acquisition_log AS ordr
    WHERE ordr.id = empl.id
);


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

SELECT salary FROM sales_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM receivables_log AS act
    WHERE act.type = ord.type
);


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

SELECT code FROM sales_registry AS usr
WHERE code IN (
    SELECT code FROM acquisition_log AS prd
    WHERE prd.level = usr.level
);


Prompt:
Schema:
  sales_registry (alias: usr)(id, amount, type, date)
  workforce_data(status, id, value, name)
Task: Select salary from sales_registry where type exists in workforce_data for the same code.
SQL:

SELECT salary FROM sales_registry AS usr
WHERE type IN (
    SELECT type FROM workforce_data AS cst
    WHERE cst.code = usr.code
);


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

SELECT amount FROM receivables_log AS inv
WHERE status IN (
    SELECT status FROM journal_entries AS prd
    WHERE prd.type = inv.type
);


Prompt:
Schema:
  cost_centers (alias: dept)(amount, name, value, status)
  journal_entries(amount, salary, id, value)
Task: Retrieve name from cost_centers with amount above the MIN(amount) of journal_entries rows sharing the same type.
SQL:

SELECT name FROM cost_centers AS dept
WHERE amount > (
    SELECT MIN(amount) FROM journal_entries AS prd
    WHERE prd.type = dept.type
);


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

SELECT value FROM workforce_data AS empl
WHERE EXISTS (
    SELECT 1 FROM receivables_log AS ord
    WHERE ord.code = empl.code
);


Prompt:
Schema:
  personnel_registry (alias: emp)(name, amount, salary, value)
  stock_catalog(id, code, name, amount)
Task: Select code from personnel_registry where amount is greater than the minimum of value in stock_catalog for matching id.
SQL:

SELECT code FROM personnel_registry AS emp
WHERE amount > (
    SELECT MIN(value) FROM stock_catalog AS spl
    WHERE spl.id = emp.id
);


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

SELECT salary FROM receivables_log AS inv
WHERE code IN (
    SELECT code FROM sourcing_list AS rgn
    WHERE rgn.type = inv.type
);


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

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


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

SELECT code FROM personnel_registry AS emp
WHERE id IN (
    SELECT id FROM acquisition_log AS ord
    WHERE ord.level = emp.level
);


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

SELECT salary FROM sales_registry AS usr
WHERE value > (
    SELECT MAX(amount) FROM facility_registry AS txn
    WHERE txn.level = usr.level
);


Prompt:
Schema:
  sales_queue (alias: ord)(salary, date, level, status)
  receivables_log(name, type, level, value)
Task: Find name from sales_queue where code appears in receivables_log entries with matching code.
SQL:

SELECT name FROM sales_queue AS ord
WHERE code IN (
    SELECT code FROM receivables_log AS ordr
    WHERE ordr.code = ord.code
);


Prompt:
Schema:
  sales_registry (alias: usr)(type, status, level, salary)
  attribute_groups(name, date, type, level)
Task: Select name from sales_registry that have at least one matching row in attribute_groups for the same level.
SQL:

SELECT name FROM sales_registry AS usr
WHERE EXISTS (
    SELECT 1 FROM attribute_groups AS shp
    WHERE shp.level = usr.level
);