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

SELECT name FROM tasks AS znob
WHERE amount > (
    SELECT AVG(salary) FROM products AS bev
    WHERE bev.level = znob.level
);


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

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


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

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


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

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


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

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


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

SELECT value FROM orders AS kab
WHERE type IN (
    SELECT type FROM accounts AS okiv
    WHERE okiv.status = kab.status
);


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

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


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

SELECT salary FROM invoices AS fal
WHERE value > (
    SELECT AVG(salary) FROM products AS hac
    WHERE hac.code = fal.code
);


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

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


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

SELECT value FROM staff AS xnob
WHERE EXISTS (
    SELECT 1 FROM departments AS jac
    WHERE jac.code = xnob.code
);


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

SELECT salary FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM regions AS okiv
    WHERE okiv.type = jac.type
);


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

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


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

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


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

SELECT name FROM departments AS dov
WHERE code IN (
    SELECT code FROM sales AS okiv
    WHERE okiv.id = dov.id
);


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

SELECT id FROM customers AS lex
WHERE salary > (
    SELECT MIN(value) FROM transactions AS cif
    WHERE cif.level = lex.level
);


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

SELECT id FROM invoices AS fal
WHERE id IN (
    SELECT id FROM projects AS nad
    WHERE nad.id = fal.id
);


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

SELECT salary FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM products AS gev
    WHERE gev.code = znob.code
);


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

SELECT salary FROM schedules AS vmob
WHERE status IN (
    SELECT status FROM invoices AS agov
    WHERE agov.id = vmob.id
);


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

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


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

SELECT id FROM tasks AS znob
WHERE code IN (
    SELECT code FROM staff AS okiv
    WHERE okiv.status = znob.status
);


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

SELECT value FROM projects AS uliv
WHERE status IN (
    SELECT status FROM tasks AS nad
    WHERE nad.code = uliv.code
);


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

SELECT code FROM tasks AS znob
WHERE type IN (
    SELECT type FROM staff AS hac
    WHERE hac.code = znob.code
);


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

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


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

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


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

SELECT id FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM customers AS kab
    WHERE kab.type = agov.type
);


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

SELECT salary FROM transactions AS gev
WHERE type IN (
    SELECT type FROM requests AS vmob
    WHERE vmob.type = gev.type
);


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

SELECT id FROM transactions AS gev
WHERE EXISTS (
    SELECT 1 FROM staff AS fal
    WHERE fal.level = gev.level
);


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

SELECT value FROM transactions AS gev
WHERE EXISTS (
    SELECT 1 FROM shipments AS ikob
    WHERE ikob.type = gev.type
);


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

SELECT value FROM departments AS dov
WHERE level IN (
    SELECT level FROM projects AS ikob
    WHERE ikob.status = dov.status
);


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

SELECT value FROM projects AS uliv
WHERE EXISTS (
    SELECT 1 FROM departments AS nad
    WHERE nad.type = uliv.type
);


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

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


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

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


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

SELECT salary FROM employees AS bev
WHERE EXISTS (
    SELECT 1 FROM customers AS kab
    WHERE kab.level = bev.level
);


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

SELECT code FROM managers AS hac
WHERE amount > (
    SELECT AVG(value) FROM orders AS ikob
    WHERE ikob.id = hac.id
);


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

SELECT name FROM managers AS hac
WHERE id IN (
    SELECT id FROM tasks AS kab
    WHERE kab.type = hac.type
);


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

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


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

SELECT amount FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM regions AS nad
    WHERE nad.type = egiv.type
);


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

SELECT salary FROM orders AS kab
WHERE value > (
    SELECT MIN(salary) FROM schedules AS ikob
    WHERE ikob.level = kab.level
);


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

SELECT name FROM managers AS hac
WHERE type IN (
    SELECT type FROM schedules AS znob
    WHERE znob.status = hac.status
);


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

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


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

SELECT name FROM sales AS cif
WHERE status IN (
    SELECT status FROM regions AS nad
    WHERE nad.type = cif.type
);


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

SELECT salary FROM items AS ikob
WHERE EXISTS (
    SELECT 1 FROM departments AS agov
    WHERE agov.level = ikob.level
);


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

SELECT salary FROM managers AS hac
WHERE EXISTS (
    SELECT 1 FROM employees AS ejof
    WHERE ejof.level = hac.level
);


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

