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

SELECT salary FROM workforce_data AS empl
WHERE type IN (
    SELECT type FROM facility_registry AS ord
    WHERE ord.id = empl.id
);


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

SELECT code FROM cost_centers AS dept
WHERE id IN (
    SELECT id FROM area_registry AS txn
    WHERE txn.status = dept.status
);


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

SELECT salary FROM sales_registry AS usr
WHERE EXISTS (
    SELECT 1 FROM dispatch_queue AS empl
    WHERE empl.status = usr.status
);


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

SELECT amount FROM engagement_log AS mgr
WHERE value > (
    SELECT MAX(salary) FROM sales_registry AS inv
    WHERE inv.type = mgr.type
);


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

SELECT salary FROM engagement_log AS mgr
WHERE salary > (
    SELECT SUM(value) FROM stock_catalog AS ord
    WHERE ord.level = mgr.level
);


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

SELECT code FROM sales_queue AS ord
WHERE salary > (
    SELECT AVG(amount) FROM sales_registry AS whs
    WHERE whs.code = ord.code
);


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

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


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

SELECT salary FROM sales_queue AS ord
WHERE level IN (
    SELECT level FROM cost_centers AS rgn
    WHERE rgn.code = ord.code
);


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

SELECT id FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM receivables_log AS tsk
    WHERE tsk.code = prod.code
);


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

SELECT value FROM engagement_log AS mgr
WHERE id IN (
    SELECT id FROM cost_centers AS rgn
    WHERE rgn.status = mgr.status
);


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

SELECT value FROM sales_registry AS usr
WHERE status IN (
    SELECT status FROM receivables_log AS inv
    WHERE inv.level = usr.level
);


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

SELECT id FROM cost_centers AS dept
WHERE amount > (
    SELECT SUM(amount) FROM attribute_groups AS shp
    WHERE shp.code = dept.code
);


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

SELECT value FROM stock_catalog AS prod
WHERE level IN (
    SELECT level FROM portfolio_index AS empl
    WHERE empl.code = prod.code
);


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

SELECT salary FROM cost_centers AS dept
WHERE EXISTS (
    SELECT 1 FROM area_registry AS dpt
    WHERE dpt.code = dept.code
);


Prompt:
Schema:
  engagement_log (alias: mgr)(salary, id, amount, name)
  sales_registry(status, value, type, level)
Task: Find name from engagement_log where value exceeds the average salary from sales_registry for the same type.
SQL:

SELECT name FROM engagement_log AS mgr
WHERE value > (
    SELECT AVG(salary) FROM sales_registry AS ordr
    WHERE ordr.type = mgr.type
);


Prompt:
Schema:
  workforce_data (alias: empl)(name, type, date, amount)
  dispatch_queue(type, level, value, code)
Task: Select value from workforce_data where amount is greater than the count of of amount in dispatch_queue for matching type.
SQL:

SELECT value FROM workforce_data AS empl
WHERE amount > (
    SELECT COUNT(amount) FROM dispatch_queue AS inv
    WHERE inv.type = empl.type
);


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

SELECT salary FROM engagement_log AS mgr
WHERE level IN (
    SELECT level FROM personnel_registry AS ctg
    WHERE ctg.type = mgr.type
);


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

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


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

SELECT name FROM cost_centers AS dept
WHERE value > (
    SELECT SUM(amount) FROM receivables_log AS dpt
    WHERE dpt.id = dept.id
);


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

SELECT name FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM area_registry AS prj
    WHERE prj.type = prod.type
);


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

SELECT code FROM cost_centers AS dept
WHERE amount > (
    SELECT AVG(salary) FROM area_registry AS ord
    WHERE ord.status = dept.status
);


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

SELECT value FROM sales_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM journal_entries AS ordr
    WHERE ordr.status = ord.status
);


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

SELECT value FROM sales_queue AS ord
WHERE salary > (
    SELECT COUNT(amount) FROM portfolio_index AS emp
    WHERE emp.id = ord.id
);


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

SELECT amount FROM personnel_registry AS emp
WHERE EXISTS (
    SELECT 1 FROM activity_log AS ordr
    WHERE ordr.id = emp.id
);


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

SELECT code FROM workforce_data AS empl
WHERE value > (
    SELECT COUNT(amount) FROM receivables_log AS ordr
    WHERE ordr.code = empl.code
);


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

SELECT salary FROM personnel_registry AS emp
WHERE amount > (
    SELECT AVG(salary) FROM sales_registry AS empl
    WHERE empl.type = emp.type
);


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

SELECT id FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM sourcing_list AS brc
    WHERE brc.id = prod.id
);


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

SELECT code FROM sales_registry AS usr
WHERE code IN (
    SELECT code FROM activity_log AS inv
    WHERE inv.level = usr.level
);


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

SELECT value FROM engagement_log AS mgr
WHERE id IN (
    SELECT id FROM stock_catalog AS ord
    WHERE ord.status = mgr.status
);


Prompt:
Schema:
  stock_catalog (alias: prod)(type, name, id, status)
  dispatch_queue(status, value, id, salary)
Task: Select code from stock_catalog where amount is greater than the total of value in dispatch_queue for matching type.
SQL:

SELECT code FROM stock_catalog AS prod
WHERE amount > (
    SELECT SUM(value) FROM dispatch_queue AS rgn
    WHERE rgn.type = prod.type
);


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

