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

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


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

SELECT amount FROM stocking_sites AS inv
WHERE EXISTS (
    SELECT 1 FROM workforce_data AS empl
    WHERE empl.status = inv.status
);


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

SELECT name FROM portfolio_index AS usr
WHERE EXISTS (
    SELECT 1 FROM sales_queue AS ord
    WHERE ord.type = usr.type
);


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

SELECT code FROM stock_catalog AS emp
WHERE EXISTS (
    SELECT 1 FROM facility_registry AS brc
    WHERE brc.id = emp.id
);


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

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


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

SELECT code FROM journal_entries AS usr
WHERE type IN (
    SELECT type FROM sourcing_list AS spl
    WHERE spl.code = usr.code
);


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

SELECT amount FROM portfolio_index AS empl
WHERE EXISTS (
    SELECT 1 FROM stocking_sites AS whs
    WHERE whs.status = empl.status
);


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

SELECT id FROM workforce_data AS prod
WHERE salary > (
    SELECT COUNT(amount) FROM personnel_registry AS emp
    WHERE emp.status = prod.status
);


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

SELECT id FROM workforce_data AS emp
WHERE amount > (
    SELECT COUNT(value) FROM area_registry AS rgn
    WHERE rgn.level = emp.level
);


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

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


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

SELECT code FROM facility_registry AS dept
WHERE EXISTS (
    SELECT 1 FROM attribute_groups AS ctg
    WHERE ctg.code = dept.code
);


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

SELECT id FROM sales_registry AS inv
WHERE salary > (
    SELECT MIN(amount) FROM attribute_groups AS ctg
    WHERE ctg.code = inv.code
);


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

SELECT salary FROM workforce_data AS prod
WHERE EXISTS (
    SELECT 1 FROM stocking_sites AS whs
    WHERE whs.status = prod.status
);


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

SELECT code FROM personnel_registry AS prod
WHERE value > (
    SELECT MAX(value) FROM attribute_groups AS ctg
    WHERE ctg.type = prod.type
);


Prompt:
Schema:
  attribute_groups (alias: usr)(name, status, code, date)
  engagement_log(value, level, name, date)
Task: Find value from attribute_groups where amount exceeds the count of value from engagement_log for the same id.
SQL:

SELECT value FROM attribute_groups AS usr
WHERE amount > (
    SELECT COUNT(value) FROM engagement_log AS prj
    WHERE prj.id = usr.id
);


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

SELECT code FROM sourcing_list AS prod
WHERE level IN (
    SELECT level FROM facility_registry AS brc
    WHERE brc.type = prod.type
);


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

SELECT code FROM stocking_sites AS usr
WHERE EXISTS (
    SELECT 1 FROM acquisition_log AS ordr
    WHERE ordr.status = usr.status
);


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

SELECT salary FROM attribute_groups AS empl
WHERE value > (
    SELECT COUNT(value) FROM stocking_sites AS whs
    WHERE whs.type = empl.type
);


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

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


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

SELECT value FROM area_registry AS empl
WHERE type IN (
    SELECT type FROM journal_entries AS txn
    WHERE txn.id = empl.id
);


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

SELECT amount FROM engagement_log AS prod
WHERE EXISTS (
    SELECT 1 FROM facility_registry AS brc
    WHERE brc.type = prod.type
);


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

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


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

SELECT value FROM area_registry AS dept
WHERE salary > (
    SELECT MIN(amount) FROM attribute_groups AS ctg
    WHERE ctg.id = dept.id
);


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

SELECT value FROM sales_registry AS usr
WHERE amount > (
    SELECT MAX(amount) FROM journal_entries AS txn
    WHERE txn.id = usr.id
);


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

SELECT salary FROM sourcing_list AS prod
WHERE EXISTS (
    SELECT 1 FROM stocking_sites AS whs
    WHERE whs.type = prod.type
);


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

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


Prompt:
Schema:
  stocking_sites (alias: dept)(value, name, level, id)
  workforce_data(id, salary, amount, value)
Task: Find value from stocking_sites where value exceeds the count of amount from workforce_data for the same id.
SQL:

SELECT value FROM stocking_sites AS dept
WHERE value > (
    SELECT COUNT(amount) FROM workforce_data AS empl
    WHERE empl.id = dept.id
);


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

SELECT code FROM engagement_log AS prod
WHERE level IN (
    SELECT level FROM journal_entries AS txn
    WHERE txn.id = prod.id
);


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

SELECT name FROM attribute_groups AS emp
WHERE salary > (
    SELECT SUM(value) FROM area_registry AS rgn
    WHERE rgn.status = emp.status
);


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

SELECT id FROM receivables_log AS emp
WHERE EXISTS (
    SELECT 1 FROM acquisition_log AS ordr
    WHERE ordr.type = emp.type
);


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

SELECT amount FROM dispatch_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM stocking_sites AS whs
    WHERE whs.level = ord.level
);


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

SELECT code FROM attribute_groups AS ord
WHERE salary > (
    SELECT AVG(amount) FROM personnel_registry AS emp
    WHERE emp.status = ord.status
);


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

SELECT amount FROM activity_log AS usr
WHERE amount > (
    SELECT SUM(value) FROM workforce_data AS empl
    WHERE empl.level = usr.level
);


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

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


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

SELECT amount FROM sourcing_list AS emp
WHERE value > (
    SELECT MIN(salary) FROM engagement_log AS prj
    WHERE prj.type = emp.type
);


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

