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

SELECT value FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM categories AS nad
    WHERE nad.id = okiv.id
);


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

SELECT value FROM products AS nad
WHERE status IN (
    SELECT status FROM branches AS uliv
    WHERE uliv.type = nad.type
);


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

SELECT code FROM products AS nad
WHERE value > (
    SELECT SUM(salary) FROM invoices AS jac
    WHERE jac.level = nad.level
);


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

SELECT amount FROM regions AS okiv
WHERE value > (
    SELECT AVG(salary) FROM tasks AS znob
    WHERE znob.status = okiv.status
);


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

SELECT id FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM accounts AS gev
    WHERE gev.level = kab.level
);


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

SELECT name FROM items AS ikob
WHERE status IN (
    SELECT status FROM regions AS kab
    WHERE kab.level = ikob.level
);


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

SELECT value FROM projects AS uliv
WHERE amount > (
    SELECT AVG(salary) FROM schedules AS lex
    WHERE lex.type = uliv.type
);


Prompt:
Schema:
  categories (alias: egiv)(salary, type, date, value)
  sales(status, value, salary, id)
Task: Find code from categories where salary exceeds the minimum salary from sales for the same code.
SQL:

SELECT code FROM categories AS egiv
WHERE salary > (
    SELECT MIN(salary) FROM sales AS hac
    WHERE hac.code = egiv.code
);


Prompt:
Schema:
  sales (alias: cif)(code, type, value, level)
  regions(id, amount, date, type)
Task: Retrieve code from sales with value above the COUNT(value) of regions rows sharing the same id.
SQL:

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


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

SELECT salary FROM transactions AS gev
WHERE code IN (
    SELECT code FROM projects AS vmob
    WHERE vmob.status = gev.status
);


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

SELECT name FROM tasks AS znob
WHERE amount > (
    SELECT MIN(amount) FROM departments AS uliv
    WHERE uliv.code = znob.code
);


Prompt:
Schema:
  invoices (alias: fal)(status, name, salary, id)
  customers(code, date, amount, name)
Task: Retrieve id from invoices with amount above the SUM(amount) of customers rows sharing the same id.
SQL:

SELECT id FROM invoices AS fal
WHERE amount > (
    SELECT SUM(amount) FROM customers AS cif
    WHERE cif.id = fal.id
);


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

SELECT value FROM branches AS agov
WHERE amount > (
    SELECT COUNT(amount) FROM customers AS cif
    WHERE cif.type = agov.type
);


Prompt:
Schema:
  accounts (alias: jac)(date, value, type, amount)
  categories(code, salary, name, type)
Task: Find id from accounts where amount exceeds the count of value from categories for the same code.
SQL:

SELECT id FROM accounts AS jac
WHERE amount > (
    SELECT COUNT(value) FROM categories AS dov
    WHERE dov.code = jac.code
);


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

SELECT salary FROM sales AS cif
WHERE EXISTS (
    SELECT 1 FROM regions AS vnob
    WHERE vnob.level = cif.level
);


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

SELECT salary FROM products AS nad
WHERE salary > (
    SELECT COUNT(amount) FROM orders AS okiv
    WHERE okiv.level = nad.level
);


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

SELECT salary FROM branches AS agov
WHERE level IN (
    SELECT level FROM items AS kab
    WHERE kab.type = agov.type
);


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

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


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

SELECT amount FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM staff AS fal
    WHERE fal.id = dov.id
);


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

SELECT value FROM tasks AS znob
WHERE salary > (
    SELECT SUM(amount) FROM sales AS hac
    WHERE hac.id = znob.id
);


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

SELECT name FROM branches AS agov
WHERE salary > (
    SELECT MIN(salary) FROM tasks AS fal
    WHERE fal.status = agov.status
);


Prompt:
Schema:
  items (alias: ikob)(name, id, status, date)
  tasks(status, id, type, date)
Task: Select name from items where level exists in tasks for the same status.
SQL:

SELECT name FROM items AS ikob
WHERE level IN (
    SELECT level FROM tasks AS znob
    WHERE znob.status = ikob.status
);


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

SELECT name FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM transactions AS znob
    WHERE znob.code = agov.code
);


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

SELECT id FROM sales AS cif
WHERE EXISTS (
    SELECT 1 FROM schedules AS lex
    WHERE lex.id = cif.id
);


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

SELECT name FROM shipments AS vnob
WHERE type IN (
    SELECT type FROM tasks AS znob
    WHERE znob.id = vnob.id
);


Prompt:
Schema:
  departments (alias: dov)(name, status, amount, code)
  categories(type, status, amount, level)
Task: Find name from departments where value exceeds the count of amount from categories for the same type.
SQL:

SELECT name FROM departments AS dov
WHERE value > (
    SELECT COUNT(amount) FROM categories AS egiv
    WHERE egiv.type = dov.type
);


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

SELECT amount FROM managers AS hac
WHERE EXISTS (
    SELECT 1 FROM requests AS vmob
    WHERE vmob.id = hac.id
);


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

SELECT value FROM accounts AS jac
WHERE salary > (
    SELECT AVG(value) FROM requests AS bev
    WHERE bev.id = jac.id
);


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

SELECT id FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM categories AS vnob
    WHERE vnob.code = dov.code
);


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

SELECT code FROM managers AS hac
WHERE level IN (
    SELECT level FROM customers AS nad
    WHERE nad.type = hac.type
);


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

SELECT id FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM staff AS znob
    WHERE znob.type = jac.type
);


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

SELECT id FROM departments AS dov
WHERE amount > (
    SELECT SUM(value) FROM staff AS uliv
    WHERE uliv.type = dov.type
);


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

SELECT code FROM employees AS bev
WHERE amount > (
    SELECT MAX(value) FROM shipments AS okiv
    WHERE okiv.level = bev.level
);


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

SELECT salary FROM tasks AS znob
WHERE value > (
    SELECT MIN(value) FROM products AS okiv
    WHERE okiv.id = znob.id
);


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

SELECT salary FROM shipments AS vnob
WHERE EXISTS (
    SELECT 1 FROM requests AS uliv
    WHERE uliv.code = vnob.code
);


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

SELECT code FROM customers AS lex
WHERE EXISTS (
    SELECT 1 FROM orders AS vnob
    WHERE vnob.id = lex.id
);


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

