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

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


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

SELECT name FROM tasks AS znob
WHERE code IN (
    SELECT code FROM accounts AS ejof
    WHERE ejof.id = znob.id
);


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

SELECT amount FROM shipments AS vnob
WHERE salary > (
    SELECT COUNT(value) FROM schedules AS xnob
    WHERE xnob.level = vnob.level
);


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

SELECT id FROM sales AS cif
WHERE EXISTS (
    SELECT 1 FROM items AS vnob
    WHERE vnob.id = cif.id
);


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

SELECT code FROM invoices AS fal
WHERE value > (
    SELECT AVG(value) FROM schedules AS ikob
    WHERE ikob.type = fal.type
);


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

SELECT code FROM accounts AS jac
WHERE value > (
    SELECT AVG(value) FROM managers AS egiv
    WHERE egiv.level = jac.level
);


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

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


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

SELECT id FROM transactions AS gev
WHERE status IN (
    SELECT status FROM managers AS xnob
    WHERE xnob.type = gev.type
);


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

SELECT id FROM staff AS xnob
WHERE EXISTS (
    SELECT 1 FROM invoices AS gev
    WHERE gev.id = xnob.id
);


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

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


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

SELECT amount FROM transactions AS gev
WHERE EXISTS (
    SELECT 1 FROM sales AS lex
    WHERE lex.status = gev.status
);


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

SELECT id FROM schedules AS vmob
WHERE amount > (
    SELECT MAX(value) FROM products AS jac
    WHERE jac.code = vmob.code
);


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

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


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

SELECT amount FROM shipments AS vnob
WHERE id IN (
    SELECT id FROM projects AS ikob
    WHERE ikob.code = vnob.code
);


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

SELECT value FROM items AS ikob
WHERE EXISTS (
    SELECT 1 FROM shipments AS cif
    WHERE cif.code = ikob.code
);


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

SELECT code FROM categories AS egiv
WHERE code IN (
    SELECT code FROM tasks AS uliv
    WHERE uliv.type = egiv.type
);


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

SELECT name FROM staff AS xnob
WHERE EXISTS (
    SELECT 1 FROM products AS vmob
    WHERE vmob.level = xnob.level
);


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

SELECT value FROM requests AS ejof
WHERE status IN (
    SELECT status FROM regions AS znob
    WHERE znob.level = ejof.level
);


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

SELECT code FROM schedules AS vmob
WHERE type IN (
    SELECT type FROM requests AS agov
    WHERE agov.status = vmob.status
);


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

SELECT id FROM categories AS egiv
WHERE level IN (
    SELECT level FROM products AS uliv
    WHERE uliv.id = egiv.id
);


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

SELECT id FROM projects AS uliv
WHERE value > (
    SELECT COUNT(salary) FROM items AS okiv
    WHERE okiv.level = uliv.level
);


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

SELECT code FROM transactions AS gev
WHERE type IN (
    SELECT type FROM departments AS vnob
    WHERE vnob.status = gev.status
);


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

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


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

SELECT id FROM transactions AS gev
WHERE EXISTS (
    SELECT 1 FROM orders AS nad
    WHERE nad.status = gev.status
);


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

SELECT name FROM sales AS cif
WHERE EXISTS (
    SELECT 1 FROM tasks AS nad
    WHERE nad.type = cif.type
);


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

SELECT name FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM items AS egiv
    WHERE egiv.type = agov.type
);


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

SELECT value FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM tasks AS ejof
    WHERE ejof.id = egiv.id
);


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

SELECT value FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM requests AS gev
    WHERE gev.level = dov.level
);


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

SELECT id FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM accounts AS lex
    WHERE lex.code = egiv.code
);


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

SELECT value FROM managers AS hac
WHERE id IN (
    SELECT id FROM orders AS xnob
    WHERE xnob.level = hac.level
);


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

SELECT amount FROM products AS nad
WHERE salary > (
    SELECT AVG(value) FROM customers AS vmob
    WHERE vmob.type = nad.type
);


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

SELECT amount FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM products AS gev
    WHERE gev.type = egiv.type
);


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

SELECT code FROM products AS nad
WHERE amount > (
    SELECT AVG(value) FROM accounts AS znob
    WHERE znob.id = nad.id
);


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

SELECT salary FROM branches AS agov
WHERE code IN (
    SELECT code FROM employees AS hac
    WHERE hac.level = agov.level
);


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

SELECT amount FROM regions AS okiv
WHERE code IN (
    SELECT code FROM shipments AS ejof
    WHERE ejof.status = okiv.status
);


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

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


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

SELECT name FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM managers AS jac
    WHERE jac.status = znob.status
);


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

SELECT name FROM employees AS bev
WHERE id IN (
    SELECT id FROM products AS agov
    WHERE agov.type = bev.type
);


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

SELECT id FROM categories AS egiv
WHERE value > (
    SELECT MIN(value) FROM projects AS cif
    WHERE cif.id = egiv.id
);


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

SELECT amount FROM customers AS lex
WHERE EXISTS (
    SELECT 1 FROM shipments AS gev
    WHERE gev.type = lex.type
);


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

