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

SELECT id FROM schedules AS vmob
WHERE code IN (
    SELECT code FROM managers AS gev
    WHERE gev.level = vmob.level
);


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

SELECT amount FROM accounts AS jac
WHERE status IN (
    SELECT status FROM managers AS egiv
    WHERE egiv.code = jac.code
);


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

SELECT value FROM shipments AS vnob
WHERE EXISTS (
    SELECT 1 FROM categories AS cif
    WHERE cif.id = vnob.id
);


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

SELECT code FROM accounts AS jac
WHERE salary > (
    SELECT COUNT(salary) FROM items AS dov
    WHERE dov.code = jac.code
);


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

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


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

SELECT value FROM schedules AS vmob
WHERE salary > (
    SELECT AVG(amount) FROM projects AS okiv
    WHERE okiv.level = vmob.level
);


Prompt:
Schema:
  regions (alias: okiv)(date, value, amount, salary)
  customers(date, type, salary, level)
Task: Find id from regions where value exceeds the count of value from customers for the same type.
SQL:

SELECT id FROM regions AS okiv
WHERE value > (
    SELECT COUNT(value) FROM customers AS lex
    WHERE lex.type = okiv.type
);


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

SELECT code FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM shipments AS vmob
    WHERE vmob.type = kab.type
);


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

SELECT salary FROM staff AS xnob
WHERE id IN (
    SELECT id FROM requests AS nad
    WHERE nad.code = xnob.code
);


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

SELECT name FROM managers AS hac
WHERE value > (
    SELECT SUM(salary) FROM regions AS znob
    WHERE znob.code = hac.code
);


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

SELECT value FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM requests AS lex
    WHERE lex.type = znob.type
);


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

SELECT amount FROM regions AS okiv
WHERE id IN (
    SELECT id FROM staff AS xnob
    WHERE xnob.type = okiv.type
);


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

SELECT amount FROM projects AS uliv
WHERE type IN (
    SELECT type FROM schedules AS znob
    WHERE znob.level = uliv.level
);


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

SELECT id FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM managers AS ikob
    WHERE ikob.id = okiv.id
);


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

SELECT salary FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM managers AS kab
    WHERE kab.level = vmob.level
);


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

SELECT code FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM transactions AS vnob
    WHERE vnob.id = znob.id
);


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

SELECT amount FROM accounts AS jac
WHERE value > (
    SELECT COUNT(amount) FROM regions AS egiv
    WHERE egiv.type = jac.type
);


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

SELECT code FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM invoices AS vmob
    WHERE vmob.code = dov.code
);


Prompt:
Schema:
  employees (alias: bev)(type, date, id, name)
  branches(level, code, name, id)
Task: Find code from employees where value exceeds the count of value from branches for the same level.
SQL:

SELECT code FROM employees AS bev
WHERE value > (
    SELECT COUNT(value) FROM branches AS ejof
    WHERE ejof.level = bev.level
);


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

SELECT value FROM staff AS xnob
WHERE EXISTS (
    SELECT 1 FROM regions AS ejof
    WHERE ejof.code = xnob.code
);


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

SELECT id FROM employees AS bev
WHERE EXISTS (
    SELECT 1 FROM tasks AS uliv
    WHERE uliv.code = bev.code
);


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

SELECT name FROM orders AS kab
WHERE id IN (
    SELECT id FROM sales AS cif
    WHERE cif.code = kab.code
);


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

SELECT id FROM invoices AS fal
WHERE level IN (
    SELECT level FROM accounts AS agov
    WHERE agov.code = fal.code
);


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

SELECT id FROM sales AS cif
WHERE amount > (
    SELECT COUNT(amount) FROM projects AS vnob
    WHERE vnob.status = cif.status
);


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

SELECT value FROM categories AS egiv
WHERE salary > (
    SELECT COUNT(salary) FROM sales AS nad
    WHERE nad.code = egiv.code
);


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

SELECT id FROM shipments AS vnob
WHERE level IN (
    SELECT level FROM employees AS okiv
    WHERE okiv.level = vnob.level
);


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

SELECT value FROM sales AS cif
WHERE id IN (
    SELECT id FROM shipments AS vmob
    WHERE vmob.status = cif.status
);


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

SELECT value FROM orders AS kab
WHERE salary > (
    SELECT MIN(value) FROM requests AS dov
    WHERE dov.type = kab.type
);


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

SELECT amount FROM transactions AS gev
WHERE salary > (
    SELECT COUNT(value) FROM shipments AS ejof
    WHERE ejof.level = gev.level
);


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

SELECT code FROM managers AS hac
WHERE level IN (
    SELECT level FROM projects AS gev
    WHERE gev.status = hac.status
);


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

SELECT id FROM regions AS okiv
WHERE value > (
    SELECT MAX(value) FROM projects AS nad
    WHERE nad.level = okiv.level
);


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

SELECT name FROM employees AS bev
WHERE EXISTS (
    SELECT 1 FROM transactions AS dov
    WHERE dov.type = bev.type
);


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

SELECT id FROM customers AS lex
WHERE EXISTS (
    SELECT 1 FROM staff AS cif
    WHERE cif.code = lex.code
);


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

SELECT name FROM orders AS kab
WHERE value > (
    SELECT MAX(value) FROM staff AS ikob
    WHERE ikob.status = kab.status
);


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

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


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

SELECT id FROM products AS nad
WHERE level IN (
    SELECT level FROM projects AS ejof
    WHERE ejof.type = nad.type
);


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

