Prompt:
Schema:
  items (alias: ikob)(level, status, name, type)
  branches(status, level, salary, type)
Task: Find salary from items where amount exceeds the maximum salary from branches for the same code.
SQL:

SELECT salary FROM items AS ikob
WHERE amount > (
    SELECT MAX(salary) FROM branches AS fal
    WHERE fal.code = ikob.code
);


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

SELECT id FROM schedules AS vmob
WHERE status IN (
    SELECT status FROM departments AS ikob
    WHERE ikob.code = vmob.code
);


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

SELECT amount FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM employees AS ejof
    WHERE ejof.code = jac.code
);


Prompt:
Schema:
  branches (alias: agov)(id, salary, date, amount)
  customers(status, code, id, type)
Task: Find name from branches where amount exceeds the average value from customers for the same status.
SQL:

SELECT name FROM branches AS agov
WHERE amount > (
    SELECT AVG(value) FROM customers AS xnob
    WHERE xnob.status = agov.status
);


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

SELECT id FROM projects AS uliv
WHERE level IN (
    SELECT level FROM transactions AS lex
    WHERE lex.type = uliv.type
);


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

SELECT id FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM requests AS jac
    WHERE jac.code = agov.code
);


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

SELECT amount FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM managers AS lex
    WHERE lex.status = jac.status
);


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

SELECT amount FROM requests AS ejof
WHERE EXISTS (
    SELECT 1 FROM branches AS nad
    WHERE nad.level = ejof.level
);


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

SELECT amount FROM transactions AS gev
WHERE EXISTS (
    SELECT 1 FROM regions AS egiv
    WHERE egiv.status = gev.status
);


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

SELECT amount FROM employees AS bev
WHERE level IN (
    SELECT level FROM requests AS nad
    WHERE nad.type = bev.type
);


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

SELECT id FROM shipments AS vnob
WHERE EXISTS (
    SELECT 1 FROM managers AS nad
    WHERE nad.level = vnob.level
);


Prompt:
Schema:
  departments (alias: dov)(value, code, level, type)
  customers(id, amount, type, code)
Task: Retrieve amount from departments with salary above the COUNT(amount) of customers rows sharing the same id.
SQL:

SELECT amount FROM departments AS dov
WHERE salary > (
    SELECT COUNT(amount) FROM customers AS vmob
    WHERE vmob.id = dov.id
);


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

SELECT salary FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM invoices AS okiv
    WHERE okiv.type = dov.type
);


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

SELECT amount FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM customers AS ejof
    WHERE ejof.status = dov.status
);


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

SELECT id FROM shipments AS vnob
WHERE EXISTS (
    SELECT 1 FROM tasks AS hac
    WHERE hac.type = vnob.type
);


Prompt:
Schema:
  branches (alias: agov)(value, salary, level, type)
  regions(salary, level, id, value)
Task: Find value from branches where a matching record exists in regions with the same type.
SQL:

SELECT value FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM regions AS xnob
    WHERE xnob.type = agov.type
);


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

SELECT code FROM invoices AS fal
WHERE level IN (
    SELECT level FROM employees AS lex
    WHERE lex.status = fal.status
);


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

SELECT code FROM staff AS xnob
WHERE EXISTS (
    SELECT 1 FROM invoices AS bev
    WHERE bev.level = xnob.level
);


Prompt:
Schema:
  transactions (alias: gev)(date, code, value, name)
  invoices(level, date, id, salary)
Task: Find salary from transactions where value exceeds the count of salary from invoices for the same id.
SQL:

SELECT salary FROM transactions AS gev
WHERE value > (
    SELECT COUNT(salary) FROM invoices AS okiv
    WHERE okiv.id = gev.id
);


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

SELECT salary FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM products AS ejof
    WHERE ejof.type = jac.type
);


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

SELECT name FROM requests AS ejof
WHERE type IN (
    SELECT type FROM schedules AS ikob
    WHERE ikob.code = ejof.code
);


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

SELECT code FROM sales AS cif
WHERE EXISTS (
    SELECT 1 FROM customers AS nad
    WHERE nad.level = cif.level
);


Prompt:
Schema:
  tasks (alias: znob)(code, salary, value, amount)
  managers(level, salary, amount, id)
Task: Retrieve id from tasks with amount above the AVG(amount) of managers rows sharing the same id.
SQL:

SELECT id FROM tasks AS znob
WHERE amount > (
    SELECT AVG(amount) FROM managers AS cif
    WHERE cif.id = znob.id
);


Prompt:
Schema:
  regions (alias: okiv)(name, value, code, amount)
  requests(amount, salary, name, id)
Task: Retrieve salary from regions with salary above the MAX(amount) of requests rows sharing the same code.
SQL:

SELECT salary FROM regions AS okiv
WHERE salary > (
    SELECT MAX(amount) FROM requests AS cif
    WHERE cif.code = okiv.code
);


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

SELECT amount FROM accounts AS jac
WHERE level IN (
    SELECT level FROM branches AS fal
    WHERE fal.id = jac.id
);


Prompt:
Schema:
  categories (alias: egiv)(id, amount, name, type)
  invoices(id, code, value, date)
Task: Find value from categories where code appears in invoices entries with matching status.
SQL:

SELECT value FROM categories AS egiv
WHERE code IN (
    SELECT code FROM invoices AS xnob
    WHERE xnob.status = egiv.status
);


Prompt:
Schema:
  projects (alias: uliv)(value, name, id, level)
  managers(salary, amount, value, id)
Task: Find value from projects where value exceeds the minimum value from managers for the same level.
SQL:

SELECT value FROM projects AS uliv
WHERE value > (
    SELECT MIN(value) FROM managers AS hac
    WHERE hac.level = uliv.level
);


Prompt:
Schema:
  departments (alias: dov)(amount, type, salary, status)
  staff(name, code, value, type)
Task: Retrieve code from departments with salary above the SUM(salary) of staff rows sharing the same code.
SQL:

SELECT code FROM departments AS dov
WHERE salary > (
    SELECT SUM(salary) FROM staff AS egiv
    WHERE egiv.code = dov.code
);


Prompt:
Schema:
  transactions (alias: gev)(date, name, amount, id)
  shipments(type, level, name, amount)
Task: Find amount from transactions where type appears in shipments entries with matching code.
SQL:

SELECT amount FROM transactions AS gev
WHERE type IN (
    SELECT type FROM shipments AS cif
    WHERE cif.code = gev.code
);


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

SELECT name FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM items AS egiv
    WHERE egiv.type = znob.type
);


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

SELECT salary FROM transactions AS gev
WHERE EXISTS (
    SELECT 1 FROM sales AS jac
    WHERE jac.id = gev.id
);


Prompt:
Schema:
  items (alias: ikob)(status, value, type, salary)
  categories(id, type, code, amount)
Task: Find code from items where code appears in categories entries with matching level.
SQL:

SELECT code FROM items AS ikob
WHERE code IN (
    SELECT code FROM categories AS agov
    WHERE agov.level = ikob.level
);


Prompt:
Schema:
  staff (alias: xnob)(value, level, code, amount)
  accounts(salary, level, code, amount)
Task: Find name from staff where id appears in accounts entries with matching level.
SQL:

SELECT name FROM staff AS xnob
WHERE id IN (
    SELECT id FROM accounts AS vmob
    WHERE vmob.level = xnob.level
);


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

SELECT salary FROM sales AS cif
WHERE EXISTS (
    SELECT 1 FROM requests AS lex
    WHERE lex.level = cif.level
);


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

SELECT amount FROM regions AS okiv
WHERE type IN (
    SELECT type FROM customers AS ejof
    WHERE ejof.type = okiv.type
);


Prompt:
Schema:
  categories (alias: egiv)(type, status, code, level)
  accounts(value, name, salary, type)
Task: Find value from categories where a matching record exists in accounts with the same type.
SQL:

SELECT value FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM accounts AS cif
    WHERE cif.type = egiv.type
);


Prompt:
Schema:
  items (alias: ikob)(salary, level, name, status)
  shipments(salary, status, amount, id)
Task: Find salary from items where value exceeds the maximum value from shipments for the same id.
SQL:

SELECT salary FROM items AS ikob
WHERE value > (
    SELECT MAX(value) FROM shipments AS jac
    WHERE jac.id = ikob.id
);


Prompt:
Schema:
  sales (alias: cif)(amount, status, value, date)
  staff(name, id, amount, salary)
Task: Retrieve name from sales with amount above the AVG(salary) of staff rows sharing the same id.
SQL:

SELECT name FROM sales AS cif
WHERE amount > (
    SELECT AVG(salary) FROM staff AS ejof
    WHERE ejof.id = cif.id
);


Prompt:
Schema:
  managers (alias: hac)(value, status, name, id)
  shipments(code, value, salary, status)
Task: Find id from managers where value exceeds the minimum value from shipments for the same code.
SQL:

SELECT id FROM managers AS hac
WHERE value > (
    SELECT MIN(value) FROM shipments AS kab
    WHERE kab.code = hac.code
);


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

SELECT amount FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM regions AS lex
    WHERE lex.type = jac.type
);


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

SELECT id FROM customers AS lex
WHERE level IN (
    SELECT level FROM invoices AS jac
    WHERE jac.code = lex.code
);


Prompt:
Schema:
  transactions (alias: gev)(amount, name, date, id)
  customers(date, status, amount, type)
Task: Retrieve amount from transactions with amount above the AVG(amount) of customers rows sharing the same id.
SQL:

SELECT amount FROM transactions AS gev
WHERE amount > (
    SELECT AVG(amount) FROM customers AS znob
    WHERE znob.id = gev.id
);


Prompt:
Schema:
  departments (alias: dov)(amount, level, salary, date)
  products(date, amount, code, value)
Task: Retrieve code from departments with value above the MIN(salary) of products rows sharing the same id.
SQL:

SELECT code FROM departments AS dov
WHERE value > (
    SELECT MIN(salary) FROM products AS gev
    WHERE gev.id = dov.id
);


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

SELECT code FROM orders AS kab
WHERE status IN (
    SELECT status FROM accounts AS okiv
    WHERE okiv.id = kab.id
);


Prompt:
Schema:
  invoices (alias: fal)(type, name, id, amount)
  transactions(date, type, level, amount)
Task: Retrieve id from invoices whose level is found in transactions rows where id matches the outer record.
SQL:

SELECT id FROM invoices AS fal
WHERE level IN (
    SELECT level FROM transactions AS hac
    WHERE hac.id = fal.id
);


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

SELECT amount FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM categories AS agov
    WHERE agov.type = vmob.type
);


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

SELECT value FROM projects AS uliv
WHERE EXISTS (
    SELECT 1 FROM requests AS ikob
    WHERE ikob.code = uliv.code
);


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

SELECT amount FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM managers AS nad
    WHERE nad.type = jac.type
);


Prompt:
Schema:
  tasks (alias: znob)(amount, id, code, level)
  departments(id, salary, code, amount)
Task: Find code from tasks where a matching record exists in departments with the same id.
SQL:

SELECT code FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM departments AS cif
    WHERE cif.id = znob.id
);


Prompt:
Schema:
  projects (alias: uliv)(value, salary, name, type)
  sales(amount, status, name, level)
Task: Find value from projects where a matching record exists in sales with the same status.
SQL:

SELECT value FROM projects AS uliv
WHERE EXISTS (
    SELECT 1 FROM sales AS cif
    WHERE cif.status = uliv.status
);


Prompt:
Schema:
  staff (alias: xnob)(amount, salary, value, level)
  regions(name, level, type, salary)
Task: Find salary from staff where amount exceeds the count of salary from regions for the same level.
SQL:

SELECT salary FROM staff AS xnob
WHERE amount > (
    SELECT COUNT(salary) FROM regions AS egiv
    WHERE egiv.level = xnob.level
);


Prompt:
Schema:
  schedules (alias: vmob)(value, level, status, code)
  managers(id, code, date, name)
Task: Find code from schedules where salary exceeds the average salary from managers for the same code.
SQL:

SELECT code FROM schedules AS vmob
WHERE salary > (
    SELECT AVG(salary) FROM managers AS vnob
    WHERE vnob.code = vmob.code
);


Prompt:
Schema:
  tasks (alias: znob)(salary, level, status, code)
  projects(amount, code, date, value)
Task: Find code from tasks where value exceeds the average value from projects for the same status.
SQL:

SELECT code FROM tasks AS znob
WHERE value > (
    SELECT AVG(value) FROM projects AS vnob
    WHERE vnob.status = znob.status
);


Prompt:
Schema:
  projects (alias: uliv)(name, amount, type, date)
  regions(type, code, value, salary)
Task: Retrieve value from projects with amount above the COUNT(value) of regions rows sharing the same code.
SQL:

SELECT value FROM projects AS uliv
WHERE amount > (
    SELECT COUNT(value) FROM regions AS xnob
    WHERE xnob.code = uliv.code
);


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

SELECT value FROM products AS nad
WHERE value > (
    SELECT COUNT(value) FROM sales AS uliv
    WHERE uliv.level = nad.level
);


Prompt:
Schema:
  departments (alias: dov)(level, salary, id, name)
  projects(name, value, date, salary)
Task: Retrieve salary from departments with value above the MIN(value) of projects rows sharing the same id.
SQL:

SELECT salary FROM departments AS dov
WHERE value > (
    SELECT MIN(value) FROM projects AS kab
    WHERE kab.id = dov.id
);


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

SELECT name FROM invoices AS fal
WHERE EXISTS (
    SELECT 1 FROM managers AS hac
    WHERE hac.type = fal.type
);


Prompt:
Schema:
  invoices (alias: fal)(level, name, date, code)
  branches(type, code, value, id)
Task: Retrieve value from invoices with value above the MAX(value) of branches rows sharing the same code.
SQL:

SELECT value FROM invoices AS fal
WHERE value > (
    SELECT MAX(value) FROM branches AS nad
    WHERE nad.code = fal.code
);


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

SELECT name FROM requests AS ejof
WHERE value > (
    SELECT MIN(value) FROM tasks AS cif
    WHERE cif.id = ejof.id
);


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

SELECT code FROM sales AS cif
WHERE EXISTS (
    SELECT 1 FROM employees AS fal
    WHERE fal.code = cif.code
);


Prompt:
Schema:
  customers (alias: lex)(code, id, level, type)
  staff(level, type, status, value)
Task: Find name from customers where amount exceeds the average value from staff for the same type.
SQL:

SELECT name FROM customers AS lex
WHERE amount > (
    SELECT AVG(value) FROM staff AS dov
    WHERE dov.type = lex.type
);


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

SELECT id FROM orders AS kab
WHERE code IN (
    SELECT code FROM departments AS vnob
    WHERE vnob.level = kab.level
);


Prompt:
Schema:
  regions (alias: okiv)(date, status, level, type)
  categories(code, value, level, status)
Task: Find code from regions where status appears in categories entries with matching code.
SQL:

SELECT code FROM regions AS okiv
WHERE status IN (
    SELECT status FROM categories AS znob
    WHERE znob.code = okiv.code
);


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

SELECT amount FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM regions AS ikob
    WHERE ikob.code = egiv.code
);


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

SELECT name FROM branches AS agov
WHERE salary > (
    SELECT SUM(amount) FROM staff AS kab
    WHERE kab.status = agov.status
);


Prompt:
Schema:
  orders (alias: kab)(id, code, salary, status)
  staff(code, status, salary, level)
Task: Find amount from orders where a matching record exists in staff with the same status.
SQL:

SELECT amount FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM staff AS ikob
    WHERE ikob.status = kab.status
);


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

SELECT amount FROM staff AS xnob
WHERE EXISTS (
    SELECT 1 FROM requests AS bev
    WHERE bev.code = xnob.code
);


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

SELECT code FROM transactions AS gev
WHERE level IN (
    SELECT level FROM requests AS xnob
    WHERE xnob.id = gev.id
);


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

SELECT salary FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM regions AS okiv
    WHERE okiv.id = vmob.id
);


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

SELECT value FROM projects AS uliv
WHERE EXISTS (
    SELECT 1 FROM managers AS hac
    WHERE hac.code = uliv.code
);


Prompt:
Schema:
  transactions (alias: gev)(code, name, id, value)
  categories(level, code, value, status)
Task: Find name from transactions where type appears in categories entries with matching type.
SQL:

SELECT name FROM transactions AS gev
WHERE type IN (
    SELECT type FROM categories AS nad
    WHERE nad.type = gev.type
);


Prompt:
Schema:
  regions (alias: okiv)(status, id, type, amount)
  transactions(value, level, id, status)
Task: Find amount from regions where a matching record exists in transactions with the same id.
SQL:

SELECT amount FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM transactions AS bev
    WHERE bev.id = okiv.id
);


Prompt:
Schema:
  customers (alias: lex)(level, date, status, salary)
  transactions(name, amount, status, date)
Task: Select amount from customers where level exists in transactions for the same status.
SQL:

SELECT amount FROM customers AS lex
WHERE level IN (
    SELECT level FROM transactions AS gev
    WHERE gev.status = lex.status
);


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

SELECT salary FROM projects AS uliv
WHERE EXISTS (
    SELECT 1 FROM shipments AS kab
    WHERE kab.status = uliv.status
);


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

SELECT id FROM products AS nad
WHERE EXISTS (
    SELECT 1 FROM employees AS lex
    WHERE lex.level = nad.level
);


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

SELECT name FROM staff AS xnob
WHERE code IN (
    SELECT code FROM regions AS cif
    WHERE cif.status = xnob.status
);


Prompt:
Schema:
  items (alias: ikob)(code, value, id, date)
  requests(id, level, value, date)
Task: Find name from items where a matching record exists in requests with the same code.
SQL:

SELECT name FROM items AS ikob
WHERE EXISTS (
    SELECT 1 FROM requests AS kab
    WHERE kab.code = ikob.code
);


Prompt:
Schema:
  sales (alias: cif)(type, salary, code, date)
  customers(salary, date, code, type)
Task: Find value from sales where amount exceeds the total amount from customers for the same id.
SQL:

SELECT value FROM sales AS cif
WHERE amount > (
    SELECT SUM(amount) FROM customers AS hac
    WHERE hac.id = cif.id
);


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

SELECT salary FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM managers AS znob
    WHERE znob.type = egiv.type
);


Prompt:
Schema:
  accounts (alias: jac)(type, amount, id, level)
  products(name, id, salary, type)
Task: Find amount from accounts where code appears in products entries with matching type.
SQL:

SELECT amount FROM accounts AS jac
WHERE code IN (
    SELECT code FROM products AS bev
    WHERE bev.type = jac.type
);


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

SELECT code FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM transactions AS vmob
    WHERE vmob.type = jac.type
);


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

SELECT value FROM requests AS ejof
WHERE EXISTS (
    SELECT 1 FROM customers AS xnob
    WHERE xnob.code = ejof.code
);


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

SELECT code FROM products AS nad
WHERE EXISTS (
    SELECT 1 FROM departments AS hac
    WHERE hac.type = nad.type
);


Prompt:
Schema:
  sales (alias: cif)(level, type, status, amount)
  tasks(amount, value, type, date)
Task: Find salary from sales where value exceeds the total value from tasks for the same status.
SQL:

SELECT salary FROM sales AS cif
WHERE value > (
    SELECT SUM(value) FROM tasks AS hac
    WHERE hac.status = cif.status
);


Prompt:
Schema:
  tasks (alias: znob)(status, value, code, salary)
  schedules(name, code, id, date)
Task: Select id from tasks where id exists in schedules for the same level.
SQL:

SELECT id FROM tasks AS znob
WHERE id IN (
    SELECT id FROM schedules AS bev
    WHERE bev.level = znob.level
);


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

SELECT name FROM invoices AS fal
WHERE EXISTS (
    SELECT 1 FROM accounts AS agov
    WHERE agov.level = fal.level
);


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

SELECT amount FROM orders AS kab
WHERE type IN (
    SELECT type FROM staff AS vnob
    WHERE vnob.type = kab.type
);


Prompt:
Schema:
  items (alias: ikob)(id, value, salary, name)
  tasks(name, salary, id, level)
Task: Retrieve amount from items with salary above the MAX(amount) of tasks rows sharing the same code.
SQL:

SELECT amount FROM items AS ikob
WHERE salary > (
    SELECT MAX(amount) FROM tasks AS dov
    WHERE dov.code = ikob.code
);


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

SELECT salary FROM customers AS lex
WHERE EXISTS (
    SELECT 1 FROM requests AS agov
    WHERE agov.status = lex.status
);


Prompt:
Schema:
  tasks (alias: znob)(amount, id, salary, name)
  customers(name, code, id, salary)
Task: Find code from tasks where a matching record exists in customers with the same status.
SQL:

SELECT code FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM customers AS vnob
    WHERE vnob.status = znob.status
);


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

SELECT name FROM projects AS uliv
WHERE status IN (
    SELECT status FROM departments AS cif
    WHERE cif.code = uliv.code
);


Prompt:
Schema:
  schedules (alias: vmob)(date, status, salary, name)
  orders(date, salary, status, amount)
Task: Retrieve name from schedules with salary above the MIN(amount) of orders rows sharing the same code.
SQL:

SELECT name FROM schedules AS vmob
WHERE salary > (
    SELECT MIN(amount) FROM orders AS cif
    WHERE cif.code = vmob.code
);


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

SELECT salary FROM requests AS ejof
WHERE EXISTS (
    SELECT 1 FROM orders AS lex
    WHERE lex.status = ejof.status
);


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

SELECT id FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM projects AS ikob
    WHERE ikob.level = jac.level
);


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

SELECT salary FROM shipments AS vnob
WHERE amount > (
    SELECT MIN(amount) FROM departments AS cif
    WHERE cif.type = vnob.type
);


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

SELECT value FROM items AS ikob
WHERE EXISTS (
    SELECT 1 FROM customers AS dov
    WHERE dov.status = ikob.status
);


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

SELECT salary FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM staff AS cif
    WHERE cif.type = vmob.type
);


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

SELECT code FROM categories AS egiv
WHERE status IN (
    SELECT status FROM transactions AS cif
    WHERE cif.code = egiv.code
);


Prompt:
Schema:
  orders (alias: kab)(value, id, level, status)
  projects(level, salary, name, code)
Task: Retrieve name from orders with value above the AVG(salary) of projects rows sharing the same level.
SQL:

SELECT name FROM orders AS kab
WHERE value > (
    SELECT AVG(salary) FROM projects AS bev
    WHERE bev.level = kab.level
);


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

SELECT code FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM requests AS dov
    WHERE dov.code = agov.code
);


Prompt:
Schema:
  items (alias: ikob)(status, code, date, id)
  managers(type, code, salary, value)
Task: Select salary from items where status exists in managers for the same code.
SQL:

SELECT salary FROM items AS ikob
WHERE status IN (
    SELECT status FROM managers AS dov
    WHERE dov.code = ikob.code
);


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

SELECT amount FROM categories AS egiv
WHERE amount > (
    SELECT MAX(salary) FROM customers AS lex
    WHERE lex.id = egiv.id
);


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

SELECT salary FROM staff AS xnob
WHERE status IN (
    SELECT status FROM employees AS vmob
    WHERE vmob.id = xnob.id
);


Prompt:
Schema:
  invoices (alias: fal)(name, id, type, level)
  shipments(amount, value, id, status)
Task: Find value from invoices where level appears in shipments entries with matching level.
SQL:

SELECT value FROM invoices AS fal
WHERE level IN (
    SELECT level FROM shipments AS egiv
    WHERE egiv.level = fal.level
);


Prompt:
Schema:
  shipments (alias: vnob)(type, id, status, date)
  schedules(type, amount, id, salary)
Task: Retrieve amount from shipments whose type is found in schedules rows where level matches the outer record.
SQL:

SELECT amount FROM shipments AS vnob
WHERE type IN (
    SELECT type FROM schedules AS agov
    WHERE agov.level = vnob.level
);


Prompt:
Schema:
  customers (alias: lex)(level, value, salary, type)
  departments(type, level, salary, value)
Task: Find value from customers where a matching record exists in departments with the same status.
SQL:

SELECT value FROM customers AS lex
WHERE EXISTS (
    SELECT 1 FROM departments AS kab
    WHERE kab.status = lex.status
);


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

SELECT id FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM accounts AS hac
    WHERE hac.id = okiv.id
);


Prompt:
Schema:
  staff (alias: xnob)(level, amount, name, salary)
  items(code, date, amount, salary)
Task: Find salary from staff where value exceeds the average value from items for the same level.
SQL:

SELECT salary FROM staff AS xnob
WHERE value > (
    SELECT AVG(value) FROM items AS kab
    WHERE kab.level = xnob.level
);


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

SELECT id FROM shipments AS vnob
WHERE EXISTS (
    SELECT 1 FROM sales AS jac
    WHERE jac.id = vnob.id
);


Prompt:
Schema:
  tasks (alias: znob)(status, date, name, value)
  requests(level, code, name, status)
Task: Find code from tasks where salary exceeds the total salary from requests for the same level.
SQL:

SELECT code FROM tasks AS znob
WHERE salary > (
    SELECT SUM(salary) FROM requests AS cif
    WHERE cif.level = znob.level
);


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

SELECT id FROM shipments AS vnob
WHERE salary > (
    SELECT SUM(amount) FROM transactions AS egiv
    WHERE egiv.code = vnob.code
);


Prompt:
Schema:
  shipments (alias: vnob)(salary, name, type, status)
  staff(salary, status, code, type)
Task: Find name from shipments where amount exceeds the average value from staff for the same type.
SQL:

SELECT name FROM shipments AS vnob
WHERE amount > (
    SELECT AVG(value) FROM staff AS fal
    WHERE fal.type = vnob.type
);


Prompt:
Schema:
  employees (alias: bev)(name, id, level, value)
  projects(date, type, amount, id)
Task: Select id from employees where type exists in projects for the same code.
SQL:

SELECT id FROM employees AS bev
WHERE type IN (
    SELECT type FROM projects AS nad
    WHERE nad.code = bev.code
);


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

SELECT id FROM schedules AS vmob
WHERE amount > (
    SELECT COUNT(value) FROM tasks AS hac
    WHERE hac.level = vmob.level
);


Prompt:
Schema:
  branches (alias: agov)(salary, code, id, status)
  accounts(status, code, id, amount)
Task: Select id from branches where id exists in accounts for the same type.
SQL:

SELECT id FROM branches AS agov
WHERE id IN (
    SELECT id FROM accounts AS fal
    WHERE fal.type = agov.type
);


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

SELECT salary FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM schedules AS fal
    WHERE fal.status = kab.status
);


Prompt:
Schema:
  transactions (alias: gev)(type, amount, level, date)
  branches(salary, name, value, amount)
Task: Retrieve name from transactions with amount above the SUM(salary) of branches rows sharing the same level.
SQL:

SELECT name FROM transactions AS gev
WHERE amount > (
    SELECT SUM(salary) FROM branches AS uliv
    WHERE uliv.level = gev.level
);


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

SELECT value FROM projects AS uliv
WHERE EXISTS (
    SELECT 1 FROM transactions AS vnob
    WHERE vnob.code = uliv.code
);


Prompt:
Schema:
  sales (alias: cif)(name, type, code, amount)
  tasks(value, level, salary, type)
Task: Retrieve value from sales with salary above the MIN(salary) of tasks rows sharing the same type.
SQL:

SELECT value FROM sales AS cif
WHERE salary > (
    SELECT MIN(salary) FROM tasks AS ejof
    WHERE ejof.type = cif.type
);


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

SELECT id FROM managers AS hac
WHERE EXISTS (
    SELECT 1 FROM customers AS dov
    WHERE dov.status = hac.status
);


Prompt:
Schema:
  managers (alias: hac)(level, amount, id, code)
  departments(level, salary, date, id)
Task: Select amount from managers where code exists in departments for the same type.
SQL:

SELECT amount FROM managers AS hac
WHERE code IN (
    SELECT code FROM departments AS nad
    WHERE nad.type = hac.type
);


Prompt:
Schema:
  customers (alias: lex)(date, code, name, level)
  categories(amount, type, salary, level)
Task: Find id from customers where salary exceeds the total value from categories for the same code.
SQL:

SELECT id FROM customers AS lex
WHERE salary > (
    SELECT SUM(value) FROM categories AS dov
    WHERE dov.code = lex.code
);


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

SELECT name FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM schedules AS fal
    WHERE fal.code = znob.code
);


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

SELECT id FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM accounts AS gev
    WHERE gev.code = okiv.code
);


Prompt:
Schema:
  staff (alias: xnob)(salary, status, code, level)
  schedules(name, id, status, salary)
Task: Find id from staff where value exceeds the minimum salary from schedules for the same level.
SQL:

SELECT id FROM staff AS xnob
WHERE value > (
    SELECT MIN(salary) FROM schedules AS cif
    WHERE cif.level = xnob.level
);


Prompt:
Schema:
  projects (alias: uliv)(name, status, type, level)
  accounts(value, amount, level, salary)
Task: Retrieve name from projects with salary above the MIN(value) of accounts rows sharing the same type.
SQL:

SELECT name FROM projects AS uliv
WHERE salary > (
    SELECT MIN(value) FROM accounts AS lex
    WHERE lex.type = uliv.type
);


Prompt:
Schema:
  orders (alias: kab)(date, status, id, code)
  managers(status, amount, date, type)
Task: Find amount from orders where amount exceeds the average value from managers for the same id.
SQL:

SELECT amount FROM orders AS kab
WHERE amount > (
    SELECT AVG(value) FROM managers AS vnob
    WHERE vnob.id = kab.id
);


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

SELECT salary FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM regions AS xnob
    WHERE xnob.id = kab.id
);


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

SELECT amount FROM requests AS ejof
WHERE value > (
    SELECT MIN(amount) FROM items AS bev
    WHERE bev.id = ejof.id
);


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

SELECT value FROM staff AS xnob
WHERE EXISTS (
    SELECT 1 FROM projects AS vnob
    WHERE vnob.level = xnob.level
);


Prompt:
Schema:
  products (alias: nad)(name, amount, value, salary)
  projects(value, date, name, status)
Task: Select salary from products where status exists in projects for the same status.
SQL:

SELECT salary FROM products AS nad
WHERE status IN (
    SELECT status FROM projects AS hac
    WHERE hac.status = nad.status
);


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

SELECT salary FROM items AS ikob
WHERE EXISTS (
    SELECT 1 FROM schedules AS jac
    WHERE jac.code = ikob.code
);


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

SELECT salary FROM accounts AS jac
WHERE salary > (
    SELECT COUNT(amount) FROM projects AS ikob
    WHERE ikob.status = jac.status
);


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

SELECT salary FROM staff AS xnob
WHERE EXISTS (
    SELECT 1 FROM shipments AS cif
    WHERE cif.level = xnob.level
);


Prompt:
Schema:
  departments (alias: dov)(name, id, value, level)
  schedules(level, code, type, amount)
Task: Find value from departments where salary exceeds the maximum salary from schedules for the same id.
SQL:

SELECT value FROM departments AS dov
WHERE salary > (
    SELECT MAX(salary) FROM schedules AS cif
    WHERE cif.id = dov.id
);


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

SELECT code FROM managers AS hac
WHERE EXISTS (
    SELECT 1 FROM tasks AS agov
    WHERE agov.status = hac.status
);


Prompt:
Schema:
  customers (alias: lex)(level, salary, value, date)
  departments(value, code, salary, date)
Task: Select id from customers where code exists in departments for the same type.
SQL:

SELECT id FROM customers AS lex
WHERE code IN (
    SELECT code FROM departments AS uliv
    WHERE uliv.type = lex.type
);


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

SELECT id FROM customers AS lex
WHERE type IN (
    SELECT type FROM accounts AS jac
    WHERE jac.id = lex.id
);


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

SELECT value FROM items AS ikob
WHERE type IN (
    SELECT type FROM requests AS fal
    WHERE fal.status = ikob.status
);


Prompt:
Schema:
  departments (alias: dov)(date, salary, status, level)
  accounts(value, status, name, amount)
Task: Find value from departments where status appears in accounts entries with matching level.
SQL:

SELECT value FROM departments AS dov
WHERE status IN (
    SELECT status FROM accounts AS gev
    WHERE gev.level = dov.level
);


Prompt:
Schema:
  orders (alias: kab)(name, status, date, code)
  items(status, level, salary, name)
Task: Find salary from orders where a matching record exists in items with the same level.
SQL:

SELECT salary FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM items AS ejof
    WHERE ejof.level = kab.level
);


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

SELECT code FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM transactions AS agov
    WHERE agov.code = jac.code
);


Prompt:
Schema:
  orders (alias: kab)(id, salary, code, level)
  projects(level, date, amount, id)
Task: Find value from orders where value exceeds the maximum salary from projects for the same status.
SQL:

SELECT value FROM orders AS kab
WHERE value > (
    SELECT MAX(salary) FROM projects AS znob
    WHERE znob.status = kab.status
);


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

SELECT value FROM items AS ikob
WHERE level IN (
    SELECT level FROM shipments AS fal
    WHERE fal.id = ikob.id
);


Prompt:
Schema:
  items (alias: ikob)(value, type, level, amount)
  shipments(level, salary, status, value)
Task: Retrieve salary from items that have at least one corresponding entry in shipments sharing the same status.
SQL:

SELECT salary FROM items AS ikob
WHERE EXISTS (
    SELECT 1 FROM shipments AS kab
    WHERE kab.status = ikob.status
);


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

SELECT amount FROM sales AS cif
WHERE EXISTS (
    SELECT 1 FROM departments AS gev
    WHERE gev.code = cif.code
);


Prompt:
Schema:
  transactions (alias: gev)(level, value, amount, salary)
  categories(salary, level, amount, id)
Task: Find id from transactions where status appears in categories entries with matching id.
SQL:

SELECT id FROM transactions AS gev
WHERE status IN (
    SELECT status FROM categories AS fal
    WHERE fal.id = gev.id
);


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

SELECT value FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM requests AS nad
    WHERE nad.status = agov.status
);


Prompt:
Schema:
  managers (alias: hac)(code, value, date, status)
  branches(status, id, code, level)
Task: Find amount from managers where salary exceeds the total salary from branches for the same status.
SQL:

SELECT amount FROM managers AS hac
WHERE salary > (
    SELECT SUM(salary) FROM branches AS nad
    WHERE nad.status = hac.status
);


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

SELECT amount FROM invoices AS fal
WHERE EXISTS (
    SELECT 1 FROM customers AS okiv
    WHERE okiv.id = fal.id
);


Prompt:
Schema:
  employees (alias: bev)(value, level, name, type)
  branches(salary, code, id, amount)
Task: Retrieve name from employees with value above the SUM(amount) of branches rows sharing the same code.
SQL:

SELECT name FROM employees AS bev
WHERE value > (
    SELECT SUM(amount) FROM branches AS egiv
    WHERE egiv.code = bev.code
);


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

SELECT id FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM items AS ejof
    WHERE ejof.id = agov.id
);


Prompt:
Schema:
  branches (alias: agov)(type, code, id, level)
  projects(id, amount, salary, code)