SELECT code FROM orders AS kab
WHERE amount > (
    SELECT MIN(salary) FROM staff AS lex
    WHERE lex.status = kab.status
);


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

SELECT code FROM shipments AS vnob
WHERE value > (
    SELECT MAX(amount) FROM products AS ejof
    WHERE ejof.code = vnob.code
);


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

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


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

SELECT code FROM requests AS ejof
WHERE salary > (
    SELECT MIN(salary) FROM accounts AS nad
    WHERE nad.type = ejof.type
);


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

SELECT id FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM projects AS kab
    WHERE kab.id = znob.id
);


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

SELECT salary FROM tasks AS znob
WHERE salary > (
    SELECT SUM(amount) FROM items AS lex
    WHERE lex.code = znob.code
);


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

SELECT value FROM sales AS cif
WHERE level IN (
    SELECT level FROM items AS vnob
    WHERE vnob.status = cif.status
);


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

SELECT value FROM products AS nad
WHERE id IN (
    SELECT id FROM categories AS fal
    WHERE fal.code = nad.code
);


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

SELECT name FROM transactions AS gev
WHERE value > (
    SELECT COUNT(salary) FROM branches AS agov
    WHERE agov.level = gev.level
);


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

SELECT value FROM staff AS xnob
WHERE level IN (
    SELECT level FROM orders AS hac
    WHERE hac.id = xnob.id
);


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

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


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

SELECT id FROM shipments AS vnob
WHERE amount > (
    SELECT MIN(amount) FROM accounts AS vmob
    WHERE vmob.type = vnob.type
);


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

SELECT amount FROM departments AS dov
WHERE value > (
    SELECT MIN(salary) FROM orders AS xnob
    WHERE xnob.type = dov.type
);


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

SELECT name FROM shipments AS vnob
WHERE EXISTS (
    SELECT 1 FROM schedules AS ejof
    WHERE ejof.level = vnob.level
);


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

SELECT salary FROM shipments AS vnob
WHERE code IN (
    SELECT code FROM staff AS gev
    WHERE gev.type = vnob.type
);


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

SELECT salary FROM departments AS dov
WHERE salary > (
    SELECT SUM(amount) FROM requests AS ejof
    WHERE ejof.code = dov.code
);


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

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


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

SELECT salary FROM regions AS okiv
WHERE level IN (
    SELECT level FROM sales AS kab
    WHERE kab.status = okiv.status
);


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

SELECT value FROM projects AS uliv
WHERE status IN (
    SELECT status FROM sales AS fal
    WHERE fal.status = uliv.status
);


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

SELECT name FROM staff AS xnob
WHERE EXISTS (
    SELECT 1 FROM projects AS hac
    WHERE hac.status = xnob.status
);


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

SELECT value FROM departments AS dov
WHERE value > (
    SELECT MIN(value) FROM projects AS fal
    WHERE fal.type = dov.type
);


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

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


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

SELECT name FROM requests AS ejof
WHERE amount > (
    SELECT MAX(amount) FROM categories AS fal
    WHERE fal.id = ejof.id
);


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

SELECT salary FROM customers AS lex
WHERE level IN (
    SELECT level FROM items AS okiv
    WHERE okiv.level = lex.level
);


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

SELECT amount FROM sales AS cif
WHERE value > (
    SELECT AVG(amount) FROM categories AS nad
    WHERE nad.level = cif.level
);


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

SELECT id FROM projects AS uliv
WHERE EXISTS (
    SELECT 1 FROM requests AS bev
    WHERE bev.code = uliv.code
);


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

SELECT code FROM managers AS hac
WHERE type IN (
    SELECT type FROM branches AS vnob
    WHERE vnob.type = hac.type
);


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

SELECT amount FROM items AS ikob
WHERE EXISTS (
    SELECT 1 FROM regions AS kab
    WHERE kab.level = ikob.level
);


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

SELECT id FROM products AS nad
WHERE type IN (
    SELECT type FROM branches AS gev
    WHERE gev.level = nad.level
);


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

SELECT code FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM shipments AS dov
    WHERE dov.level = okiv.level
);


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

SELECT code FROM requests AS ejof
WHERE EXISTS (
    SELECT 1 FROM staff AS dov
    WHERE dov.status = ejof.status
);


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

SELECT id FROM projects AS uliv
WHERE salary > (
    SELECT AVG(value) FROM schedules AS nad
    WHERE nad.level = uliv.level
);


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

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


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

SELECT salary FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM sales AS kab
    WHERE kab.id = okiv.id
);


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

SELECT salary FROM accounts AS jac
WHERE code IN (
    SELECT code FROM managers AS xnob
    WHERE xnob.code = jac.code
);


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

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


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

SELECT name FROM orders AS kab
WHERE amount > (
    SELECT MAX(value) FROM branches AS znob
    WHERE znob.code = kab.code
);


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

SELECT value FROM invoices AS fal
WHERE EXISTS (
    SELECT 1 FROM employees AS gev
    WHERE gev.id = fal.id
);


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

SELECT id FROM products AS nad
WHERE amount > (
    SELECT COUNT(value) FROM regions AS znob
    WHERE znob.level = nad.level
);


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