SELECT code FROM categories AS egiv
WHERE salary > (
    SELECT AVG(salary) FROM invoices AS bev
    WHERE bev.code = egiv.code
);


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

SELECT amount FROM branches AS agov
WHERE type IN (
    SELECT type FROM categories AS vmob
    WHERE vmob.status = agov.status
);


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

SELECT code FROM sales AS cif
WHERE value > (
    SELECT MAX(value) FROM transactions AS xnob
    WHERE xnob.id = cif.id
);


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

SELECT code FROM branches AS agov
WHERE level IN (
    SELECT level FROM regions AS egiv
    WHERE egiv.status = agov.status
);


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

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


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

SELECT salary FROM employees AS bev
WHERE salary > (
    SELECT AVG(value) FROM tasks AS okiv
    WHERE okiv.status = bev.status
);


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

SELECT id FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM orders AS uliv
    WHERE uliv.level = dov.level
);


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

SELECT code FROM schedules AS vmob
WHERE salary > (
    SELECT COUNT(salary) FROM sales AS dov
    WHERE dov.status = vmob.status
);


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

SELECT id FROM customers AS lex
WHERE salary > (
    SELECT SUM(value) FROM staff AS ikob
    WHERE ikob.id = lex.id
);


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

SELECT code FROM requests AS ejof
WHERE status IN (
    SELECT status FROM sales AS nad
    WHERE nad.type = ejof.type
);


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

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


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

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


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

SELECT id FROM requests AS ejof
WHERE EXISTS (
    SELECT 1 FROM categories AS nad
    WHERE nad.type = ejof.type
);


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

SELECT amount FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM shipments AS gev
    WHERE gev.id = okiv.id
);


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

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


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

SELECT id FROM employees AS bev
WHERE code IN (
    SELECT code FROM products AS agov
    WHERE agov.status = bev.status
);


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

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


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

SELECT value FROM staff AS xnob
WHERE type IN (
    SELECT type FROM accounts AS bev
    WHERE bev.code = xnob.code
);


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

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


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

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


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

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


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

SELECT value FROM items AS ikob
WHERE amount > (
    SELECT MAX(amount) FROM shipments AS hac
    WHERE hac.type = ikob.type
);


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

SELECT value FROM departments AS dov
WHERE amount > (
    SELECT COUNT(value) FROM products AS hac
    WHERE hac.id = dov.id
);


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

SELECT name FROM accounts AS jac
WHERE salary > (
    SELECT MAX(value) FROM items AS fal
    WHERE fal.level = jac.level
);


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

SELECT value FROM sales AS cif
WHERE value > (
    SELECT COUNT(amount) FROM schedules AS vmob
    WHERE vmob.type = cif.type
);


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

SELECT id FROM orders AS kab
WHERE status IN (
    SELECT status FROM accounts AS hac
    WHERE hac.type = kab.type
);


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

SELECT amount FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM schedules AS uliv
    WHERE uliv.status = okiv.status
);


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

SELECT code FROM orders AS kab
WHERE salary > (
    SELECT AVG(amount) FROM invoices AS gev
    WHERE gev.type = kab.type
);


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

SELECT value FROM managers AS hac
WHERE EXISTS (
    SELECT 1 FROM employees AS agov
    WHERE agov.id = hac.id
);


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

SELECT salary FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM invoices AS dov
    WHERE dov.id = jac.id
);


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

SELECT salary FROM requests AS ejof
WHERE level IN (
    SELECT level FROM tasks AS nad
    WHERE nad.type = ejof.type
);


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

SELECT amount FROM schedules AS vmob
WHERE level IN (
    SELECT level FROM categories AS okiv
    WHERE okiv.status = vmob.status
);


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

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


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

SELECT amount FROM invoices AS fal
WHERE EXISTS (
    SELECT 1 FROM regions AS ejof
    WHERE ejof.status = fal.status
);


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

SELECT id FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM orders AS vnob
    WHERE vnob.code = agov.code
);


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

SELECT id FROM accounts AS jac
WHERE id IN (
    SELECT id FROM products AS vnob
    WHERE vnob.code = jac.code
);


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

SELECT code FROM transactions AS gev
WHERE level IN (
    SELECT level FROM employees AS vnob
    WHERE vnob.code = gev.code
);


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

SELECT salary FROM products AS nad
WHERE salary > (
    SELECT MAX(amount) FROM sales AS ikob
    WHERE ikob.level = nad.level
);


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

