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

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


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

SELECT name FROM employees AS bev
WHERE code IN (
    SELECT code FROM projects AS hac
    WHERE hac.type = bev.type
);


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

SELECT name FROM staff AS xnob
WHERE salary > (
    SELECT MIN(amount) FROM employees AS hac
    WHERE hac.level = xnob.level
);


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

SELECT id FROM items AS ikob
WHERE EXISTS (
    SELECT 1 FROM transactions AS jac
    WHERE jac.id = ikob.id
);


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

SELECT amount FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM employees AS ejof
    WHERE ejof.level = egiv.level
);


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

SELECT amount FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM invoices AS xnob
    WHERE xnob.code = egiv.code
);


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

SELECT value FROM invoices AS fal
WHERE EXISTS (
    SELECT 1 FROM schedules AS dov
    WHERE dov.id = fal.id
);


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

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


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

SELECT name FROM staff AS xnob
WHERE id IN (
    SELECT id FROM products AS egiv
    WHERE egiv.status = xnob.status
);


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

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


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

SELECT name FROM requests AS ejof
WHERE code IN (
    SELECT code FROM sales AS vmob
    WHERE vmob.type = ejof.type
);


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

SELECT id FROM shipments AS vnob
WHERE EXISTS (
    SELECT 1 FROM managers AS uliv
    WHERE uliv.type = vnob.type
);


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

SELECT value FROM items AS ikob
WHERE value > (
    SELECT MAX(value) FROM projects AS okiv
    WHERE okiv.id = ikob.id
);


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

SELECT name FROM staff AS xnob
WHERE EXISTS (
    SELECT 1 FROM items AS egiv
    WHERE egiv.type = xnob.type
);


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

SELECT amount FROM requests AS ejof
WHERE salary > (
    SELECT COUNT(value) FROM transactions AS hac
    WHERE hac.status = ejof.status
);


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

SELECT value FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM schedules AS bev
    WHERE bev.id = znob.id
);


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

SELECT code FROM employees AS bev
WHERE value > (
    SELECT MIN(amount) FROM items AS fal
    WHERE fal.id = bev.id
);


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

SELECT amount FROM projects AS uliv
WHERE EXISTS (
    SELECT 1 FROM departments AS gev
    WHERE gev.status = uliv.status
);


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

SELECT value FROM regions AS okiv
WHERE level IN (
    SELECT level FROM accounts AS nad
    WHERE nad.id = okiv.id
);


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

SELECT value FROM regions AS okiv
WHERE type IN (
    SELECT type FROM branches AS fal
    WHERE fal.id = okiv.id
);


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

SELECT amount FROM products AS nad
WHERE type IN (
    SELECT type FROM accounts AS znob
    WHERE znob.code = nad.code
);


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

SELECT salary FROM products AS nad
WHERE status IN (
    SELECT status FROM tasks AS fal
    WHERE fal.status = nad.status
);


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

SELECT value FROM regions AS okiv
WHERE status IN (
    SELECT status FROM transactions AS cif
    WHERE cif.level = okiv.level
);


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

SELECT salary FROM invoices AS fal
WHERE EXISTS (
    SELECT 1 FROM employees AS okiv
    WHERE okiv.id = fal.id
);


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

SELECT value FROM shipments AS vnob
WHERE level IN (
    SELECT level FROM projects AS jac
    WHERE jac.type = vnob.type
);


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

SELECT name FROM items AS ikob
WHERE id IN (
    SELECT id FROM accounts AS okiv
    WHERE okiv.status = ikob.status
);


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

SELECT id FROM products AS nad
WHERE id IN (
    SELECT id FROM schedules AS bev
    WHERE bev.id = nad.id
);


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

SELECT name FROM categories AS egiv
WHERE level IN (
    SELECT level FROM tasks AS okiv
    WHERE okiv.level = egiv.level
);


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

SELECT code FROM projects AS uliv
WHERE level IN (
    SELECT level FROM tasks AS fal
    WHERE fal.id = uliv.id
);


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

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


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

SELECT code FROM items AS ikob
WHERE salary > (
    SELECT MIN(salary) FROM departments AS okiv
    WHERE okiv.type = ikob.type
);


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

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


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

SELECT amount FROM staff AS xnob
WHERE salary > (
    SELECT MIN(value) FROM schedules AS nad
    WHERE nad.type = xnob.type
);


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

SELECT code FROM managers AS hac
WHERE EXISTS (
    SELECT 1 FROM categories AS ejof
    WHERE ejof.level = hac.level
);


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

SELECT amount FROM tasks AS znob
WHERE type IN (
    SELECT type FROM orders AS hac
    WHERE hac.level = znob.level
);


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

SELECT name FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM tasks AS gev
    WHERE gev.id = egiv.id
);


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

SELECT amount FROM products AS nad
WHERE EXISTS (
    SELECT 1 FROM accounts AS vmob
    WHERE vmob.level = nad.level
);


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