SELECT id FROM shipments AS vnob
WHERE salary > (
    SELECT COUNT(amount) FROM products AS nad
    WHERE nad.code = vnob.code
);


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

SELECT value FROM managers AS hac
WHERE level IN (
    SELECT level FROM orders AS ikob
    WHERE ikob.status = hac.status
);


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

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


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

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


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

SELECT amount FROM items AS ikob
WHERE amount > (
    SELECT AVG(salary) FROM accounts AS agov
    WHERE agov.level = ikob.level
);


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

SELECT value FROM departments AS dov
WHERE amount > (
    SELECT AVG(value) FROM sales AS gev
    WHERE gev.level = dov.level
);


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

SELECT value FROM employees AS bev
WHERE code IN (
    SELECT code FROM accounts AS jac
    WHERE jac.type = bev.type
);


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

SELECT name FROM branches AS agov
WHERE status IN (
    SELECT status FROM sales AS lex
    WHERE lex.type = agov.type
);


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

SELECT salary FROM orders AS kab
WHERE level IN (
    SELECT level FROM staff AS ikob
    WHERE ikob.type = kab.type
);


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

SELECT id FROM sales AS cif
WHERE type IN (
    SELECT type FROM managers AS bev
    WHERE bev.code = cif.code
);


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

SELECT amount FROM sales AS cif
WHERE EXISTS (
    SELECT 1 FROM staff AS vmob
    WHERE vmob.id = cif.id
);


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

SELECT salary FROM products AS nad
WHERE amount > (
    SELECT MAX(salary) FROM branches AS lex
    WHERE lex.type = nad.type
);


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

SELECT value FROM sales AS cif
WHERE salary > (
    SELECT MIN(amount) FROM tasks AS agov
    WHERE agov.code = cif.code
);


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

SELECT amount FROM staff AS xnob
WHERE value > (
    SELECT MIN(salary) FROM tasks AS ikob
    WHERE ikob.code = xnob.code
);


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

SELECT code FROM items AS ikob
WHERE value > (
    SELECT SUM(amount) FROM transactions AS lex
    WHERE lex.status = ikob.status
);


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

SELECT value FROM tasks AS znob
WHERE code IN (
    SELECT code FROM accounts AS okiv
    WHERE okiv.level = znob.level
);


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

SELECT value FROM staff AS xnob
WHERE code IN (
    SELECT code FROM sales AS lex
    WHERE lex.code = xnob.code
);


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

SELECT id FROM orders AS kab
WHERE value > (
    SELECT MAX(salary) FROM products AS cif
    WHERE cif.id = kab.id
);


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

SELECT id FROM products AS nad
WHERE salary > (
    SELECT SUM(salary) FROM accounts AS egiv
    WHERE egiv.id = nad.id
);


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

SELECT name FROM accounts AS jac
WHERE code IN (
    SELECT code FROM projects AS lex
    WHERE lex.level = jac.level
);


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

SELECT code FROM projects AS uliv
WHERE amount > (
    SELECT AVG(amount) FROM orders AS ejof
    WHERE ejof.level = uliv.level
);


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

SELECT id FROM products AS nad
WHERE EXISTS (
    SELECT 1 FROM orders AS vnob
    WHERE vnob.code = nad.code
);


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

SELECT salary FROM requests AS ejof
WHERE status IN (
    SELECT status FROM shipments AS znob
    WHERE znob.code = ejof.code
);


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

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


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

SELECT salary FROM projects AS uliv
WHERE EXISTS (
    SELECT 1 FROM managers AS znob
    WHERE znob.type = uliv.type
);


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

SELECT name FROM sales AS cif
WHERE salary > (
    SELECT SUM(salary) FROM regions AS ikob
    WHERE ikob.type = cif.type
);


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

SELECT name FROM staff AS xnob
WHERE EXISTS (
    SELECT 1 FROM schedules AS okiv
    WHERE okiv.status = xnob.status
);


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

SELECT id FROM orders AS kab
WHERE code IN (
    SELECT code FROM categories AS vnob
    WHERE vnob.type = kab.type
);


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

SELECT name FROM regions AS okiv
WHERE id IN (
    SELECT id FROM orders AS nad
    WHERE nad.level = okiv.level
);


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

SELECT name FROM requests AS ejof
WHERE level IN (
    SELECT level FROM accounts AS dov
    WHERE dov.level = ejof.level
);


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

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


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

SELECT id FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM managers AS hac
    WHERE hac.type = agov.type
);


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

SELECT name FROM sales AS cif
WHERE amount > (
    SELECT AVG(value) FROM schedules AS jac
    WHERE jac.level = cif.level
);


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

SELECT salary FROM products AS nad
WHERE salary > (
    SELECT MAX(value) FROM customers AS kab
    WHERE kab.level = nad.level
);


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

SELECT value FROM managers AS hac
WHERE level IN (
    SELECT level FROM invoices AS ikob
    WHERE ikob.type = hac.type
);


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

SELECT salary FROM shipments AS vnob
WHERE EXISTS (
    SELECT 1 FROM customers AS dov
    WHERE dov.id = vnob.id
);


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