SELECT salary FROM invoices AS fal
WHERE status IN (
    SELECT status FROM projects AS gev
    WHERE gev.type = fal.type
);


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

SELECT value FROM sales AS cif
WHERE salary > (
    SELECT MAX(salary) FROM invoices AS vnob
    WHERE vnob.status = cif.status
);


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

SELECT id FROM items AS ikob
WHERE value > (
    SELECT COUNT(salary) FROM branches AS znob
    WHERE znob.status = ikob.status
);


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

SELECT value FROM schedules AS vmob
WHERE code IN (
    SELECT code FROM staff AS znob
    WHERE znob.id = vmob.id
);


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

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


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

SELECT amount FROM products AS nad
WHERE EXISTS (
    SELECT 1 FROM employees AS ikob
    WHERE ikob.code = nad.code
);


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

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


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

SELECT value FROM orders AS kab
WHERE level IN (
    SELECT level FROM customers AS vmob
    WHERE vmob.level = kab.level
);


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

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


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

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


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

SELECT amount FROM shipments AS vnob
WHERE level IN (
    SELECT level FROM departments AS vmob
    WHERE vmob.id = vnob.id
);


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

SELECT name FROM employees AS bev
WHERE code IN (
    SELECT code FROM departments AS ikob
    WHERE ikob.code = bev.code
);


Prompt:
Schema:
  branches (alias: agov)(level, amount, code, type)
  schedules(level, amount, code, type)
Task: Find code from branches where salary exceeds the total salary from schedules for the same level.
SQL:

SELECT code FROM branches AS agov
WHERE salary > (
    SELECT SUM(salary) FROM schedules AS nad
    WHERE nad.level = agov.level
);


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

SELECT code FROM orders AS kab
WHERE type IN (
    SELECT type FROM shipments AS ejof
    WHERE ejof.code = kab.code
);


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

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


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

SELECT name FROM transactions AS gev
WHERE type IN (
    SELECT type FROM items AS xnob
    WHERE xnob.id = gev.id
);


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

SELECT id FROM requests AS ejof
WHERE amount > (
    SELECT MIN(amount) FROM customers AS okiv
    WHERE okiv.type = ejof.type
);


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

SELECT id FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM employees AS cif
    WHERE cif.status = znob.status
);


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

SELECT amount FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM branches AS kab
    WHERE kab.level = vmob.level
);


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

SELECT amount FROM departments AS dov
WHERE code IN (
    SELECT code FROM orders AS gev
    WHERE gev.status = dov.status
);


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

SELECT code FROM regions AS okiv
WHERE code IN (
    SELECT code FROM employees AS agov
    WHERE agov.type = okiv.type
);


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

SELECT name FROM staff AS xnob
WHERE EXISTS (
    SELECT 1 FROM shipments AS okiv
    WHERE okiv.code = xnob.code
);


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

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


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

SELECT name FROM employees AS bev
WHERE salary > (
    SELECT MIN(salary) FROM customers AS dov
    WHERE dov.code = bev.code
);


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

SELECT value FROM invoices AS fal
WHERE level IN (
    SELECT level FROM orders AS znob
    WHERE znob.code = fal.code
);


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

SELECT code FROM schedules AS vmob
WHERE level IN (
    SELECT level FROM staff AS znob
    WHERE znob.id = vmob.id
);


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

SELECT amount FROM staff AS xnob
WHERE EXISTS (
    SELECT 1 FROM employees AS kab
    WHERE kab.type = xnob.type
);


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

SELECT salary FROM customers AS lex
WHERE amount > (
    SELECT COUNT(amount) FROM shipments AS dov
    WHERE dov.level = lex.level
);


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

SELECT name FROM products AS nad
WHERE EXISTS (
    SELECT 1 FROM regions AS vmob
    WHERE vmob.id = nad.id
);


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

SELECT code FROM branches AS agov
WHERE value > (
    SELECT SUM(value) FROM staff AS cif
    WHERE cif.type = agov.type
);


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

SELECT name FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM accounts AS hac
    WHERE hac.code = vmob.code
);


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

SELECT id FROM categories AS egiv
WHERE level IN (
    SELECT level FROM shipments AS bev
    WHERE bev.level = egiv.level
);


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

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


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