SELECT id FROM engagement_log AS mgr
WHERE salary > (
    SELECT AVG(salary) FROM area_registry AS ctg
    WHERE ctg.code = mgr.code
);


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

SELECT code FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM sourcing_list AS shp
    WHERE shp.level = prod.level
);


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

SELECT name FROM personnel_registry AS emp
WHERE value > (
    SELECT MAX(salary) FROM acquisition_log AS ord
    WHERE ord.type = emp.type
);


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

SELECT salary FROM cost_centers AS dept
WHERE EXISTS (
    SELECT 1 FROM acquisition_log AS ordr
    WHERE ordr.type = dept.type
);


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

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


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

SELECT id FROM receivables_log AS inv
WHERE status IN (
    SELECT status FROM sales_registry AS emp
    WHERE emp.code = inv.code
);


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

SELECT value FROM sales_registry AS usr
WHERE EXISTS (
    SELECT 1 FROM stocking_sites AS act
    WHERE act.id = usr.id
);


Prompt:
Schema:
  workforce_data (alias: empl)(code, id, salary, status)
  journal_entries(status, code, name, date)
Task: Select name from workforce_data that have at least one matching row in journal_entries for the same id.
SQL:

SELECT name FROM workforce_data AS empl
WHERE EXISTS (
    SELECT 1 FROM journal_entries AS txn
    WHERE txn.id = empl.id
);


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

SELECT id FROM personnel_registry AS emp
WHERE salary > (
    SELECT COUNT(value) FROM sourcing_list AS ctg
    WHERE ctg.type = emp.type
);


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

SELECT code FROM receivables_log AS inv
WHERE id IN (
    SELECT id FROM area_registry AS rgn
    WHERE rgn.code = inv.code
);


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

SELECT code FROM personnel_registry AS emp
WHERE id IN (
    SELECT id FROM facility_registry AS ctg
    WHERE ctg.code = emp.code
);


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

SELECT amount FROM receivables_log AS inv
WHERE EXISTS (
    SELECT 1 FROM facility_registry AS ord
    WHERE ord.id = inv.id
);


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

SELECT name FROM workforce_data AS empl
WHERE amount > (
    SELECT AVG(salary) FROM stock_catalog AS cst
    WHERE cst.type = empl.type
);


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

SELECT value FROM sales_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM acquisition_log AS ordr
    WHERE ordr.type = ord.type
);


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

SELECT code FROM personnel_registry AS emp
WHERE EXISTS (
    SELECT 1 FROM receivables_log AS brc
    WHERE brc.status = emp.status
);


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

SELECT value FROM personnel_registry AS emp
WHERE code IN (
    SELECT code FROM sales_registry AS cst
    WHERE cst.code = emp.code
);


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

SELECT id FROM cost_centers AS dept
WHERE EXISTS (
    SELECT 1 FROM portfolio_index AS shp
    WHERE shp.status = dept.status
);


Prompt:
Schema:
  sales_queue (alias: ord)(name, code, value, level)
  portfolio_index(name, level, amount, salary)
Task: Retrieve amount from sales_queue with salary above the SUM(value) of portfolio_index rows sharing the same type.
SQL:

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


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

SELECT code FROM workforce_data AS empl
WHERE EXISTS (
    SELECT 1 FROM stocking_sites AS spl
    WHERE spl.status = empl.status
);


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

SELECT name FROM workforce_data AS empl
WHERE EXISTS (
    SELECT 1 FROM dispatch_queue AS prj
    WHERE prj.status = empl.status
);


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

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


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

SELECT amount FROM cost_centers AS dept
WHERE id IN (
    SELECT id FROM acquisition_log AS tsk
    WHERE tsk.id = dept.id
);


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

SELECT amount FROM receivables_log AS inv
WHERE value > (
    SELECT MAX(value) FROM sales_queue AS ordr
    WHERE ordr.level = inv.level
);


Prompt:
Schema:
  stock_catalog (alias: prod)(id, salary, amount, level)
  facility_registry(level, name, code, date)
Task: Select name from stock_catalog where amount is greater than the average of salary in facility_registry for matching status.
SQL:

SELECT name FROM stock_catalog AS prod
WHERE amount > (
    SELECT AVG(salary) FROM facility_registry AS act
    WHERE act.status = prod.status
);


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

SELECT value FROM cost_centers AS dept
WHERE id IN (
    SELECT id FROM acquisition_log AS act
    WHERE act.status = dept.status
);


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

SELECT salary FROM engagement_log AS mgr
WHERE amount > (
    SELECT COUNT(salary) FROM personnel_registry AS whs
    WHERE whs.code = mgr.code
);


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

SELECT code FROM engagement_log AS mgr
WHERE salary > (
    SELECT AVG(salary) FROM personnel_registry AS spl
    WHERE spl.code = mgr.code
);


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

SELECT value FROM personnel_registry AS emp
WHERE level IN (
    SELECT level FROM area_registry AS prd
    WHERE prd.status = emp.status
);


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

SELECT id FROM personnel_registry AS emp
WHERE amount > (
    SELECT AVG(salary) FROM attribute_groups AS txn
    WHERE txn.level = emp.level
);


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

SELECT salary FROM workforce_data AS empl
WHERE amount > (
    SELECT AVG(amount) FROM portfolio_index AS dpt
    WHERE dpt.status = empl.status
);


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

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


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