SELECT amount FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM items AS bev
    WHERE bev.code = egiv.code
);


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

SELECT value FROM requests AS ejof
WHERE EXISTS (
    SELECT 1 FROM schedules AS lex
    WHERE lex.type = ejof.type
);


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

SELECT amount FROM staff AS xnob
WHERE EXISTS (
    SELECT 1 FROM accounts AS vnob
    WHERE vnob.code = xnob.code
);


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

SELECT code FROM departments AS dov
WHERE type IN (
    SELECT type FROM accounts AS vmob
    WHERE vmob.id = dov.id
);


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

SELECT salary FROM items AS ikob
WHERE amount > (
    SELECT SUM(value) FROM schedules AS dov
    WHERE dov.status = ikob.status
);


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

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


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

SELECT name FROM projects AS uliv
WHERE EXISTS (
    SELECT 1 FROM requests AS fal
    WHERE fal.code = uliv.code
);


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

SELECT name FROM schedules AS vmob
WHERE value > (
    SELECT SUM(salary) FROM customers AS xnob
    WHERE xnob.status = vmob.status
);


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

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


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

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


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

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


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

SELECT name FROM schedules AS vmob
WHERE value > (
    SELECT MIN(value) FROM regions AS egiv
    WHERE egiv.type = vmob.type
);


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

SELECT value FROM customers AS lex
WHERE amount > (
    SELECT COUNT(salary) FROM orders AS xnob
    WHERE xnob.code = lex.code
);


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

SELECT name FROM branches AS agov
WHERE level IN (
    SELECT level FROM transactions AS kab
    WHERE kab.id = agov.id
);


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

SELECT id FROM staff AS xnob
WHERE value > (
    SELECT COUNT(salary) FROM customers AS bev
    WHERE bev.level = xnob.level
);


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

SELECT code FROM requests AS ejof
WHERE salary > (
    SELECT SUM(salary) FROM orders AS bev
    WHERE bev.id = ejof.id
);


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

SELECT id FROM customers AS lex
WHERE type IN (
    SELECT type FROM sales AS nad
    WHERE nad.code = lex.code
);


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

SELECT value FROM accounts AS jac
WHERE code IN (
    SELECT code FROM products AS okiv
    WHERE okiv.code = jac.code
);


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

SELECT salary FROM projects AS uliv
WHERE type IN (
    SELECT type FROM regions AS nad
    WHERE nad.status = uliv.status
);


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

SELECT code FROM products AS nad
WHERE EXISTS (
    SELECT 1 FROM requests AS egiv
    WHERE egiv.type = nad.type
);


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

SELECT id FROM items AS ikob
WHERE type IN (
    SELECT type FROM branches AS cif
    WHERE cif.id = ikob.id
);


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

SELECT code FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM staff AS ikob
    WHERE ikob.type = dov.type
);


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

SELECT id FROM projects AS uliv
WHERE EXISTS (
    SELECT 1 FROM employees AS ejof
    WHERE ejof.id = uliv.id
);


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

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


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

SELECT amount FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM employees AS jac
    WHERE jac.level = vmob.level
);


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

SELECT code FROM sales AS cif
WHERE level IN (
    SELECT level FROM employees AS okiv
    WHERE okiv.id = cif.id
);


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

SELECT id FROM sales AS cif
WHERE type IN (
    SELECT type FROM tasks AS hac
    WHERE hac.status = cif.status
);


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

SELECT name FROM projects AS uliv
WHERE salary > (
    SELECT MAX(amount) FROM shipments AS xnob
    WHERE xnob.code = uliv.code
);


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

SELECT id FROM transactions AS gev
WHERE salary > (
    SELECT COUNT(value) FROM regions AS lex
    WHERE lex.status = gev.status
);


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

SELECT id FROM categories AS egiv
WHERE value > (
    SELECT SUM(amount) FROM tasks AS gev
    WHERE gev.id = egiv.id
);


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

SELECT id FROM schedules AS vmob
WHERE amount > (
    SELECT MIN(salary) FROM branches AS fal
    WHERE fal.code = vmob.code
);


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

SELECT code FROM products AS nad
WHERE value > (
    SELECT MAX(amount) FROM customers AS hac
    WHERE hac.type = nad.type
);


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

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


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

SELECT code FROM employees AS bev
WHERE id IN (
    SELECT id FROM managers AS kab
    WHERE kab.type = bev.type
);


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

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


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

SELECT id FROM projects AS uliv
WHERE salary > (
    SELECT COUNT(amount) FROM sales AS gev
    WHERE gev.code = uliv.code
);


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

SELECT code FROM orders AS kab
WHERE code IN (
    SELECT code FROM invoices AS dov
    WHERE dov.status = kab.status
);


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

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


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

SELECT salary FROM customers AS lex
WHERE id IN (
    SELECT id FROM schedules AS agov
    WHERE agov.code = lex.code
);


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

SELECT amount FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM projects AS bev
    WHERE bev.level = vmob.level
);


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