Task: Find code from branches where a matching record exists in projects with the same id.
SQL:

SELECT code FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM projects AS jac
    WHERE jac.id = agov.id
);


Prompt:
Schema:
  requests (alias: ejof)(date, amount, code, value)
  customers(value, status, code, type)
Task: Find name from requests where salary exceeds the count of value from customers for the same type.
SQL:

SELECT name FROM requests AS ejof
WHERE salary > (
    SELECT COUNT(value) FROM customers AS okiv
    WHERE okiv.type = ejof.type
);


Prompt:
Schema:
  invoices (alias: fal)(amount, value, date, name)
  projects(type, name, id, code)
Task: Find value from invoices where code appears in projects entries with matching level.
SQL:

SELECT value FROM invoices AS fal
WHERE code IN (
    SELECT code FROM projects AS kab
    WHERE kab.level = fal.level
);


Prompt:
Schema:
  departments (alias: dov)(id, value, amount, type)
  accounts(status, type, name, id)
Task: Select amount from departments where status exists in accounts for the same level.
SQL:

SELECT amount FROM departments AS dov
WHERE status IN (
    SELECT status FROM accounts AS vnob
    WHERE vnob.level = dov.level
);


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

SELECT name FROM departments AS dov
WHERE level IN (
    SELECT level FROM categories AS cif
    WHERE cif.level = dov.level
);


Prompt:
Schema:
  employees (alias: bev)(level, type, code, date)
  managers(code, status, name, date)
Task: Select id from employees where level exists in managers for the same code.
SQL:

SELECT id FROM employees AS bev
WHERE level IN (
    SELECT level FROM managers AS vnob
    WHERE vnob.code = bev.code
);


Prompt:
Schema:
  products (alias: nad)(amount, date, level, code)
  departments(salary, name, status, date)
Task: Find amount from products where type appears in departments entries with matching status.
SQL:

SELECT amount FROM products AS nad
WHERE type IN (
    SELECT type FROM departments AS hac
    WHERE hac.status = nad.status
);


Prompt:
Schema:
  sales (alias: cif)(name, salary, value, level)
  managers(code, id, value, date)
Task: Select amount from sales where status exists in managers for the same level.
SQL:

SELECT amount FROM sales AS cif
WHERE status IN (
    SELECT status FROM managers AS kab
    WHERE kab.level = cif.level
);


Prompt:
Schema:
  products (alias: nad)(date, value, code, status)
  orders(level, type, code, amount)
Task: Find salary from products where value exceeds the minimum value from orders for the same type.
SQL:

SELECT salary FROM products AS nad
WHERE value > (
    SELECT MIN(value) FROM orders AS gev
    WHERE gev.type = nad.type
);


Prompt:
Schema:
  branches (alias: agov)(amount, type, date, value)
  tasks(name, status, amount, value)
Task: Retrieve salary from branches with amount above the SUM(value) of tasks rows sharing the same type.
SQL:

SELECT salary FROM branches AS agov
WHERE amount > (
    SELECT SUM(value) FROM tasks AS cif
    WHERE cif.type = agov.type
);


Prompt:
Schema:
  transactions (alias: gev)(amount, type, code, value)
  employees(type, value, name, id)
Task: Find amount from transactions where amount exceeds the maximum salary from employees for the same code.
SQL:

SELECT amount FROM transactions AS gev
WHERE amount > (
    SELECT MAX(salary) FROM employees AS dov
    WHERE dov.code = gev.code
);


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

SELECT amount FROM transactions AS gev
WHERE EXISTS (
    SELECT 1 FROM departments AS vmob
    WHERE vmob.status = gev.status
);


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

SELECT name FROM schedules AS vmob
WHERE type IN (
    SELECT type FROM employees AS cif
    WHERE cif.status = vmob.status
);


Prompt:
Schema:
  categories (alias: egiv)(salary, date, type, status)
  schedules(id, date, salary, level)
Task: Find salary from categories where amount exceeds the total amount from schedules for the same id.
SQL:

SELECT salary FROM categories AS egiv
WHERE amount > (
    SELECT SUM(amount) FROM schedules AS xnob
    WHERE xnob.id = egiv.id
);


Prompt:
Schema:
  customers (alias: lex)(name, type, amount, value)
  employees(name, type, id, salary)
Task: Select id from customers where status exists in employees for the same id.
SQL:

SELECT id FROM customers AS lex
WHERE status IN (
    SELECT status FROM employees AS egiv
    WHERE egiv.id = lex.id
);


Prompt:
Schema:
  schedules (alias: vmob)(status, code, level, date)
  tasks(code, date, salary, name)
Task: Find code from schedules where type appears in tasks entries with matching code.
SQL:

SELECT code FROM schedules AS vmob
WHERE type IN (
    SELECT type FROM tasks AS znob
    WHERE znob.code = vmob.code
);


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

SELECT amount FROM orders AS kab
WHERE level IN (
    SELECT level FROM branches AS ikob
    WHERE ikob.id = kab.id
);


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

SELECT code FROM items AS ikob
WHERE amount > (
    SELECT SUM(amount) FROM departments AS vmob
    WHERE vmob.type = ikob.type
);


Prompt:
Schema:
  staff (alias: xnob)(id, type, name, value)
  invoices(type, level, date, salary)
Task: Select code from staff where code exists in invoices for the same level.
SQL:

SELECT code FROM staff AS xnob
WHERE code IN (
    SELECT code FROM invoices AS uliv
    WHERE uliv.level = xnob.level
);


Prompt:
Schema:
  departments (alias: dov)(name, level, id, status)
  projects(amount, level, value, name)
Task: Retrieve salary from departments with salary above the COUNT(amount) of projects rows sharing the same type.
SQL:

SELECT salary FROM departments AS dov
WHERE salary > (
    SELECT COUNT(amount) FROM projects AS agov
    WHERE agov.type = dov.type
);


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

SELECT code FROM shipments AS vnob
WHERE EXISTS (
    SELECT 1 FROM orders AS dov
    WHERE dov.status = vnob.status
);


Prompt:
Schema:
  customers (alias: lex)(salary, id, code, level)
  tasks(id, type, date, salary)
Task: Find id from customers where value exceeds the count of salary from tasks for the same status.
SQL:

SELECT id FROM customers AS lex
WHERE value > (
    SELECT COUNT(salary) FROM tasks AS okiv
    WHERE okiv.status = lex.status
);


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

SELECT name FROM items AS ikob
WHERE EXISTS (
    SELECT 1 FROM schedules AS vnob
    WHERE vnob.type = ikob.type
);


Prompt:
Schema:
  tasks (alias: znob)(type, value, salary, code)
  staff(value, code, id, date)
Task: Find id from tasks where a matching record exists in staff with the same id.
SQL:

SELECT id FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM staff AS ikob
    WHERE ikob.id = znob.id
);


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

SELECT id FROM sales AS cif
WHERE type IN (
    SELECT type FROM projects AS uliv
    WHERE uliv.level = cif.level
);


Prompt:
Schema:
  products (alias: nad)(amount, date, status, type)
  categories(date, status, id, code)
Task: Find value from products where a matching record exists in categories with the same id.
SQL:

SELECT value FROM products AS nad
WHERE EXISTS (
    SELECT 1 FROM categories AS gev
    WHERE gev.id = nad.id
);


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

SELECT value FROM items AS ikob
WHERE id IN (
    SELECT id FROM sales AS okiv
    WHERE okiv.code = ikob.code
);


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

SELECT amount FROM managers AS hac
WHERE EXISTS (
    SELECT 1 FROM departments AS nad
    WHERE nad.code = hac.code
);


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

SELECT id FROM shipments AS vnob
WHERE status IN (
    SELECT status FROM tasks AS nad
    WHERE nad.id = vnob.id
);


Prompt:
Schema:
  employees (alias: bev)(code, name, date, type)
  staff(name, type, id, salary)
Task: Find name from employees where a matching record exists in staff with the same id.
SQL:

SELECT name FROM employees AS bev
WHERE EXISTS (
    SELECT 1 FROM staff AS jac
    WHERE jac.id = bev.id
);


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

SELECT code FROM sales AS cif
WHERE value > (
    SELECT MAX(salary) FROM tasks AS dov
    WHERE dov.level = cif.level
);


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

SELECT code FROM invoices AS fal
WHERE EXISTS (
    SELECT 1 FROM staff AS uliv
    WHERE uliv.status = fal.status
);


Prompt:
Schema:
  invoices (alias: fal)(amount, type, value, salary)
  accounts(salary, name, status, amount)
Task: Find value from invoices where a matching record exists in accounts with the same status.
SQL:

SELECT value FROM invoices AS fal
WHERE EXISTS (
    SELECT 1 FROM accounts AS hac
    WHERE hac.status = fal.status
);


Prompt:
Schema:
  items (alias: ikob)(level, type, status, date)
  transactions(code, status, level, id)
Task: Find name from items where amount exceeds the average value from transactions for the same code.
SQL:

SELECT name FROM items AS ikob
WHERE amount > (
    SELECT AVG(value) FROM transactions AS nad
    WHERE nad.code = ikob.code
);


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

SELECT salary FROM categories AS egiv
WHERE type IN (
    SELECT type FROM shipments AS vnob
    WHERE vnob.level = egiv.level
);


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

SELECT salary FROM invoices AS fal
WHERE EXISTS (
    SELECT 1 FROM items AS kab
    WHERE kab.type = fal.type
);


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

SELECT salary FROM employees AS bev
WHERE EXISTS (
    SELECT 1 FROM departments AS egiv
    WHERE egiv.id = bev.id
);


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

SELECT value FROM accounts AS jac
WHERE status IN (
    SELECT status FROM branches AS okiv
    WHERE okiv.id = jac.id
);


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

SELECT name FROM employees AS bev
WHERE code IN (
    SELECT code FROM requests AS uliv
    WHERE uliv.type = bev.type
);


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

SELECT amount FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM staff AS lex
    WHERE lex.code = znob.code
);


Prompt:
Schema:
  branches (alias: agov)(type, status, name, id)
  accounts(value, salary, amount, level)
Task: Select salary from branches where id exists in accounts for the same code.
SQL:

SELECT salary FROM branches AS agov
WHERE id IN (
    SELECT id FROM accounts AS okiv
    WHERE okiv.code = agov.code
);


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

SELECT id FROM employees AS bev
WHERE EXISTS (
    SELECT 1 FROM products AS okiv
    WHERE okiv.status = bev.status
);


Prompt:
Schema:
  departments (alias: dov)(date, salary, amount, type)
  orders(status, salary, name, amount)
Task: Find name from departments where salary exceeds the maximum value from orders for the same id.
SQL:

SELECT name FROM departments AS dov
WHERE salary > (
    SELECT MAX(value) FROM orders AS egiv
    WHERE egiv.id = dov.id
);


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

SELECT value FROM departments AS dov
WHERE type IN (
    SELECT type FROM schedules AS kab
    WHERE kab.id = dov.id
);


Prompt:
Schema:
  accounts (alias: jac)(type, name, date, value)
  requests(id, status, value, amount)
Task: Find salary from accounts where level appears in requests entries with matching id.
SQL:

SELECT salary FROM accounts AS jac
WHERE level IN (
    SELECT level FROM requests AS vmob
    WHERE vmob.id = jac.id
);


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

SELECT amount FROM shipments AS vnob
WHERE EXISTS (
    SELECT 1 FROM departments AS bev
    WHERE bev.status = vnob.status
);


Prompt:
Schema:
  staff (alias: xnob)(type, status, level, date)
  tasks(date, amount, value, type)
Task: Retrieve amount from staff with amount above the MAX(value) of tasks rows sharing the same status.
SQL:

SELECT amount FROM staff AS xnob
WHERE amount > (
    SELECT MAX(value) FROM tasks AS cif
    WHERE cif.status = xnob.status
);


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

SELECT salary FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM products AS egiv
    WHERE egiv.status = znob.status
);


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

SELECT salary FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM schedules AS znob
    WHERE znob.id = egiv.id
);


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

SELECT code FROM requests AS ejof
WHERE id IN (
    SELECT id FROM staff AS uliv
    WHERE uliv.status = ejof.status
);


Prompt:
Schema:
  requests (alias: ejof)(name, code, status, amount)
  invoices(salary, code, value, amount)
Task: Find name from requests where salary exceeds the average value from invoices for the same type.
SQL:

SELECT name FROM requests AS ejof
WHERE salary > (
    SELECT AVG(value) FROM invoices AS jac
    WHERE jac.type = ejof.type
);


Prompt:
Schema:
  branches (alias: agov)(amount, date, name, status)
  requests(value, amount, salary, id)
Task: Select value from branches where id exists in requests for the same status.
SQL:

SELECT value FROM branches AS agov
WHERE id IN (
    SELECT id FROM requests AS kab
    WHERE kab.status = agov.status
);


Prompt:
Schema:
  tasks (alias: znob)(amount, status, type, salary)
  schedules(amount, value, id, date)
Task: Find id from tasks where amount exceeds the minimum salary from schedules for the same code.
SQL:

SELECT id FROM tasks AS znob
WHERE amount > (
    SELECT MIN(salary) FROM schedules AS dov
    WHERE dov.code = znob.code
);


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

SELECT code FROM categories AS egiv
WHERE salary > (
    SELECT AVG(amount) FROM shipments AS gev
    WHERE gev.status = egiv.status
);


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

SELECT salary FROM shipments AS vnob
WHERE value > (
    SELECT COUNT(salary) FROM orders AS fal
    WHERE fal.status = vnob.status
);


Prompt:
Schema:
  categories (alias: egiv)(id, salary, name, status)
  transactions(value, id, salary, name)
Task: Retrieve name from categories with salary above the MAX(salary) of transactions rows sharing the same status.
SQL:

SELECT name FROM categories AS egiv
WHERE salary > (
    SELECT MAX(salary) FROM transactions AS jac
    WHERE jac.status = egiv.status
);


Prompt:
Schema:
  products (alias: nad)(value, type, amount, name)
  transactions(type, value, date, level)
Task: Retrieve salary from products with amount above the AVG(salary) of transactions rows sharing the same status.
SQL:

SELECT salary FROM products AS nad
WHERE amount > (
    SELECT AVG(salary) FROM transactions AS fal
    WHERE fal.status = nad.status
);


Prompt:
Schema:
  departments (alias: dov)(value, code, salary, date)
  invoices(code, name, id, amount)
Task: Find id from departments where amount exceeds the maximum amount from invoices for the same level.
SQL:

SELECT id FROM departments AS dov
WHERE amount > (
    SELECT MAX(amount) FROM invoices AS vnob
    WHERE vnob.level = dov.level
);


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

SELECT id FROM employees AS bev
WHERE EXISTS (
    SELECT 1 FROM items AS vmob
    WHERE vmob.status = bev.status
);


Prompt:
Schema:
  transactions (alias: gev)(type, level, amount, code)
  employees(date, amount, level, status)
Task: Find id from transactions where status appears in employees entries with matching type.
SQL:

SELECT id FROM transactions AS gev
WHERE status IN (
    SELECT status FROM employees AS nad
    WHERE nad.type = gev.type
);


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

SELECT code FROM accounts AS jac
WHERE value > (
    SELECT MAX(amount) FROM departments AS agov
    WHERE agov.status = jac.status
);


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

SELECT name FROM items AS ikob
WHERE EXISTS (
    SELECT 1 FROM projects AS xnob
    WHERE xnob.level = ikob.level
);


Prompt:
Schema:
  items (alias: ikob)(code, status, value, type)
  transactions(status, id, value, name)
Task: Find id from items where amount exceeds the average value from transactions for the same level.
SQL:

SELECT id FROM items AS ikob
WHERE amount > (
    SELECT AVG(value) FROM transactions AS kab
    WHERE kab.level = ikob.level
);


Prompt:
Schema:
  invoices (alias: fal)(level, name, amount, value)
  requests(id, value, level, type)
Task: Find name from invoices where a matching record exists in requests with the same type.
SQL:

SELECT name FROM invoices AS fal
WHERE EXISTS (
    SELECT 1 FROM requests AS kab
    WHERE kab.type = fal.type
);


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

SELECT name FROM requests AS ejof
WHERE code IN (
    SELECT code FROM products AS hac
    WHERE hac.id = ejof.id
);


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

SELECT amount FROM employees AS bev
WHERE status IN (
    SELECT status FROM categories AS vmob
    WHERE vmob.type = bev.type
);


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

SELECT value FROM regions AS okiv
WHERE id IN (
    SELECT id FROM categories AS ikob
    WHERE ikob.code = okiv.code
);


Prompt:
Schema:
  transactions (alias: gev)(status, name, amount, date)
  accounts(name, value, level, code)
Task: Find salary from transactions where level appears in accounts entries with matching status.
SQL:

SELECT salary FROM transactions AS gev
WHERE level IN (
    SELECT level FROM accounts AS cif
    WHERE cif.status = gev.status
);


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

SELECT value FROM invoices AS fal
WHERE level IN (
    SELECT level FROM categories AS gev
    WHERE gev.level = fal.level
);


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

SELECT salary FROM invoices AS fal
WHERE salary > (
    SELECT AVG(amount) FROM departments AS egiv
    WHERE egiv.code = fal.code
);


Prompt:
Schema:
  branches (alias: agov)(value, salary, level, type)
  products(code, value, status, id)
Task: Find value from branches where id appears in products entries with matching level.
SQL:

SELECT value FROM branches AS agov
WHERE id IN (
    SELECT id FROM products AS cif
    WHERE cif.level = agov.level
);


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

SELECT salary FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM shipments AS kab
    WHERE kab.code = agov.code
);