SELECT name FROM employees AS bev
WHERE EXISTS (
    SELECT 1 FROM shipments AS xnob
    WHERE xnob.status = bev.status
);


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

SELECT salary FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM categories AS cif
    WHERE cif.id = jac.id
);


Prompt:
Schema:
  items (alias: ikob)(salary, code, name, type)
  products(type, code, id, date)
Task: Retrieve value from items with value above the SUM(salary) of products rows sharing the same code.
SQL:

SELECT value FROM items AS ikob
WHERE value > (
    SELECT SUM(salary) FROM products AS vmob
    WHERE vmob.code = ikob.code
);


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

SELECT value FROM categories AS egiv
WHERE status IN (
    SELECT status FROM shipments AS ikob
    WHERE ikob.status = egiv.status
);


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

SELECT salary FROM schedules AS vmob
WHERE id IN (
    SELECT id FROM orders AS okiv
    WHERE okiv.type = vmob.type
);


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

SELECT value FROM categories AS egiv
WHERE code IN (
    SELECT code FROM sales AS vmob
    WHERE vmob.status = egiv.status
);


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

SELECT name FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM employees AS uliv
    WHERE uliv.code = okiv.code
);


Prompt:
Schema:
  accounts (alias: jac)(status, code, value, amount)
  categories(amount, name, code, status)
Task: Retrieve code from accounts with amount above the SUM(amount) of categories rows sharing the same type.
SQL:

SELECT code FROM accounts AS jac
WHERE amount > (
    SELECT SUM(amount) FROM categories AS ikob
    WHERE ikob.type = jac.type
);


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

SELECT amount FROM sales AS cif
WHERE EXISTS (
    SELECT 1 FROM employees AS uliv
    WHERE uliv.type = cif.type
);


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

SELECT value FROM managers AS hac
WHERE EXISTS (
    SELECT 1 FROM items AS kab
    WHERE kab.type = hac.type
);


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

SELECT value FROM items AS ikob
WHERE amount > (
    SELECT SUM(value) FROM employees AS vnob
    WHERE vnob.type = ikob.type
);


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

SELECT amount FROM employees AS bev
WHERE id IN (
    SELECT id FROM accounts AS vmob
    WHERE vmob.status = bev.status
);


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

SELECT value FROM requests AS ejof
WHERE id IN (
    SELECT id FROM projects AS xnob
    WHERE xnob.type = ejof.type
);


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

SELECT code FROM projects AS uliv
WHERE salary > (
    SELECT MIN(value) FROM shipments AS dov
    WHERE dov.status = uliv.status
);


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

SELECT amount FROM categories AS egiv
WHERE salary > (
    SELECT MAX(value) FROM employees AS dov
    WHERE dov.level = egiv.level
);


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

SELECT code FROM employees AS bev
WHERE EXISTS (
    SELECT 1 FROM managers AS egiv
    WHERE egiv.id = bev.id
);


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

SELECT salary FROM accounts AS jac
WHERE id IN (
    SELECT id FROM schedules AS vmob
    WHERE vmob.type = jac.type
);


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

SELECT salary FROM invoices AS fal
WHERE EXISTS (
    SELECT 1 FROM staff AS uliv
    WHERE uliv.level = fal.level
);


Prompt:
Schema:
  requests (alias: ejof)(value, code, amount, name)
  managers(amount, id, name, date)
Task: Find code from requests where value exceeds the count of amount from managers for the same level.
SQL:

SELECT code FROM requests AS ejof
WHERE value > (
    SELECT COUNT(amount) FROM managers AS dov
    WHERE dov.level = ejof.level
);


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

SELECT value FROM regions AS okiv
WHERE amount > (
    SELECT SUM(salary) FROM products AS ejof
    WHERE ejof.code = okiv.code
);


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

SELECT code FROM tasks AS znob
WHERE code IN (
    SELECT code FROM projects AS agov
    WHERE agov.level = znob.level
);


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

SELECT amount FROM staff AS xnob
WHERE type IN (
    SELECT type FROM projects AS kab
    WHERE kab.code = xnob.code
);


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

SELECT salary FROM staff AS xnob
WHERE id IN (
    SELECT id FROM regions AS vnob
    WHERE vnob.level = xnob.level
);


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

SELECT amount FROM branches AS agov
WHERE amount > (
    SELECT COUNT(salary) FROM categories AS xnob
    WHERE xnob.code = agov.code
);


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

SELECT code FROM tasks AS znob
WHERE level IN (
    SELECT level FROM branches AS jac
    WHERE jac.id = znob.id
);


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

SELECT code FROM shipments AS vnob
WHERE salary > (
    SELECT MIN(amount) FROM requests AS okiv
    WHERE okiv.status = vnob.status
);


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

SELECT amount FROM products AS nad
WHERE EXISTS (
    SELECT 1 FROM requests AS vmob
    WHERE vmob.id = nad.id
);


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

SELECT salary FROM staff AS xnob
WHERE amount > (
    SELECT COUNT(value) FROM branches AS nad
    WHERE nad.status = xnob.status
);


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

SELECT value FROM sales AS cif
WHERE code IN (
    SELECT code FROM branches AS nad
    WHERE nad.code = cif.code
);


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

SELECT value FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM managers AS agov
    WHERE agov.id = jac.id
);


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