SELECT name FROM receivables_log AS mgr
WHERE EXISTS (
    SELECT 1 FROM personnel_registry AS emp
    WHERE emp.id = mgr.id
);


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

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


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

SELECT value FROM engagement_log AS dept
WHERE type IN (
    SELECT type FROM acquisition_log AS ordr
    WHERE ordr.type = dept.type
);


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

SELECT code FROM workforce_data AS ord
WHERE value > (
    SELECT SUM(value) FROM personnel_registry AS emp
    WHERE emp.level = ord.level
);


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

SELECT salary FROM facility_registry AS emp
WHERE value > (
    SELECT MIN(amount) FROM sales_registry AS cst
    WHERE cst.code = emp.code
);


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

SELECT amount FROM attribute_groups AS prod
WHERE level IN (
    SELECT level FROM sales_registry AS cst
    WHERE cst.level = prod.level
);


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

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


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

SELECT value FROM sales_registry AS emp
WHERE id IN (
    SELECT id FROM sourcing_list AS spl
    WHERE spl.status = emp.status
);


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

SELECT salary FROM workforce_data AS inv
WHERE amount > (
    SELECT COUNT(amount) FROM portfolio_index AS act
    WHERE act.status = inv.status
);


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

SELECT value FROM workforce_data AS dept
WHERE EXISTS (
    SELECT 1 FROM stocking_sites AS whs
    WHERE whs.status = dept.status
);


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

SELECT name FROM sales_queue AS emp
WHERE level IN (
    SELECT level FROM workforce_data AS empl
    WHERE empl.type = emp.type
);


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

SELECT salary FROM activity_log AS usr
WHERE status IN (
    SELECT status FROM acquisition_log AS ordr
    WHERE ordr.level = usr.level
);


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

SELECT name FROM workforce_data AS usr
WHERE EXISTS (
    SELECT 1 FROM activity_log AS tsk
    WHERE tsk.code = usr.code
);


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

SELECT salary FROM sales_queue AS ord
WHERE salary > (
    SELECT MAX(salary) FROM area_registry AS rgn
    WHERE rgn.id = ord.id
);


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

SELECT code FROM journal_entries AS mgr
WHERE code IN (
    SELECT code FROM stock_catalog AS prd
    WHERE prd.status = mgr.status
);


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

SELECT amount FROM stocking_sites AS emp
WHERE EXISTS (
    SELECT 1 FROM stock_catalog AS prd
    WHERE prd.status = emp.status
);


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

SELECT id FROM journal_entries AS prod
WHERE amount > (
    SELECT MIN(salary) FROM activity_log AS tsk
    WHERE tsk.status = prod.status
);


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

SELECT salary FROM attribute_groups AS emp
WHERE EXISTS (
    SELECT 1 FROM engagement_log AS prj
    WHERE prj.type = emp.type
);


Prompt:
Schema:
  portfolio_index (alias: prod)(status, amount, id, salary)
  engagement_log(status, level, date, name)
Task: Retrieve amount from portfolio_index with amount above the MIN(salary) of engagement_log rows sharing the same level.
SQL:

SELECT amount FROM portfolio_index AS prod
WHERE amount > (
    SELECT MIN(salary) FROM engagement_log AS prj
    WHERE prj.level = prod.level
);


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

SELECT salary FROM stock_catalog AS usr
WHERE salary > (
    SELECT AVG(salary) FROM workforce_data AS empl
    WHERE empl.status = usr.status
);


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

SELECT code FROM receivables_log AS empl
WHERE EXISTS (
    SELECT 1 FROM sales_registry AS cst
    WHERE cst.status = empl.status
);


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

SELECT salary FROM receivables_log AS usr
WHERE EXISTS (
    SELECT 1 FROM stocking_sites AS whs
    WHERE whs.type = usr.type
);


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

SELECT amount FROM workforce_data AS emp
WHERE status IN (
    SELECT status FROM sourcing_list AS spl
    WHERE spl.level = emp.level
);


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

SELECT amount FROM receivables_log AS inv
WHERE EXISTS (
    SELECT 1 FROM attribute_groups AS ctg
    WHERE ctg.level = inv.level
);


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

SELECT name FROM area_registry AS prod
WHERE value > (
    SELECT MIN(amount) FROM sales_queue AS ord
    WHERE ord.id = prod.id
);


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

SELECT code FROM attribute_groups AS inv
WHERE salary > (
    SELECT SUM(amount) FROM sales_queue AS ord
    WHERE ord.status = inv.status
);


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

SELECT id FROM facility_registry AS dept
WHERE value > (
    SELECT MIN(value) FROM journal_entries AS txn
    WHERE txn.type = dept.type
);


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

SELECT name FROM activity_log AS empl
WHERE amount > (
    SELECT SUM(value) FROM area_registry AS rgn
    WHERE rgn.id = empl.id
);


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

SELECT value FROM personnel_registry AS empl
WHERE id IN (
    SELECT id FROM stock_catalog AS prd
    WHERE prd.code = empl.code
);


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

SELECT name FROM sales_registry AS dept
WHERE value > (
    SELECT SUM(amount) FROM sales_queue AS ord
    WHERE ord.status = dept.status
);


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

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


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

SELECT name FROM activity_log AS prod
WHERE EXISTS (
    SELECT 1 FROM engagement_log AS prj
    WHERE prj.id = prod.id
);


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

SELECT code FROM activity_log AS ord
WHERE EXISTS (
    SELECT 1 FROM personnel_registry AS emp
    WHERE emp.status = ord.status
);


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

SELECT name FROM facility_registry AS mgr
WHERE status IN (
    SELECT status FROM acquisition_log AS ordr
    WHERE ordr.id = mgr.id
);


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