SELECT id FROM engagement_log AS mgr
WHERE EXISTS (
    SELECT 1 FROM facility_registry AS dpt
    WHERE dpt.type = mgr.type
);


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

SELECT name FROM engagement_log AS mgr
WHERE id IN (
    SELECT id FROM sales_queue AS brc
    WHERE brc.id = mgr.id
);


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

SELECT id FROM sales_queue AS ord
WHERE status IN (
    SELECT status FROM workforce_data AS inv
    WHERE inv.status = ord.status
);


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

SELECT name FROM sales_registry AS usr
WHERE type IN (
    SELECT type FROM receivables_log AS ordr
    WHERE ordr.level = usr.level
);


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

SELECT code FROM workforce_data AS empl
WHERE code IN (
    SELECT code FROM sourcing_list AS act
    WHERE act.id = empl.id
);


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

SELECT salary FROM engagement_log AS mgr
WHERE EXISTS (
    SELECT 1 FROM sales_queue AS txn
    WHERE txn.level = mgr.level
);


Prompt:
Schema:
  sales_registry (alias: usr)(name, date, id, level)
  engagement_log(level, id, type, amount)
Task: Find id from sales_registry where amount exceeds the total salary from engagement_log for the same type.
SQL:

SELECT id FROM sales_registry AS usr
WHERE amount > (
    SELECT SUM(salary) FROM engagement_log AS brc
    WHERE brc.type = usr.type
);


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

SELECT name FROM receivables_log AS inv
WHERE EXISTS (
    SELECT 1 FROM acquisition_log AS spl
    WHERE spl.id = inv.id
);


Prompt:
Schema:
  receivables_log (alias: inv)(date, status, salary, value)
  sourcing_list(level, name, value, id)
Task: Retrieve salary from receivables_log with salary above the SUM(value) of sourcing_list rows sharing the same level.
SQL:

SELECT salary FROM receivables_log AS inv
WHERE salary > (
    SELECT SUM(value) FROM sourcing_list AS spl
    WHERE spl.level = inv.level
);


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

SELECT code FROM personnel_registry AS emp
WHERE value > (
    SELECT AVG(amount) FROM receivables_log AS dpt
    WHERE dpt.code = emp.code
);


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

SELECT amount FROM personnel_registry AS emp
WHERE EXISTS (
    SELECT 1 FROM journal_entries AS brc
    WHERE brc.level = emp.level
);


Prompt:
Schema:
  stock_catalog (alias: prod)(date, code, id, name)
  facility_registry(level, id, type, amount)
Task: Select amount from stock_catalog where salary is greater than the total of salary in facility_registry for matching level.
SQL:

SELECT amount FROM stock_catalog AS prod
WHERE salary > (
    SELECT SUM(salary) FROM facility_registry AS spl
    WHERE spl.level = prod.level
);


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

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


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

SELECT salary FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM sourcing_list AS brc
    WHERE brc.type = prod.type
);


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

SELECT amount FROM receivables_log AS inv
WHERE amount > (
    SELECT MIN(salary) FROM sales_queue AS ctg
    WHERE ctg.level = inv.level
);


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

SELECT value FROM receivables_log AS inv
WHERE code IN (
    SELECT code FROM stock_catalog AS cst
    WHERE cst.id = inv.id
);


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

SELECT name FROM receivables_log AS inv
WHERE id IN (
    SELECT id FROM sales_registry AS emp
    WHERE emp.status = inv.status
);


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

SELECT amount FROM stock_catalog AS prod
WHERE level IN (
    SELECT level FROM cost_centers AS ordr
    WHERE ordr.status = prod.status
);


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

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


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

SELECT salary FROM sales_queue AS ord
WHERE salary > (
    SELECT MAX(value) FROM acquisition_log AS inv
    WHERE inv.level = ord.level
);


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

SELECT value FROM sales_queue AS ord
WHERE code IN (
    SELECT code FROM cost_centers AS prd
    WHERE prd.status = ord.status
);


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

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


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

SELECT amount FROM personnel_registry AS emp
WHERE EXISTS (
    SELECT 1 FROM facility_registry AS rgn
    WHERE rgn.status = emp.status
);


Prompt:
Schema:
  cost_centers (alias: dept)(name, code, salary, date)
  portfolio_index(salary, code, date, name)
Task: Find id from cost_centers where a matching record exists in portfolio_index with the same id.
SQL:

SELECT id FROM cost_centers AS dept
WHERE EXISTS (
    SELECT 1 FROM portfolio_index AS ctg
    WHERE ctg.id = dept.id
);


Prompt:
Schema:
  engagement_log (alias: mgr)(name, code, salary, type)
  workforce_data(id, value, code, type)
Task: Retrieve salary from engagement_log with value above the COUNT(amount) of workforce_data rows sharing the same type.
SQL:

SELECT salary FROM engagement_log AS mgr
WHERE value > (
    SELECT COUNT(amount) FROM workforce_data AS ordr
    WHERE ordr.type = mgr.type
);


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

SELECT amount FROM personnel_registry AS emp
WHERE EXISTS (
    SELECT 1 FROM attribute_groups AS tsk
    WHERE tsk.code = emp.code
);


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

SELECT salary FROM workforce_data AS empl
WHERE EXISTS (
    SELECT 1 FROM receivables_log AS rgn
    WHERE rgn.type = empl.type
);


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

SELECT amount FROM sales_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM engagement_log AS emp
    WHERE emp.code = ord.code
);


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