SELECT code FROM items AS ikob
WHERE id IN (
    SELECT id FROM branches AS uliv
    WHERE uliv.level = ikob.level
);


Prompt:
Schema:
  employees (alias: bev)(type, id, status, value)
  tasks(amount, id, salary, code)
Task: Find value from employees where value exceeds the count of amount from tasks for the same type.
SQL:

SELECT value FROM employees AS bev
WHERE value > (
    SELECT COUNT(amount) FROM tasks AS lex
    WHERE lex.type = bev.type
);


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

SELECT salary FROM branches AS agov
WHERE amount > (
    SELECT MAX(salary) FROM categories AS hac
    WHERE hac.level = agov.level
);


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

SELECT code FROM departments AS dov
WHERE status IN (
    SELECT status FROM staff AS vnob
    WHERE vnob.type = dov.type
);


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

SELECT amount FROM accounts AS jac
WHERE id IN (
    SELECT id FROM shipments AS znob
    WHERE znob.code = jac.code
);


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

SELECT value FROM employees AS bev
WHERE salary > (
    SELECT COUNT(value) FROM departments AS hac
    WHERE hac.type = bev.type
);


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

SELECT value FROM orders AS kab
WHERE status IN (
    SELECT status FROM staff AS nad
    WHERE nad.id = kab.id
);


Prompt:
Schema:
  products (alias: nad)(code, salary, status, name)
  shipments(code, name, status, type)
Task: Find id from products where a matching record exists in shipments with the same code.
SQL:

SELECT id FROM products AS nad
WHERE EXISTS (
    SELECT 1 FROM shipments AS ikob
    WHERE ikob.code = nad.code
);


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

SELECT name FROM invoices AS fal
WHERE type IN (
    SELECT type FROM schedules AS xnob
    WHERE xnob.status = fal.status
);


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

SELECT salary FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM shipments AS jac
    WHERE jac.code = egiv.code
);


Prompt:
Schema:
  projects (alias: uliv)(id, salary, type, level)
  schedules(id, code, type, salary)
Task: Select value from projects where type exists in schedules for the same code.
SQL:

SELECT value FROM projects AS uliv
WHERE type IN (
    SELECT type FROM schedules AS hac
    WHERE hac.code = uliv.code
);


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

SELECT name FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM transactions AS znob
    WHERE znob.type = okiv.type
);


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

SELECT salary FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM transactions AS ejof
    WHERE ejof.code = znob.code
);


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

SELECT salary FROM schedules AS vmob
WHERE code IN (
    SELECT code FROM tasks AS nad
    WHERE nad.status = vmob.status
);


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

SELECT amount FROM transactions AS gev
WHERE value > (
    SELECT MAX(value) FROM sales AS ikob
    WHERE ikob.status = gev.status
);


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

SELECT salary FROM departments AS dov
WHERE salary > (
    SELECT AVG(value) FROM transactions AS ikob
    WHERE ikob.type = dov.type
);


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

SELECT code FROM employees AS bev
WHERE EXISTS (
    SELECT 1 FROM requests AS agov
    WHERE agov.code = bev.code
);


Prompt:
Schema:
  accounts (alias: jac)(date, id, value, type)
  categories(value, status, type, level)
Task: Find value from accounts where amount exceeds the average amount from categories for the same id.
SQL:

SELECT value FROM accounts AS jac
WHERE amount > (
    SELECT AVG(amount) FROM categories AS uliv
    WHERE uliv.id = jac.id
);


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

SELECT value FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM staff AS kab
    WHERE kab.status = okiv.status
);


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

SELECT amount FROM staff AS xnob
WHERE EXISTS (
    SELECT 1 FROM categories AS vmob
    WHERE vmob.id = xnob.id
);


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

SELECT id FROM projects AS uliv
WHERE id IN (
    SELECT id FROM managers AS cif
    WHERE cif.id = uliv.id
);


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

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


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

SELECT name FROM requests AS ejof
WHERE type IN (
    SELECT type FROM departments AS fal
    WHERE fal.code = ejof.code
);


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

SELECT id FROM invoices AS fal
WHERE value > (
    SELECT MIN(salary) FROM regions AS bev
    WHERE bev.status = fal.status
);


Prompt:
Schema:
  managers (alias: hac)(id, name, level, type)
  transactions(amount, name, status, value)
Task: Find name from managers where salary exceeds the count of value from transactions for the same id.
SQL:

SELECT name FROM managers AS hac
WHERE salary > (
    SELECT COUNT(value) FROM transactions AS gev
    WHERE gev.id = hac.id
);


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

SELECT name FROM accounts AS jac
WHERE status IN (
    SELECT status FROM products AS ikob
    WHERE ikob.status = jac.status
);


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

SELECT salary FROM requests AS ejof
WHERE level IN (
    SELECT level FROM orders AS ikob
    WHERE ikob.type = ejof.type
);


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

SELECT name FROM invoices AS fal
WHERE level IN (
    SELECT level FROM items AS xnob
    WHERE xnob.code = fal.code
);


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

SELECT name FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM regions AS gev
    WHERE gev.code = agov.code
);


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

SELECT id FROM employees AS bev
WHERE EXISTS (
    SELECT 1 FROM orders AS vnob
    WHERE vnob.type = bev.type
);


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

SELECT name FROM projects AS uliv
WHERE id IN (
    SELECT id FROM items AS nad
    WHERE nad.type = uliv.type
);


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

SELECT name FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM regions AS bev
    WHERE bev.type = kab.type
);


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

SELECT code FROM categories AS egiv
WHERE amount > (
    SELECT COUNT(salary) FROM requests AS bev
    WHERE bev.status = egiv.status
);


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

SELECT name FROM products AS nad
WHERE EXISTS (
    SELECT 1 FROM orders AS jac
    WHERE jac.code = nad.code
);


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

SELECT salary FROM projects AS uliv
WHERE EXISTS (
    SELECT 1 FROM tasks AS fal
    WHERE fal.type = uliv.type
);


Prompt:
Schema:
  schedules (alias: vmob)(date, status, name, amount)
  invoices(status, amount, type, value)
Task: Find amount from schedules where amount exceeds the minimum amount from invoices for the same level.
SQL:

SELECT amount FROM schedules AS vmob
WHERE amount > (
    SELECT MIN(amount) FROM invoices AS lex
    WHERE lex.level = vmob.level
);


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