SELECT value FROM invoices AS fal
WHERE EXISTS (
    SELECT 1 FROM schedules AS xnob
    WHERE xnob.status = fal.status
);


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

SELECT amount FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM products AS uliv
    WHERE uliv.id = dov.id
);


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

SELECT salary FROM departments AS dov
WHERE value > (
    SELECT COUNT(value) FROM sales AS kab
    WHERE kab.code = dov.code
);


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

SELECT salary FROM shipments AS vnob
WHERE EXISTS (
    SELECT 1 FROM products AS fal
    WHERE fal.type = vnob.type
);


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

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


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

SELECT code FROM employees AS bev
WHERE amount > (
    SELECT MAX(value) FROM products AS dov
    WHERE dov.type = bev.type
);


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

SELECT value FROM shipments AS vnob
WHERE level IN (
    SELECT level FROM sales AS vmob
    WHERE vmob.id = vnob.id
);


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

SELECT salary FROM shipments AS vnob
WHERE salary > (
    SELECT SUM(salary) FROM categories AS znob
    WHERE znob.type = vnob.type
);


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

SELECT id FROM transactions AS gev
WHERE status IN (
    SELECT status FROM customers AS okiv
    WHERE okiv.level = gev.level
);


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

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


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

SELECT code FROM shipments AS vnob
WHERE salary > (
    SELECT COUNT(amount) FROM categories AS uliv
    WHERE uliv.level = vnob.level
);


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

SELECT value FROM categories AS egiv
WHERE status IN (
    SELECT status FROM items AS bev
    WHERE bev.level = egiv.level
);


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

SELECT amount FROM products AS nad
WHERE salary > (
    SELECT COUNT(value) FROM items AS vnob
    WHERE vnob.level = nad.level
);


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

SELECT value FROM projects AS uliv
WHERE amount > (
    SELECT MIN(value) FROM staff AS ejof
    WHERE ejof.level = uliv.level
);


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

SELECT code FROM requests AS ejof
WHERE code IN (
    SELECT code FROM departments AS kab
    WHERE kab.status = ejof.status
);


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

SELECT name FROM employees AS bev
WHERE value > (
    SELECT MAX(value) FROM items AS lex
    WHERE lex.code = bev.code
);


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

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


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

SELECT name FROM branches AS agov
WHERE status IN (
    SELECT status FROM schedules AS vnob
    WHERE vnob.level = agov.level
);


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

SELECT code FROM transactions AS gev
WHERE value > (
    SELECT MAX(salary) FROM categories AS kab
    WHERE kab.type = gev.type
);


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

SELECT amount FROM managers AS hac
WHERE EXISTS (
    SELECT 1 FROM products AS bev
    WHERE bev.id = hac.id
);


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

SELECT id FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM orders AS jac
    WHERE jac.code = vmob.code
);


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

SELECT value FROM regions AS okiv
WHERE level IN (
    SELECT level FROM orders AS xnob
    WHERE xnob.type = okiv.type
);


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

SELECT salary FROM customers AS lex
WHERE salary > (
    SELECT MIN(amount) FROM regions AS xnob
    WHERE xnob.type = lex.type
);


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

SELECT salary FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM managers AS vmob
    WHERE vmob.level = znob.level
);


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

SELECT code FROM transactions AS gev
WHERE EXISTS (
    SELECT 1 FROM projects AS znob
    WHERE znob.level = gev.level
);


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

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


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

SELECT salary FROM requests AS ejof
WHERE level IN (
    SELECT level FROM items AS vnob
    WHERE vnob.status = ejof.status
);


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

SELECT code FROM customers AS lex
WHERE EXISTS (
    SELECT 1 FROM items AS bev
    WHERE bev.type = lex.type
);


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

SELECT salary FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM schedules AS nad
    WHERE nad.level = kab.level
);


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

SELECT code FROM employees AS bev
WHERE EXISTS (
    SELECT 1 FROM projects AS znob
    WHERE znob.level = bev.level
);


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

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


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

SELECT salary FROM shipments AS vnob
WHERE code IN (
    SELECT code FROM invoices AS vmob
    WHERE vmob.type = vnob.type
);


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

SELECT amount FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM orders AS uliv
    WHERE uliv.status = vmob.status
);


Prompt:
Schema:
  departments (alias: dov)(date, name, type, level)
  requests(code, level, type, 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 lex
    WHERE lex.level = dov.level
);


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

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


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

SELECT code FROM shipments AS vnob
WHERE salary > (
    SELECT MAX(amount) FROM staff AS ikob
    WHERE ikob.id = vnob.id
);


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

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


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

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


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

SELECT amount FROM customers AS lex
WHERE EXISTS (
    SELECT 1 FROM categories AS uliv
    WHERE uliv.type = lex.type
);


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

SELECT name FROM products AS nad
WHERE status IN (
    SELECT status FROM employees AS vnob
    WHERE vnob.code = nad.code
);


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

