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

SELECT name FROM workforce_data AS empl
WHERE amount > (
    SELECT AVG(salary) FROM sourcing_list AS dpt
    WHERE dpt.code = empl.code
);


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

SELECT name FROM sales_registry AS usr
WHERE EXISTS (
    SELECT 1 FROM personnel_registry AS shp
    WHERE shp.status = usr.status
);


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

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


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

SELECT salary FROM personnel_registry AS emp
WHERE level IN (
    SELECT level FROM workforce_data AS ordr
    WHERE ordr.id = emp.id
);


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

SELECT salary FROM sales_registry AS usr
WHERE EXISTS (
    SELECT 1 FROM sales_queue AS tsk
    WHERE tsk.status = usr.status
);


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

SELECT salary FROM engagement_log AS mgr
WHERE salary > (
    SELECT MIN(amount) FROM area_registry AS brc
    WHERE brc.type = mgr.type
);


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

SELECT code FROM cost_centers AS dept
WHERE EXISTS (
    SELECT 1 FROM facility_registry AS cst
    WHERE cst.code = dept.code
);


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

SELECT value FROM personnel_registry AS emp
WHERE EXISTS (
    SELECT 1 FROM stock_catalog AS empl
    WHERE empl.type = emp.type
);


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

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


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

SELECT code FROM workforce_data AS empl
WHERE type IN (
    SELECT type FROM facility_registry AS inv
    WHERE inv.status = empl.status
);


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

SELECT id FROM receivables_log AS inv
WHERE EXISTS (
    SELECT 1 FROM workforce_data AS spl
    WHERE spl.type = inv.type
);


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

SELECT name FROM receivables_log AS inv
WHERE salary > (
    SELECT MIN(value) FROM workforce_data AS prj
    WHERE prj.status = inv.status
);


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

SELECT name FROM engagement_log AS mgr
WHERE EXISTS (
    SELECT 1 FROM acquisition_log AS whs
    WHERE whs.status = mgr.status
);


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

SELECT code FROM receivables_log AS inv
WHERE value > (
    SELECT MAX(value) FROM portfolio_index AS shp
    WHERE shp.id = inv.id
);


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

SELECT amount FROM personnel_registry AS emp
WHERE value > (
    SELECT SUM(value) FROM engagement_log AS ctg
    WHERE ctg.level = emp.level
);


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

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


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

SELECT amount FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM sales_registry AS spl
    WHERE spl.type = prod.type
);


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

SELECT id FROM workforce_data AS empl
WHERE amount > (
    SELECT MAX(amount) FROM sales_queue AS tsk
    WHERE tsk.id = empl.id
);


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

SELECT name FROM personnel_registry AS emp
WHERE amount > (
    SELECT MAX(amount) FROM workforce_data AS prj
    WHERE prj.code = emp.code
);


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

SELECT id FROM engagement_log AS mgr
WHERE value > (
    SELECT AVG(salary) FROM dispatch_queue AS rgn
    WHERE rgn.status = mgr.status
);


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

SELECT salary FROM engagement_log AS mgr
WHERE status IN (
    SELECT status FROM sales_registry AS prd
    WHERE prd.status = mgr.status
);


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

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


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

SELECT value FROM engagement_log AS mgr
WHERE status IN (
    SELECT status FROM attribute_groups AS act
    WHERE act.level = mgr.level
);


Prompt:
Schema:
  workforce_data (alias: empl)(id, salary, code, status)
  stocking_sites(status, value, salary, date)
Task: Find value from workforce_data where value exceeds the maximum salary from stocking_sites for the same status.
SQL:

SELECT value FROM workforce_data AS empl
WHERE value > (
    SELECT MAX(salary) FROM stocking_sites AS tsk
    WHERE tsk.status = empl.status
);


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

SELECT code FROM sales_queue AS ord
WHERE salary > (
    SELECT MIN(value) FROM attribute_groups AS empl
    WHERE empl.id = ord.id
);


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

SELECT amount FROM engagement_log AS mgr
WHERE salary > (
    SELECT COUNT(value) FROM facility_registry AS empl
    WHERE empl.level = mgr.level
);


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

SELECT name FROM sales_registry AS usr
WHERE EXISTS (
    SELECT 1 FROM cost_centers AS dpt
    WHERE dpt.id = usr.id
);


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