SELECT salary FROM branches AS agov
WHERE salary > (
    SELECT MIN(salary) FROM projects AS cif
    WHERE cif.type = agov.type
);


Prompt:
Schema:
  requests (alias: ejof)(value, id, date, level)
  projects(amount, value, date, salary)
Task: Find value from requests where value exceeds the total amount from projects for the same id.
SQL:

SELECT value FROM requests AS ejof
WHERE value > (
    SELECT SUM(amount) FROM projects AS nad
    WHERE nad.id = ejof.id
);


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

SELECT id FROM projects AS uliv
WHERE EXISTS (
    SELECT 1 FROM transactions AS agov
    WHERE agov.id = uliv.id
);


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

SELECT name FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM items AS vmob
    WHERE vmob.id = okiv.id
);


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

SELECT id FROM transactions AS gev
WHERE value > (
    SELECT MIN(value) FROM shipments AS vmob
    WHERE vmob.level = gev.level
);


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

SELECT code FROM requests AS ejof
WHERE level IN (
    SELECT level FROM transactions AS nad
    WHERE nad.code = ejof.code
);


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

SELECT name FROM items AS ikob
WHERE EXISTS (
    SELECT 1 FROM departments AS dov
    WHERE dov.type = ikob.type
);


Prompt:
Schema:
  staff (alias: xnob)(type, status, id, amount)
  transactions(status, id, type, name)
Task: Find value from staff where id appears in transactions entries with matching id.
SQL:

SELECT value FROM staff AS xnob
WHERE id IN (
    SELECT id FROM transactions AS vnob
    WHERE vnob.id = xnob.id
);


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

SELECT amount FROM invoices AS fal
WHERE level IN (
    SELECT level FROM regions AS bev
    WHERE bev.level = fal.level
);


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

SELECT value FROM transactions AS gev
WHERE status IN (
    SELECT status FROM accounts AS uliv
    WHERE uliv.id = gev.id
);


Prompt:
Schema:
  schedules (alias: vmob)(type, level, salary, value)
  items(status, salary, name, type)
Task: Retrieve value from schedules with salary above the AVG(value) of items rows sharing the same type.
SQL:

SELECT value FROM schedules AS vmob
WHERE salary > (
    SELECT AVG(value) FROM items AS vnob
    WHERE vnob.type = vmob.type
);


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

SELECT code FROM customers AS lex
WHERE EXISTS (
    SELECT 1 FROM tasks AS kab
    WHERE kab.code = lex.code
);


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

SELECT salary FROM invoices AS fal
WHERE id IN (
    SELECT id FROM sales AS cif
    WHERE cif.type = fal.type
);


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

SELECT value FROM branches AS agov
WHERE code IN (
    SELECT code FROM shipments AS lex
    WHERE lex.code = agov.code
);


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

SELECT value FROM managers AS hac
WHERE EXISTS (
    SELECT 1 FROM transactions AS xnob
    WHERE xnob.status = hac.status
);


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

SELECT code FROM transactions AS gev
WHERE amount > (
    SELECT SUM(amount) FROM requests AS lex
    WHERE lex.code = gev.code
);


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

SELECT code FROM employees AS bev
WHERE amount > (
    SELECT MAX(salary) FROM accounts AS ikob
    WHERE ikob.type = bev.type
);


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

SELECT code FROM requests AS ejof
WHERE EXISTS (
    SELECT 1 FROM customers AS hac
    WHERE hac.status = ejof.status
);


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

SELECT value FROM orders AS kab
WHERE code IN (
    SELECT code FROM categories AS agov
    WHERE agov.id = kab.id
);


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

SELECT value FROM categories AS egiv
WHERE salary > (
    SELECT COUNT(value) FROM branches AS vnob
    WHERE vnob.type = egiv.type
);


Prompt:
Schema:
  branches (alias: agov)(date, salary, id, level)
  departments(id, status, level, salary)
Task: Find salary from branches where salary exceeds the minimum amount from departments for the same type.
SQL:

SELECT salary FROM branches AS agov
WHERE salary > (
    SELECT MIN(amount) FROM departments AS hac
    WHERE hac.type = agov.type
);


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

SELECT name FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM invoices AS gev
    WHERE gev.level = egiv.level
);


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

SELECT value FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM staff AS vmob
    WHERE vmob.id = jac.id
);


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

SELECT name FROM schedules AS vmob
WHERE salary > (
    SELECT COUNT(value) FROM sales AS xnob
    WHERE xnob.type = vmob.type
);


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

SELECT amount FROM items AS ikob
WHERE value > (
    SELECT AVG(amount) FROM requests AS kab
    WHERE kab.code = ikob.code
);


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

SELECT value FROM shipments AS vnob
WHERE level IN (
    SELECT level FROM transactions AS lex
    WHERE lex.type = vnob.type
);


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

SELECT code FROM requests AS ejof
WHERE level IN (
    SELECT level FROM regions AS jac
    WHERE jac.type = ejof.type
);


Prompt:
Schema:
  accounts (alias: jac)(name, level, salary, status)
  products(code, level, salary, status)
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 fal
    WHERE fal.type = jac.type
);


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

SELECT amount FROM orders AS kab
WHERE amount > (
    SELECT MAX(salary) FROM customers AS uliv
    WHERE uliv.type = kab.type
);


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

SELECT value FROM departments AS dov
WHERE level IN (
    SELECT level FROM items AS xnob
    WHERE xnob.code = dov.code
);


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

SELECT id FROM managers AS hac
WHERE salary > (
    SELECT MIN(salary) FROM categories AS fal
    WHERE fal.status = hac.status
);


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

SELECT name FROM customers AS lex
WHERE EXISTS (
    SELECT 1 FROM sales AS fal
    WHERE fal.type = lex.type
);


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

SELECT value FROM invoices AS fal
WHERE id IN (
    SELECT id FROM regions AS xnob
    WHERE xnob.status = fal.status
);


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

SELECT id FROM accounts AS jac
WHERE type IN (
    SELECT type FROM departments AS okiv
    WHERE okiv.code = jac.code
);


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

SELECT amount FROM shipments AS vnob
WHERE salary > (
    SELECT SUM(salary) FROM requests AS jac
    WHERE jac.code = vnob.code
);


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

SELECT salary FROM customers AS lex
WHERE status IN (
    SELECT status FROM sales AS agov
    WHERE agov.status = lex.status
);


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