SELECT id FROM personnel_registry AS emp
WHERE amount > (
    SELECT SUM(value) FROM stock_catalog AS inv
    WHERE inv.level = emp.level
);


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

SELECT code FROM workforce_data AS empl
WHERE salary > (
    SELECT SUM(value) FROM stock_catalog AS txn
    WHERE txn.code = empl.code
);


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

SELECT amount FROM engagement_log AS mgr
WHERE EXISTS (
    SELECT 1 FROM receivables_log AS prd
    WHERE prd.id = mgr.id
);


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

SELECT value FROM sales_queue AS ord
WHERE code IN (
    SELECT code FROM activity_log AS spl
    WHERE spl.code = ord.code
);


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

SELECT salary FROM sales_registry AS usr
WHERE salary > (
    SELECT MIN(amount) FROM activity_log AS act
    WHERE act.type = usr.type
);


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

SELECT id FROM stock_catalog AS prod
WHERE amount > (
    SELECT AVG(salary) FROM stocking_sites AS cst
    WHERE cst.code = prod.code
);


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

SELECT amount FROM sales_queue AS ord
WHERE value > (
    SELECT AVG(salary) FROM personnel_registry AS rgn
    WHERE rgn.type = ord.type
);


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

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


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

SELECT salary FROM sales_registry AS usr
WHERE EXISTS (
    SELECT 1 FROM dispatch_queue AS spl
    WHERE spl.type = usr.type
);


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

SELECT id FROM engagement_log AS mgr
WHERE EXISTS (
    SELECT 1 FROM receivables_log AS ordr
    WHERE ordr.level = mgr.level
);


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

SELECT value FROM receivables_log AS inv
WHERE code IN (
    SELECT code FROM sales_registry AS ctg
    WHERE ctg.level = inv.level
);


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

SELECT code FROM stock_catalog AS prod
WHERE status IN (
    SELECT status FROM portfolio_index AS inv
    WHERE inv.type = prod.type
);


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

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


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

SELECT amount FROM sales_queue AS ord
WHERE status IN (
    SELECT status FROM engagement_log AS dpt
    WHERE dpt.level = ord.level
);


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

SELECT code FROM sales_registry AS usr
WHERE salary > (
    SELECT MAX(value) FROM activity_log AS ctg
    WHERE ctg.status = usr.status
);


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

SELECT salary FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM cost_centers AS dpt
    WHERE dpt.id = prod.id
);


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

SELECT amount FROM sales_queue AS ord
WHERE salary > (
    SELECT AVG(salary) FROM workforce_data AS ctg
    WHERE ctg.id = ord.id
);


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

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


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

SELECT id FROM personnel_registry AS emp
WHERE EXISTS (
    SELECT 1 FROM stocking_sites AS txn
    WHERE txn.status = emp.status
);


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

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


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

SELECT salary FROM sales_queue AS ord
WHERE salary > (
    SELECT AVG(value) FROM portfolio_index AS prj
    WHERE prj.id = ord.id
);


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

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


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

SELECT id FROM stock_catalog AS prod
WHERE value > (
    SELECT MIN(salary) FROM dispatch_queue AS tsk
    WHERE tsk.status = prod.status
);


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

SELECT salary FROM cost_centers AS dept
WHERE id IN (
    SELECT id FROM journal_entries AS ordr
    WHERE ordr.level = dept.level
);


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

SELECT id FROM receivables_log AS inv
WHERE type IN (
    SELECT type FROM workforce_data AS brc
    WHERE brc.code = inv.code
);


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

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


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

SELECT id FROM workforce_data AS empl
WHERE EXISTS (
    SELECT 1 FROM journal_entries AS prj
    WHERE prj.level = empl.level
);


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

SELECT id FROM stock_catalog AS prod
WHERE type IN (
    SELECT type FROM acquisition_log AS prd
    WHERE prd.code = prod.code
);


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

SELECT code FROM sales_queue AS ord
WHERE salary > (
    SELECT SUM(amount) FROM dispatch_queue AS empl
    WHERE empl.id = ord.id
);


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

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


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

SELECT name FROM workforce_data AS empl
WHERE code IN (
    SELECT code FROM portfolio_index AS spl
    WHERE spl.type = empl.type
);


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

SELECT salary FROM receivables_log AS inv
WHERE EXISTS (
    SELECT 1 FROM stock_catalog AS rgn
    WHERE rgn.level = inv.level
);


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

SELECT code FROM personnel_registry AS emp
WHERE EXISTS (
    SELECT 1 FROM sales_queue AS txn
    WHERE txn.code = emp.code
);


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

SELECT value FROM engagement_log AS mgr
WHERE EXISTS (
    SELECT 1 FROM sales_registry AS prd
    WHERE prd.level = mgr.level
);


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

SELECT amount FROM workforce_data AS empl
WHERE type IN (
    SELECT type FROM stock_catalog AS whs
    WHERE whs.type = empl.type
);


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

SELECT id FROM sales_queue AS ord
WHERE salary > (
    SELECT AVG(value) FROM portfolio_index AS cst
    WHERE cst.type = ord.type
);


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

SELECT code FROM stock_catalog AS prod
WHERE code IN (
    SELECT code FROM dispatch_queue AS ord
    WHERE ord.status = prod.status
);


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