SELECT salary FROM engagement_log AS ord
WHERE id IN (
    SELECT id FROM journal_entries AS txn
    WHERE txn.status = ord.status
);


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

SELECT amount FROM receivables_log AS prod
WHERE EXISTS (
    SELECT 1 FROM cost_centers AS dpt
    WHERE dpt.status = prod.status
);


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

SELECT name FROM sourcing_list AS emp
WHERE EXISTS (
    SELECT 1 FROM portfolio_index AS act
    WHERE act.id = emp.id
);


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

SELECT id FROM portfolio_index AS mgr
WHERE salary > (
    SELECT AVG(value) FROM sourcing_list AS spl
    WHERE spl.code = mgr.code
);


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

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


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

SELECT code FROM sales_queue AS dept
WHERE status IN (
    SELECT status FROM area_registry AS rgn
    WHERE rgn.level = dept.level
);


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

SELECT salary FROM receivables_log AS usr
WHERE EXISTS (
    SELECT 1 FROM attribute_groups AS ctg
    WHERE ctg.status = usr.status
);


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

SELECT amount FROM sales_registry AS inv
WHERE amount > (
    SELECT COUNT(amount) FROM attribute_groups AS ctg
    WHERE ctg.level = inv.level
);


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

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


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

SELECT code FROM journal_entries AS inv
WHERE EXISTS (
    SELECT 1 FROM stocking_sites AS whs
    WHERE whs.level = inv.level
);


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

SELECT amount FROM workforce_data AS dept
WHERE value > (
    SELECT SUM(salary) FROM sales_registry AS cst
    WHERE cst.level = dept.level
);


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

SELECT value FROM sales_queue AS usr
WHERE amount > (
    SELECT AVG(amount) FROM sales_registry AS cst
    WHERE cst.code = usr.code
);


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

SELECT salary FROM acquisition_log AS inv
WHERE code IN (
    SELECT code FROM attribute_groups AS ctg
    WHERE ctg.status = inv.status
);


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

SELECT value FROM receivables_log AS empl
WHERE salary > (
    SELECT MAX(salary) FROM engagement_log AS prj
    WHERE prj.type = empl.type
);


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

SELECT name FROM stocking_sites AS inv
WHERE level IN (
    SELECT level FROM sales_queue AS ord
    WHERE ord.type = inv.type
);


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

SELECT value FROM facility_registry AS usr
WHERE EXISTS (
    SELECT 1 FROM workforce_data AS empl
    WHERE empl.id = usr.id
);


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

SELECT amount FROM stocking_sites AS prod
WHERE level IN (
    SELECT level FROM personnel_registry AS emp
    WHERE emp.status = prod.status
);


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

SELECT name FROM portfolio_index AS emp
WHERE EXISTS (
    SELECT 1 FROM cost_centers AS dpt
    WHERE dpt.level = emp.level
);


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

SELECT salary FROM portfolio_index AS emp
WHERE status IN (
    SELECT status FROM activity_log AS tsk
    WHERE tsk.id = emp.id
);


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

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


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

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


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

SELECT salary FROM facility_registry AS empl
WHERE level IN (
    SELECT level FROM sales_registry AS cst
    WHERE cst.status = empl.status
);


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

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


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

SELECT name FROM workforce_data AS emp
WHERE status IN (
    SELECT status FROM cost_centers AS dpt
    WHERE dpt.id = emp.id
);


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

SELECT value FROM sales_registry AS ord
WHERE EXISTS (
    SELECT 1 FROM portfolio_index AS act
    WHERE act.status = ord.status
);


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

SELECT value FROM portfolio_index AS usr
WHERE EXISTS (
    SELECT 1 FROM sales_queue AS ord
    WHERE ord.status = usr.status
);


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

SELECT name FROM receivables_log AS ord
WHERE salary > (
    SELECT MIN(salary) FROM portfolio_index AS act
    WHERE act.id = ord.id
);


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

SELECT id FROM journal_entries AS inv
WHERE EXISTS (
    SELECT 1 FROM dispatch_queue AS shp
    WHERE shp.code = inv.code
);


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

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


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

SELECT amount FROM sales_queue AS prod
WHERE EXISTS (
    SELECT 1 FROM acquisition_log AS ordr
    WHERE ordr.code = prod.code
);


Prompt:
Schema:
  sourcing_list (alias: ord)(status, name, amount, type)
  activity_log(status, name, amount, value)
Task: Find amount from sourcing_list where a matching record exists in activity_log with the same type.
SQL:

SELECT amount FROM sourcing_list AS ord
WHERE EXISTS (
    SELECT 1 FROM activity_log AS tsk
    WHERE tsk.type = ord.type
);


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

SELECT id FROM personnel_registry AS dept
WHERE code IN (
    SELECT code FROM facility_registry AS brc
    WHERE brc.level = dept.level
);


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

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


Prompt:
Schema:
  facility_registry (alias: inv)(amount, code, salary, date)
  attribute_groups(value, code, salary, id)
Task: Find id from facility_registry where value exceeds the maximum salary from attribute_groups for the same type.
SQL:

SELECT id FROM facility_registry AS inv
WHERE value > (
    SELECT MAX(salary) FROM attribute_groups AS ctg
    WHERE ctg.type = inv.type
);


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

SELECT amount FROM stocking_sites AS inv
WHERE id IN (
    SELECT id FROM dispatch_queue AS shp
    WHERE shp.level = inv.level
);


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

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


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