SELECT salary FROM requests AS ejof
WHERE EXISTS (
    SELECT 1 FROM regions AS nad
    WHERE nad.type = ejof.type
);


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

SELECT code FROM employees AS bev
WHERE type IN (
    SELECT type FROM invoices AS fal
    WHERE fal.type = bev.type
);


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

SELECT salary FROM tasks AS znob
WHERE id IN (
    SELECT id FROM transactions AS dov
    WHERE dov.type = znob.type
);


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

SELECT name FROM categories AS egiv
WHERE amount > (
    SELECT MIN(value) FROM regions AS vmob
    WHERE vmob.id = egiv.id
);


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

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


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

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


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

SELECT amount FROM customers AS lex
WHERE amount > (
    SELECT MAX(salary) FROM schedules AS hac
    WHERE hac.code = lex.code
);


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

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


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

SELECT code FROM tasks AS znob
WHERE id IN (
    SELECT id FROM projects AS dov
    WHERE dov.type = znob.type
);


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

SELECT name FROM projects AS uliv
WHERE amount > (
    SELECT SUM(value) FROM customers AS ejof
    WHERE ejof.status = uliv.status
);


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

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


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

SELECT code FROM requests AS ejof
WHERE level IN (
    SELECT level FROM managers AS znob
    WHERE znob.status = ejof.status
);


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

SELECT code FROM invoices AS fal
WHERE value > (
    SELECT MAX(value) FROM orders AS agov
    WHERE agov.type = fal.type
);


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

SELECT id FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM shipments AS znob
    WHERE znob.type = okiv.type
);


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

SELECT salary FROM departments AS dov
WHERE salary > (
    SELECT MAX(amount) FROM staff AS okiv
    WHERE okiv.level = dov.level
);


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

SELECT amount FROM requests AS ejof
WHERE EXISTS (
    SELECT 1 FROM managers AS ikob
    WHERE ikob.type = ejof.type
);


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

SELECT amount FROM projects AS uliv
WHERE type IN (
    SELECT type FROM items AS znob
    WHERE znob.code = uliv.code
);


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

SELECT salary FROM items AS ikob
WHERE EXISTS (
    SELECT 1 FROM orders AS okiv
    WHERE okiv.type = ikob.type
);


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

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


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

SELECT amount FROM accounts AS jac
WHERE value > (
    SELECT MAX(amount) FROM customers AS cif
    WHERE cif.status = jac.status
);


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

SELECT amount FROM managers AS hac
WHERE amount > (
    SELECT AVG(salary) FROM requests AS egiv
    WHERE egiv.level = hac.level
);


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

SELECT id FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM projects AS ejof
    WHERE ejof.code = okiv.code
);


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

SELECT id FROM customers AS lex
WHERE level IN (
    SELECT level FROM staff AS hac
    WHERE hac.status = lex.status
);


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

SELECT salary FROM regions AS okiv
WHERE id IN (
    SELECT id FROM branches AS nad
    WHERE nad.code = okiv.code
);


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

SELECT id FROM projects AS uliv
WHERE amount > (
    SELECT MIN(value) FROM sales AS okiv
    WHERE okiv.type = uliv.type
);


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

SELECT code FROM products AS nad
WHERE code IN (
    SELECT code FROM shipments AS vmob
    WHERE vmob.level = nad.level
);


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

SELECT id FROM branches AS agov
WHERE value > (
    SELECT SUM(value) FROM managers AS dov
    WHERE dov.code = agov.code
);


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

SELECT amount FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM departments AS uliv
    WHERE uliv.type = okiv.type
);


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

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


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

SELECT salary FROM categories AS egiv
WHERE code IN (
    SELECT code FROM shipments AS lex
    WHERE lex.level = egiv.level
);


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

SELECT amount FROM shipments AS vnob
WHERE id IN (
    SELECT id FROM items AS cif
    WHERE cif.status = vnob.status
);


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

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


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

SELECT name FROM accounts AS jac
WHERE level IN (
    SELECT level FROM transactions AS okiv
    WHERE okiv.code = jac.code
);


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

SELECT name FROM products AS nad
WHERE amount > (
    SELECT AVG(amount) FROM orders AS egiv
    WHERE egiv.code = nad.code
);


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

SELECT id FROM projects AS uliv
WHERE value > (
    SELECT MIN(salary) FROM departments AS vmob
    WHERE vmob.status = uliv.status
);


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

SELECT value FROM projects AS uliv
WHERE EXISTS (
    SELECT 1 FROM categories AS vmob
    WHERE vmob.code = uliv.code
);


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

SELECT id FROM customers AS lex
WHERE amount > (
    SELECT AVG(amount) FROM staff AS gev
    WHERE gev.status = lex.status
);


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

SELECT amount FROM regions AS okiv
WHERE amount > (
    SELECT MIN(salary) FROM shipments AS vnob
    WHERE vnob.id = okiv.id
);


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