SELECT code FROM items AS ikob
WHERE salary > (
    SELECT MAX(salary) FROM projects AS lex
    WHERE lex.level = ikob.level
);


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

SELECT code FROM items AS ikob
WHERE type IN (
    SELECT type FROM sales AS uliv
    WHERE uliv.status = ikob.status
);


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

SELECT name FROM employees AS bev
WHERE id IN (
    SELECT id FROM managers AS nad
    WHERE nad.code = bev.code
);


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

SELECT id FROM transactions AS gev
WHERE EXISTS (
    SELECT 1 FROM managers AS egiv
    WHERE egiv.level = gev.level
);


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

SELECT id FROM tasks AS znob
WHERE level IN (
    SELECT level FROM items AS cif
    WHERE cif.id = znob.id
);


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

SELECT salary FROM schedules AS vmob
WHERE amount > (
    SELECT MAX(value) FROM items AS gev
    WHERE gev.type = vmob.type
);


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

SELECT name FROM branches AS agov
WHERE status IN (
    SELECT status FROM staff AS dov
    WHERE dov.id = agov.id
);


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

SELECT salary FROM managers AS hac
WHERE amount > (
    SELECT AVG(value) FROM invoices AS bev
    WHERE bev.code = hac.code
);


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

SELECT value FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM accounts AS jac
    WHERE jac.code = kab.code
);


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

SELECT id FROM products AS nad
WHERE EXISTS (
    SELECT 1 FROM shipments AS bev
    WHERE bev.status = nad.status
);


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

SELECT id FROM tasks AS znob
WHERE level IN (
    SELECT level FROM sales AS jac
    WHERE jac.id = znob.id
);


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

SELECT amount FROM managers AS hac
WHERE id IN (
    SELECT id FROM sales AS xnob
    WHERE xnob.status = hac.status
);


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

SELECT amount FROM products AS nad
WHERE value > (
    SELECT MAX(salary) FROM requests AS dov
    WHERE dov.id = nad.id
);


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

SELECT code FROM products AS nad
WHERE EXISTS (
    SELECT 1 FROM categories AS uliv
    WHERE uliv.type = nad.type
);


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

SELECT id FROM categories AS egiv
WHERE amount > (
    SELECT SUM(salary) FROM employees AS fal
    WHERE fal.type = egiv.type
);


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

SELECT salary FROM sales AS cif
WHERE EXISTS (
    SELECT 1 FROM orders AS gev
    WHERE gev.type = cif.type
);


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

SELECT amount FROM managers AS hac
WHERE amount > (
    SELECT MAX(value) FROM regions AS kab
    WHERE kab.level = hac.level
);


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

SELECT id FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM managers AS bev
    WHERE bev.code = znob.code
);


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

SELECT value FROM requests AS ejof
WHERE EXISTS (
    SELECT 1 FROM shipments AS gev
    WHERE gev.id = ejof.id
);


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

SELECT id FROM projects AS uliv
WHERE id IN (
    SELECT id FROM items AS kab
    WHERE kab.status = uliv.status
);


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

SELECT id FROM employees AS bev
WHERE EXISTS (
    SELECT 1 FROM items AS ejof
    WHERE ejof.code = bev.code
);


Prompt:
Schema:
  requests (alias: ejof)(id, date, code, type)
  shipments(id, amount, name, level)
Task: Retrieve code from requests with amount above the AVG(amount) of shipments rows sharing the same code.
SQL:

SELECT code FROM requests AS ejof
WHERE amount > (
    SELECT AVG(amount) FROM shipments AS nad
    WHERE nad.code = ejof.code
);


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

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


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

SELECT amount FROM staff AS xnob
WHERE type IN (
    SELECT type FROM schedules AS agov
    WHERE agov.status = xnob.status
);


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

SELECT id FROM requests AS ejof
WHERE status IN (
    SELECT status FROM transactions AS gev
    WHERE gev.level = ejof.level
);


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

SELECT salary FROM departments AS dov
WHERE salary > (
    SELECT SUM(value) FROM employees AS xnob
    WHERE xnob.id = dov.id
);


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

SELECT amount FROM shipments AS vnob
WHERE amount > (
    SELECT MIN(value) FROM items AS ikob
    WHERE ikob.code = vnob.code
);


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

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


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

SELECT name FROM managers AS hac
WHERE value > (
    SELECT AVG(value) FROM customers AS gev
    WHERE gev.level = hac.level
);


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

SELECT value FROM shipments AS vnob
WHERE id IN (
    SELECT id FROM orders AS agov
    WHERE agov.id = vnob.id
);


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

SELECT amount FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM departments AS vmob
    WHERE vmob.id = agov.id
);


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

SELECT value FROM managers AS hac
WHERE EXISTS (
    SELECT 1 FROM regions AS lex
    WHERE lex.level = hac.level
);


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

SELECT id FROM accounts AS jac
WHERE amount > (
    SELECT MAX(value) FROM regions AS gev
    WHERE gev.id = jac.id
);


Prompt:
Schema:
  shipments (alias: vnob)(salary, amount, code, status)
  transactions(value, id, amount, date)
Task: Retrieve code from shipments with salary above the MAX(value) of transactions rows sharing the same code.
SQL:

SELECT code FROM shipments AS vnob
WHERE salary > (
    SELECT MAX(value) FROM transactions AS nad
    WHERE nad.code = vnob.code
);


Prompt:
Schema:
  shipments (alias: vnob)(id, salary, date, amount)
  tasks(salary, amount, name, type)