SELECT amount FROM projects AS uliv
WHERE EXISTS (
    SELECT 1 FROM invoices AS jac
    WHERE jac.id = uliv.id
);


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

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


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

SELECT salary FROM schedules AS vmob
WHERE value > (
    SELECT SUM(amount) FROM projects AS uliv
    WHERE uliv.id = vmob.id
);


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

SELECT amount FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM sales AS hac
    WHERE hac.status = jac.status
);


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

SELECT code FROM departments AS dov
WHERE salary > (
    SELECT MIN(value) FROM tasks AS xnob
    WHERE xnob.type = dov.type
);


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

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


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

SELECT salary FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM invoices AS dov
    WHERE dov.id = okiv.id
);


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

SELECT name FROM regions AS okiv
WHERE id IN (
    SELECT id FROM departments AS nad
    WHERE nad.type = okiv.type
);


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

SELECT salary FROM staff AS xnob
WHERE type IN (
    SELECT type FROM sales AS egiv
    WHERE egiv.level = xnob.level
);


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

SELECT amount FROM transactions AS gev
WHERE salary > (
    SELECT MAX(amount) FROM categories AS uliv
    WHERE uliv.level = gev.level
);


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

SELECT id FROM tasks AS znob
WHERE salary > (
    SELECT MIN(value) FROM sales AS uliv
    WHERE uliv.code = znob.code
);


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

SELECT code FROM staff AS xnob
WHERE code IN (
    SELECT code FROM categories AS nad
    WHERE nad.status = xnob.status
);


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

SELECT amount FROM shipments AS vnob
WHERE level IN (
    SELECT level FROM schedules AS kab
    WHERE kab.status = vnob.status
);


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

SELECT salary FROM sales AS cif
WHERE status IN (
    SELECT status FROM schedules AS hac
    WHERE hac.id = cif.id
);


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

SELECT value FROM shipments AS vnob
WHERE value > (
    SELECT SUM(value) FROM sales AS ejof
    WHERE ejof.id = vnob.id
);


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

SELECT salary FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM sales AS vmob
    WHERE vmob.id = kab.id
);


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

SELECT amount FROM invoices AS fal
WHERE type IN (
    SELECT type FROM regions AS znob
    WHERE znob.status = fal.status
);


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

SELECT amount FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM employees AS dov
    WHERE dov.id = okiv.id
);


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

SELECT salary FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM shipments AS vnob
    WHERE vnob.id = vmob.id
);


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

SELECT name FROM departments AS dov
WHERE value > (
    SELECT AVG(value) FROM projects AS xnob
    WHERE xnob.level = dov.level
);


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

SELECT name FROM managers AS hac
WHERE EXISTS (
    SELECT 1 FROM products AS ikob
    WHERE ikob.level = hac.level
);


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

SELECT code FROM customers AS lex
WHERE level IN (
    SELECT level FROM managers AS dov
    WHERE dov.type = lex.type
);


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

SELECT amount FROM invoices AS fal
WHERE EXISTS (
    SELECT 1 FROM departments AS gev
    WHERE gev.code = fal.code
);


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

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


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

SELECT salary FROM departments AS dov
WHERE status IN (
    SELECT status FROM customers AS znob
    WHERE znob.status = dov.status
);


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

SELECT code FROM customers AS lex
WHERE salary > (
    SELECT AVG(value) FROM transactions AS kab
    WHERE kab.code = lex.code
);


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

SELECT salary FROM orders AS kab
WHERE level IN (
    SELECT level FROM items AS gev
    WHERE gev.code = kab.code
);


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

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


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

SELECT id FROM transactions AS gev
WHERE salary > (
    SELECT COUNT(amount) FROM categories AS xnob
    WHERE xnob.code = gev.code
);


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

SELECT amount FROM orders AS kab
WHERE type IN (
    SELECT type FROM requests AS fal
    WHERE fal.code = kab.code
);


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

SELECT name FROM requests AS ejof
WHERE EXISTS (
    SELECT 1 FROM items AS hac
    WHERE hac.status = ejof.status
);


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

SELECT value FROM customers AS lex
WHERE status IN (
    SELECT status FROM invoices AS nad
    WHERE nad.level = lex.level
);


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

SELECT amount FROM branches AS agov
WHERE id IN (
    SELECT id FROM staff AS hac
    WHERE hac.type = agov.type
);


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

SELECT amount FROM items AS ikob
WHERE amount > (
    SELECT MAX(amount) FROM accounts AS egiv
    WHERE egiv.level = ikob.level
);


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

SELECT name FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM projects AS hac
    WHERE hac.level = agov.level
);


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

SELECT id FROM products AS nad
WHERE id IN (
    SELECT id FROM sales AS cif
    WHERE cif.level = nad.level
);


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

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


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

SELECT amount FROM regions AS okiv
WHERE code IN (
    SELECT code FROM shipments AS kab
    WHERE kab.status = okiv.status
);


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

SELECT salary FROM transactions AS gev
WHERE EXISTS (
    SELECT 1 FROM customers AS nad
    WHERE nad.status = gev.status
);


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

SELECT name FROM employees AS bev
WHERE value > (
    SELECT COUNT(salary) FROM projects AS dov
    WHERE dov.status = bev.status
);


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

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


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

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


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