SELECT code FROM invoices AS fal
WHERE amount > (
    SELECT MAX(salary) FROM shipments AS okiv
    WHERE okiv.code = fal.code
);


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

SELECT value FROM products AS nad
WHERE id IN (
    SELECT id FROM tasks AS bev
    WHERE bev.type = nad.type
);


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

SELECT id FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM invoices AS gev
    WHERE gev.status = vmob.status
);


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

SELECT name FROM staff AS xnob
WHERE salary > (
    SELECT MAX(amount) FROM employees AS vmob
    WHERE vmob.status = xnob.status
);


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

SELECT value FROM branches AS agov
WHERE amount > (
    SELECT MAX(amount) FROM sales AS kab
    WHERE kab.level = agov.level
);


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

SELECT amount FROM sales AS cif
WHERE amount > (
    SELECT SUM(amount) FROM requests AS vmob
    WHERE vmob.type = cif.type
);


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

SELECT name FROM managers AS hac
WHERE value > (
    SELECT COUNT(value) FROM orders AS agov
    WHERE agov.status = hac.status
);


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

SELECT id FROM sales AS cif
WHERE salary > (
    SELECT SUM(amount) FROM invoices AS agov
    WHERE agov.type = cif.type
);


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

SELECT name FROM products AS nad
WHERE salary > (
    SELECT MAX(salary) FROM accounts AS xnob
    WHERE xnob.code = nad.code
);


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

SELECT amount FROM branches AS agov
WHERE salary > (
    SELECT MAX(salary) FROM managers AS znob
    WHERE znob.status = agov.status
);


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

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


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

SELECT id FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM products AS uliv
    WHERE uliv.status = kab.status
);


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

SELECT amount FROM items AS ikob
WHERE amount > (
    SELECT MIN(value) FROM regions AS vmob
    WHERE vmob.type = ikob.type
);


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

SELECT code FROM managers AS hac
WHERE amount > (
    SELECT MAX(salary) FROM departments AS ikob
    WHERE ikob.level = hac.level
);


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

SELECT name FROM staff AS xnob
WHERE status IN (
    SELECT status FROM orders AS dov
    WHERE dov.code = xnob.code
);


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

SELECT salary FROM projects AS uliv
WHERE id IN (
    SELECT id FROM customers AS okiv
    WHERE okiv.code = uliv.code
);


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

SELECT code FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM invoices AS hac
    WHERE hac.status = okiv.status
);


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

SELECT name FROM customers AS lex
WHERE value > (
    SELECT SUM(amount) FROM shipments AS kab
    WHERE kab.id = lex.id
);


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

SELECT value FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM regions AS cif
    WHERE cif.status = dov.status
);


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

SELECT value FROM sales AS cif
WHERE status IN (
    SELECT status FROM customers AS egiv
    WHERE egiv.status = cif.status
);


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

SELECT id FROM products AS nad
WHERE code IN (
    SELECT code FROM orders AS vmob
    WHERE vmob.level = nad.level
);


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

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


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

SELECT salary FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM customers AS dov
    WHERE dov.code = vmob.code
);


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

SELECT name FROM invoices AS fal
WHERE status IN (
    SELECT status FROM projects AS nad
    WHERE nad.type = fal.type
);


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

SELECT value FROM staff AS xnob
WHERE id IN (
    SELECT id FROM schedules AS gev
    WHERE gev.id = xnob.id
);


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

SELECT id FROM accounts AS jac
WHERE code IN (
    SELECT code FROM projects AS vmob
    WHERE vmob.id = jac.id
);


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

SELECT amount FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM invoices AS bev
    WHERE bev.id = agov.id
);


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

SELECT name FROM managers AS hac
WHERE id IN (
    SELECT id FROM invoices AS gev
    WHERE gev.type = hac.type
);


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

SELECT value FROM transactions AS gev
WHERE EXISTS (
    SELECT 1 FROM tasks AS xnob
    WHERE xnob.status = gev.status
);


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

SELECT salary FROM orders AS kab
WHERE code IN (
    SELECT code FROM sales AS vmob
    WHERE vmob.code = kab.code
);


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

SELECT value FROM sales AS cif
WHERE EXISTS (
    SELECT 1 FROM schedules AS ejof
    WHERE ejof.type = cif.type
);


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

SELECT salary FROM staff AS xnob
WHERE EXISTS (
    SELECT 1 FROM branches AS nad
    WHERE nad.level = xnob.level
);


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

SELECT name FROM sales AS cif
WHERE type IN (
    SELECT type FROM managers AS agov
    WHERE agov.code = cif.code
);


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

SELECT amount FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM shipments AS vnob
    WHERE vnob.status = znob.status
);


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

SELECT salary FROM schedules AS vmob
WHERE value > (
    SELECT AVG(salary) FROM orders AS gev
    WHERE gev.level = vmob.level
);


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

SELECT name FROM projects AS uliv
WHERE value > (
    SELECT MIN(salary) FROM transactions AS bev
    WHERE bev.status = uliv.status
);


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