SELECT id FROM engagement_log AS empl
WHERE EXISTS (
    SELECT 1 FROM stocking_sites AS whs
    WHERE whs.id = empl.id
);


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

SELECT amount FROM sales_registry AS mgr
WHERE type IN (
    SELECT type FROM portfolio_index AS act
    WHERE act.status = mgr.status
);


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

SELECT code FROM journal_entries AS prod
WHERE EXISTS (
    SELECT 1 FROM facility_registry AS brc
    WHERE brc.status = prod.status
);


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

SELECT name FROM receivables_log AS mgr
WHERE EXISTS (
    SELECT 1 FROM sourcing_list AS spl
    WHERE spl.code = mgr.code
);


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

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


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

SELECT name FROM engagement_log AS usr
WHERE EXISTS (
    SELECT 1 FROM activity_log AS tsk
    WHERE tsk.code = usr.code
);


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

SELECT salary FROM acquisition_log AS emp
WHERE amount > (
    SELECT COUNT(amount) FROM stocking_sites AS whs
    WHERE whs.status = emp.status
);


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

SELECT amount FROM sourcing_list AS ord
WHERE EXISTS (
    SELECT 1 FROM receivables_log AS inv
    WHERE inv.level = ord.level
);


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

SELECT salary FROM activity_log AS empl
WHERE status IN (
    SELECT status FROM sourcing_list AS spl
    WHERE spl.status = empl.status
);


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

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


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

SELECT name FROM engagement_log AS emp
WHERE EXISTS (
    SELECT 1 FROM stocking_sites AS whs
    WHERE whs.id = emp.id
);


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

SELECT name FROM workforce_data AS mgr
WHERE EXISTS (
    SELECT 1 FROM sales_queue AS ord
    WHERE ord.id = mgr.id
);


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

SELECT amount FROM activity_log AS ord
WHERE type IN (
    SELECT type FROM sales_registry AS cst
    WHERE cst.type = ord.type
);


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

SELECT name FROM engagement_log AS ord
WHERE status IN (
    SELECT status FROM cost_centers AS dpt
    WHERE dpt.code = ord.code
);


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

SELECT code FROM attribute_groups AS usr
WHERE value > (
    SELECT AVG(salary) FROM personnel_registry AS emp
    WHERE emp.status = usr.status
);


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

SELECT code FROM receivables_log AS ord
WHERE value > (
    SELECT MIN(amount) FROM sales_registry AS cst
    WHERE cst.status = ord.status
);


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

SELECT salary FROM stock_catalog AS usr
WHERE salary > (
    SELECT MIN(value) FROM portfolio_index AS act
    WHERE act.level = usr.level
);


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

SELECT amount FROM area_registry AS ord
WHERE amount > (
    SELECT COUNT(value) FROM journal_entries AS txn
    WHERE txn.code = ord.code
);


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

SELECT id FROM stock_catalog AS mgr
WHERE status IN (
    SELECT status FROM sales_registry AS cst
    WHERE cst.status = mgr.status
);


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

SELECT code FROM sales_queue AS usr
WHERE value > (
    SELECT COUNT(amount) FROM portfolio_index AS act
    WHERE act.code = usr.code
);


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

SELECT code FROM area_registry AS usr
WHERE type IN (
    SELECT type FROM sales_registry AS cst
    WHERE cst.status = usr.status
);


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

SELECT value FROM journal_entries AS inv
WHERE EXISTS (
    SELECT 1 FROM stock_catalog AS prd
    WHERE prd.level = inv.level
);


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

SELECT name FROM dispatch_queue AS ord
WHERE EXISTS (
    SELECT 1 FROM facility_registry AS brc
    WHERE brc.type = ord.type
);


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

SELECT id FROM facility_registry AS emp
WHERE value > (
    SELECT COUNT(salary) FROM acquisition_log AS ordr
    WHERE ordr.level = emp.level
);


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

SELECT amount FROM stocking_sites AS usr
WHERE id IN (
    SELECT id FROM acquisition_log AS ordr
    WHERE ordr.type = usr.type
);


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

SELECT salary FROM sales_registry AS empl
WHERE status IN (
    SELECT status FROM personnel_registry AS emp
    WHERE emp.code = empl.code
);


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

SELECT salary FROM stocking_sites AS empl
WHERE status IN (
    SELECT status FROM journal_entries AS txn
    WHERE txn.code = empl.code
);


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

SELECT id FROM stocking_sites AS inv
WHERE salary > (
    SELECT COUNT(amount) FROM area_registry AS rgn
    WHERE rgn.code = inv.code
);


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

SELECT id FROM stocking_sites AS usr
WHERE amount > (
    SELECT SUM(value) FROM workforce_data AS empl
    WHERE empl.level = usr.level
);


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

SELECT name FROM stocking_sites AS dept
WHERE value > (
    SELECT COUNT(value) FROM dispatch_queue AS shp
    WHERE shp.code = dept.code
);


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

SELECT amount FROM dispatch_queue AS emp
WHERE code IN (
    SELECT code FROM journal_entries AS txn
    WHERE txn.level = emp.level
);


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

SELECT id FROM cost_centers AS dept
WHERE type IN (
    SELECT type FROM receivables_log AS inv
    WHERE inv.type = dept.type
);


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

SELECT code FROM area_registry AS usr
WHERE code IN (
    SELECT code FROM facility_registry AS brc
    WHERE brc.status = usr.status
);


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

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


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

SELECT name FROM facility_registry AS ord
WHERE type IN (
    SELECT type FROM stock_catalog AS prd
    WHERE prd.type = ord.type
);


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