SELECT value FROM regions AS okiv
WHERE code IN (
    SELECT code FROM shipments AS fal
    WHERE fal.id = okiv.id
);


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

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


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

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


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

SELECT code FROM items AS ikob
WHERE type IN (
    SELECT type FROM orders AS dov
    WHERE dov.code = ikob.code
);


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

SELECT name FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM managers AS uliv
    WHERE uliv.code = jac.code
);


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

SELECT name FROM sales AS cif
WHERE salary > (
    SELECT AVG(value) FROM schedules AS dov
    WHERE dov.code = cif.code
);


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

SELECT salary FROM invoices AS fal
WHERE EXISTS (
    SELECT 1 FROM tasks AS egiv
    WHERE egiv.type = fal.type
);


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

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


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

SELECT value FROM staff AS xnob
WHERE value > (
    SELECT MAX(amount) FROM categories AS ejof
    WHERE ejof.level = xnob.level
);


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

SELECT id FROM staff AS xnob
WHERE EXISTS (
    SELECT 1 FROM items AS uliv
    WHERE uliv.id = xnob.id
);


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

SELECT salary FROM accounts AS jac
WHERE status IN (
    SELECT status FROM categories AS nad
    WHERE nad.level = jac.level
);


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

SELECT name FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM invoices AS ejof
    WHERE ejof.type = dov.type
);


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

SELECT name FROM customers AS lex
WHERE salary > (
    SELECT MIN(value) FROM sales AS nad
    WHERE nad.id = lex.id
);


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

SELECT salary FROM regions AS okiv
WHERE salary > (
    SELECT COUNT(value) FROM orders AS bev
    WHERE bev.level = okiv.level
);


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

SELECT code FROM products AS nad
WHERE value > (
    SELECT AVG(value) FROM orders AS dov
    WHERE dov.type = nad.type
);


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

SELECT amount FROM shipments AS vnob
WHERE value > (
    SELECT AVG(amount) FROM transactions AS okiv
    WHERE okiv.id = vnob.id
);


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

SELECT value FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM departments AS nad
    WHERE nad.type = jac.type
);


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

SELECT value FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM shipments AS vnob
    WHERE vnob.level = okiv.level
);


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

SELECT value FROM categories AS egiv
WHERE value > (
    SELECT MIN(amount) FROM shipments AS znob
    WHERE znob.id = egiv.id
);


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

SELECT amount FROM invoices AS fal
WHERE EXISTS (
    SELECT 1 FROM shipments AS lex
    WHERE lex.type = fal.type
);


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

SELECT value FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM schedules AS ejof
    WHERE ejof.code = jac.code
);


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

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


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

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


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

SELECT id FROM invoices AS fal
WHERE EXISTS (
    SELECT 1 FROM shipments AS kab
    WHERE kab.id = fal.id
);


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

SELECT name FROM customers AS lex
WHERE amount > (
    SELECT MIN(amount) FROM orders AS agov
    WHERE agov.id = lex.id
);


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

SELECT code FROM transactions AS gev
WHERE value > (
    SELECT MIN(salary) FROM products AS lex
    WHERE lex.type = gev.type
);


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

SELECT id FROM items AS ikob
WHERE amount > (
    SELECT AVG(value) FROM shipments AS egiv
    WHERE egiv.code = ikob.code
);


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

SELECT id FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM managers AS nad
    WHERE nad.status = znob.status
);


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

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


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

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


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

SELECT name FROM requests AS ejof
WHERE EXISTS (
    SELECT 1 FROM customers AS ikob
    WHERE ikob.level = ejof.level
);


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

SELECT salary FROM projects AS uliv
WHERE EXISTS (
    SELECT 1 FROM requests AS cif
    WHERE cif.status = uliv.status
);


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

SELECT amount FROM invoices AS fal
WHERE value > (
    SELECT SUM(value) FROM products AS ikob
    WHERE ikob.status = fal.status
);


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

SELECT value FROM sales AS cif
WHERE EXISTS (
    SELECT 1 FROM orders AS vnob
    WHERE vnob.level = cif.level
);


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

SELECT salary FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM tasks AS nad
    WHERE nad.code = vmob.code
);


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

SELECT value FROM regions AS okiv
WHERE level IN (
    SELECT level FROM employees AS nad
    WHERE nad.type = okiv.type
);


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

SELECT salary FROM transactions AS gev
WHERE status IN (
    SELECT status FROM orders AS nad
    WHERE nad.type = gev.type
);


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

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


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