SELECT id FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM invoices AS cif
    WHERE cif.status = dov.status
);


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

SELECT value FROM invoices AS fal
WHERE salary > (
    SELECT MIN(amount) FROM products AS xnob
    WHERE xnob.level = fal.level
);


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

SELECT salary FROM sales AS cif
WHERE salary > (
    SELECT COUNT(amount) FROM employees AS ikob
    WHERE ikob.status = cif.status
);


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

SELECT salary FROM accounts AS jac
WHERE status IN (
    SELECT status FROM schedules AS okiv
    WHERE okiv.type = jac.type
);


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

SELECT salary FROM employees AS bev
WHERE status IN (
    SELECT status FROM departments AS cif
    WHERE cif.code = bev.code
);


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

SELECT value FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM departments AS cif
    WHERE cif.id = okiv.id
);


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

SELECT salary FROM projects AS uliv
WHERE amount > (
    SELECT SUM(value) FROM sales AS vnob
    WHERE vnob.status = uliv.status
);


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

SELECT salary FROM categories AS egiv
WHERE status IN (
    SELECT status FROM invoices AS fal
    WHERE fal.code = egiv.code
);


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

SELECT id FROM tasks AS znob
WHERE amount > (
    SELECT MAX(value) FROM requests AS fal
    WHERE fal.type = znob.type
);


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

SELECT salary FROM staff AS xnob
WHERE type IN (
    SELECT type FROM categories AS hac
    WHERE hac.id = xnob.id
);


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

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


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

SELECT amount FROM employees AS bev
WHERE status IN (
    SELECT status FROM regions AS kab
    WHERE kab.type = bev.type
);


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

SELECT id FROM transactions AS gev
WHERE EXISTS (
    SELECT 1 FROM accounts AS ejof
    WHERE ejof.id = gev.id
);


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

SELECT code FROM departments AS dov
WHERE code IN (
    SELECT code FROM staff AS fal
    WHERE fal.id = dov.id
);


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

SELECT code FROM invoices AS fal
WHERE salary > (
    SELECT COUNT(value) FROM regions AS egiv
    WHERE egiv.code = fal.code
);


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

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


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

SELECT code FROM transactions AS gev
WHERE id IN (
    SELECT id FROM branches AS ejof
    WHERE ejof.level = gev.level
);


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

SELECT code FROM managers AS hac
WHERE EXISTS (
    SELECT 1 FROM accounts AS ikob
    WHERE ikob.code = hac.code
);


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

SELECT value FROM managers AS hac
WHERE status IN (
    SELECT status FROM projects AS kab
    WHERE kab.type = hac.type
);


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

SELECT code FROM managers AS hac
WHERE amount > (
    SELECT MAX(value) FROM branches AS nad
    WHERE nad.id = hac.id
);


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

SELECT salary FROM customers AS lex
WHERE amount > (
    SELECT SUM(value) FROM invoices AS agov
    WHERE agov.status = lex.status
);


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

SELECT amount FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM categories AS uliv
    WHERE uliv.code = jac.code
);


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

SELECT name FROM sales AS cif
WHERE type IN (
    SELECT type FROM departments AS agov
    WHERE agov.status = cif.status
);


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

SELECT name FROM managers AS hac
WHERE value > (
    SELECT SUM(amount) FROM categories AS fal
    WHERE fal.status = hac.status
);


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

SELECT name FROM schedules AS vmob
WHERE value > (
    SELECT MIN(salary) FROM shipments AS jac
    WHERE jac.level = vmob.level
);


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

SELECT id FROM transactions AS gev
WHERE value > (
    SELECT AVG(salary) FROM products AS egiv
    WHERE egiv.id = gev.id
);


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

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


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

SELECT salary FROM products AS nad
WHERE EXISTS (
    SELECT 1 FROM schedules AS hac
    WHERE hac.code = nad.code
);


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

SELECT name FROM managers AS hac
WHERE amount > (
    SELECT SUM(salary) FROM departments AS gev
    WHERE gev.id = hac.id
);


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

SELECT amount FROM transactions AS gev
WHERE amount > (
    SELECT AVG(salary) FROM projects AS ikob
    WHERE ikob.level = gev.level
);


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

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


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

SELECT amount FROM departments AS dov
WHERE status IN (
    SELECT status FROM transactions AS nad
    WHERE nad.type = dov.type
);


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

SELECT id FROM projects AS uliv
WHERE id IN (
    SELECT id FROM shipments AS vmob
    WHERE vmob.status = uliv.status
);


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

SELECT id FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM accounts AS gev
    WHERE gev.id = agov.id
);


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

SELECT code FROM orders AS kab
WHERE code IN (
    SELECT code FROM schedules AS lex
    WHERE lex.type = kab.type
);


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

SELECT name FROM schedules AS vmob
WHERE salary > (
    SELECT SUM(amount) FROM projects AS nad
    WHERE nad.code = vmob.code
);


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