SELECT name FROM requests AS ejof
WHERE salary > (
    SELECT MIN(amount) FROM employees AS agov
    WHERE agov.level = ejof.level
);


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

SELECT name FROM schedules AS vmob
WHERE level IN (
    SELECT level FROM managers AS nad
    WHERE nad.code = vmob.code
);


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

SELECT id FROM departments AS dov
WHERE amount > (
    SELECT COUNT(amount) FROM managers AS nad
    WHERE nad.level = dov.level
);


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

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


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

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


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

SELECT code FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM managers AS dov
    WHERE dov.type = egiv.type
);


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

SELECT id FROM items AS ikob
WHERE value > (
    SELECT MAX(amount) FROM requests AS uliv
    WHERE uliv.type = ikob.type
);


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

SELECT salary FROM customers AS lex
WHERE EXISTS (
    SELECT 1 FROM orders AS cif
    WHERE cif.level = lex.level
);


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

SELECT salary FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM staff AS vnob
    WHERE vnob.status = egiv.status
);


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

SELECT code FROM projects AS uliv
WHERE level IN (
    SELECT level FROM items AS gev
    WHERE gev.level = uliv.level
);


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

SELECT code FROM schedules AS vmob
WHERE salary > (
    SELECT AVG(amount) FROM items AS okiv
    WHERE okiv.id = vmob.id
);


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

SELECT salary FROM regions AS okiv
WHERE type IN (
    SELECT type FROM orders AS lex
    WHERE lex.status = okiv.status
);


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

SELECT code FROM employees AS bev
WHERE level IN (
    SELECT level FROM invoices AS cif
    WHERE cif.id = bev.id
);


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

SELECT salary FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM branches AS xnob
    WHERE xnob.status = kab.status
);


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

SELECT salary FROM projects AS uliv
WHERE amount > (
    SELECT MIN(value) FROM regions AS hac
    WHERE hac.id = uliv.id
);


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

SELECT value FROM shipments AS vnob
WHERE salary > (
    SELECT SUM(salary) FROM regions AS cif
    WHERE cif.status = vnob.status
);


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

SELECT code FROM schedules AS vmob
WHERE salary > (
    SELECT MIN(value) FROM projects AS okiv
    WHERE okiv.code = vmob.code
);


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

SELECT salary FROM products AS nad
WHERE EXISTS (
    SELECT 1 FROM transactions AS gev
    WHERE gev.level = nad.level
);


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

SELECT value FROM invoices AS fal
WHERE id IN (
    SELECT id FROM tasks AS hac
    WHERE hac.id = fal.id
);


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

SELECT id FROM regions AS okiv
WHERE amount > (
    SELECT MIN(value) FROM requests AS ejof
    WHERE ejof.code = okiv.code
);


Prompt:
Schema:
  staff (alias: xnob)(amount, value, code, name)
  regions(value, level, amount, salary)
Task: Retrieve name from staff with value above the AVG(value) of regions rows sharing the same level.
SQL:

SELECT name FROM staff AS xnob
WHERE value > (
    SELECT AVG(value) FROM regions AS dov
    WHERE dov.level = xnob.level
);


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

SELECT id FROM managers AS hac
WHERE EXISTS (
    SELECT 1 FROM shipments AS znob
    WHERE znob.level = hac.level
);


Prompt:
Schema:
  products (alias: nad)(status, code, name, amount)
  schedules(status, amount, code, value)
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 bev
    WHERE bev.id = nad.id
);


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

SELECT amount FROM branches AS agov
WHERE type IN (
    SELECT type FROM invoices AS dov
    WHERE dov.level = agov.level
);


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

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


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

SELECT code FROM schedules AS vmob
WHERE salary > (
    SELECT AVG(salary) FROM branches AS uliv
    WHERE uliv.status = vmob.status
);


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

SELECT salary FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM customers AS vnob
    WHERE vnob.code = egiv.code
);


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

SELECT name FROM projects AS uliv
WHERE EXISTS (
    SELECT 1 FROM accounts AS vmob
    WHERE vmob.level = uliv.level
);


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

SELECT id FROM regions AS okiv
WHERE amount > (
    SELECT MAX(salary) FROM accounts AS agov
    WHERE agov.type = okiv.type
);


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

SELECT name FROM transactions AS gev
WHERE level IN (
    SELECT level FROM tasks AS vmob
    WHERE vmob.status = gev.status
);


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

SELECT name FROM items AS ikob
WHERE amount > (
    SELECT MIN(value) FROM schedules AS bev
    WHERE bev.level = ikob.level
);


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

SELECT name FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM departments AS kab
    WHERE kab.level = jac.level
);


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

SELECT id FROM schedules AS vmob
WHERE salary > (
    SELECT AVG(salary) FROM projects AS hac
    WHERE hac.code = vmob.code
);


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

SELECT id FROM transactions AS gev
WHERE value > (
    SELECT AVG(salary) FROM branches AS uliv
    WHERE uliv.level = gev.level
);


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

SELECT value FROM transactions AS gev
WHERE value > (
    SELECT COUNT(amount) FROM items AS agov
    WHERE agov.type = gev.type
);


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

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


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