SELECT value FROM products AS nad
WHERE level IN (
    SELECT level FROM invoices AS xnob
    WHERE xnob.type = nad.type
);


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

SELECT code FROM items AS ikob
WHERE amount > (
    SELECT SUM(value) FROM accounts AS hac
    WHERE hac.level = ikob.level
);


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

SELECT id FROM products AS nad
WHERE type IN (
    SELECT type FROM shipments AS xnob
    WHERE xnob.type = nad.type
);


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

SELECT code FROM shipments AS vnob
WHERE value > (
    SELECT SUM(value) FROM staff AS nad
    WHERE nad.status = vnob.status
);


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

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


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

SELECT amount FROM sales AS cif
WHERE type IN (
    SELECT type FROM requests AS fal
    WHERE fal.id = cif.id
);


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

SELECT id FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM customers AS agov
    WHERE agov.type = kab.type
);


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

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


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

SELECT code FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM projects AS dov
    WHERE dov.type = kab.type
);


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

SELECT value FROM items AS ikob
WHERE EXISTS (
    SELECT 1 FROM employees AS dov
    WHERE dov.level = ikob.level
);


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

SELECT code FROM sales AS cif
WHERE type IN (
    SELECT type FROM schedules AS uliv
    WHERE uliv.status = cif.status
);


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

SELECT value FROM requests AS ejof
WHERE EXISTS (
    SELECT 1 FROM regions AS uliv
    WHERE uliv.id = ejof.id
);


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

SELECT amount FROM employees AS bev
WHERE EXISTS (
    SELECT 1 FROM shipments AS egiv
    WHERE egiv.id = bev.id
);


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

SELECT value FROM employees AS bev
WHERE value > (
    SELECT MAX(value) FROM staff AS ikob
    WHERE ikob.level = bev.level
);


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

SELECT amount FROM branches AS agov
WHERE salary > (
    SELECT SUM(salary) FROM employees AS egiv
    WHERE egiv.id = agov.id
);


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

SELECT name FROM items AS ikob
WHERE code IN (
    SELECT code FROM categories AS egiv
    WHERE egiv.code = ikob.code
);


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

SELECT name FROM managers AS hac
WHERE EXISTS (
    SELECT 1 FROM regions AS jac
    WHERE jac.level = hac.level
);


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

SELECT amount FROM employees AS bev
WHERE amount > (
    SELECT AVG(salary) FROM departments AS okiv
    WHERE okiv.id = bev.id
);


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

SELECT name FROM branches AS agov
WHERE amount > (
    SELECT COUNT(value) FROM requests AS gev
    WHERE gev.type = agov.type
);


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

SELECT amount FROM products AS nad
WHERE level IN (
    SELECT level FROM shipments AS hac
    WHERE hac.level = nad.level
);


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

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


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

SELECT amount FROM items AS ikob
WHERE EXISTS (
    SELECT 1 FROM schedules AS cif
    WHERE cif.status = ikob.status
);


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

SELECT code FROM branches AS agov
WHERE status IN (
    SELECT status FROM customers AS gev
    WHERE gev.level = agov.level
);


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

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


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

SELECT salary FROM transactions AS gev
WHERE value > (
    SELECT MAX(amount) FROM managers AS kab
    WHERE kab.level = gev.level
);


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

SELECT name FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM requests AS egiv
    WHERE egiv.code = znob.code
);


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

SELECT name FROM categories AS egiv
WHERE level IN (
    SELECT level FROM regions AS xnob
    WHERE xnob.type = egiv.type
);


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

SELECT salary FROM transactions AS gev
WHERE value > (
    SELECT MAX(value) FROM orders AS okiv
    WHERE okiv.status = gev.status
);


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

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


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

SELECT name FROM requests AS ejof
WHERE type IN (
    SELECT type FROM staff AS uliv
    WHERE uliv.level = ejof.level
);


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

SELECT value FROM customers AS lex
WHERE EXISTS (
    SELECT 1 FROM managers AS egiv
    WHERE egiv.code = lex.code
);


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

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


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

SELECT amount FROM staff AS xnob
WHERE level IN (
    SELECT level FROM invoices AS bev
    WHERE bev.id = xnob.id
);


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

SELECT amount FROM items AS ikob
WHERE value > (
    SELECT COUNT(salary) FROM accounts AS xnob
    WHERE xnob.level = ikob.level
);


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