Task: Retrieve salary from shipments with salary above the SUM(salary) of tasks rows sharing the same type.
SQL:

SELECT salary FROM shipments AS vnob
WHERE salary > (
    SELECT SUM(salary) FROM tasks AS dov
    WHERE dov.type = vnob.type
);


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

SELECT code FROM transactions AS gev
WHERE id IN (
    SELECT id FROM employees AS dov
    WHERE dov.status = gev.status
);


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

SELECT salary FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM customers AS cif
    WHERE cif.status = agov.status
);


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

SELECT id FROM staff AS xnob
WHERE amount > (
    SELECT COUNT(salary) FROM managers AS nad
    WHERE nad.level = xnob.level
);


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

SELECT name FROM customers AS lex
WHERE value > (
    SELECT MAX(amount) FROM transactions AS cif
    WHERE cif.level = lex.level
);


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

SELECT id FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM departments AS bev
    WHERE bev.code = kab.code
);


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

SELECT salary FROM categories AS egiv
WHERE salary > (
    SELECT MIN(amount) FROM customers AS uliv
    WHERE uliv.code = egiv.code
);


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

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


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

SELECT amount FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM transactions AS fal
    WHERE fal.code = agov.code
);


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

SELECT salary FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM shipments AS uliv
    WHERE uliv.code = jac.code
);


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

SELECT name FROM requests AS ejof
WHERE type IN (
    SELECT type FROM invoices AS jac
    WHERE jac.type = ejof.type
);


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

SELECT id FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM transactions AS vmob
    WHERE vmob.type = kab.type
);


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

SELECT id FROM departments AS dov
WHERE value > (
    SELECT COUNT(value) FROM customers AS uliv
    WHERE uliv.level = dov.level
);


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

SELECT salary FROM shipments AS vnob
WHERE EXISTS (
    SELECT 1 FROM items AS znob
    WHERE znob.type = vnob.type
);


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

SELECT value FROM invoices AS fal
WHERE level IN (
    SELECT level FROM accounts AS jac
    WHERE jac.id = fal.id
);


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

SELECT value FROM invoices AS fal
WHERE value > (
    SELECT SUM(value) FROM transactions AS uliv
    WHERE uliv.type = fal.type
);


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

SELECT amount FROM regions AS okiv
WHERE status IN (
    SELECT status FROM tasks AS nad
    WHERE nad.level = okiv.level
);


Prompt:
Schema:
  managers (alias: hac)(type, name, salary, level)
  projects(level, value, name, amount)
Task: Retrieve name from managers with amount above the MAX(amount) of projects rows sharing the same code.
SQL:

SELECT name FROM managers AS hac
WHERE amount > (
    SELECT MAX(amount) FROM projects AS okiv
    WHERE okiv.code = hac.code
);


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

SELECT salary FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM projects AS fal
    WHERE fal.id = kab.id
);


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

SELECT salary FROM invoices AS fal
WHERE salary > (
    SELECT MIN(salary) FROM orders AS znob
    WHERE znob.code = fal.code
);


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

SELECT salary FROM projects AS uliv
WHERE salary > (
    SELECT MIN(value) FROM regions AS kab
    WHERE kab.code = uliv.code
);


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

SELECT salary FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM departments AS jac
    WHERE jac.type = agov.type
);


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

SELECT salary FROM products AS nad
WHERE value > (
    SELECT AVG(salary) FROM regions AS gev
    WHERE gev.status = nad.status
);


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

SELECT id FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM employees AS fal
    WHERE fal.type = kab.type
);


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

SELECT name FROM branches AS agov
WHERE code IN (
    SELECT code FROM schedules AS bev
    WHERE bev.status = agov.status
);


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

SELECT code FROM departments AS dov
WHERE salary > (
    SELECT COUNT(salary) FROM customers AS ikob
    WHERE ikob.code = dov.code
);


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

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


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

SELECT amount FROM projects AS uliv
WHERE amount > (
    SELECT SUM(value) FROM managers AS ejof
    WHERE ejof.type = uliv.type
);


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

SELECT name FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM staff AS ejof
    WHERE ejof.level = okiv.level
);


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

SELECT salary FROM orders AS kab
WHERE id IN (
    SELECT id FROM departments AS ejof
    WHERE ejof.type = kab.type
);


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

SELECT id FROM regions AS okiv
WHERE salary > (
    SELECT MAX(salary) FROM orders AS cif
    WHERE cif.id = okiv.id
);


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

SELECT id FROM projects AS uliv
WHERE amount > (
    SELECT AVG(value) FROM branches AS kab
    WHERE kab.code = uliv.code
);


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

SELECT value FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM branches AS bev
    WHERE bev.status = jac.status
);


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

SELECT value FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM tasks AS dov
    WHERE dov.status = egiv.status
);


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

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


Prompt:
Schema:
  items (alias: ikob)(date, status, salary, id)
  products(date, salary, id, type)
Task: Retrieve salary from items with value above the MAX(value) of products rows sharing the same status.
SQL:

SELECT salary FROM items AS ikob
WHERE value > (
    SELECT MAX(value) FROM products AS ejof
    WHERE ejof.status = ikob.status
);


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

SELECT amount FROM tasks AS znob
WHERE salary > (
    SELECT MIN(salary) FROM categories AS kab
    WHERE kab.id = znob.id
);


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

SELECT id FROM sales AS cif
WHERE EXISTS (
    SELECT 1 FROM shipments AS agov
    WHERE agov.code = cif.code
);


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