SELECT value FROM transactions AS gev
WHERE id IN (
    SELECT id FROM projects AS vmob
    WHERE vmob.status = gev.status
);


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

SELECT name FROM staff AS xnob
WHERE EXISTS (
    SELECT 1 FROM transactions AS bev
    WHERE bev.code = xnob.code
);


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

SELECT salary FROM categories AS egiv
WHERE code IN (
    SELECT code FROM requests AS dov
    WHERE dov.level = egiv.level
);


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

SELECT amount FROM shipments AS vnob
WHERE value > (
    SELECT MAX(amount) FROM orders AS okiv
    WHERE okiv.level = vnob.level
);


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

SELECT name FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM customers AS fal
    WHERE fal.code = jac.code
);


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

SELECT value FROM customers AS lex
WHERE EXISTS (
    SELECT 1 FROM employees AS vnob
    WHERE vnob.level = lex.level
);


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

SELECT name FROM shipments AS vnob
WHERE level IN (
    SELECT level FROM customers AS dov
    WHERE dov.type = vnob.type
);


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

SELECT salary FROM products AS nad
WHERE amount > (
    SELECT MAX(amount) FROM invoices AS cif
    WHERE cif.status = nad.status
);


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

SELECT amount FROM staff AS xnob
WHERE type IN (
    SELECT type FROM orders AS agov
    WHERE agov.code = xnob.code
);


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

SELECT name FROM products AS nad
WHERE type IN (
    SELECT type FROM regions AS vnob
    WHERE vnob.id = nad.id
);


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

SELECT code FROM staff AS xnob
WHERE status IN (
    SELECT status FROM requests AS jac
    WHERE jac.status = xnob.status
);


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

SELECT code FROM managers AS hac
WHERE value > (
    SELECT MIN(amount) FROM requests AS nad
    WHERE nad.code = hac.code
);


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

SELECT amount FROM tasks AS znob
WHERE type IN (
    SELECT type FROM products AS ikob
    WHERE ikob.type = znob.type
);


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

SELECT salary FROM departments AS dov
WHERE type IN (
    SELECT type FROM tasks AS egiv
    WHERE egiv.level = dov.level
);


Prompt:
Schema:
  categories (alias: egiv)(date, type, id, name)
  accounts(salary, amount, value, name)
Task: Retrieve amount from categories with value above the MIN(salary) of accounts rows sharing the same id.
SQL:

SELECT amount FROM categories AS egiv
WHERE value > (
    SELECT MIN(salary) FROM accounts AS lex
    WHERE lex.id = egiv.id
);


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

SELECT value FROM sales AS cif
WHERE type IN (
    SELECT type FROM departments AS nad
    WHERE nad.type = cif.type
);


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

SELECT amount FROM customers AS lex
WHERE code IN (
    SELECT code FROM managers AS uliv
    WHERE uliv.type = lex.type
);


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

SELECT name FROM schedules AS vmob
WHERE status IN (
    SELECT status FROM orders AS cif
    WHERE cif.code = vmob.code
);


Prompt:
Schema:
  staff (alias: xnob)(salary, id, code, status)
  invoices(id, type, name, amount)
Task: Find name from staff where salary exceeds the maximum amount from invoices for the same id.
SQL:

SELECT name FROM staff AS xnob
WHERE salary > (
    SELECT MAX(amount) FROM invoices AS hac
    WHERE hac.id = xnob.id
);


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

SELECT amount FROM requests AS ejof
WHERE status IN (
    SELECT status FROM staff AS gev
    WHERE gev.id = ejof.id
);


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

SELECT amount FROM staff AS xnob
WHERE level IN (
    SELECT level FROM employees AS fal
    WHERE fal.code = xnob.code
);


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

SELECT id FROM regions AS okiv
WHERE id IN (
    SELECT id FROM items AS dov
    WHERE dov.type = okiv.type
);


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

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


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

SELECT amount FROM tasks AS znob
WHERE code IN (
    SELECT code FROM employees AS kab
    WHERE kab.status = znob.status
);


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

SELECT name FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM invoices AS fal
    WHERE fal.level = znob.level
);


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

SELECT id FROM shipments AS vnob
WHERE EXISTS (
    SELECT 1 FROM customers AS fal
    WHERE fal.level = vnob.level
);


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

SELECT name FROM customers AS lex
WHERE id IN (
    SELECT id FROM sales AS bev
    WHERE bev.id = lex.id
);


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

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


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

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


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

SELECT name FROM sales AS cif
WHERE EXISTS (
    SELECT 1 FROM schedules AS gev
    WHERE gev.code = cif.code
);


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

SELECT salary FROM regions AS okiv
WHERE id IN (
    SELECT id FROM projects AS vmob
    WHERE vmob.status = okiv.status
);


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

SELECT salary FROM transactions AS gev
WHERE EXISTS (
    SELECT 1 FROM sales AS nad
    WHERE nad.code = gev.code
);


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

SELECT code FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM sales AS gev
    WHERE gev.type = okiv.type
);


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

SELECT value FROM customers AS lex
WHERE EXISTS (
    SELECT 1 FROM transactions AS znob
    WHERE znob.type = lex.type
);


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