SELECT value FROM shipments AS vnob
WHERE salary > (
    SELECT MAX(amount) FROM staff AS cif
    WHERE cif.status = vnob.status
);


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

SELECT name FROM requests AS ejof
WHERE salary > (
    SELECT SUM(salary) FROM categories AS kab
    WHERE kab.code = ejof.code
);


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

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


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

SELECT salary FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM projects AS ejof
    WHERE ejof.status = dov.status
);


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

SELECT value FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM tasks AS xnob
    WHERE xnob.level = vmob.level
);


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

SELECT amount FROM regions AS okiv
WHERE status IN (
    SELECT status FROM customers AS xnob
    WHERE xnob.status = okiv.status
);


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

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


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

SELECT salary FROM tasks AS znob
WHERE id IN (
    SELECT id FROM regions AS lex
    WHERE lex.type = znob.type
);


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

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


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

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


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

SELECT salary FROM categories AS egiv
WHERE type IN (
    SELECT type FROM orders AS cif
    WHERE cif.status = egiv.status
);


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

SELECT name FROM customers AS lex
WHERE type IN (
    SELECT type FROM branches AS cif
    WHERE cif.code = lex.code
);


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

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


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

SELECT code FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM accounts AS hac
    WHERE hac.level = egiv.level
);


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

SELECT amount FROM orders AS kab
WHERE id IN (
    SELECT id FROM customers AS bev
    WHERE bev.level = kab.level
);


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

SELECT value FROM categories AS egiv
WHERE code IN (
    SELECT code FROM customers AS bev
    WHERE bev.type = egiv.type
);


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

SELECT id FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM sales AS agov
    WHERE agov.status = egiv.status
);


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

SELECT amount FROM staff AS xnob
WHERE amount > (
    SELECT MAX(amount) FROM orders AS fal
    WHERE fal.status = xnob.status
);


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

SELECT amount FROM regions AS okiv
WHERE value > (
    SELECT SUM(amount) FROM orders AS xnob
    WHERE xnob.level = okiv.level
);


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

SELECT name FROM invoices AS fal
WHERE level IN (
    SELECT level FROM schedules AS znob
    WHERE znob.id = fal.id
);


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

SELECT code FROM invoices AS fal
WHERE value > (
    SELECT COUNT(amount) FROM departments AS dov
    WHERE dov.type = fal.type
);


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

SELECT id FROM departments AS dov
WHERE code IN (
    SELECT code FROM requests AS vmob
    WHERE vmob.status = dov.status
);


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

SELECT amount FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM customers AS bev
    WHERE bev.level = dov.level
);


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

SELECT code FROM projects AS uliv
WHERE value > (
    SELECT COUNT(amount) FROM sales AS vmob
    WHERE vmob.type = uliv.type
);


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

SELECT salary FROM orders AS kab
WHERE value > (
    SELECT COUNT(amount) FROM branches AS cif
    WHERE cif.type = kab.type
);


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

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


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

SELECT value FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM transactions AS agov
    WHERE agov.type = egiv.type
);


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

SELECT salary FROM items AS ikob
WHERE code IN (
    SELECT code FROM sales AS vnob
    WHERE vnob.status = ikob.status
);


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

SELECT id FROM accounts AS jac
WHERE salary > (
    SELECT MAX(value) FROM sales AS cif
    WHERE cif.level = jac.level
);


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

SELECT value FROM customers AS lex
WHERE value > (
    SELECT MIN(salary) FROM staff AS znob
    WHERE znob.status = lex.status
);


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

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


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

SELECT name FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM customers AS xnob
    WHERE xnob.status = znob.status
);


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

SELECT amount FROM customers AS lex
WHERE status IN (
    SELECT status FROM orders AS agov
    WHERE agov.level = lex.level
);


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

SELECT id FROM tasks AS znob
WHERE salary > (
    SELECT SUM(value) FROM regions AS egiv
    WHERE egiv.type = znob.type
);


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

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


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

SELECT name FROM accounts AS jac
WHERE amount > (
    SELECT SUM(value) FROM orders AS ikob
    WHERE ikob.code = jac.code
);


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

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


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

SELECT code FROM regions AS okiv
WHERE status IN (
    SELECT status FROM schedules AS cif
    WHERE cif.status = okiv.status
);


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