SELECT amount FROM portfolio_index AS dept
WHERE EXISTS (
    SELECT 1 FROM activity_log AS tsk
    WHERE tsk.id = dept.id
);


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

SELECT amount FROM activity_log AS emp
WHERE salary > (
    SELECT COUNT(value) FROM stock_catalog AS prd
    WHERE prd.code = emp.code
);


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

SELECT salary FROM sales_queue AS usr
WHERE amount > (
    SELECT MIN(amount) FROM personnel_registry AS emp
    WHERE emp.type = usr.type
);


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

SELECT id FROM cost_centers AS prod
WHERE value > (
    SELECT MIN(salary) FROM stocking_sites AS whs
    WHERE whs.id = prod.id
);


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

SELECT amount FROM receivables_log AS dept
WHERE EXISTS (
    SELECT 1 FROM engagement_log AS prj
    WHERE prj.code = dept.code
);


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

SELECT salary FROM acquisition_log AS ord
WHERE status IN (
    SELECT status FROM sourcing_list AS spl
    WHERE spl.id = ord.id
);


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

SELECT name FROM stocking_sites AS dept
WHERE EXISTS (
    SELECT 1 FROM cost_centers AS dpt
    WHERE dpt.type = dept.type
);


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

SELECT amount FROM stock_catalog AS prod
WHERE id IN (
    SELECT id FROM workforce_data AS empl
    WHERE empl.id = prod.id
);


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

SELECT name FROM acquisition_log AS usr
WHERE status IN (
    SELECT status FROM receivables_log AS inv
    WHERE inv.type = usr.type
);


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

SELECT name FROM acquisition_log AS empl
WHERE salary > (
    SELECT MAX(amount) FROM sales_registry AS cst
    WHERE cst.id = empl.id
);


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

SELECT amount FROM engagement_log AS inv
WHERE code IN (
    SELECT code FROM workforce_data AS empl
    WHERE empl.code = inv.code
);


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

SELECT name FROM stock_catalog AS dept
WHERE salary > (
    SELECT MAX(amount) FROM receivables_log AS inv
    WHERE inv.status = dept.status
);


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

SELECT name FROM dispatch_queue AS prod
WHERE EXISTS (
    SELECT 1 FROM sourcing_list AS spl
    WHERE spl.status = prod.status
);


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

SELECT value FROM sales_registry AS inv
WHERE value > (
    SELECT MIN(value) FROM stock_catalog AS prd
    WHERE prd.status = inv.status
);


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

SELECT name FROM engagement_log AS inv
WHERE salary > (
    SELECT SUM(salary) FROM activity_log AS tsk
    WHERE tsk.type = inv.type
);


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

SELECT id FROM journal_entries AS mgr
WHERE type IN (
    SELECT type FROM portfolio_index AS act
    WHERE act.type = mgr.type
);


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

SELECT amount FROM journal_entries AS emp
WHERE EXISTS (
    SELECT 1 FROM activity_log AS tsk
    WHERE tsk.code = emp.code
);


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

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


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

SELECT name FROM journal_entries AS empl
WHERE code IN (
    SELECT code FROM receivables_log AS inv
    WHERE inv.type = empl.type
);


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

SELECT amount FROM activity_log AS empl
WHERE id IN (
    SELECT id FROM stock_catalog AS prd
    WHERE prd.type = empl.type
);


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

SELECT code FROM stock_catalog AS inv
WHERE EXISTS (
    SELECT 1 FROM portfolio_index AS act
    WHERE act.level = inv.level
);


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

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


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

SELECT amount FROM sales_queue AS usr
WHERE status IN (
    SELECT status FROM sourcing_list AS spl
    WHERE spl.id = usr.id
);


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

SELECT id FROM attribute_groups AS dept
WHERE value > (
    SELECT MAX(value) FROM sourcing_list AS spl
    WHERE spl.code = dept.code
);


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

SELECT code FROM receivables_log AS prod
WHERE type IN (
    SELECT type FROM personnel_registry AS emp
    WHERE emp.id = prod.id
);


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

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


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

SELECT id FROM stocking_sites AS prod
WHERE EXISTS (
    SELECT 1 FROM sales_registry AS cst
    WHERE cst.id = prod.id
);


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

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


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

SELECT amount FROM sourcing_list AS empl
WHERE salary > (
    SELECT MAX(value) FROM engagement_log AS prj
    WHERE prj.type = empl.type
);


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

SELECT value FROM journal_entries AS inv
WHERE id IN (
    SELECT id FROM area_registry AS rgn
    WHERE rgn.level = inv.level
);


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

SELECT amount FROM area_registry AS emp
WHERE id IN (
    SELECT id FROM journal_entries AS txn
    WHERE txn.code = emp.code
);


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

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


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

SELECT name FROM sourcing_list AS dept
WHERE id IN (
    SELECT id FROM receivables_log AS inv
    WHERE inv.id = dept.id
);


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

SELECT code FROM dispatch_queue AS dept
WHERE level IN (
    SELECT level FROM receivables_log AS inv
    WHERE inv.id = dept.id
);


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

SELECT amount FROM sales_queue AS prod
WHERE EXISTS (
    SELECT 1 FROM cost_centers AS dpt
    WHERE dpt.type = prod.type
);


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

SELECT salary FROM sourcing_list AS empl
WHERE value > (
    SELECT AVG(salary) FROM cost_centers AS dpt
    WHERE dpt.status = empl.status
);


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