SELECT code FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM regions AS egiv
    WHERE egiv.type = znob.type
);


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

SELECT amount FROM departments AS dov
WHERE amount > (
    SELECT MAX(amount) FROM categories AS egiv
    WHERE egiv.code = dov.code
);


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

SELECT value FROM products AS nad
WHERE EXISTS (
    SELECT 1 FROM schedules AS xnob
    WHERE xnob.code = nad.code
);


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

SELECT code FROM branches AS agov
WHERE type IN (
    SELECT type FROM products AS znob
    WHERE znob.id = agov.id
);


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

SELECT value FROM requests AS ejof
WHERE EXISTS (
    SELECT 1 FROM departments AS kab
    WHERE kab.type = ejof.type
);


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

SELECT code FROM staff AS xnob
WHERE EXISTS (
    SELECT 1 FROM orders AS gev
    WHERE gev.status = xnob.status
);


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

SELECT salary FROM requests AS ejof
WHERE id IN (
    SELECT id FROM branches AS egiv
    WHERE egiv.status = ejof.status
);


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

SELECT code FROM projects AS uliv
WHERE salary > (
    SELECT MIN(salary) FROM branches AS ikob
    WHERE ikob.status = uliv.status
);


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

SELECT amount FROM managers AS hac
WHERE value > (
    SELECT AVG(amount) FROM accounts AS znob
    WHERE znob.code = hac.code
);


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

SELECT value FROM customers AS lex
WHERE EXISTS (
    SELECT 1 FROM orders AS nad
    WHERE nad.code = lex.code
);


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

SELECT value FROM projects AS uliv
WHERE status IN (
    SELECT status FROM staff AS cif
    WHERE cif.level = uliv.level
);


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

SELECT code FROM customers AS lex
WHERE EXISTS (
    SELECT 1 FROM categories AS hac
    WHERE hac.code = lex.code
);


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

SELECT name FROM projects AS uliv
WHERE EXISTS (
    SELECT 1 FROM shipments AS dov
    WHERE dov.type = uliv.type
);


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

SELECT id FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM customers AS dov
    WHERE dov.level = agov.level
);


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

SELECT salary FROM tasks AS znob
WHERE level IN (
    SELECT level FROM categories AS nad
    WHERE nad.id = znob.id
);


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

SELECT value FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM sales AS cif
    WHERE cif.id = egiv.id
);


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

SELECT code FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM shipments AS ejof
    WHERE ejof.level = agov.level
);


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

SELECT id FROM products AS nad
WHERE type IN (
    SELECT type FROM customers AS vmob
    WHERE vmob.id = nad.id
);


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

SELECT salary FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM projects AS okiv
    WHERE okiv.code = znob.code
);


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

SELECT id FROM projects AS uliv
WHERE EXISTS (
    SELECT 1 FROM orders AS lex
    WHERE lex.code = uliv.code
);


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

SELECT amount FROM categories AS egiv
WHERE value > (
    SELECT SUM(amount) FROM products AS xnob
    WHERE xnob.status = egiv.status
);


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

SELECT value FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM sales AS nad
    WHERE nad.code = dov.code
);


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

SELECT value FROM tasks AS znob
WHERE value > (
    SELECT MIN(value) FROM branches AS cif
    WHERE cif.type = znob.type
);


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

SELECT amount FROM branches AS agov
WHERE code IN (
    SELECT code FROM departments AS jac
    WHERE jac.level = agov.level
);


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

SELECT value FROM employees AS bev
WHERE EXISTS (
    SELECT 1 FROM transactions AS nad
    WHERE nad.id = bev.id
);


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

SELECT value FROM customers AS lex
WHERE EXISTS (
    SELECT 1 FROM orders AS nad
    WHERE nad.type = lex.type
);


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

SELECT code FROM tasks AS znob
WHERE salary > (
    SELECT MIN(salary) FROM orders AS hac
    WHERE hac.code = znob.code
);


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

SELECT value FROM schedules AS vmob
WHERE level IN (
    SELECT level FROM projects AS kab
    WHERE kab.status = vmob.status
);


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

SELECT name FROM accounts AS jac
WHERE amount > (
    SELECT AVG(salary) FROM categories AS vnob
    WHERE vnob.id = jac.id
);


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

SELECT code FROM products AS nad
WHERE id IN (
    SELECT id FROM orders AS fal
    WHERE fal.level = nad.level
);


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

SELECT id FROM staff AS xnob
WHERE status IN (
    SELECT status FROM categories AS vnob
    WHERE vnob.level = xnob.level
);


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

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


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

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


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

SELECT value FROM accounts AS jac
WHERE amount > (
    SELECT SUM(value) FROM sales AS dov
    WHERE dov.status = jac.status
);


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

SELECT amount FROM invoices AS fal
WHERE type IN (
    SELECT type FROM orders AS bev
    WHERE bev.status = fal.status
);


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