Prompt:
Schema:
  schedules (alias: vmob)(id, name, level, status)
  branches(name, status, id, code)
Task: Retrieve id from schedules with salary above the MAX(value) of branches rows sharing the same id.
SQL:

SELECT id FROM schedules AS vmob
WHERE salary > (
    SELECT MAX(value) FROM branches AS cif
    WHERE cif.id = vmob.id
);


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

SELECT salary FROM invoices AS fal
WHERE EXISTS (
    SELECT 1 FROM branches AS nad
    WHERE nad.id = fal.id
);


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

SELECT amount FROM employees AS bev
WHERE value > (
    SELECT MAX(amount) FROM departments AS gev
    WHERE gev.status = bev.status
);


Prompt:
Schema:
  sales (alias: cif)(name, salary, level, amount)
  staff(name, value, type, status)
Task: Retrieve value from sales with amount above the SUM(amount) of staff rows sharing the same type.
SQL:

SELECT value FROM sales AS cif
WHERE amount > (
    SELECT SUM(amount) FROM staff AS egiv
    WHERE egiv.type = cif.type
);


Prompt:
Schema:
  managers (alias: hac)(salary, date, level, value)
  tasks(id, value, level, name)
Task: Select amount from managers where level exists in tasks for the same level.
SQL:

SELECT amount FROM managers AS hac
WHERE level IN (
    SELECT level FROM tasks AS jac
    WHERE jac.level = hac.level
);


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

SELECT value FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM orders AS dov
    WHERE dov.level = znob.level
);


Prompt:
Schema:
  staff (alias: xnob)(id, name, type, salary)
  categories(status, date, salary, level)
Task: Retrieve name from staff with salary above the SUM(amount) of categories rows sharing the same status.
SQL:

SELECT name FROM staff AS xnob
WHERE salary > (
    SELECT SUM(amount) FROM categories AS okiv
    WHERE okiv.status = xnob.status
);


Prompt:
Schema:
  requests (alias: ejof)(id, status, type, salary)
  managers(status, id, type, date)
Task: Select value from requests where status exists in managers for the same code.
SQL:

SELECT value FROM requests AS ejof
WHERE status IN (
    SELECT status FROM managers AS agov
    WHERE agov.code = ejof.code
);


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

SELECT amount FROM products AS nad
WHERE type IN (
    SELECT type FROM transactions AS okiv
    WHERE okiv.level = nad.level
);


Prompt:
Schema:
  departments (alias: dov)(salary, date, value, status)
  tasks(salary, status, level, code)
Task: Retrieve code from departments with salary above the MIN(amount) of tasks rows sharing the same status.
SQL:

SELECT code FROM departments AS dov
WHERE salary > (
    SELECT MIN(amount) FROM tasks AS kab
    WHERE kab.status = dov.status
);


Prompt:
Schema:
  accounts (alias: jac)(id, date, value, code)
  customers(amount, level, name, status)
Task: Find code from accounts where id appears in customers entries with matching status.
SQL:

SELECT code FROM accounts AS jac
WHERE id IN (
    SELECT id FROM customers AS fal
    WHERE fal.status = jac.status
);


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

SELECT code FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM departments AS znob
    WHERE znob.code = okiv.code
);


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

SELECT value FROM shipments AS vnob
WHERE type IN (
    SELECT type FROM requests AS egiv
    WHERE egiv.level = vnob.level
);


Prompt:
Schema:
  requests (alias: ejof)(value, type, code, amount)
  customers(date, status, id, value)
Task: Retrieve id from requests with amount above the COUNT(salary) of customers rows sharing the same id.
SQL:

SELECT id FROM requests AS ejof
WHERE amount > (
    SELECT COUNT(salary) FROM customers AS lex
    WHERE lex.id = ejof.id
);


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

SELECT salary FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM orders AS vmob
    WHERE vmob.id = jac.id
);


Prompt:
Schema:
  invoices (alias: fal)(value, name, salary, status)
  items(id, salary, status, level)
Task: Retrieve salary from invoices with value above the SUM(salary) of items rows sharing the same id.
SQL:

SELECT salary FROM invoices AS fal
WHERE value > (
    SELECT SUM(salary) FROM items AS ejof
    WHERE ejof.id = fal.id
);


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

SELECT amount FROM managers AS hac
WHERE EXISTS (
    SELECT 1 FROM sales AS nad
    WHERE nad.id = hac.id
);


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

SELECT code FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM projects AS dov
    WHERE dov.code = jac.code
);


Prompt:
Schema:
  customers (alias: lex)(id, type, name, amount)
  shipments(level, name, type, salary)
Task: Find value from customers where salary exceeds the maximum value from shipments for the same code.
SQL:

SELECT value FROM customers AS lex
WHERE salary > (
    SELECT MAX(value) FROM shipments AS xnob
    WHERE xnob.code = lex.code
);


Prompt:
Schema:
  transactions (alias: gev)(level, amount, name, salary)
  products(level, date, amount, value)
Task: Find id from transactions where amount exceeds the minimum amount from products for the same status.
SQL:

SELECT id FROM transactions AS gev
WHERE amount > (
    SELECT MIN(amount) FROM products AS xnob
    WHERE xnob.status = gev.status
);


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

SELECT amount FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM sales AS vmob
    WHERE vmob.level = jac.level
);


Prompt:
Schema:
  products (alias: nad)(id, code, name, type)
  items(id, value, type, code)
Task: Retrieve code from products with amount above the AVG(amount) of items rows sharing the same code.
SQL:

SELECT code FROM products AS nad
WHERE amount > (
    SELECT AVG(amount) FROM items AS bev
    WHERE bev.code = nad.code
);


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

SELECT value FROM transactions AS gev
WHERE EXISTS (
    SELECT 1 FROM branches AS kab
    WHERE kab.type = gev.type
);


Prompt:
Schema:
  transactions (alias: gev)(type, value, salary, name)
  schedules(type, name, salary, date)
Task: Select amount from transactions where id exists in schedules for the same id.
SQL:

SELECT amount FROM transactions AS gev
WHERE id IN (
    SELECT id FROM schedules AS kab
    WHERE kab.id = gev.id
);


Prompt:
Schema:
  requests (alias: ejof)(type, code, value, name)
  items(id, date, status, code)
Task: Find value from requests where amount exceeds the average salary from items for the same code.
SQL:

SELECT value FROM requests AS ejof
WHERE amount > (
    SELECT AVG(salary) FROM items AS uliv
    WHERE uliv.code = ejof.code
);


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

SELECT value FROM tasks AS znob
WHERE value > (
    SELECT MIN(value) FROM customers AS xnob
    WHERE xnob.type = znob.type
);


Prompt:
Schema:
  categories (alias: egiv)(code, name, value, salary)
  managers(id, level, value, amount)
Task: Find code from categories where level appears in managers entries with matching code.
SQL:

SELECT code FROM categories AS egiv
WHERE level IN (
    SELECT level FROM managers AS hac
    WHERE hac.code = egiv.code
);


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

SELECT salary FROM invoices AS fal
WHERE EXISTS (
    SELECT 1 FROM items AS agov
    WHERE agov.code = fal.code
);


Prompt:
Schema:
  customers (alias: lex)(type, salary, value, id)
  requests(level, amount, name, type)
Task: Retrieve salary from customers with value above the AVG(salary) of requests rows sharing the same type.
SQL:

SELECT salary FROM customers AS lex
WHERE value > (
    SELECT AVG(salary) FROM requests AS ejof
    WHERE ejof.type = lex.type
);


Prompt:
Schema:
  schedules (alias: vmob)(code, level, value, status)
  staff(value, code, date, type)
Task: Find value from schedules where code appears in staff entries with matching type.
SQL:

SELECT value FROM schedules AS vmob
WHERE code IN (
    SELECT code FROM staff AS hac
    WHERE hac.type = vmob.type
);


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

SELECT code FROM transactions AS gev
WHERE EXISTS (
    SELECT 1 FROM orders AS dov
    WHERE dov.type = gev.type
);


Prompt:
Schema:
  transactions (alias: gev)(value, amount, level, type)
  branches(code, type, name, amount)
Task: Retrieve id from transactions with value above the MIN(amount) of branches rows sharing the same level.
SQL:

SELECT id FROM transactions AS gev
WHERE value > (
    SELECT MIN(amount) FROM branches AS ejof
    WHERE ejof.level = gev.level
);


Prompt:
Schema:
  customers (alias: lex)(salary, code, value, type)
  branches(level, code, date, status)
Task: Find salary from customers where amount exceeds the maximum salary from branches for the same level.
SQL:

SELECT salary FROM customers AS lex
WHERE amount > (
    SELECT MAX(salary) FROM branches AS uliv
    WHERE uliv.level = lex.level
);


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

SELECT amount FROM products AS nad
WHERE EXISTS (
    SELECT 1 FROM customers AS jac
    WHERE jac.code = nad.code
);


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