SELECT code FROM sales AS cif
WHERE type IN (
    SELECT type FROM products AS ikob
    WHERE ikob.code = cif.code
);


Prompt:
Schema:
  branches (alias: agov)(name, amount, id, status)
  orders(level, status, type, date)
Task: Find id from branches where salary exceeds the total amount from orders for the same type.
SQL:

SELECT id FROM branches AS agov
WHERE salary > (
    SELECT SUM(amount) FROM orders AS znob
    WHERE znob.type = agov.type
);


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

SELECT name FROM employees AS bev
WHERE status IN (
    SELECT status FROM requests AS hac
    WHERE hac.type = bev.type
);


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

SELECT value FROM requests AS ejof
WHERE amount > (
    SELECT MAX(amount) FROM regions AS vnob
    WHERE vnob.id = ejof.id
);


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

SELECT salary FROM sales AS cif
WHERE value > (
    SELECT MAX(value) FROM orders AS znob
    WHERE znob.type = cif.type
);


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

SELECT id FROM transactions AS gev
WHERE EXISTS (
    SELECT 1 FROM branches AS hac
    WHERE hac.type = gev.type
);


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

SELECT id FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM products AS okiv
    WHERE okiv.type = kab.type
);


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

SELECT value FROM regions AS okiv
WHERE amount > (
    SELECT MIN(value) FROM tasks AS gev
    WHERE gev.level = okiv.level
);


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

SELECT code FROM requests AS ejof
WHERE status IN (
    SELECT status FROM staff AS okiv
    WHERE okiv.type = ejof.type
);


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

SELECT salary FROM employees AS bev
WHERE value > (
    SELECT MIN(salary) FROM projects AS gev
    WHERE gev.level = bev.level
);


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

SELECT code FROM sales AS cif
WHERE value > (
    SELECT AVG(value) FROM products AS ejof
    WHERE ejof.type = cif.type
);


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

SELECT id FROM transactions AS gev
WHERE code IN (
    SELECT code FROM shipments AS xnob
    WHERE xnob.status = gev.status
);


Prompt:
Schema:
  managers (alias: hac)(status, value, code, type)
  items(status, id, code, salary)
Task: Retrieve amount from managers with amount above the MIN(salary) of items rows sharing the same id.
SQL:

SELECT amount FROM managers AS hac
WHERE amount > (
    SELECT MIN(salary) FROM items AS znob
    WHERE znob.id = hac.id
);


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

SELECT id FROM products AS nad
WHERE EXISTS (
    SELECT 1 FROM staff AS okiv
    WHERE okiv.status = nad.status
);


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

SELECT code FROM shipments AS vnob
WHERE EXISTS (
    SELECT 1 FROM products AS agov
    WHERE agov.level = vnob.level
);


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

SELECT salary FROM managers AS hac
WHERE EXISTS (
    SELECT 1 FROM customers AS znob
    WHERE znob.level = hac.level
);


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

SELECT code FROM sales AS cif
WHERE level IN (
    SELECT level FROM employees AS fal
    WHERE fal.type = cif.type
);


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

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


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

SELECT value FROM sales AS cif
WHERE EXISTS (
    SELECT 1 FROM staff AS lex
    WHERE lex.id = cif.id
);


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

SELECT id FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM customers AS bev
    WHERE bev.level = znob.level
);


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

SELECT value FROM accounts AS jac
WHERE salary > (
    SELECT COUNT(value) FROM staff AS uliv
    WHERE uliv.level = jac.level
);


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

SELECT amount FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM requests AS nad
    WHERE nad.id = kab.id
);


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

SELECT amount FROM regions AS okiv
WHERE id IN (
    SELECT id FROM shipments AS uliv
    WHERE uliv.id = okiv.id
);


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

SELECT amount FROM branches AS agov
WHERE code IN (
    SELECT code FROM employees AS jac
    WHERE jac.id = agov.id
);


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

SELECT name FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM requests AS gev
    WHERE gev.code = okiv.code
);


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

SELECT value FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM transactions AS fal
    WHERE fal.code = dov.code
);


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

SELECT id FROM requests AS ejof
WHERE EXISTS (
    SELECT 1 FROM customers AS jac
    WHERE jac.type = ejof.type
);


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

SELECT salary FROM invoices AS fal
WHERE id IN (
    SELECT id FROM categories AS znob
    WHERE znob.id = fal.id
);


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

SELECT amount FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM departments AS gev
    WHERE gev.level = znob.level
);


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

SELECT code FROM requests AS ejof
WHERE amount > (
    SELECT MIN(value) FROM departments AS nad
    WHERE nad.level = ejof.level
);


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

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


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

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


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

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


Prompt:
Schema:
  schedules (alias: vmob)(code, salary, id, level)
  tasks(amount, level, id, code)
Task: Retrieve id from schedules that have at least one corresponding entry in tasks sharing the same id.
SQL:

SELECT id FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM tasks AS ikob
    WHERE ikob.id = vmob.id
);


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

SELECT name FROM items AS ikob
WHERE EXISTS (
    SELECT 1 FROM categories AS nad
    WHERE nad.status = ikob.status
);


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

SELECT name FROM managers AS hac
WHERE code IN (
    SELECT code FROM accounts AS vnob
    WHERE vnob.status = hac.status
);


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

SELECT amount FROM projects AS uliv
WHERE salary > (
    SELECT COUNT(salary) FROM transactions AS kab
    WHERE kab.level = uliv.level
);


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

SELECT name FROM customers AS lex
WHERE EXISTS (
    SELECT 1 FROM managers AS xnob
    WHERE xnob.status = lex.status
);


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

SELECT value FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM accounts AS xnob
    WHERE xnob.id = kab.id
);


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

SELECT amount FROM requests AS ejof
WHERE EXISTS (
    SELECT 1 FROM regions AS lex
    WHERE lex.level = ejof.level
);


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

SELECT amount FROM staff AS xnob
WHERE EXISTS (
    SELECT 1 FROM managers AS vmob
    WHERE vmob.level = xnob.level
);


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

SELECT value FROM staff AS xnob
WHERE EXISTS (
    SELECT 1 FROM categories AS agov
    WHERE agov.level = xnob.level
);


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