SELECT id FROM products AS nad
WHERE id IN (
    SELECT id FROM staff AS ejof
    WHERE ejof.status = nad.status
);


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

SELECT name FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM orders AS hac
    WHERE hac.level = znob.level
);


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

SELECT name FROM transactions AS gev
WHERE EXISTS (
    SELECT 1 FROM sales AS vmob
    WHERE vmob.level = gev.level
);


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

SELECT value FROM regions AS okiv
WHERE salary > (
    SELECT AVG(salary) FROM staff AS agov
    WHERE agov.type = okiv.type
);


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

SELECT name FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM requests AS vnob
    WHERE vnob.status = jac.status
);


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

SELECT code FROM staff AS xnob
WHERE status IN (
    SELECT status FROM departments AS kab
    WHERE kab.id = xnob.id
);


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

SELECT id FROM customers AS lex
WHERE EXISTS (
    SELECT 1 FROM departments AS fal
    WHERE fal.type = lex.type
);


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

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


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

SELECT value FROM categories AS egiv
WHERE code IN (
    SELECT code FROM tasks AS fal
    WHERE fal.status = egiv.status
);


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

SELECT name FROM items AS ikob
WHERE EXISTS (
    SELECT 1 FROM employees AS vmob
    WHERE vmob.id = ikob.id
);


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

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


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

SELECT salary FROM regions AS okiv
WHERE code IN (
    SELECT code FROM tasks AS lex
    WHERE lex.level = okiv.level
);


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

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


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

SELECT id FROM staff AS xnob
WHERE amount > (
    SELECT MAX(amount) FROM regions AS vnob
    WHERE vnob.status = xnob.status
);


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

SELECT id FROM managers AS hac
WHERE salary > (
    SELECT MAX(value) FROM employees AS nad
    WHERE nad.id = hac.id
);


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

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


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

SELECT value FROM projects AS uliv
WHERE amount > (
    SELECT AVG(amount) FROM departments AS agov
    WHERE agov.code = uliv.code
);


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

SELECT amount FROM transactions AS gev
WHERE level IN (
    SELECT level FROM sales AS xnob
    WHERE xnob.level = gev.level
);


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

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


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

SELECT salary FROM sales AS cif
WHERE EXISTS (
    SELECT 1 FROM tasks AS agov
    WHERE agov.code = cif.code
);


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

SELECT value FROM orders AS kab
WHERE salary > (
    SELECT COUNT(amount) FROM tasks AS vmob
    WHERE vmob.status = kab.status
);


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

SELECT amount FROM tasks AS znob
WHERE type IN (
    SELECT type FROM categories AS nad
    WHERE nad.id = znob.id
);


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

SELECT id FROM managers AS hac
WHERE EXISTS (
    SELECT 1 FROM staff AS cif
    WHERE cif.type = hac.type
);


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

SELECT value FROM accounts AS jac
WHERE code IN (
    SELECT code FROM staff AS lex
    WHERE lex.type = jac.type
);


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

SELECT amount FROM employees AS bev
WHERE EXISTS (
    SELECT 1 FROM departments AS ejof
    WHERE ejof.type = bev.type
);


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

SELECT value FROM branches AS agov
WHERE status IN (
    SELECT status FROM products AS gev
    WHERE gev.type = agov.type
);


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

SELECT value FROM shipments AS vnob
WHERE EXISTS (
    SELECT 1 FROM departments AS kab
    WHERE kab.level = vnob.level
);


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

SELECT value FROM categories AS egiv
WHERE value > (
    SELECT COUNT(amount) FROM managers AS okiv
    WHERE okiv.status = egiv.status
);


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

SELECT amount FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM managers AS jac
    WHERE jac.code = kab.code
);


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

SELECT id FROM customers AS lex
WHERE value > (
    SELECT SUM(value) FROM products AS vmob
    WHERE vmob.level = lex.level
);


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

SELECT value FROM staff AS xnob
WHERE amount > (
    SELECT MAX(value) FROM items AS agov
    WHERE agov.id = xnob.id
);


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

SELECT code FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM employees AS okiv
    WHERE okiv.type = znob.type
);


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

SELECT name FROM sales AS cif
WHERE id IN (
    SELECT id FROM shipments AS lex
    WHERE lex.level = cif.level
);


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

SELECT id FROM projects AS uliv
WHERE EXISTS (
    SELECT 1 FROM invoices AS bev
    WHERE bev.status = uliv.status
);


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