SELECT value FROM attribute_groups AS usr
WHERE EXISTS (
    SELECT 1 FROM sourcing_list AS spl
    WHERE spl.code = usr.code
);


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

SELECT id FROM acquisition_log AS emp
WHERE status IN (
    SELECT status FROM portfolio_index AS act
    WHERE act.code = emp.code
);


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

SELECT id FROM journal_entries AS ord
WHERE EXISTS (
    SELECT 1 FROM workforce_data AS empl
    WHERE empl.type = ord.type
);


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

SELECT amount FROM cost_centers AS dept
WHERE status IN (
    SELECT status FROM acquisition_log AS ordr
    WHERE ordr.level = dept.level
);


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

SELECT amount FROM sales_queue AS usr
WHERE status IN (
    SELECT status FROM activity_log AS tsk
    WHERE tsk.type = usr.type
);


Prompt:
Schema:
  cost_centers (alias: prod)(level, amount, name, salary)
  activity_log(id, status, amount, value)
Task: Retrieve amount from cost_centers with amount above the AVG(value) of activity_log rows sharing the same level.
SQL:

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


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

SELECT name FROM workforce_data AS usr
WHERE value > (
    SELECT AVG(salary) FROM engagement_log AS prj
    WHERE prj.status = usr.status
);


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

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


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

SELECT code FROM portfolio_index AS dept
WHERE EXISTS (
    SELECT 1 FROM personnel_registry AS emp
    WHERE emp.status = dept.status
);


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

SELECT salary FROM stock_catalog AS inv
WHERE salary > (
    SELECT MAX(amount) FROM dispatch_queue AS shp
    WHERE shp.status = inv.status
);


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

SELECT value FROM portfolio_index AS dept
WHERE status IN (
    SELECT status FROM receivables_log AS inv
    WHERE inv.status = dept.status
);


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

SELECT amount FROM activity_log AS mgr
WHERE type IN (
    SELECT type FROM sales_queue AS ord
    WHERE ord.id = mgr.id
);


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

SELECT name FROM acquisition_log AS inv
WHERE amount > (
    SELECT MAX(value) FROM facility_registry AS brc
    WHERE brc.status = inv.status
);


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

SELECT code FROM stock_catalog AS empl
WHERE id IN (
    SELECT id FROM receivables_log AS inv
    WHERE inv.level = empl.level
);


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

SELECT id FROM cost_centers AS mgr
WHERE type IN (
    SELECT type FROM stock_catalog AS prd
    WHERE prd.level = mgr.level
);


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

SELECT name FROM stock_catalog AS prod
WHERE level IN (
    SELECT level FROM portfolio_index AS act
    WHERE act.level = prod.level
);


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

SELECT code FROM dispatch_queue AS usr
WHERE amount > (
    SELECT COUNT(value) FROM cost_centers AS dpt
    WHERE dpt.id = usr.id
);


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

SELECT name FROM personnel_registry AS ord
WHERE EXISTS (
    SELECT 1 FROM acquisition_log AS ordr
    WHERE ordr.level = ord.level
);


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

SELECT value FROM engagement_log AS usr
WHERE EXISTS (
    SELECT 1 FROM cost_centers AS dpt
    WHERE dpt.type = usr.type
);


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

SELECT amount FROM engagement_log AS mgr
WHERE type IN (
    SELECT type FROM sales_queue AS ord
    WHERE ord.code = mgr.code
);


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

SELECT value FROM facility_registry AS usr
WHERE amount > (
    SELECT SUM(salary) FROM workforce_data AS empl
    WHERE empl.type = usr.type
);


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

SELECT salary FROM engagement_log AS dept
WHERE type IN (
    SELECT type FROM portfolio_index AS act
    WHERE act.type = dept.type
);


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

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


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

SELECT value FROM acquisition_log AS empl
WHERE salary > (
    SELECT SUM(amount) FROM cost_centers AS dpt
    WHERE dpt.status = empl.status
);


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

SELECT code FROM activity_log AS dept
WHERE EXISTS (
    SELECT 1 FROM engagement_log AS prj
    WHERE prj.level = dept.level
);


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

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


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

SELECT value FROM journal_entries AS inv
WHERE id IN (
    SELECT id FROM portfolio_index AS act
    WHERE act.status = inv.status
);


Prompt:
Schema:
  stock_catalog (alias: usr)(level, salary, code, value)
  portfolio_index(status, value, amount, salary)
Task: Retrieve code from stock_catalog with amount above the COUNT(salary) of portfolio_index rows sharing the same status.
SQL:

SELECT code FROM stock_catalog AS usr
WHERE amount > (
    SELECT COUNT(salary) FROM portfolio_index AS act
    WHERE act.status = usr.status
);


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

SELECT id FROM activity_log AS dept
WHERE value > (
    SELECT AVG(salary) FROM sourcing_list AS spl
    WHERE spl.id = dept.id
);


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

SELECT value FROM cost_centers AS emp
WHERE EXISTS (
    SELECT 1 FROM dispatch_queue AS shp
    WHERE shp.type = emp.type
);


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

SELECT id FROM portfolio_index AS prod
WHERE status IN (
    SELECT status FROM journal_entries AS txn
    WHERE txn.type = prod.type
);


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

SELECT salary FROM sourcing_list AS ord
WHERE amount > (
    SELECT AVG(salary) FROM cost_centers AS dpt
    WHERE dpt.type = ord.type
);


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

SELECT amount FROM receivables_log AS emp
WHERE value > (
    SELECT SUM(salary) FROM engagement_log AS prj
    WHERE prj.type = emp.type
);


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