SELECT amount FROM sales_registry AS usr
WHERE salary > (
    SELECT AVG(value) FROM workforce_data AS shp
    WHERE shp.status = usr.status
);


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

SELECT salary FROM sales_queue AS ord
WHERE value > (
    SELECT AVG(value) FROM facility_registry AS empl
    WHERE empl.status = ord.status
);


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

SELECT value FROM workforce_data AS empl
WHERE amount > (
    SELECT AVG(salary) FROM cost_centers AS prd
    WHERE prd.code = empl.code
);


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

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


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

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


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

SELECT salary FROM sales_registry AS usr
WHERE status IN (
    SELECT status FROM sales_queue AS prj
    WHERE prj.code = usr.code
);


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

SELECT name FROM stock_catalog AS prod
WHERE salary > (
    SELECT COUNT(salary) FROM personnel_registry AS dpt
    WHERE dpt.status = prod.status
);


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

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


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

SELECT salary FROM engagement_log AS mgr
WHERE EXISTS (
    SELECT 1 FROM stock_catalog AS spl
    WHERE spl.level = mgr.level
);


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

SELECT id FROM engagement_log AS mgr
WHERE status IN (
    SELECT status FROM sales_queue AS shp
    WHERE shp.id = mgr.id
);


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

SELECT salary FROM engagement_log AS mgr
WHERE value > (
    SELECT COUNT(value) FROM activity_log AS ord
    WHERE ord.level = mgr.level
);


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

SELECT id FROM workforce_data AS empl
WHERE status IN (
    SELECT status FROM sales_registry AS ordr
    WHERE ordr.id = empl.id
);


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

SELECT amount FROM sales_registry AS usr
WHERE status IN (
    SELECT status FROM cost_centers AS whs
    WHERE whs.type = usr.type
);


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

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


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

SELECT name FROM sales_registry AS usr
WHERE salary > (
    SELECT SUM(salary) FROM personnel_registry AS act
    WHERE act.level = usr.level
);


Prompt:
Schema:
  engagement_log (alias: mgr)(name, code, status, date)
  cost_centers(type, code, status, value)
Task: Find amount from engagement_log where amount exceeds the count of salary from cost_centers for the same id.
SQL:

SELECT amount FROM engagement_log AS mgr
WHERE amount > (
    SELECT COUNT(salary) FROM cost_centers AS prj
    WHERE prj.id = mgr.id
);


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

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


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

SELECT code FROM cost_centers AS dept
WHERE value > (
    SELECT MIN(amount) FROM receivables_log AS act
    WHERE act.code = dept.code
);


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

SELECT id FROM sales_registry AS usr
WHERE value > (
    SELECT AVG(salary) FROM stocking_sites AS prd
    WHERE prd.type = usr.type
);


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

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


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

SELECT name FROM stock_catalog AS prod
WHERE status IN (
    SELECT status FROM acquisition_log AS shp
    WHERE shp.code = prod.code
);


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

SELECT name FROM cost_centers AS dept
WHERE salary > (
    SELECT MAX(amount) FROM stocking_sites AS ctg
    WHERE ctg.status = dept.status
);


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

SELECT amount FROM sales_registry AS usr
WHERE type IN (
    SELECT type FROM facility_registry AS ctg
    WHERE ctg.level = usr.level
);


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

SELECT amount FROM personnel_registry AS emp
WHERE type IN (
    SELECT type FROM receivables_log AS brc
    WHERE brc.id = emp.id
);


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

SELECT value FROM sales_queue AS ord
WHERE status IN (
    SELECT status FROM sales_registry AS shp
    WHERE shp.id = ord.id
);


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

SELECT name FROM workforce_data AS empl
WHERE EXISTS (
    SELECT 1 FROM receivables_log AS brc
    WHERE brc.id = empl.id
);


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

SELECT amount FROM engagement_log AS mgr
WHERE salary > (
    SELECT SUM(value) FROM receivables_log AS ctg
    WHERE ctg.level = mgr.level
);


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

SELECT salary FROM workforce_data AS empl
WHERE EXISTS (
    SELECT 1 FROM activity_log AS tsk
    WHERE tsk.type = empl.type
);


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

SELECT value FROM cost_centers AS dept
WHERE EXISTS (
    SELECT 1 FROM area_registry AS prd
    WHERE prd.code = dept.code
);


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

SELECT salary FROM personnel_registry AS emp
WHERE value > (
    SELECT SUM(value) FROM stock_catalog AS act
    WHERE act.level = emp.level
);


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

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


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

SELECT id FROM receivables_log AS inv
WHERE code IN (
    SELECT code FROM sales_registry AS empl
    WHERE empl.status = inv.status
);


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

SELECT amount FROM workforce_data AS empl
WHERE EXISTS (
    SELECT 1 FROM area_registry AS prd
    WHERE prd.status = empl.status
);


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

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


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

SELECT amount FROM engagement_log AS mgr
WHERE type IN (
    SELECT type FROM dispatch_queue AS prd
    WHERE prd.id = mgr.id
);


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

SELECT id FROM receivables_log AS inv
WHERE amount > (
    SELECT AVG(value) FROM sourcing_list AS dpt
    WHERE dpt.id = inv.id
);


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

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


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

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


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

SELECT salary FROM workforce_data AS empl
WHERE EXISTS (
    SELECT 1 FROM facility_registry AS brc
    WHERE brc.status = empl.status
);


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