SELECT amount FROM customers AS lex
WHERE value > (
    SELECT AVG(value) FROM items AS vmob
    WHERE vmob.status = lex.status
);


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

SELECT salary FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM sales AS agov
    WHERE agov.level = egiv.level
);


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

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


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

SELECT value FROM requests AS ejof
WHERE value > (
    SELECT COUNT(amount) FROM schedules AS uliv
    WHERE uliv.status = ejof.status
);


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

SELECT code FROM items AS ikob
WHERE type IN (
    SELECT type FROM categories AS nad
    WHERE nad.status = ikob.status
);


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

SELECT salary FROM staff AS xnob
WHERE type IN (
    SELECT type FROM schedules AS gev
    WHERE gev.level = xnob.level
);


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

SELECT amount FROM orders AS kab
WHERE EXISTS (
    SELECT 1 FROM requests AS bev
    WHERE bev.status = kab.status
);


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

SELECT amount FROM products AS nad
WHERE value > (
    SELECT SUM(salary) FROM sales AS lex
    WHERE lex.id = nad.id
);


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

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


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

SELECT code FROM tasks AS znob
WHERE salary > (
    SELECT SUM(amount) FROM categories AS uliv
    WHERE uliv.type = znob.type
);


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

SELECT amount FROM transactions AS gev
WHERE EXISTS (
    SELECT 1 FROM tasks AS vnob
    WHERE vnob.code = gev.code
);


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

SELECT code FROM orders AS kab
WHERE status IN (
    SELECT status FROM transactions AS hac
    WHERE hac.code = kab.code
);


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

SELECT name FROM sales AS cif
WHERE EXISTS (
    SELECT 1 FROM shipments AS lex
    WHERE lex.status = cif.status
);


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

SELECT code FROM products AS nad
WHERE EXISTS (
    SELECT 1 FROM accounts AS kab
    WHERE kab.code = nad.code
);


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

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


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

SELECT amount FROM regions AS okiv
WHERE EXISTS (
    SELECT 1 FROM accounts AS egiv
    WHERE egiv.code = okiv.code
);


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

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


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

SELECT name FROM departments AS dov
WHERE salary > (
    SELECT COUNT(salary) FROM shipments AS okiv
    WHERE okiv.level = dov.level
);


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

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


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

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


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

SELECT id FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM orders AS fal
    WHERE fal.status = vmob.status
);


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

SELECT code FROM branches AS agov
WHERE EXISTS (
    SELECT 1 FROM categories AS vmob
    WHERE vmob.code = agov.code
);


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

SELECT id FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM branches AS agov
    WHERE agov.level = egiv.level
);


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

SELECT name FROM staff AS xnob
WHERE salary > (
    SELECT COUNT(salary) FROM shipments AS ikob
    WHERE ikob.type = xnob.type
);


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

SELECT name FROM products AS nad
WHERE value > (
    SELECT COUNT(amount) FROM sales AS dov
    WHERE dov.type = nad.type
);


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

SELECT value FROM accounts AS jac
WHERE status IN (
    SELECT status FROM orders AS kab
    WHERE kab.id = jac.id
);


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

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


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

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


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

SELECT salary FROM sales AS cif
WHERE status IN (
    SELECT status FROM regions AS okiv
    WHERE okiv.type = cif.type
);


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

SELECT amount FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM employees AS bev
    WHERE bev.id = egiv.id
);


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

SELECT code FROM departments AS dov
WHERE amount > (
    SELECT COUNT(amount) FROM schedules AS hac
    WHERE hac.code = dov.code
);


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

SELECT id FROM transactions AS gev
WHERE EXISTS (
    SELECT 1 FROM tasks AS hac
    WHERE hac.level = gev.level
);


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

SELECT code FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM managers AS cif
    WHERE cif.id = vmob.id
);


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

SELECT id FROM orders AS kab
WHERE status IN (
    SELECT status FROM regions AS hac
    WHERE hac.code = kab.code
);


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

SELECT name FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM sales AS jac
    WHERE jac.status = egiv.status
);


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

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


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

SELECT id FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM categories AS egiv
    WHERE egiv.level = znob.level
);


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

SELECT id FROM categories AS egiv
WHERE code IN (
    SELECT code FROM invoices AS lex
    WHERE lex.status = egiv.status
);


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

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


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

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


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

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