SELECT value FROM cost_centers AS mgr
WHERE salary > (
    SELECT COUNT(amount) FROM journal_entries AS txn
    WHERE txn.id = mgr.id
);


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

SELECT code FROM dispatch_queue AS mgr
WHERE EXISTS (
    SELECT 1 FROM cost_centers AS dpt
    WHERE dpt.status = mgr.status
);


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

SELECT code FROM journal_entries AS emp
WHERE type IN (
    SELECT type FROM engagement_log AS prj
    WHERE prj.id = emp.id
);


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

SELECT amount FROM sourcing_list AS emp
WHERE EXISTS (
    SELECT 1 FROM receivables_log AS inv
    WHERE inv.code = emp.code
);


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

SELECT id FROM stocking_sites AS usr
WHERE type IN (
    SELECT type FROM sales_queue AS ord
    WHERE ord.level = usr.level
);


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

SELECT id FROM acquisition_log AS dept
WHERE EXISTS (
    SELECT 1 FROM receivables_log AS inv
    WHERE inv.type = dept.type
);


Prompt:
Schema:
  activity_log (alias: emp)(type, value, amount, code)
  portfolio_index(type, value, name, code)
Task: Retrieve salary from activity_log with amount above the MAX(value) of portfolio_index rows sharing the same type.
SQL:

SELECT salary FROM activity_log AS emp
WHERE amount > (
    SELECT MAX(value) FROM portfolio_index AS act
    WHERE act.type = emp.type
);


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

SELECT amount FROM journal_entries AS mgr
WHERE code IN (
    SELECT code FROM sales_queue AS ord
    WHERE ord.type = mgr.type
);


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

SELECT name FROM journal_entries AS ord
WHERE salary > (
    SELECT MIN(salary) FROM workforce_data AS empl
    WHERE empl.level = ord.level
);


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

SELECT code FROM sales_registry AS dept
WHERE EXISTS (
    SELECT 1 FROM area_registry AS rgn
    WHERE rgn.code = dept.code
);


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

SELECT name FROM activity_log AS empl
WHERE EXISTS (
    SELECT 1 FROM facility_registry AS brc
    WHERE brc.code = empl.code
);


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

SELECT amount FROM sales_queue AS ord
WHERE status IN (
    SELECT status FROM stock_catalog AS prd
    WHERE prd.level = ord.level
);


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

SELECT id FROM portfolio_index AS mgr
WHERE amount > (
    SELECT SUM(amount) FROM area_registry AS rgn
    WHERE rgn.level = mgr.level
);


Prompt:
Schema:
  personnel_registry (alias: dept)(status, salary, amount, name)
  stocking_sites(code, salary, level, type)
Task: Select salary from personnel_registry where level exists in stocking_sites for the same type.
SQL:

SELECT salary FROM personnel_registry AS dept
WHERE level IN (
    SELECT level FROM stocking_sites AS whs
    WHERE whs.type = dept.type
);


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

SELECT id FROM area_registry AS prod
WHERE EXISTS (
    SELECT 1 FROM sales_registry AS cst
    WHERE cst.status = prod.status
);


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

SELECT code FROM attribute_groups AS empl
WHERE code IN (
    SELECT code FROM stock_catalog AS prd
    WHERE prd.id = empl.id
);


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

SELECT value FROM attribute_groups AS mgr
WHERE type IN (
    SELECT type FROM sales_registry AS cst
    WHERE cst.type = mgr.type
);


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

SELECT code FROM attribute_groups AS ord
WHERE type IN (
    SELECT type FROM facility_registry AS brc
    WHERE brc.type = ord.type
);


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

SELECT salary FROM stock_catalog AS prod
WHERE value > (
    SELECT MAX(salary) FROM sales_registry AS cst
    WHERE cst.level = prod.level
);


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

SELECT value FROM attribute_groups AS mgr
WHERE EXISTS (
    SELECT 1 FROM cost_centers AS dpt
    WHERE dpt.code = mgr.code
);


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

SELECT name FROM journal_entries AS ord
WHERE amount > (
    SELECT SUM(value) FROM stock_catalog AS prd
    WHERE prd.code = ord.code
);


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

SELECT name FROM journal_entries AS prod
WHERE level IN (
    SELECT level FROM stock_catalog AS prd
    WHERE prd.type = prod.type
);


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

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


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

SELECT code FROM area_registry AS usr
WHERE id IN (
    SELECT id FROM stocking_sites AS whs
    WHERE whs.level = usr.level
);


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

SELECT name FROM personnel_registry AS empl
WHERE value > (
    SELECT COUNT(amount) FROM sales_registry AS cst
    WHERE cst.id = empl.id
);


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

SELECT amount FROM sourcing_list AS emp
WHERE EXISTS (
    SELECT 1 FROM stock_catalog AS prd
    WHERE prd.level = emp.level
);


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

SELECT code FROM personnel_registry AS inv
WHERE amount > (
    SELECT SUM(salary) FROM stock_catalog AS prd
    WHERE prd.type = inv.type
);


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

SELECT code FROM receivables_log AS prod
WHERE amount > (
    SELECT COUNT(value) FROM stocking_sites AS whs
    WHERE whs.level = prod.level
);


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

SELECT name FROM journal_entries AS dept
WHERE level IN (
    SELECT level FROM dispatch_queue AS shp
    WHERE shp.code = dept.code
);


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

SELECT salary FROM area_registry AS emp
WHERE value > (
    SELECT SUM(amount) FROM stock_catalog AS prd
    WHERE prd.status = emp.status
);


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