SELECT id FROM invoices AS fal
WHERE id IN (
    SELECT id FROM transactions AS kab
    WHERE kab.type = fal.type
);


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

SELECT id FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM requests AS bev
    WHERE bev.type = kab.type
);


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

SELECT amount FROM categories AS egiv
WHERE salary > (
    SELECT SUM(amount) FROM projects AS lex
    WHERE lex.level = egiv.level
);


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

SELECT salary FROM orders AS kab
WHERE salary > (
    SELECT COUNT(value) FROM employees AS lex
    WHERE lex.status = kab.status
);


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

SELECT id FROM regions AS okiv
WHERE amount > (
    SELECT COUNT(salary) FROM employees AS ikob
    WHERE ikob.code = okiv.code
);


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

SELECT name FROM projects AS uliv
WHERE value > (
    SELECT MAX(amount) FROM requests AS vnob
    WHERE vnob.type = uliv.type
);


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

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


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

SELECT salary FROM branches AS agov
WHERE code IN (
    SELECT code FROM orders AS vnob
    WHERE vnob.id = agov.id
);


Prompt:
Schema:
  schedules (alias: vmob)(type, id, value, amount)
  tasks(type, id, name, value)
Task: Find name from schedules where amount exceeds the average amount from tasks for the same id.
SQL:

SELECT name FROM schedules AS vmob
WHERE amount > (
    SELECT AVG(amount) FROM tasks AS jac
    WHERE jac.id = vmob.id
);


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

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


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

SELECT amount FROM shipments AS vnob
WHERE EXISTS (
    SELECT 1 FROM orders AS uliv
    WHERE uliv.level = vnob.level
);


Prompt:
Schema:
  items (alias: ikob)(name, code, date, salary)
  departments(status, name, salary, date)
Task: Retrieve salary from items with amount above the AVG(value) of departments rows sharing the same status.
SQL:

SELECT salary FROM items AS ikob
WHERE amount > (
    SELECT AVG(value) FROM departments AS kab
    WHERE kab.status = ikob.status
);


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

SELECT salary FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM projects AS vmob
    WHERE vmob.type = dov.type
);


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

SELECT name FROM managers AS hac
WHERE level IN (
    SELECT level FROM accounts AS egiv
    WHERE egiv.status = hac.status
);


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

SELECT name FROM employees AS bev
WHERE code IN (
    SELECT code FROM regions AS gev
    WHERE gev.id = bev.id
);


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

SELECT salary FROM staff AS xnob
WHERE id IN (
    SELECT id FROM sales AS agov
    WHERE agov.code = xnob.code
);


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

SELECT name FROM branches AS agov
WHERE value > (
    SELECT SUM(amount) FROM shipments AS cif
    WHERE cif.id = agov.id
);


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

SELECT name FROM regions AS okiv
WHERE type IN (
    SELECT type FROM shipments AS znob
    WHERE znob.level = okiv.level
);


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

SELECT code FROM projects AS uliv
WHERE amount > (
    SELECT MAX(salary) FROM categories AS hac
    WHERE hac.level = uliv.level
);


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

SELECT salary FROM schedules AS vmob
WHERE value > (
    SELECT COUNT(value) FROM categories AS nad
    WHERE nad.type = vmob.type
);


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

SELECT salary FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM tasks AS hac
    WHERE hac.code = kab.code
);


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

SELECT code FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM sales AS bev
    WHERE bev.id = kab.id
);


Prompt:
Schema:
  categories (alias: egiv)(date, level, type, value)
  products(value, level, date, type)
Task: Select id from categories where status exists in products for the same id.
SQL:

SELECT id FROM categories AS egiv
WHERE status IN (
    SELECT status FROM products AS vmob
    WHERE vmob.id = egiv.id
);


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

SELECT code FROM sales AS cif
WHERE EXISTS (
    SELECT 1 FROM tasks AS ejof
    WHERE ejof.id = cif.id
);


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

SELECT amount FROM categories AS egiv
WHERE id IN (
    SELECT id FROM shipments AS gev
    WHERE gev.status = egiv.status
);


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

SELECT salary FROM products AS nad
WHERE EXISTS (
    SELECT 1 FROM invoices AS ejof
    WHERE ejof.code = nad.code
);


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

SELECT name FROM staff AS xnob
WHERE id IN (
    SELECT id FROM customers AS okiv
    WHERE okiv.code = xnob.code
);


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

SELECT code FROM items AS ikob
WHERE value > (
    SELECT COUNT(amount) FROM staff AS dov
    WHERE dov.level = ikob.level
);


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

SELECT salary FROM managers AS hac
WHERE type IN (
    SELECT type FROM regions AS xnob
    WHERE xnob.level = hac.level
);


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

SELECT code FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM shipments AS nad
    WHERE nad.id = znob.id
);


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

SELECT code FROM transactions AS gev
WHERE type IN (
    SELECT type FROM products AS cif
    WHERE cif.level = gev.level
);


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

SELECT salary FROM shipments AS vnob
WHERE EXISTS (
    SELECT 1 FROM products AS ejof
    WHERE ejof.id = vnob.id
);


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

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


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

SELECT salary FROM customers AS lex
WHERE EXISTS (
    SELECT 1 FROM branches AS gev
    WHERE gev.id = lex.id
);


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

SELECT salary FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM items AS uliv
    WHERE uliv.level = dov.level
);


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