SELECT value FROM receivables_log AS inv
WHERE salary > (
    SELECT COUNT(salary) FROM sales_registry AS shp
    WHERE shp.level = inv.level
);


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

SELECT id FROM sales_registry AS usr
WHERE amount > (
    SELECT MAX(salary) FROM dispatch_queue AS dpt
    WHERE dpt.id = usr.id
);


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

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


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

SELECT amount FROM personnel_registry AS emp
WHERE id IN (
    SELECT id FROM cost_centers AS prj
    WHERE prj.level = emp.level
);


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

SELECT value FROM sales_registry AS usr
WHERE id IN (
    SELECT id FROM acquisition_log AS empl
    WHERE empl.level = usr.level
);


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

SELECT name FROM cost_centers AS dept
WHERE EXISTS (
    SELECT 1 FROM stock_catalog AS ordr
    WHERE ordr.code = dept.code
);


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

SELECT salary FROM receivables_log AS inv
WHERE EXISTS (
    SELECT 1 FROM sales_registry AS ord
    WHERE ord.code = inv.code
);


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

SELECT value FROM receivables_log AS inv
WHERE code IN (
    SELECT code FROM personnel_registry AS ordr
    WHERE ordr.level = inv.level
);


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

SELECT code FROM workforce_data AS empl
WHERE status IN (
    SELECT status FROM stocking_sites AS ctg
    WHERE ctg.level = empl.level
);


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

SELECT name FROM sales_registry AS usr
WHERE code IN (
    SELECT code FROM personnel_registry AS dpt
    WHERE dpt.status = usr.status
);


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

SELECT code FROM sales_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM personnel_registry AS spl
    WHERE spl.type = ord.type
);


Prompt:
Schema:
  stock_catalog (alias: prod)(type, status, salary, amount)
  cost_centers(value, salary, id, amount)
Task: Find amount from stock_catalog where value exceeds the average amount from cost_centers for the same status.
SQL:

SELECT amount FROM stock_catalog AS prod
WHERE value > (
    SELECT AVG(amount) FROM cost_centers AS ctg
    WHERE ctg.status = prod.status
);


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

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


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

SELECT salary FROM workforce_data AS empl
WHERE id IN (
    SELECT id FROM journal_entries AS spl
    WHERE spl.type = empl.type
);


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

SELECT value FROM stock_catalog AS prod
WHERE EXISTS (
    SELECT 1 FROM personnel_registry AS empl
    WHERE empl.id = prod.id
);


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

SELECT id FROM receivables_log AS inv
WHERE salary > (
    SELECT MIN(value) FROM cost_centers AS spl
    WHERE spl.type = inv.type
);


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

SELECT salary FROM stock_catalog AS prod
WHERE type IN (
    SELECT type FROM personnel_registry AS shp
    WHERE shp.id = prod.id
);


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

SELECT name FROM workforce_data AS empl
WHERE EXISTS (
    SELECT 1 FROM cost_centers AS brc
    WHERE brc.code = empl.code
);


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

SELECT salary FROM receivables_log AS inv
WHERE status IN (
    SELECT status FROM stock_catalog AS ctg
    WHERE ctg.id = inv.id
);


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

SELECT salary FROM sales_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM personnel_registry AS ctg
    WHERE ctg.id = ord.id
);


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

SELECT id FROM engagement_log AS mgr
WHERE value > (
    SELECT MAX(value) FROM facility_registry AS brc
    WHERE brc.code = mgr.code
);


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

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


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

SELECT code FROM sales_queue AS ord
WHERE id IN (
    SELECT id FROM receivables_log AS act
    WHERE act.level = ord.level
);


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

SELECT name FROM engagement_log AS mgr
WHERE salary > (
    SELECT MAX(salary) FROM cost_centers AS ordr
    WHERE ordr.code = mgr.code
);


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

SELECT code FROM sales_registry AS usr
WHERE value > (
    SELECT MAX(amount) FROM facility_registry AS shp
    WHERE shp.type = usr.type
);


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

SELECT value FROM personnel_registry AS emp
WHERE EXISTS (
    SELECT 1 FROM dispatch_queue AS empl
    WHERE empl.code = emp.code
);