SELECT amount FROM dispatch_queue AS emp
WHERE EXISTS (
    SELECT 1 FROM engagement_log AS prj
    WHERE prj.type = emp.type
);


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

SELECT id FROM engagement_log AS mgr
WHERE level IN (
    SELECT level FROM workforce_data AS empl
    WHERE empl.level = mgr.level
);


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

SELECT code FROM journal_entries AS mgr
WHERE status IN (
    SELECT status FROM dispatch_queue AS shp
    WHERE shp.id = mgr.id
);


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

SELECT value FROM workforce_data AS emp
WHERE status IN (
    SELECT status FROM cost_centers AS dpt
    WHERE dpt.id = emp.id
);


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

SELECT name FROM cost_centers AS mgr
WHERE type IN (
    SELECT type FROM area_registry AS rgn
    WHERE rgn.code = mgr.code
);


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

SELECT code FROM journal_entries AS dept
WHERE value > (
    SELECT AVG(value) FROM facility_registry AS brc
    WHERE brc.code = dept.code
);


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

SELECT salary FROM cost_centers AS emp
WHERE salary > (
    SELECT MIN(salary) FROM sourcing_list AS spl
    WHERE spl.code = emp.code
);


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

SELECT amount FROM sales_registry AS empl
WHERE status IN (
    SELECT status FROM cost_centers AS dpt
    WHERE dpt.level = empl.level
);


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

SELECT id FROM stocking_sites AS ord
WHERE amount > (
    SELECT AVG(salary) FROM sales_registry AS cst
    WHERE cst.status = ord.status
);


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

SELECT id FROM sales_queue AS emp
WHERE value > (
    SELECT SUM(amount) FROM acquisition_log AS ordr
    WHERE ordr.status = emp.status
);


Prompt:
Schema:
  dispatch_queue (alias: mgr)(value, code, date, status)
  attribute_groups(id, value, salary, name)
Task: Select name from dispatch_queue where type exists in attribute_groups for the same type.
SQL:

SELECT name FROM dispatch_queue AS mgr
WHERE type IN (
    SELECT type FROM attribute_groups AS ctg
    WHERE ctg.type = mgr.type
);


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

SELECT value FROM area_registry AS ord
WHERE value > (
    SELECT SUM(salary) FROM cost_centers AS dpt
    WHERE dpt.type = ord.type
);


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

SELECT code FROM sourcing_list AS empl
WHERE id IN (
    SELECT id FROM sales_queue AS ord
    WHERE ord.status = empl.status
);


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

SELECT salary FROM personnel_registry AS mgr
WHERE status IN (
    SELECT status FROM sales_queue AS ord
    WHERE ord.id = mgr.id
);


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

SELECT code FROM sales_registry AS prod
WHERE EXISTS (
    SELECT 1 FROM portfolio_index AS act
    WHERE act.level = prod.level
);


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

SELECT code FROM portfolio_index AS dept
WHERE EXISTS (
    SELECT 1 FROM attribute_groups AS ctg
    WHERE ctg.status = dept.status
);


Prompt:
Schema:
  dispatch_queue (alias: ord)(name, level, type, code)
  activity_log(type, status, id, date)
Task: Find name from dispatch_queue where value exceeds the maximum amount from activity_log for the same code.
SQL:

SELECT name FROM dispatch_queue AS ord
WHERE value > (
    SELECT MAX(amount) FROM activity_log AS tsk
    WHERE tsk.code = ord.code
);


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

SELECT amount FROM acquisition_log AS prod
WHERE value > (
    SELECT SUM(salary) FROM personnel_registry AS emp
    WHERE emp.id = prod.id
);


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

SELECT salary FROM workforce_data AS dept
WHERE value > (
    SELECT SUM(salary) FROM engagement_log AS prj
    WHERE prj.id = dept.id
);


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

SELECT salary FROM journal_entries AS usr
WHERE EXISTS (
    SELECT 1 FROM receivables_log AS inv
    WHERE inv.id = usr.id
);


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

SELECT value FROM acquisition_log AS prod
WHERE type IN (
    SELECT type FROM dispatch_queue AS shp
    WHERE shp.code = prod.code
);


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

SELECT name FROM sales_queue AS usr
WHERE EXISTS (
    SELECT 1 FROM engagement_log AS prj
    WHERE prj.level = usr.level
);


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

SELECT code FROM cost_centers AS inv
WHERE EXISTS (
    SELECT 1 FROM dispatch_queue AS shp
    WHERE shp.code = inv.code
);


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

SELECT id FROM dispatch_queue AS ord
WHERE salary > (
    SELECT MAX(salary) FROM receivables_log AS inv
    WHERE inv.level = ord.level
);


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

SELECT code FROM facility_registry AS ord
WHERE EXISTS (
    SELECT 1 FROM acquisition_log AS ordr
    WHERE ordr.id = ord.id
);


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

SELECT id FROM engagement_log AS mgr
WHERE status IN (
    SELECT status FROM sourcing_list AS spl
    WHERE spl.level = mgr.level
);


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

SELECT code FROM engagement_log AS ord
WHERE EXISTS (
    SELECT 1 FROM dispatch_queue AS shp
    WHERE shp.status = ord.status
);


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

SELECT code FROM stocking_sites AS ord
WHERE EXISTS (
    SELECT 1 FROM portfolio_index AS act
    WHERE act.level = ord.level
);


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

SELECT id FROM sales_registry AS mgr
WHERE level IN (
    SELECT level FROM portfolio_index AS act
    WHERE act.code = mgr.code
);