SELECT id FROM tasks AS znob
WHERE value > (
    SELECT SUM(amount) FROM products AS cif
    WHERE cif.type = znob.type
);


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

SELECT amount FROM invoices AS fal
WHERE status IN (
    SELECT status FROM staff AS xnob
    WHERE xnob.code = fal.code
);


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

SELECT name FROM products AS nad
WHERE status IN (
    SELECT status FROM categories AS ikob
    WHERE ikob.level = nad.level
);


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

SELECT salary FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM departments AS agov
    WHERE agov.status = okiv.status
);


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

SELECT salary FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM requests AS xnob
    WHERE xnob.code = vmob.code
);


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

SELECT salary FROM sales AS cif
WHERE EXISTS (
    SELECT 1 FROM customers AS vmob
    WHERE vmob.level = cif.level
);


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

SELECT id FROM categories AS egiv
WHERE type IN (
    SELECT type FROM accounts AS dov
    WHERE dov.id = egiv.id
);


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

SELECT salary FROM products AS nad
WHERE amount > (
    SELECT AVG(amount) FROM invoices AS ikob
    WHERE ikob.type = nad.type
);


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

SELECT value FROM departments AS dov
WHERE code IN (
    SELECT code FROM schedules AS uliv
    WHERE uliv.code = dov.code
);


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

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


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

SELECT id FROM managers AS hac
WHERE salary > (
    SELECT SUM(value) FROM products AS lex
    WHERE lex.code = hac.code
);


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

SELECT salary FROM items AS ikob
WHERE status IN (
    SELECT status FROM projects AS egiv
    WHERE egiv.status = ikob.status
);


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

SELECT id FROM invoices AS fal
WHERE id IN (
    SELECT id FROM employees AS uliv
    WHERE uliv.code = fal.code
);


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

SELECT id FROM requests AS ejof
WHERE level IN (
    SELECT level FROM employees AS xnob
    WHERE xnob.id = ejof.id
);


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

SELECT code FROM branches AS agov
WHERE type IN (
    SELECT type FROM invoices AS vnob
    WHERE vnob.type = agov.type
);


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

SELECT salary FROM categories AS egiv
WHERE status IN (
    SELECT status FROM schedules AS lex
    WHERE lex.status = egiv.status
);


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

SELECT amount FROM requests AS ejof
WHERE salary > (
    SELECT MIN(amount) FROM categories AS egiv
    WHERE egiv.id = ejof.id
);


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

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


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

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


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

SELECT salary FROM sales AS cif
WHERE level IN (
    SELECT level FROM invoices AS dov
    WHERE dov.code = cif.code
);


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

SELECT code FROM shipments AS vnob
WHERE id IN (
    SELECT id FROM employees AS jac
    WHERE jac.level = vnob.level
);


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

SELECT salary FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM products AS ikob
    WHERE ikob.level = jac.level
);


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

SELECT salary FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM customers AS bev
    WHERE bev.id = vmob.id
);


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

SELECT code FROM shipments AS vnob
WHERE type IN (
    SELECT type FROM categories AS ikob
    WHERE ikob.code = vnob.code
);


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

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


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

SELECT amount FROM schedules AS vmob
WHERE level IN (
    SELECT level FROM invoices AS fal
    WHERE fal.level = vmob.level
);


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

SELECT code FROM sales AS cif
WHERE level IN (
    SELECT level FROM projects AS okiv
    WHERE okiv.type = cif.type
);


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

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


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

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


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

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


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

SELECT name FROM sales AS cif
WHERE value > (
    SELECT MIN(value) FROM projects AS nad
    WHERE nad.status = cif.status
);


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

SELECT value FROM managers AS hac
WHERE EXISTS (
    SELECT 1 FROM invoices AS agov
    WHERE agov.level = hac.level
);


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

SELECT id FROM customers AS lex
WHERE value > (
    SELECT COUNT(salary) FROM sales AS vnob
    WHERE vnob.code = lex.code
);


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

SELECT code FROM regions AS okiv
WHERE status IN (
    SELECT status FROM branches AS ikob
    WHERE ikob.code = okiv.code
);


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

SELECT amount FROM orders AS kab
WHERE salary > (
    SELECT COUNT(salary) FROM requests AS hac
    WHERE hac.code = kab.code
);


Prompt:
Schema:
  regions (alias: okiv)(type, amount, code, level)
  employees(value, amount, type, level)
Task: Retrieve code from regions with amount above the MIN(amount) of employees rows sharing the same level.
SQL:

SELECT code FROM regions AS okiv
WHERE amount > (
    SELECT MIN(amount) FROM employees AS nad
    WHERE nad.level = okiv.level
);


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

SELECT amount FROM tasks AS znob
WHERE amount > (
    SELECT COUNT(value) FROM products AS jac
    WHERE jac.type = znob.type
);


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

SELECT salary FROM branches AS agov
WHERE amount > (
    SELECT AVG(value) FROM schedules AS bev
    WHERE bev.status = agov.status
);


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

SELECT code FROM tasks AS znob
WHERE code IN (
    SELECT code FROM invoices AS agov
    WHERE agov.code = znob.code
);


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

SELECT code FROM items AS ikob
WHERE code IN (
    SELECT code FROM products AS okiv
    WHERE okiv.status = ikob.status
);


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

SELECT salary FROM shipments AS vnob
WHERE salary > (
    SELECT SUM(amount) FROM items AS xnob
    WHERE xnob.level = vnob.level
);