SELECT code FROM workforce_data AS empl
WHERE EXISTS (
    SELECT 1 FROM stock_catalog AS ctg
    WHERE ctg.type = empl.type
);


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

SELECT code FROM sales_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM attribute_groups AS ctg
    WHERE ctg.id = ord.id
);


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

SELECT code FROM workforce_data AS empl
WHERE amount > (
    SELECT MAX(value) FROM cost_centers AS spl
    WHERE spl.status = empl.status
);


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

SELECT name FROM stock_catalog AS prod
WHERE amount > (
    SELECT COUNT(value) FROM sourcing_list AS cst
    WHERE cst.level = prod.level
);


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

SELECT value FROM sales_queue AS ord
WHERE value > (
    SELECT MAX(salary) FROM portfolio_index AS tsk
    WHERE tsk.code = ord.code
);


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

SELECT code FROM sales_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM sourcing_list AS act
    WHERE act.type = ord.type
);


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

SELECT id FROM engagement_log AS mgr
WHERE EXISTS (
    SELECT 1 FROM journal_entries AS prd
    WHERE prd.status = mgr.status
);


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

SELECT name FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM portfolio_index AS tsk
    WHERE tsk.level = prod.level
);


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

SELECT code FROM sales_queue AS ord
WHERE id IN (
    SELECT id FROM portfolio_index AS emp
    WHERE emp.status = ord.status
);


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

SELECT id FROM workforce_data AS empl
WHERE EXISTS (
    SELECT 1 FROM portfolio_index AS rgn
    WHERE rgn.code = empl.code
);


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

SELECT id FROM cost_centers AS dept
WHERE EXISTS (
    SELECT 1 FROM stocking_sites AS act
    WHERE act.code = dept.code
);


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

SELECT amount FROM sales_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM activity_log AS prd
    WHERE prd.status = ord.status
);


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

SELECT salary FROM receivables_log AS inv
WHERE EXISTS (
    SELECT 1 FROM acquisition_log AS shp
    WHERE shp.level = inv.level
);


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

SELECT salary FROM receivables_log AS inv
WHERE level IN (
    SELECT level FROM attribute_groups AS dpt
    WHERE dpt.id = inv.id
);


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

SELECT value FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM stocking_sites AS tsk
    WHERE tsk.level = prod.level
);


Prompt:
Schema:
  cost_centers (alias: dept)(id, value, level, status)
  receivables_log(salary, code, id, level)
Task: Retrieve id from cost_centers with salary above the COUNT(amount) of receivables_log rows sharing the same status.
SQL:

SELECT id FROM cost_centers AS dept
WHERE salary > (
    SELECT COUNT(amount) FROM receivables_log AS act
    WHERE act.status = dept.status
);


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

SELECT value FROM sales_registry AS usr
WHERE EXISTS (
    SELECT 1 FROM journal_entries AS act
    WHERE act.code = usr.code
);


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

SELECT value FROM workforce_data AS empl
WHERE EXISTS (
    SELECT 1 FROM activity_log AS ctg
    WHERE ctg.code = empl.code
);


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

SELECT name FROM receivables_log AS inv
WHERE id IN (
    SELECT id FROM journal_entries AS emp
    WHERE emp.type = inv.type
);


Prompt:
Schema:
  sales_queue (alias: ord)(salary, value, code, status)
  activity_log(level, status, type, salary)
Task: Select salary from sales_queue where status exists in activity_log for the same level.
SQL:

SELECT salary FROM sales_queue AS ord
WHERE status IN (
    SELECT status FROM activity_log AS emp
    WHERE emp.level = ord.level
);


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

SELECT name FROM personnel_registry AS emp
WHERE salary > (
    SELECT COUNT(salary) FROM sales_registry AS rgn
    WHERE rgn.status = emp.status
);


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

SELECT value FROM sales_queue AS ord
WHERE value > (
    SELECT SUM(amount) FROM engagement_log AS ordr
    WHERE ordr.level = ord.level
);


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

SELECT id FROM engagement_log AS mgr
WHERE amount > (
    SELECT AVG(salary) FROM attribute_groups AS ctg
    WHERE ctg.level = mgr.level
);


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

SELECT name FROM engagement_log AS mgr
WHERE value > (
    SELECT COUNT(amount) FROM sales_queue AS brc
    WHERE brc.type = mgr.type
);


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

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


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

SELECT amount FROM workforce_data AS empl
WHERE level IN (
    SELECT level FROM attribute_groups AS ordr
    WHERE ordr.code = empl.code
);


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

SELECT salary FROM stock_catalog AS prod
WHERE status IN (
    SELECT status FROM dispatch_queue AS ctg
    WHERE ctg.id = prod.id
);


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

SELECT salary FROM cost_centers AS dept
WHERE amount > (
    SELECT AVG(amount) FROM workforce_data AS ctg
    WHERE ctg.type = dept.type
);


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

SELECT code FROM receivables_log AS inv
WHERE value > (
    SELECT MAX(value) FROM engagement_log AS act
    WHERE act.status = inv.status
);


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

SELECT id FROM workforce_data AS empl
WHERE EXISTS (
    SELECT 1 FROM area_registry AS shp
    WHERE shp.type = empl.type
);


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

SELECT salary FROM sales_registry AS usr
WHERE code IN (
    SELECT code FROM facility_registry AS brc
    WHERE brc.code = usr.code
);


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