SELECT id FROM departments AS dov
WHERE amount > (
    SELECT AVG(salary) FROM managers AS fal
    WHERE fal.id = dov.id
);


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

SELECT code FROM transactions AS gev
WHERE level IN (
    SELECT level FROM managers AS nad
    WHERE nad.code = gev.code
);


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

SELECT amount FROM schedules AS vmob
WHERE value > (
    SELECT MIN(value) FROM invoices AS ikob
    WHERE ikob.id = vmob.id
);


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

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


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

SELECT code FROM orders AS kab
WHERE amount > (
    SELECT MAX(salary) FROM employees AS cif
    WHERE cif.level = kab.level
);


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

SELECT name FROM employees AS bev
WHERE type IN (
    SELECT type FROM categories AS ikob
    WHERE ikob.level = bev.level
);


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

SELECT name FROM tasks AS znob
WHERE status IN (
    SELECT status FROM transactions AS uliv
    WHERE uliv.type = znob.type
);


Prompt:
Schema:
  regions (alias: okiv)(name, id, amount, value)
  managers(id, amount, name, type)
Task: Find salary from regions where amount exceeds the average salary from managers for the same status.
SQL:

SELECT salary FROM regions AS okiv
WHERE amount > (
    SELECT AVG(salary) FROM managers AS xnob
    WHERE xnob.status = okiv.status
);


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

SELECT amount FROM schedules AS vmob
WHERE value > (
    SELECT MAX(salary) FROM staff AS hac
    WHERE hac.status = vmob.status
);


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

SELECT salary FROM categories AS egiv
WHERE salary > (
    SELECT SUM(value) FROM projects AS ejof
    WHERE ejof.id = egiv.id
);


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

SELECT amount FROM staff AS xnob
WHERE EXISTS (
    SELECT 1 FROM managers AS kab
    WHERE kab.code = xnob.code
);


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

SELECT name FROM requests AS ejof
WHERE value > (
    SELECT AVG(value) FROM regions AS jac
    WHERE jac.code = ejof.code
);


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

SELECT name FROM items AS ikob
WHERE salary > (
    SELECT AVG(salary) FROM shipments AS xnob
    WHERE xnob.code = ikob.code
);


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

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


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

SELECT code FROM schedules AS vmob
WHERE type IN (
    SELECT type FROM items AS egiv
    WHERE egiv.status = vmob.status
);


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

SELECT amount FROM sales AS cif
WHERE value > (
    SELECT MAX(amount) FROM schedules AS bev
    WHERE bev.id = cif.id
);


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

SELECT salary FROM shipments AS vnob
WHERE EXISTS (
    SELECT 1 FROM branches AS lex
    WHERE lex.status = vnob.status
);


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

SELECT code FROM transactions AS gev
WHERE EXISTS (
    SELECT 1 FROM regions AS kab
    WHERE kab.type = gev.type
);


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

SELECT code FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM categories AS agov
    WHERE agov.type = okiv.type
);


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

SELECT code FROM tasks AS znob
WHERE id IN (
    SELECT id FROM categories AS vmob
    WHERE vmob.id = znob.id
);


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

SELECT code FROM items AS ikob
WHERE id IN (
    SELECT id FROM products AS vnob
    WHERE vnob.id = ikob.id
);


Prompt:
Schema:
  managers (alias: hac)(amount, date, value, salary)
  customers(amount, salary, value, code)
Task: Retrieve code from managers with amount above the MIN(value) of customers rows sharing the same id.
SQL:

SELECT code FROM managers AS hac
WHERE amount > (
    SELECT MIN(value) FROM customers AS lex
    WHERE lex.id = hac.id
);


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

SELECT salary FROM orders AS kab
WHERE level IN (
    SELECT level FROM departments AS cif
    WHERE cif.status = kab.status
);


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

SELECT salary FROM shipments AS vnob
WHERE level IN (
    SELECT level FROM invoices AS vmob
    WHERE vmob.id = vnob.id
);


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

SELECT id FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM invoices AS uliv
    WHERE uliv.code = agov.code
);


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

SELECT value FROM invoices AS fal
WHERE id IN (
    SELECT id FROM transactions AS egiv
    WHERE egiv.code = fal.code
);


Prompt:
Schema:
  schedules (alias: vmob)(value, salary, id, name)
  staff(level, amount, id, type)
Task: Retrieve value from schedules with amount above the MIN(value) of staff rows sharing the same level.
SQL:

SELECT value FROM schedules AS vmob
WHERE amount > (
    SELECT MIN(value) FROM staff AS kab
    WHERE kab.level = vmob.level
);


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

SELECT id FROM transactions AS gev
WHERE id IN (
    SELECT id FROM departments AS lex
    WHERE lex.status = gev.status
);


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

SELECT id FROM shipments AS vnob
WHERE value > (
    SELECT MIN(value) FROM tasks AS bev
    WHERE bev.type = vnob.type
);


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

SELECT name FROM customers AS lex
WHERE value > (
    SELECT MAX(value) FROM branches AS nad
    WHERE nad.code = lex.code
);


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

SELECT value FROM products AS nad
WHERE code IN (
    SELECT code FROM items AS ejof
    WHERE ejof.code = nad.code
);


Prompt:
Schema:
  schedules (alias: vmob)(code, level, id, name)
  projects(salary, code, date, level)
Task: Find id from schedules where salary exceeds the maximum amount from projects for the same id.
SQL:

SELECT id FROM schedules AS vmob
WHERE salary > (
    SELECT MAX(amount) FROM projects AS znob
    WHERE znob.id = vmob.id
);


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

SELECT id FROM products AS nad
WHERE EXISTS (
    SELECT 1 FROM projects AS kab
    WHERE kab.status = nad.status
);


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

SELECT id FROM transactions AS gev
WHERE code IN (
    SELECT code FROM staff AS hac
    WHERE hac.id = gev.id
);


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

SELECT salary FROM departments AS dov
WHERE type IN (
    SELECT type FROM requests AS fal
    WHERE fal.code = dov.code
);


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

SELECT salary FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM categories AS hac
    WHERE hac.type = kab.type
);


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

SELECT salary FROM products AS nad
WHERE status IN (
    SELECT status FROM staff AS uliv
    WHERE uliv.code = nad.code
);


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

SELECT id FROM shipments AS vnob
WHERE salary > (
    SELECT MIN(salary) FROM categories AS nad
    WHERE nad.level = vnob.level
);


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