Prompt:
Schema:
  branches (alias: agov)(id, type, amount, date)
  regions(amount, id, date, name)
Task: Select amount from branches where level exists in regions for the same id.
SQL:

SELECT amount FROM branches AS agov
WHERE level IN (
    SELECT level FROM regions AS uliv
    WHERE uliv.id = agov.id
);


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

SELECT id FROM items AS ikob
WHERE salary > (
    SELECT MIN(value) FROM requests AS znob
    WHERE znob.code = ikob.code
);


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

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


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

SELECT amount FROM branches AS agov
WHERE value > (
    SELECT AVG(value) FROM invoices AS nad
    WHERE nad.code = agov.code
);


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

SELECT value FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM invoices AS ikob
    WHERE ikob.type = agov.type
);


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

SELECT name FROM departments AS dov
WHERE code IN (
    SELECT code FROM accounts AS agov
    WHERE agov.level = dov.level
);


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

SELECT value FROM orders AS kab
WHERE id IN (
    SELECT id FROM regions AS jac
    WHERE jac.type = kab.type
);


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

SELECT code FROM employees AS bev
WHERE value > (
    SELECT MIN(salary) FROM items AS vnob
    WHERE vnob.level = bev.level
);


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

SELECT salary FROM invoices AS fal
WHERE EXISTS (
    SELECT 1 FROM schedules AS okiv
    WHERE okiv.status = fal.status
);


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

SELECT code FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM staff AS nad
    WHERE nad.status = agov.status
);


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

SELECT name FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM shipments AS uliv
    WHERE uliv.status = agov.status
);


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

SELECT amount FROM accounts AS jac
WHERE salary > (
    SELECT MAX(amount) FROM managers AS okiv
    WHERE okiv.type = jac.type
);


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

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


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

SELECT amount FROM accounts AS jac
WHERE value > (
    SELECT MAX(salary) FROM tasks AS uliv
    WHERE uliv.level = jac.level
);


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

SELECT name FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM tasks AS uliv
    WHERE uliv.level = agov.level
);


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

SELECT value FROM schedules AS vmob
WHERE status IN (
    SELECT status FROM regions AS hac
    WHERE hac.status = vmob.status
);


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

SELECT name FROM products AS nad
WHERE id IN (
    SELECT id FROM branches AS znob
    WHERE znob.id = nad.id
);


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

SELECT salary FROM invoices AS fal
WHERE amount > (
    SELECT AVG(amount) FROM categories AS cif
    WHERE cif.id = fal.id
);


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

SELECT amount FROM employees AS bev
WHERE amount > (
    SELECT COUNT(value) FROM items AS vnob
    WHERE vnob.code = bev.code
);


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

SELECT value FROM customers AS lex
WHERE EXISTS (
    SELECT 1 FROM requests AS nad
    WHERE nad.level = lex.level
);


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

SELECT amount FROM transactions AS gev
WHERE type IN (
    SELECT type FROM customers AS fal
    WHERE fal.code = gev.code
);


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

SELECT id FROM projects AS uliv
WHERE value > (
    SELECT SUM(amount) FROM branches AS ikob
    WHERE ikob.level = uliv.level
);


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

SELECT value FROM transactions AS gev
WHERE value > (
    SELECT MAX(value) FROM requests AS jac
    WHERE jac.status = gev.status
);


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

SELECT value FROM branches AS agov
WHERE amount > (
    SELECT MIN(salary) FROM sales AS znob
    WHERE znob.status = agov.status
);


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

SELECT value FROM schedules AS vmob
WHERE code IN (
    SELECT code FROM regions AS uliv
    WHERE uliv.level = vmob.level
);


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

SELECT name FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM transactions AS okiv
    WHERE okiv.id = egiv.id
);


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

SELECT id FROM requests AS ejof
WHERE EXISTS (
    SELECT 1 FROM departments AS agov
    WHERE agov.type = ejof.type
);


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

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


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

SELECT salary FROM invoices AS fal
WHERE code IN (
    SELECT code FROM customers AS jac
    WHERE jac.type = fal.type
);


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

SELECT amount FROM items AS ikob
WHERE EXISTS (
    SELECT 1 FROM requests AS znob
    WHERE znob.code = ikob.code
);


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

SELECT id FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM customers AS gev
    WHERE gev.status = jac.status
);


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

SELECT value FROM departments AS dov
WHERE code IN (
    SELECT code FROM regions AS vnob
    WHERE vnob.code = dov.code
);


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

SELECT id FROM employees AS bev
WHERE EXISTS (
    SELECT 1 FROM departments AS xnob
    WHERE xnob.type = bev.type
);


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

SELECT value FROM requests AS ejof
WHERE value > (
    SELECT AVG(amount) FROM sales AS ikob
    WHERE ikob.level = ejof.level
);


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

SELECT name FROM projects AS uliv
WHERE status IN (
    SELECT status FROM items AS bev
    WHERE bev.id = uliv.id
);


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

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


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

SELECT id FROM products AS nad
WHERE EXISTS (
    SELECT 1 FROM schedules AS jac
    WHERE jac.id = nad.id
);


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

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


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

SELECT code FROM projects AS uliv
WHERE salary > (
    SELECT SUM(value) FROM accounts AS okiv
    WHERE okiv.code = uliv.code
);


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

SELECT amount FROM tasks AS znob
WHERE amount > (
    SELECT MAX(value) FROM projects AS cif
    WHERE cif.level = znob.level
);


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