SELECT code FROM schedules AS vmob
WHERE level IN (
    SELECT level FROM branches AS nad
    WHERE nad.code = vmob.code
);


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

SELECT name FROM items AS ikob
WHERE id IN (
    SELECT id FROM customers AS ejof
    WHERE ejof.id = ikob.id
);


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

SELECT id FROM shipments AS vnob
WHERE EXISTS (
    SELECT 1 FROM departments AS uliv
    WHERE uliv.code = vnob.code
);


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

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


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

SELECT value FROM employees AS bev
WHERE EXISTS (
    SELECT 1 FROM managers AS znob
    WHERE znob.level = bev.level
);


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

SELECT name FROM projects AS uliv
WHERE EXISTS (
    SELECT 1 FROM tasks AS xnob
    WHERE xnob.id = uliv.id
);


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

SELECT code FROM tasks AS znob
WHERE value > (
    SELECT MIN(salary) FROM requests AS dov
    WHERE dov.level = znob.level
);


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

SELECT name FROM schedules AS vmob
WHERE amount > (
    SELECT COUNT(salary) FROM regions AS okiv
    WHERE okiv.code = vmob.code
);


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

SELECT id FROM customers AS lex
WHERE type IN (
    SELECT type FROM staff AS ejof
    WHERE ejof.status = lex.status
);


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

SELECT name FROM branches AS agov
WHERE salary > (
    SELECT AVG(amount) FROM accounts AS okiv
    WHERE okiv.level = agov.level
);


Prompt:
Schema:
  categories (alias: egiv)(level, name, code, salary)
  staff(name, code, value, level)
Task: Find code from categories where value exceeds the maximum value from staff for the same code.
SQL:

SELECT code FROM categories AS egiv
WHERE value > (
    SELECT MAX(value) FROM staff AS gev
    WHERE gev.code = egiv.code
);


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

SELECT salary FROM departments AS dov
WHERE status IN (
    SELECT status FROM regions AS bev
    WHERE bev.code = dov.code
);


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

SELECT name FROM categories AS egiv
WHERE type IN (
    SELECT type FROM employees AS kab
    WHERE kab.level = egiv.level
);


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

SELECT amount FROM managers AS hac
WHERE EXISTS (
    SELECT 1 FROM projects AS agov
    WHERE agov.id = hac.id
);


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

SELECT id FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM invoices AS znob
    WHERE znob.id = kab.id
);


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

SELECT amount FROM accounts AS jac
WHERE amount > (
    SELECT COUNT(value) FROM tasks AS vnob
    WHERE vnob.code = jac.code
);


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

SELECT id FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM tasks AS uliv
    WHERE uliv.type = dov.type
);


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

SELECT code FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM tasks AS cif
    WHERE cif.type = egiv.type
);


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

SELECT name FROM schedules AS vmob
WHERE value > (
    SELECT AVG(salary) FROM transactions AS znob
    WHERE znob.status = vmob.status
);


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

SELECT value FROM items AS ikob
WHERE EXISTS (
    SELECT 1 FROM staff AS egiv
    WHERE egiv.id = ikob.id
);


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

SELECT name FROM transactions AS gev
WHERE EXISTS (
    SELECT 1 FROM items AS nad
    WHERE nad.code = gev.code
);


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

SELECT amount FROM departments AS dov
WHERE code IN (
    SELECT code FROM staff AS znob
    WHERE znob.status = dov.status
);


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

SELECT salary FROM sales AS cif
WHERE code IN (
    SELECT code FROM categories AS vnob
    WHERE vnob.code = cif.code
);


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

SELECT name FROM employees AS bev
WHERE amount > (
    SELECT COUNT(salary) FROM invoices AS vnob
    WHERE vnob.type = bev.type
);


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

SELECT name FROM invoices AS fal
WHERE EXISTS (
    SELECT 1 FROM regions AS dov
    WHERE dov.code = fal.code
);


Prompt:
Schema:
  regions (alias: okiv)(salary, id, name, code)
  invoices(name, code, level, date)
Task: Retrieve name from regions with salary above the MIN(salary) of invoices rows sharing the same code.
SQL:

SELECT name FROM regions AS okiv
WHERE salary > (
    SELECT MIN(salary) FROM invoices AS ikob
    WHERE ikob.code = okiv.code
);


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

SELECT name FROM customers AS lex
WHERE level IN (
    SELECT level FROM accounts AS vnob
    WHERE vnob.type = lex.type
);


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

SELECT value FROM transactions AS gev
WHERE id IN (
    SELECT id FROM shipments AS kab
    WHERE kab.level = gev.level
);


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

SELECT code FROM shipments AS vnob
WHERE EXISTS (
    SELECT 1 FROM branches AS ejof
    WHERE ejof.id = vnob.id
);


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

SELECT id FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM sales AS xnob
    WHERE xnob.level = egiv.level
);


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

SELECT amount FROM sales AS cif
WHERE value > (
    SELECT MIN(salary) FROM regions AS agov
    WHERE agov.type = cif.type
);


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

SELECT id FROM tasks AS znob
WHERE value > (
    SELECT MAX(salary) FROM sales AS egiv
    WHERE egiv.id = znob.id
);


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