SELECT amount FROM transactions AS gev
WHERE level IN (
    SELECT level FROM items AS dov
    WHERE dov.id = gev.id
);


Prompt:
Schema:
  branches (alias: agov)(id, salary, level, status)
  sales(name, code, level, value)
Task: Find name from branches where amount exceeds the maximum salary from sales for the same code.
SQL:

SELECT name FROM branches AS agov
WHERE amount > (
    SELECT MAX(salary) FROM sales AS uliv
    WHERE uliv.code = agov.code
);


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

SELECT name FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM projects AS lex
    WHERE lex.id = egiv.id
);


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

SELECT id FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM regions AS fal
    WHERE fal.level = dov.level
);


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

SELECT amount FROM shipments AS vnob
WHERE status IN (
    SELECT status FROM staff AS kab
    WHERE kab.id = vnob.id
);


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

SELECT amount FROM invoices AS fal
WHERE EXISTS (
    SELECT 1 FROM departments AS jac
    WHERE jac.level = fal.level
);


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

SELECT salary FROM transactions AS gev
WHERE EXISTS (
    SELECT 1 FROM requests AS fal
    WHERE fal.code = gev.code
);


Prompt:
Schema:
  sales (alias: cif)(id, name, salary, status)
  tasks(status, type, code, date)
Task: Find amount from sales where amount exceeds the maximum amount from tasks for the same id.
SQL:

SELECT amount FROM sales AS cif
WHERE amount > (
    SELECT MAX(amount) FROM tasks AS uliv
    WHERE uliv.id = cif.id
);


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

SELECT salary FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM staff AS ejof
    WHERE ejof.id = vmob.id
);


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

SELECT name FROM managers AS hac
WHERE status IN (
    SELECT status FROM requests AS ikob
    WHERE ikob.id = hac.id
);


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

SELECT code FROM items AS ikob
WHERE EXISTS (
    SELECT 1 FROM requests AS uliv
    WHERE uliv.id = ikob.id
);


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

SELECT value FROM departments AS dov
WHERE type IN (
    SELECT type FROM shipments AS gev
    WHERE gev.level = dov.level
);


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

SELECT amount FROM customers AS lex
WHERE status IN (
    SELECT status FROM accounts AS znob
    WHERE znob.status = lex.status
);


Prompt:
Schema:
  branches (alias: agov)(name, date, amount, code)
  departments(id, status, name, value)
Task: Retrieve amount from branches with amount above the COUNT(value) of departments rows sharing the same level.
SQL:

SELECT amount FROM branches AS agov
WHERE amount > (
    SELECT COUNT(value) FROM departments AS uliv
    WHERE uliv.level = agov.level
);


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

SELECT amount FROM sales AS cif
WHERE code IN (
    SELECT code FROM staff AS bev
    WHERE bev.status = cif.status
);


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

SELECT salary FROM schedules AS vmob
WHERE type IN (
    SELECT type FROM items AS vnob
    WHERE vnob.code = vmob.code
);


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

SELECT value FROM categories AS egiv
WHERE salary > (
    SELECT MAX(value) FROM products AS lex
    WHERE lex.level = egiv.level
);


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

SELECT salary FROM shipments AS vnob
WHERE type IN (
    SELECT type FROM invoices AS kab
    WHERE kab.status = vnob.status
);


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

SELECT id FROM categories AS egiv
WHERE level IN (
    SELECT level FROM items AS znob
    WHERE znob.level = egiv.level
);


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

SELECT name FROM requests AS ejof
WHERE EXISTS (
    SELECT 1 FROM products AS hac
    WHERE hac.code = ejof.code
);


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

SELECT code FROM managers AS hac
WHERE EXISTS (
    SELECT 1 FROM items AS dov
    WHERE dov.type = hac.type
);


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

SELECT salary FROM employees AS bev
WHERE status IN (
    SELECT status FROM managers AS dov
    WHERE dov.id = bev.id
);


Prompt:
Schema:
  regions (alias: okiv)(salary, value, status, name)
  invoices(type, code, salary, amount)
Task: Find code from regions where value exceeds the maximum amount from invoices for the same level.
SQL:

SELECT code FROM regions AS okiv
WHERE value > (
    SELECT MAX(amount) FROM invoices AS jac
    WHERE jac.level = okiv.level
);


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

SELECT code FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM transactions AS dov
    WHERE dov.status = okiv.status
);


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

SELECT name FROM tasks AS znob
WHERE status IN (
    SELECT status FROM customers AS jac
    WHERE jac.status = znob.status
);


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

SELECT value FROM schedules AS vmob
WHERE value > (
    SELECT SUM(amount) FROM requests AS fal
    WHERE fal.status = vmob.status
);


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

SELECT value FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM categories AS hac
    WHERE hac.id = dov.id
);


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

SELECT amount FROM regions AS okiv
WHERE status IN (
    SELECT status FROM managers AS uliv
    WHERE uliv.status = okiv.status
);


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

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


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

SELECT salary FROM employees AS bev
WHERE value > (
    SELECT MIN(value) FROM managers AS agov
    WHERE agov.type = bev.type
);


Prompt:
Schema:
  regions (alias: okiv)(date, level, type, value)
  managers(value, type, salary, status)
Task: Retrieve salary from regions with salary above the AVG(amount) of managers rows sharing the same type.
SQL:

SELECT salary FROM regions AS okiv
WHERE salary > (
    SELECT AVG(amount) FROM managers AS fal
    WHERE fal.type = okiv.type
);


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

SELECT name FROM products AS nad
WHERE amount > (
    SELECT AVG(salary) FROM branches AS kab
    WHERE kab.type = nad.type
);


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

SELECT id FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM sales AS xnob
    WHERE xnob.id = vmob.id
);


Prompt:
Schema:
  regions (alias: okiv)(date, level, id, value)
  managers(level, value, status, amount)
Task: Select amount from regions where id exists in managers for the same level.
SQL:

SELECT amount FROM regions AS okiv
WHERE id IN (
    SELECT id FROM managers AS dov
    WHERE dov.level = okiv.level
);


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

SELECT amount FROM sales AS cif
WHERE salary > (
    SELECT MIN(salary) FROM departments AS hac
    WHERE hac.level = cif.level
);


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