SELECT name FROM invoices AS fal
WHERE salary > (
    SELECT MAX(value) FROM staff AS lex
    WHERE lex.status = fal.status
);


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

SELECT salary FROM sales AS cif
WHERE salary > (
    SELECT COUNT(value) FROM regions AS agov
    WHERE agov.id = cif.id
);


Prompt:
Schema:
  tasks (alias: znob)(value, id, salary, amount)
  managers(salary, value, date, code)
Task: Find id from tasks where status appears in managers entries with matching status.
SQL:

SELECT id FROM tasks AS znob
WHERE status IN (
    SELECT status FROM managers AS ejof
    WHERE ejof.status = znob.status
);


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

SELECT salary FROM projects AS uliv
WHERE status IN (
    SELECT status FROM tasks AS agov
    WHERE agov.id = uliv.id
);


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

SELECT value FROM transactions AS gev
WHERE salary > (
    SELECT MIN(salary) FROM staff AS znob
    WHERE znob.type = gev.type
);


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

SELECT id FROM branches AS agov
WHERE status IN (
    SELECT status FROM requests AS fal
    WHERE fal.type = agov.type
);


Prompt:
Schema:
  sales (alias: cif)(level, id, code, amount)
  schedules(id, level, salary, name)
Task: Find value from sales where type appears in schedules entries with matching status.
SQL:

SELECT value FROM sales AS cif
WHERE type IN (
    SELECT type FROM schedules AS hac
    WHERE hac.status = cif.status
);


Prompt:
Schema:
  employees (alias: bev)(id, value, status, date)
  branches(status, id, date, name)
Task: Select value from employees where type exists in branches for the same type.
SQL:

SELECT value FROM employees AS bev
WHERE type IN (
    SELECT type FROM branches AS dov
    WHERE dov.type = bev.type
);


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

SELECT value FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM managers AS vmob
    WHERE vmob.status = egiv.status
);


Prompt:
Schema:
  invoices (alias: fal)(value, id, status, salary)
  employees(id, type, level, amount)
Task: Find code from invoices where salary exceeds the minimum salary from employees for the same type.
SQL:

SELECT code FROM invoices AS fal
WHERE salary > (
    SELECT MIN(salary) FROM employees AS nad
    WHERE nad.type = fal.type
);


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

SELECT name FROM invoices AS fal
WHERE type IN (
    SELECT type FROM accounts AS dov
    WHERE dov.status = fal.status
);


Prompt:
Schema:
  requests (alias: ejof)(status, code, level, salary)
  customers(type, amount, value, date)
Task: Retrieve salary from requests with value above the MIN(amount) of customers rows sharing the same type.
SQL:

SELECT salary FROM requests AS ejof
WHERE value > (
    SELECT MIN(amount) FROM customers AS znob
    WHERE znob.type = ejof.type
);


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

SELECT amount FROM employees AS bev
WHERE id IN (
    SELECT id FROM customers AS hac
    WHERE hac.type = bev.type
);


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

SELECT code FROM staff AS xnob
WHERE EXISTS (
    SELECT 1 FROM accounts AS egiv
    WHERE egiv.level = xnob.level
);


Prompt:
Schema:
  requests (alias: ejof)(id, salary, level, name)
  tasks(name, value, code, salary)
Task: Select salary from requests where status exists in tasks for the same type.
SQL:

SELECT salary FROM requests AS ejof
WHERE status IN (
    SELECT status FROM tasks AS xnob
    WHERE xnob.type = ejof.type
);


Prompt:
Schema:
  orders (alias: kab)(name, value, date, amount)
  branches(salary, amount, name, status)
Task: Find value from orders where value exceeds the count of value from branches for the same id.
SQL:

SELECT value FROM orders AS kab
WHERE value > (
    SELECT COUNT(value) FROM branches AS hac
    WHERE hac.id = kab.id
);


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

SELECT salary FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM employees AS uliv
    WHERE uliv.type = agov.type
);


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

SELECT code FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM staff AS znob
    WHERE znob.status = jac.status
);


Prompt:
Schema:
  categories (alias: egiv)(salary, level, type, name)
  products(value, type, status, date)
Task: Find amount from categories where salary exceeds the count of amount from products for the same type.
SQL:

SELECT amount FROM categories AS egiv
WHERE salary > (
    SELECT COUNT(amount) FROM products AS uliv
    WHERE uliv.type = egiv.type
);


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

SELECT id FROM employees AS bev
WHERE EXISTS (
    SELECT 1 FROM managers AS lex
    WHERE lex.type = bev.type
);


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

SELECT code FROM shipments AS vnob
WHERE id IN (
    SELECT id FROM invoices AS agov
    WHERE agov.status = vnob.status
);


Prompt:
Schema:
  requests (alias: ejof)(code, status, level, name)
  tasks(date, salary, code, amount)
Task: Retrieve name from requests with salary above the COUNT(salary) of tasks rows sharing the same code.
SQL:

SELECT name FROM requests AS ejof
WHERE salary > (
    SELECT COUNT(salary) FROM tasks AS znob
    WHERE znob.code = ejof.code
);


Prompt:
Schema:
  tasks (alias: znob)(status, value, name, code)
  customers(value, name, id, code)
Task: Select code from tasks where code exists in customers for the same code.
SQL:

SELECT code FROM tasks AS znob
WHERE code IN (
    SELECT code FROM customers AS vnob
    WHERE vnob.code = znob.code
);


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

SELECT salary FROM products AS nad
WHERE id IN (
    SELECT id FROM employees AS cif
    WHERE cif.status = nad.status
);


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

SELECT code FROM departments AS dov
WHERE level IN (
    SELECT level FROM items AS lex
    WHERE lex.id = dov.id
);


Prompt:
Schema:
  managers (alias: hac)(value, code, name, date)
  items(name, status, level, amount)
Task: Find id from managers where amount exceeds the average amount from items for the same level.
SQL:

SELECT id FROM managers AS hac
WHERE amount > (
    SELECT AVG(amount) FROM items AS ikob
    WHERE ikob.level = hac.level
);


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

SELECT value FROM employees AS bev
WHERE amount > (
    SELECT COUNT(salary) FROM customers AS nad
    WHERE nad.level = bev.level
);


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

SELECT id FROM accounts AS jac
WHERE status IN (
    SELECT status FROM managers AS bev
    WHERE bev.id = jac.id
);


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

SELECT amount FROM projects AS uliv
WHERE EXISTS (
    SELECT 1 FROM items AS jac
    WHERE jac.type = uliv.type
);


Prompt:
Schema:
  transactions (alias: gev)(name, salary, level, status)
  invoices(type, name, status, amount)
Task: Find code from transactions where salary exceeds the average value from invoices for the same id.
SQL:

SELECT code FROM transactions AS gev
WHERE salary > (
    SELECT AVG(value) FROM invoices AS agov
    WHERE agov.id = gev.id
);


Prompt:
Schema:
  regions (alias: okiv)(value, status, date, type)
  customers(amount, name, salary, id)
Task: Find name from regions where level appears in customers entries with matching code.
SQL:

SELECT name FROM regions AS okiv
WHERE level IN (
    SELECT level FROM customers AS bev
    WHERE bev.code = okiv.code
);


Prompt:
Schema:
  items (alias: ikob)(id, salary, value, status)
  shipments(amount, value, status, date)
Task: Find code from items where code appears in shipments entries with matching status.
SQL:

SELECT code FROM items AS ikob
WHERE code IN (
    SELECT code FROM shipments AS agov
    WHERE agov.status = ikob.status
);


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

SELECT name FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM items AS bev
    WHERE bev.id = dov.id
);


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

SELECT name FROM projects AS uliv
WHERE value > (
    SELECT AVG(salary) FROM managers AS jac
    WHERE jac.status = uliv.status
);


Prompt:
Schema:
  invoices (alias: fal)(id, amount, level, value)
  tasks(name, code, amount, status)
Task: Retrieve amount from invoices with salary above the COUNT(salary) of tasks rows sharing the same code.
SQL:

SELECT amount FROM invoices AS fal
WHERE salary > (
    SELECT COUNT(salary) FROM tasks AS cif
    WHERE cif.code = fal.code
);


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

SELECT salary FROM branches AS agov
WHERE level IN (
    SELECT level FROM products AS znob
    WHERE znob.type = agov.type
);


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

SELECT code FROM staff AS xnob
WHERE value > (
    SELECT COUNT(value) FROM items AS vmob
    WHERE vmob.status = xnob.status
);


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

SELECT id FROM tasks AS znob
WHERE type IN (
    SELECT type FROM managers AS gev
    WHERE gev.id = znob.id
);


Prompt:
Schema:
  branches (alias: agov)(amount, date, id, value)
  managers(date, level, type, id)
Task: Find id from branches where salary exceeds the average value from managers for the same code.
SQL:

SELECT id FROM branches AS agov
WHERE salary > (
    SELECT AVG(value) FROM managers AS lex
    WHERE lex.code = agov.code
);