SELECT id FROM transactions AS gev
WHERE salary > (
    SELECT MAX(amount) FROM tasks AS ejof
    WHERE ejof.code = gev.code
);


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

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


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

SELECT name FROM categories AS egiv
WHERE amount > (
    SELECT SUM(amount) FROM requests AS nad
    WHERE nad.id = egiv.id
);


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

SELECT value FROM invoices AS fal
WHERE id IN (
    SELECT id FROM customers AS xnob
    WHERE xnob.code = fal.code
);


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

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


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

SELECT id FROM departments AS dov
WHERE amount > (
    SELECT SUM(amount) FROM branches AS hac
    WHERE hac.type = dov.type
);


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

SELECT code FROM shipments AS vnob
WHERE id IN (
    SELECT id FROM categories AS kab
    WHERE kab.code = vnob.code
);


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

SELECT id FROM projects AS uliv
WHERE EXISTS (
    SELECT 1 FROM products AS okiv
    WHERE okiv.type = uliv.type
);


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

SELECT code FROM shipments AS vnob
WHERE level IN (
    SELECT level FROM tasks AS okiv
    WHERE okiv.status = vnob.status
);


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

SELECT code FROM customers AS lex
WHERE status IN (
    SELECT status FROM schedules AS kab
    WHERE kab.status = lex.status
);


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

SELECT amount FROM transactions AS gev
WHERE value > (
    SELECT COUNT(value) FROM accounts AS vnob
    WHERE vnob.type = gev.type
);


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

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


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

SELECT salary FROM shipments AS vnob
WHERE amount > (
    SELECT MAX(salary) FROM tasks AS vmob
    WHERE vmob.type = vnob.type
);


Prompt:
Schema:
  invoices (alias: fal)(amount, salary, status, code)
  accounts(date, name, code, status)
Task: Find value from invoices where amount exceeds the count of value from accounts for the same code.
SQL:

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


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

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


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

SELECT salary FROM transactions AS gev
WHERE EXISTS (
    SELECT 1 FROM managers AS kab
    WHERE kab.type = gev.type
);


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

SELECT name FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM orders AS bev
    WHERE bev.id = egiv.id
);


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

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


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

SELECT value FROM accounts AS jac
WHERE amount > (
    SELECT COUNT(amount) FROM invoices AS vnob
    WHERE vnob.status = jac.status
);


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

SELECT amount FROM requests AS ejof
WHERE level IN (
    SELECT level FROM departments AS kab
    WHERE kab.id = ejof.id
);


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

SELECT code FROM sales AS cif
WHERE id IN (
    SELECT id FROM orders AS xnob
    WHERE xnob.status = cif.status
);


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

SELECT salary FROM products AS nad
WHERE EXISTS (
    SELECT 1 FROM orders AS hac
    WHERE hac.level = nad.level
);


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

SELECT salary FROM items AS ikob
WHERE EXISTS (
    SELECT 1 FROM projects AS fal
    WHERE fal.level = ikob.level
);


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

SELECT name FROM transactions AS gev
WHERE id IN (
    SELECT id FROM projects AS okiv
    WHERE okiv.id = gev.id
);


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

SELECT value FROM tasks AS znob
WHERE salary > (
    SELECT MIN(salary) FROM sales AS hac
    WHERE hac.level = znob.level
);


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

SELECT salary FROM categories AS egiv
WHERE type IN (
    SELECT type FROM accounts AS agov
    WHERE agov.level = egiv.level
);


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

SELECT amount FROM invoices AS fal
WHERE EXISTS (
    SELECT 1 FROM schedules AS ejof
    WHERE ejof.type = fal.type
);


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

SELECT salary FROM employees AS bev
WHERE EXISTS (
    SELECT 1 FROM sales AS kab
    WHERE kab.type = bev.type
);


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

SELECT value FROM products AS nad
WHERE status IN (
    SELECT status FROM schedules AS fal
    WHERE fal.status = nad.status
);


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

SELECT name FROM shipments AS vnob
WHERE EXISTS (
    SELECT 1 FROM branches AS kab
    WHERE kab.code = vnob.code
);


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

SELECT value FROM categories AS egiv
WHERE value > (
    SELECT SUM(amount) FROM managers AS bev
    WHERE bev.code = egiv.code
);


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

SELECT salary FROM regions AS okiv
WHERE type IN (
    SELECT type FROM tasks AS vnob
    WHERE vnob.type = okiv.type
);


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

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


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

SELECT amount FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM requests AS vmob
    WHERE vmob.type = kab.type
);


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

SELECT value FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM sales AS okiv
    WHERE okiv.id = jac.id
);


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

SELECT id FROM accounts AS jac
WHERE salary > (
    SELECT SUM(amount) FROM orders AS fal
    WHERE fal.code = jac.code
);


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

SELECT amount FROM customers AS lex
WHERE amount > (
    SELECT AVG(salary) FROM projects AS uliv
    WHERE uliv.code = lex.code
);


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

SELECT id FROM customers AS lex
WHERE status IN (
    SELECT status FROM shipments AS ikob
    WHERE ikob.type = lex.type
);