SELECT code FROM tasks AS znob
WHERE value > (
    SELECT COUNT(salary) FROM managers AS hac
    WHERE hac.status = znob.status
);


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

SELECT amount FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM sales AS fal
    WHERE fal.level = vmob.level
);


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

SELECT salary FROM staff AS xnob
WHERE value > (
    SELECT COUNT(salary) FROM schedules AS fal
    WHERE fal.id = xnob.id
);


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

SELECT amount FROM accounts AS jac
WHERE code IN (
    SELECT code FROM employees AS agov
    WHERE agov.status = jac.status
);


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

SELECT code FROM categories AS egiv
WHERE salary > (
    SELECT MAX(amount) FROM invoices AS cif
    WHERE cif.status = egiv.status
);


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

SELECT amount FROM departments AS dov
WHERE status IN (
    SELECT status FROM invoices AS okiv
    WHERE okiv.id = dov.id
);


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

SELECT amount FROM items AS ikob
WHERE id IN (
    SELECT id FROM accounts AS uliv
    WHERE uliv.type = ikob.type
);


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

SELECT code FROM orders AS kab
WHERE id IN (
    SELECT id FROM managers AS ikob
    WHERE ikob.type = kab.type
);


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

SELECT code FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM regions AS okiv
    WHERE okiv.type = kab.type
);


Prompt:
Schema:
  staff (alias: xnob)(name, status, amount, date)
  categories(date, level, amount, status)
Task: Find name from staff where amount exceeds the minimum value from categories for the same type.
SQL:

SELECT name FROM staff AS xnob
WHERE amount > (
    SELECT MIN(value) FROM categories AS gev
    WHERE gev.type = xnob.type
);


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

SELECT code FROM customers AS lex
WHERE EXISTS (
    SELECT 1 FROM accounts AS vnob
    WHERE vnob.code = lex.code
);


Prompt:
Schema:
  projects (alias: uliv)(id, code, date, salary)
  invoices(value, type, id, code)
Task: Find value from projects where salary exceeds the count of value from invoices for the same type.
SQL:

SELECT value FROM projects AS uliv
WHERE salary > (
    SELECT COUNT(value) FROM invoices AS znob
    WHERE znob.type = uliv.type
);


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

SELECT amount FROM orders AS kab
WHERE amount > (
    SELECT SUM(salary) FROM regions AS znob
    WHERE znob.type = kab.type
);


Prompt:
Schema:
  sales (alias: cif)(amount, code, type, level)
  regions(value, code, amount, type)
Task: Select amount from sales where level exists in regions for the same type.
SQL:

SELECT amount FROM sales AS cif
WHERE level IN (
    SELECT level FROM regions AS nad
    WHERE nad.type = cif.type
);


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

SELECT amount FROM invoices AS fal
WHERE value > (
    SELECT AVG(salary) FROM branches AS jac
    WHERE jac.code = fal.code
);


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

SELECT id FROM accounts AS jac
WHERE level IN (
    SELECT level FROM regions AS ejof
    WHERE ejof.id = jac.id
);


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

SELECT name FROM departments AS dov
WHERE value > (
    SELECT AVG(salary) FROM employees AS xnob
    WHERE xnob.type = dov.type
);


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

SELECT name FROM invoices AS fal
WHERE EXISTS (
    SELECT 1 FROM accounts AS vnob
    WHERE vnob.type = fal.type
);


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

SELECT salary FROM schedules AS vmob
WHERE amount > (
    SELECT AVG(amount) FROM orders AS jac
    WHERE jac.type = vmob.type
);


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

SELECT salary FROM transactions AS gev
WHERE value > (
    SELECT AVG(amount) FROM projects AS hac
    WHERE hac.status = gev.status
);


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

SELECT id FROM customers AS lex
WHERE level IN (
    SELECT level FROM tasks AS znob
    WHERE znob.level = lex.level
);


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

SELECT name FROM transactions AS gev
WHERE type IN (
    SELECT type FROM managers AS dov
    WHERE dov.code = gev.code
);


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

SELECT value FROM employees AS bev
WHERE status IN (
    SELECT status FROM products AS vmob
    WHERE vmob.code = bev.code
);


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

SELECT name FROM transactions AS gev
WHERE amount > (
    SELECT MAX(amount) FROM accounts AS xnob
    WHERE xnob.status = gev.status
);


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

SELECT id FROM items AS ikob
WHERE EXISTS (
    SELECT 1 FROM projects AS hac
    WHERE hac.status = ikob.status
);


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

SELECT salary FROM sales AS cif
WHERE code IN (
    SELECT code FROM departments AS nad
    WHERE nad.status = cif.status
);


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

SELECT code FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM regions AS lex
    WHERE lex.status = kab.status
);


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

SELECT code FROM sales AS cif
WHERE status IN (
    SELECT status FROM staff AS vmob
    WHERE vmob.type = cif.type
);


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

SELECT name FROM employees AS bev
WHERE level IN (
    SELECT level FROM staff AS jac
    WHERE jac.status = bev.status
);


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

SELECT value FROM invoices AS fal
WHERE type IN (
    SELECT type FROM departments AS vnob
    WHERE vnob.status = fal.status
);


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

SELECT name FROM categories AS egiv
WHERE value > (
    SELECT COUNT(value) FROM sales AS vnob
    WHERE vnob.level = egiv.level
);


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

SELECT value FROM products AS nad
WHERE amount > (
    SELECT AVG(value) FROM branches AS uliv
    WHERE uliv.status = nad.status
);


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

SELECT amount FROM shipments AS vnob
WHERE EXISTS (
    SELECT 1 FROM branches AS jac
    WHERE jac.status = vnob.status
);


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

SELECT name FROM tasks AS znob
WHERE id IN (
    SELECT id FROM customers AS vnob
    WHERE vnob.level = znob.level
);


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

SELECT name FROM schedules AS vmob
WHERE code IN (
    SELECT code FROM departments AS okiv
    WHERE okiv.status = vmob.status
);


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

SELECT code FROM invoices AS fal
WHERE value > (
    SELECT MAX(amount) FROM regions AS xnob
    WHERE xnob.level = fal.level
);


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

SELECT id FROM managers AS hac
WHERE code IN (
    SELECT code FROM tasks AS xnob
    WHERE xnob.id = hac.id
);


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

SELECT amount FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM tasks AS znob
    WHERE znob.level = kab.level
);