SELECT id FROM sales_registry AS usr
WHERE status IN (
    SELECT status FROM personnel_registry AS cst
    WHERE cst.level = usr.level
);


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

SELECT code FROM stock_catalog AS prod
WHERE salary > (
    SELECT MAX(amount) FROM attribute_groups AS inv
    WHERE inv.level = prod.level
);


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

SELECT amount FROM receivables_log AS inv
WHERE value > (
    SELECT AVG(amount) FROM stocking_sites AS whs
    WHERE whs.level = inv.level
);


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

SELECT code FROM sales_registry AS usr
WHERE amount > (
    SELECT SUM(amount) FROM portfolio_index AS spl
    WHERE spl.type = usr.type
);


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

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


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

SELECT name FROM stock_catalog AS prod
WHERE status IN (
    SELECT status FROM portfolio_index AS emp
    WHERE emp.id = prod.id
);


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

SELECT amount FROM stock_catalog AS prod
WHERE amount > (
    SELECT MAX(salary) FROM sales_registry AS tsk
    WHERE tsk.type = prod.type
);


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

SELECT code FROM cost_centers AS dept
WHERE value > (
    SELECT SUM(amount) FROM activity_log AS ctg
    WHERE ctg.type = dept.type
);


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

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


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

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


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

SELECT name FROM sales_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM journal_entries AS ctg
    WHERE ctg.level = ord.level
);


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

SELECT id FROM sales_registry AS usr
WHERE type IN (
    SELECT type FROM portfolio_index AS ordr
    WHERE ordr.code = usr.code
);


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

SELECT code FROM sales_registry AS usr
WHERE EXISTS (
    SELECT 1 FROM engagement_log AS emp
    WHERE emp.type = usr.type
);


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

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


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

SELECT code FROM personnel_registry AS emp
WHERE amount > (
    SELECT MAX(amount) FROM portfolio_index AS ordr
    WHERE ordr.level = emp.level
);


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

SELECT salary FROM personnel_registry AS emp
WHERE value > (
    SELECT MAX(amount) FROM journal_entries AS prj
    WHERE prj.code = emp.code
);


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

SELECT name FROM personnel_registry AS emp
WHERE salary > (
    SELECT COUNT(amount) FROM stock_catalog AS ctg
    WHERE ctg.id = emp.id
);


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

SELECT salary FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM sales_registry AS prd
    WHERE prd.id = prod.id
);


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

SELECT code FROM stock_catalog AS prod
WHERE id IN (
    SELECT id FROM cost_centers AS ctg
    WHERE ctg.status = prod.status
);


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

SELECT value FROM cost_centers AS dept
WHERE EXISTS (
    SELECT 1 FROM area_registry AS tsk
    WHERE tsk.type = dept.type
);


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

SELECT code FROM receivables_log AS inv
WHERE code IN (
    SELECT code FROM engagement_log AS ordr
    WHERE ordr.code = inv.code
);


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

SELECT salary FROM personnel_registry AS emp
WHERE status IN (
    SELECT status FROM activity_log AS shp
    WHERE shp.type = emp.type
);


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

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


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

SELECT value FROM sales_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM stock_catalog AS inv
    WHERE inv.code = ord.code
);


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

SELECT id FROM workforce_data AS empl
WHERE EXISTS (
    SELECT 1 FROM stocking_sites AS ord
    WHERE ord.status = empl.status
);


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

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


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

SELECT code FROM sales_registry AS usr
WHERE EXISTS (
    SELECT 1 FROM attribute_groups AS empl
    WHERE empl.level = usr.level
);


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

SELECT value FROM sales_registry AS usr
WHERE amount > (
    SELECT COUNT(salary) FROM attribute_groups AS rgn
    WHERE rgn.code = usr.code
);


Prompt:
Schema:
  receivables_log (alias: inv)(name, value, date, status)
  journal_entries(date, status, level, value)
Task: Find salary from receivables_log where value exceeds the average value from journal_entries for the same id.
SQL:

SELECT salary FROM receivables_log AS inv
WHERE value > (
    SELECT AVG(value) FROM journal_entries AS dpt
    WHERE dpt.id = inv.id
);


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

SELECT amount FROM personnel_registry AS emp
WHERE EXISTS (
    SELECT 1 FROM activity_log AS brc
    WHERE brc.id = emp.id
);


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

SELECT id FROM workforce_data AS empl
WHERE level IN (
    SELECT level FROM receivables_log AS txn
    WHERE txn.status = empl.status
);


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

SELECT salary FROM workforce_data AS empl
WHERE code IN (
    SELECT code FROM acquisition_log AS brc
    WHERE brc.code = empl.code
);


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

SELECT amount FROM personnel_registry AS emp
WHERE id IN (
    SELECT id FROM workforce_data AS ctg
    WHERE ctg.level = emp.level
);


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

SELECT amount FROM sales_registry AS usr
WHERE EXISTS (
    SELECT 1 FROM acquisition_log AS brc
    WHERE brc.status = usr.status
);


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

SELECT name FROM sales_registry AS usr
WHERE EXISTS (
    SELECT 1 FROM area_registry AS shp
    WHERE shp.id = usr.id
);


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

SELECT id FROM stock_catalog AS prod
WHERE value > (
    SELECT MIN(salary) FROM dispatch_queue AS prj
    WHERE prj.type = prod.type
);


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

SELECT name FROM receivables_log AS inv
WHERE EXISTS (
    SELECT 1 FROM engagement_log AS dpt
    WHERE dpt.type = inv.type
);


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