SELECT code FROM employees AS bev
WHERE EXISTS (
    SELECT 1 FROM branches AS lex
    WHERE lex.level = bev.level
);


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

SELECT code FROM invoices AS fal
WHERE EXISTS (
    SELECT 1 FROM employees AS kab
    WHERE kab.code = fal.code
);


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

SELECT id FROM managers AS hac
WHERE value > (
    SELECT COUNT(value) FROM items AS uliv
    WHERE uliv.level = hac.level
);


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

SELECT value FROM shipments AS vnob
WHERE value > (
    SELECT SUM(value) FROM customers AS kab
    WHERE kab.type = vnob.type
);


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

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


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

SELECT id FROM shipments AS vnob
WHERE salary > (
    SELECT MAX(value) FROM accounts AS egiv
    WHERE egiv.id = vnob.id
);


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

SELECT amount FROM accounts AS jac
WHERE level IN (
    SELECT level FROM schedules AS znob
    WHERE znob.id = jac.id
);


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

SELECT id FROM staff AS xnob
WHERE level IN (
    SELECT level FROM schedules AS okiv
    WHERE okiv.id = xnob.id
);


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

SELECT code FROM requests AS ejof
WHERE value > (
    SELECT SUM(value) FROM branches AS uliv
    WHERE uliv.type = ejof.type
);


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

SELECT code FROM employees AS bev
WHERE value > (
    SELECT SUM(salary) FROM managers AS lex
    WHERE lex.type = bev.type
);


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

SELECT salary FROM requests AS ejof
WHERE EXISTS (
    SELECT 1 FROM invoices AS kab
    WHERE kab.level = ejof.level
);


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

SELECT salary FROM employees AS bev
WHERE EXISTS (
    SELECT 1 FROM branches AS hac
    WHERE hac.type = bev.type
);


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

SELECT name FROM schedules AS vmob
WHERE type IN (
    SELECT type FROM staff AS ejof
    WHERE ejof.id = vmob.id
);


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

SELECT value FROM schedules AS vmob
WHERE value > (
    SELECT MAX(value) FROM accounts AS bev
    WHERE bev.type = vmob.type
);


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

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


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

SELECT amount FROM items AS ikob
WHERE status IN (
    SELECT status FROM customers AS xnob
    WHERE xnob.code = ikob.code
);


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

SELECT code FROM items AS ikob
WHERE EXISTS (
    SELECT 1 FROM sales AS ejof
    WHERE ejof.code = ikob.code
);


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

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


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

SELECT name FROM accounts AS jac
WHERE type IN (
    SELECT type FROM items AS agov
    WHERE agov.id = jac.id
);


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

SELECT amount FROM employees AS bev
WHERE salary > (
    SELECT MAX(salary) FROM invoices AS hac
    WHERE hac.status = bev.status
);


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

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


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

SELECT id FROM regions AS okiv
WHERE level IN (
    SELECT level FROM accounts AS agov
    WHERE agov.type = okiv.type
);


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

SELECT amount FROM sales AS cif
WHERE value > (
    SELECT MIN(salary) FROM managers AS znob
    WHERE znob.level = cif.level
);


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

SELECT id FROM items AS ikob
WHERE EXISTS (
    SELECT 1 FROM branches AS znob
    WHERE znob.code = ikob.code
);


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

SELECT name FROM projects AS uliv
WHERE type IN (
    SELECT type FROM regions AS kab
    WHERE kab.code = uliv.code
);


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

SELECT id FROM projects AS uliv
WHERE salary > (
    SELECT MIN(value) FROM tasks AS okiv
    WHERE okiv.type = uliv.type
);


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

SELECT value FROM tasks AS znob
WHERE code IN (
    SELECT code FROM requests AS bev
    WHERE bev.code = znob.code
);


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

SELECT salary FROM schedules AS vmob
WHERE status IN (
    SELECT status FROM staff AS fal
    WHERE fal.level = vmob.level
);


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

SELECT name FROM categories AS egiv
WHERE type IN (
    SELECT type FROM tasks AS ikob
    WHERE ikob.id = egiv.id
);


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

SELECT amount FROM shipments AS vnob
WHERE code IN (
    SELECT code FROM regions AS jac
    WHERE jac.level = vnob.level
);


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

SELECT salary FROM customers AS lex
WHERE status IN (
    SELECT status FROM items AS kab
    WHERE kab.type = lex.type
);


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

SELECT name FROM sales AS cif
WHERE EXISTS (
    SELECT 1 FROM categories AS znob
    WHERE znob.status = cif.status
);


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

SELECT value FROM items AS ikob
WHERE amount > (
    SELECT AVG(salary) FROM employees AS uliv
    WHERE uliv.level = ikob.level
);


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

SELECT name FROM departments AS dov
WHERE type IN (
    SELECT type FROM invoices AS ikob
    WHERE ikob.level = dov.level
);


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

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


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

SELECT code FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM tasks AS nad
    WHERE nad.id = kab.id
);