SELECT id FROM projects AS uliv
WHERE EXISTS (
    SELECT 1 FROM shipments AS gev
    WHERE gev.type = uliv.type
);


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

SELECT code FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM requests AS jac
    WHERE jac.type = vmob.type
);


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

SELECT code FROM shipments AS vnob
WHERE EXISTS (
    SELECT 1 FROM projects AS egiv
    WHERE egiv.code = vnob.code
);


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

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


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

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


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

SELECT amount FROM tasks AS znob
WHERE status IN (
    SELECT status FROM employees AS fal
    WHERE fal.level = znob.level
);


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

SELECT name FROM shipments AS vnob
WHERE status IN (
    SELECT status FROM invoices AS fal
    WHERE fal.level = vnob.level
);


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

SELECT code FROM orders AS kab
WHERE salary > (
    SELECT COUNT(value) FROM shipments AS ikob
    WHERE ikob.code = kab.code
);


Prompt:
Schema:
  items (alias: ikob)(amount, salary, date, status)
  projects(code, type, name, id)
Task: Find name from items where amount exceeds the count of amount from projects for the same id.
SQL:

SELECT name FROM items AS ikob
WHERE amount > (
    SELECT COUNT(amount) FROM projects AS uliv
    WHERE uliv.id = ikob.id
);


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

SELECT code FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM sales AS fal
    WHERE fal.id = jac.id
);


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

SELECT amount FROM tasks AS znob
WHERE salary > (
    SELECT COUNT(value) FROM departments AS dov
    WHERE dov.type = znob.type
);


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

SELECT code FROM staff AS xnob
WHERE EXISTS (
    SELECT 1 FROM regions AS nad
    WHERE nad.level = xnob.level
);


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

SELECT amount FROM tasks AS znob
WHERE status IN (
    SELECT status FROM items AS jac
    WHERE jac.code = znob.code
);


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

SELECT amount FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM departments AS egiv
    WHERE egiv.level = jac.level
);


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

SELECT value FROM shipments AS vnob
WHERE EXISTS (
    SELECT 1 FROM employees AS agov
    WHERE agov.code = vnob.code
);


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

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


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

SELECT value FROM projects AS uliv
WHERE code IN (
    SELECT code FROM shipments AS gev
    WHERE gev.status = uliv.status
);


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

SELECT value FROM customers AS lex
WHERE amount > (
    SELECT MAX(value) FROM projects AS cif
    WHERE cif.code = lex.code
);


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

SELECT value FROM staff AS xnob
WHERE EXISTS (
    SELECT 1 FROM sales AS nad
    WHERE nad.id = xnob.id
);


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

SELECT id FROM schedules AS vmob
WHERE level IN (
    SELECT level FROM requests AS xnob
    WHERE xnob.status = vmob.status
);


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

SELECT amount FROM tasks AS znob
WHERE salary > (
    SELECT MIN(value) FROM regions AS lex
    WHERE lex.id = znob.id
);


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

SELECT name FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM managers AS kab
    WHERE kab.type = egiv.type
);


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

SELECT value FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM schedules AS xnob
    WHERE xnob.status = kab.status
);


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

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


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

SELECT code FROM customers AS lex
WHERE id IN (
    SELECT id FROM schedules AS okiv
    WHERE okiv.level = lex.level
);


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

SELECT name FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM invoices AS vnob
    WHERE vnob.id = dov.id
);


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

SELECT code FROM items AS ikob
WHERE status IN (
    SELECT status FROM schedules AS hac
    WHERE hac.id = ikob.id
);


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

SELECT code FROM managers AS hac
WHERE EXISTS (
    SELECT 1 FROM staff AS jac
    WHERE jac.code = hac.code
);


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

SELECT amount FROM items AS ikob
WHERE EXISTS (
    SELECT 1 FROM categories AS fal
    WHERE fal.type = ikob.type
);


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

SELECT salary FROM categories AS egiv
WHERE level IN (
    SELECT level FROM regions AS ejof
    WHERE ejof.status = egiv.status
);


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

SELECT amount FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM transactions AS hac
    WHERE hac.code = znob.code
);


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

SELECT value FROM projects AS uliv
WHERE EXISTS (
    SELECT 1 FROM products AS znob
    WHERE znob.status = uliv.status
);


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

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


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

SELECT id FROM requests AS ejof
WHERE salary > (
    SELECT AVG(value) FROM sales AS gev
    WHERE gev.id = ejof.id
);


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

SELECT value FROM shipments AS vnob
WHERE status IN (
    SELECT status FROM managers AS kab
    WHERE kab.type = vnob.type
);


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

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


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

SELECT name FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM projects AS lex
    WHERE lex.level = vmob.level
);


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

SELECT code FROM shipments AS vnob
WHERE status IN (
    SELECT status FROM projects AS jac
    WHERE jac.status = vnob.status
);


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

SELECT id FROM regions AS okiv
WHERE salary > (
    SELECT AVG(value) FROM categories AS ikob
    WHERE ikob.type = okiv.type
);


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

SELECT value FROM employees AS bev
WHERE EXISTS (
    SELECT 1 FROM staff AS jac
    WHERE jac.code = bev.code
);


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

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


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

SELECT id FROM regions AS okiv
WHERE amount > (
    SELECT MAX(value) FROM transactions AS vmob
    WHERE vmob.level = okiv.level
);