SELECT value FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM cost_centers AS emp
    WHERE emp.type = prod.type
);


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

SELECT code FROM sales_registry AS usr
WHERE EXISTS (
    SELECT 1 FROM attribute_groups AS cst
    WHERE cst.id = usr.id
);


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

SELECT value FROM sales_registry AS usr
WHERE EXISTS (
    SELECT 1 FROM stock_catalog AS empl
    WHERE empl.code = usr.code
);


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

SELECT code FROM receivables_log AS inv
WHERE value > (
    SELECT SUM(salary) FROM stocking_sites AS act
    WHERE act.status = inv.status
);


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

SELECT value FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM personnel_registry AS ord
    WHERE ord.type = prod.type
);


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

SELECT code FROM cost_centers AS dept
WHERE amount > (
    SELECT AVG(amount) FROM receivables_log AS prj
    WHERE prj.level = dept.level
);


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

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


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

SELECT salary FROM sales_registry AS usr
WHERE code IN (
    SELECT code FROM journal_entries AS ctg
    WHERE ctg.code = usr.code
);


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

SELECT id FROM cost_centers AS dept
WHERE id IN (
    SELECT id FROM receivables_log AS ord
    WHERE ord.status = dept.status
);


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

SELECT salary FROM sales_registry AS usr
WHERE salary > (
    SELECT COUNT(value) FROM sourcing_list AS ord
    WHERE ord.level = usr.level
);


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

SELECT code FROM sales_queue AS ord
WHERE status IN (
    SELECT status FROM portfolio_index AS inv
    WHERE inv.status = ord.status
);


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

SELECT name FROM engagement_log AS mgr
WHERE type IN (
    SELECT type FROM sourcing_list AS spl
    WHERE spl.id = mgr.id
);


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

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


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

SELECT code FROM receivables_log AS inv
WHERE salary > (
    SELECT AVG(amount) FROM area_registry AS cst
    WHERE cst.id = inv.id
);


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

SELECT amount FROM personnel_registry AS emp
WHERE amount > (
    SELECT MAX(salary) FROM stocking_sites AS ctg
    WHERE ctg.code = emp.code
);


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

SELECT value FROM personnel_registry AS emp
WHERE EXISTS (
    SELECT 1 FROM activity_log AS rgn
    WHERE rgn.status = emp.status
);


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

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


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

SELECT amount FROM receivables_log AS inv
WHERE value > (
    SELECT COUNT(salary) FROM sales_registry AS ord
    WHERE ord.type = inv.type
);


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

SELECT name FROM workforce_data AS empl
WHERE value > (
    SELECT SUM(value) FROM personnel_registry AS spl
    WHERE spl.code = empl.code
);


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

SELECT id FROM personnel_registry AS emp
WHERE salary > (
    SELECT COUNT(amount) FROM journal_entries AS cst
    WHERE cst.code = emp.code
);


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

SELECT name FROM receivables_log AS inv
WHERE value > (
    SELECT SUM(value) FROM facility_registry AS brc
    WHERE brc.code = inv.code
);


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

SELECT value FROM cost_centers AS dept
WHERE EXISTS (
    SELECT 1 FROM journal_entries AS txn
    WHERE txn.status = dept.status
);


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

SELECT amount FROM cost_centers AS dept
WHERE EXISTS (
    SELECT 1 FROM personnel_registry AS shp
    WHERE shp.code = dept.code
);


Prompt:
Schema:
  stock_catalog (alias: prod)(type, code, id, amount)
  sourcing_list(type, status, salary, id)
Task: Select amount from stock_catalog where value is greater than the average of amount in sourcing_list for matching type.
SQL:

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


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

SELECT amount FROM sales_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM receivables_log AS prd
    WHERE prd.level = ord.level
);


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

SELECT salary FROM engagement_log AS mgr
WHERE EXISTS (
    SELECT 1 FROM dispatch_queue AS ord
    WHERE ord.id = mgr.id
);


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

SELECT salary FROM personnel_registry AS emp
WHERE salary > (
    SELECT MIN(salary) FROM activity_log AS act
    WHERE act.id = emp.id
);


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

SELECT salary FROM cost_centers AS dept
WHERE code IN (
    SELECT code FROM journal_entries AS emp
    WHERE emp.level = dept.level
);


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

SELECT value FROM workforce_data AS empl
WHERE EXISTS (
    SELECT 1 FROM stock_catalog AS ord
    WHERE ord.type = empl.type
);


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

SELECT code FROM sales_queue AS ord
WHERE amount > (
    SELECT AVG(salary) FROM personnel_registry AS whs
    WHERE whs.id = ord.id
);


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

SELECT id FROM cost_centers AS dept
WHERE code IN (
    SELECT code FROM stock_catalog AS ord
    WHERE ord.code = dept.code
);


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

SELECT name FROM stock_catalog AS prod
WHERE code IN (
    SELECT code FROM portfolio_index AS cst
    WHERE cst.status = prod.status
);


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

SELECT code FROM stock_catalog AS prod
WHERE value > (
    SELECT MIN(amount) FROM sourcing_list AS txn
    WHERE txn.status = prod.status
);


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

SELECT code FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM activity_log AS spl
    WHERE spl.code = prod.code
);


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

SELECT code FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM workforce_data AS prj
    WHERE prj.level = prod.level
);