Prompt:
Schema:
  items (alias: ikob)(level, name, id, code)
  managers(name, salary, level, id)
Task: Retrieve salary from items that have at least one corresponding entry in managers sharing the same level.
SQL:

SELECT salary FROM items AS ikob
WHERE EXISTS (
    SELECT 1 FROM managers AS kab
    WHERE kab.level = ikob.level
);


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

SELECT name FROM regions AS okiv
WHERE id IN (
    SELECT id FROM employees AS ejof
    WHERE ejof.code = okiv.code
);


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

SELECT amount FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM tasks AS egiv
    WHERE egiv.type = dov.type
);


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

SELECT amount FROM requests AS ejof
WHERE EXISTS (
    SELECT 1 FROM staff AS dov
    WHERE dov.id = ejof.id
);


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

SELECT name FROM projects AS uliv
WHERE level IN (
    SELECT level FROM staff AS jac
    WHERE jac.type = uliv.type
);


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

SELECT code FROM requests AS ejof
WHERE EXISTS (
    SELECT 1 FROM regions AS ikob
    WHERE ikob.level = ejof.level
);


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

SELECT salary FROM staff AS xnob
WHERE code IN (
    SELECT code FROM departments AS hac
    WHERE hac.level = xnob.level
);


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

SELECT code FROM customers AS lex
WHERE EXISTS (
    SELECT 1 FROM orders AS znob
    WHERE znob.id = lex.id
);


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

SELECT code FROM branches AS agov
WHERE salary > (
    SELECT AVG(amount) FROM projects AS bev
    WHERE bev.id = agov.id
);


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

SELECT salary FROM requests AS ejof
WHERE type IN (
    SELECT type FROM invoices AS vnob
    WHERE vnob.status = ejof.status
);


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

SELECT id FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM categories AS ikob
    WHERE ikob.level = dov.level
);


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

SELECT id FROM customers AS lex
WHERE status IN (
    SELECT status FROM categories AS dov
    WHERE dov.id = lex.id
);


Prompt:
Schema:
  branches (alias: agov)(name, type, salary, id)
  invoices(status, date, name, level)
Task: Find salary from branches where value exceeds the count of value from invoices for the same status.
SQL:

SELECT salary FROM branches AS agov
WHERE value > (
    SELECT COUNT(value) FROM invoices AS uliv
    WHERE uliv.status = agov.status
);


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

SELECT name FROM invoices AS fal
WHERE id IN (
    SELECT id FROM orders AS gev
    WHERE gev.id = fal.id
);


Prompt:
Schema:
  invoices (alias: fal)(date, amount, name, type)
  managers(code, salary, level, status)
Task: Find name from invoices where amount exceeds the maximum value from managers for the same code.
SQL:

SELECT name FROM invoices AS fal
WHERE amount > (
    SELECT MAX(value) FROM managers AS hac
    WHERE hac.code = fal.code
);


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

SELECT id FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM products AS fal
    WHERE fal.type = dov.type
);


Prompt:
Schema:
  managers (alias: hac)(date, name, id, type)
  regions(name, salary, id, type)
Task: Find code from managers where level appears in regions entries with matching id.
SQL:

SELECT code FROM managers AS hac
WHERE level IN (
    SELECT level FROM regions AS vnob
    WHERE vnob.id = hac.id
);


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

SELECT code FROM products AS nad
WHERE code IN (
    SELECT code FROM orders AS vnob
    WHERE vnob.type = nad.type
);


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

SELECT value FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM categories AS ejof
    WHERE ejof.status = znob.status
);


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

SELECT code FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM tasks AS egiv
    WHERE egiv.id = agov.id
);


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

SELECT name FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM products AS vnob
    WHERE vnob.status = vmob.status
);


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

SELECT id FROM departments AS dov
WHERE amount > (
    SELECT MIN(amount) FROM tasks AS cif
    WHERE cif.code = dov.code
);


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

SELECT name FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM transactions AS agov
    WHERE agov.level = dov.level
);


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

SELECT amount FROM branches AS agov
WHERE value > (
    SELECT MAX(amount) FROM accounts AS jac
    WHERE jac.type = agov.type
);


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

SELECT id FROM items AS ikob
WHERE EXISTS (
    SELECT 1 FROM orders AS nad
    WHERE nad.code = ikob.code
);


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

SELECT value FROM items AS ikob
WHERE EXISTS (
    SELECT 1 FROM managers AS cif
    WHERE cif.status = ikob.status
);


Prompt:
Schema:
  requests (alias: ejof)(code, type, name, amount)
  shipments(id, status, type, code)
Task: Find amount from requests where a matching record exists in shipments with the same code.
SQL:

SELECT amount FROM requests AS ejof
WHERE EXISTS (
    SELECT 1 FROM shipments AS okiv
    WHERE okiv.code = ejof.code
);


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

SELECT code FROM tasks AS znob
WHERE amount > (
    SELECT MAX(value) FROM items AS xnob
    WHERE xnob.type = znob.type
);


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

SELECT amount FROM invoices AS fal
WHERE value > (
    SELECT AVG(value) FROM tasks AS uliv
    WHERE uliv.level = fal.level
);


Prompt:
Schema:
  managers (alias: hac)(id, name, status, salary)
  departments(level, amount, id, code)
Task: Find amount from managers where salary exceeds the count of salary from departments for the same id.
SQL:

SELECT amount FROM managers AS hac
WHERE salary > (
    SELECT COUNT(salary) FROM departments AS ejof
    WHERE ejof.id = hac.id
);


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

SELECT code FROM requests AS ejof
WHERE EXISTS (
    SELECT 1 FROM departments AS fal
    WHERE fal.code = ejof.code
);


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

SELECT id FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM regions AS jac
    WHERE jac.level = znob.level
);


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

SELECT salary FROM transactions AS gev
WHERE EXISTS (
    SELECT 1 FROM invoices AS vmob
    WHERE vmob.code = gev.code
);


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

SELECT salary FROM employees AS bev
WHERE EXISTS (
    SELECT 1 FROM managers AS okiv
    WHERE okiv.type = bev.type
);


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

SELECT amount FROM categories AS egiv
WHERE amount > (
    SELECT AVG(value) FROM invoices AS jac
    WHERE jac.status = egiv.status
);


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

SELECT id FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM requests AS ejof
    WHERE ejof.level = egiv.level
);