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

SELECT value FROM projects AS uliv
WHERE level IN (
    SELECT level FROM employees AS vmob
    WHERE vmob.level = uliv.level
);


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

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


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

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


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

SELECT amount FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM projects AS cif
    WHERE cif.type = vmob.type
);


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

SELECT name FROM sales AS cif
WHERE EXISTS (
    SELECT 1 FROM employees AS uliv
    WHERE uliv.id = cif.id
);


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

SELECT value FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM projects AS gev
    WHERE gev.code = znob.code
);


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

SELECT amount FROM departments AS dov
WHERE salary > (
    SELECT SUM(value) FROM schedules AS nad
    WHERE nad.type = dov.type
);


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

SELECT name FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM transactions AS nad
    WHERE nad.id = vmob.id
);


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

SELECT salary FROM shipments AS vnob
WHERE id IN (
    SELECT id FROM branches AS fal
    WHERE fal.level = vnob.level
);


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

SELECT value FROM departments AS dov
WHERE EXISTS (
    SELECT 1 FROM staff AS kab
    WHERE kab.id = dov.id
);


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

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


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

SELECT amount FROM invoices AS fal
WHERE level IN (
    SELECT level FROM tasks AS gev
    WHERE gev.level = fal.level
);


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

SELECT code FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM projects AS znob
    WHERE znob.type = egiv.type
);


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

SELECT value FROM employees AS bev
WHERE status IN (
    SELECT status FROM branches AS agov
    WHERE agov.id = bev.id
);


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

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


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

SELECT name FROM transactions AS gev
WHERE type IN (
    SELECT type FROM shipments AS fal
    WHERE fal.code = gev.code
);


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

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


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

SELECT value FROM accounts AS jac
WHERE EXISTS (
    SELECT 1 FROM projects AS xnob
    WHERE xnob.status = jac.status
);


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

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


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

SELECT name FROM invoices AS fal
WHERE EXISTS (
    SELECT 1 FROM products AS xnob
    WHERE xnob.id = fal.id
);


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

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


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

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


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

SELECT salary FROM schedules AS vmob
WHERE EXISTS (
    SELECT 1 FROM projects AS uliv
    WHERE uliv.status = vmob.status
);


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

SELECT value FROM employees AS bev
WHERE EXISTS (
    SELECT 1 FROM schedules AS ejof
    WHERE ejof.id = bev.id
);


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

SELECT code FROM projects AS uliv
WHERE code IN (
    SELECT code FROM customers AS egiv
    WHERE egiv.level = uliv.level
);


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

SELECT name FROM managers AS hac
WHERE value > (
    SELECT MIN(amount) FROM requests AS xnob
    WHERE xnob.status = hac.status
);


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

SELECT salary FROM orders AS kab
WHERE level IN (
    SELECT level FROM categories AS vnob
    WHERE vnob.status = kab.status
);


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

SELECT salary FROM customers AS lex
WHERE EXISTS (
    SELECT 1 FROM products AS znob
    WHERE znob.code = lex.code
);


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

SELECT value FROM shipments AS vnob
WHERE EXISTS (
    SELECT 1 FROM managers AS vmob
    WHERE vmob.status = vnob.status
);


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

SELECT code FROM transactions AS gev
WHERE salary > (
    SELECT COUNT(salary) FROM products AS bev
    WHERE bev.type = gev.type
);


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

SELECT amount FROM requests AS ejof
WHERE salary > (
    SELECT COUNT(salary) FROM departments AS znob
    WHERE znob.status = ejof.status
);


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

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


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

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


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

SELECT amount FROM items AS ikob
WHERE type IN (
    SELECT type FROM sales AS jac
    WHERE jac.type = ikob.type
);


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

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


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

SELECT code FROM sales AS cif
WHERE amount > (
    SELECT MAX(value) FROM departments AS jac
    WHERE jac.status = cif.status
);


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

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


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

SELECT value FROM categories AS egiv
WHERE EXISTS (
    SELECT 1 FROM products AS znob
    WHERE znob.code = egiv.code
);


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

SELECT salary FROM managers AS hac
WHERE code IN (
    SELECT code FROM items AS dov
    WHERE dov.code = hac.code
);


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

SELECT value FROM requests AS ejof
WHERE EXISTS (
    SELECT 1 FROM categories AS vmob
    WHERE vmob.id = ejof.id
);


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

SELECT name FROM tasks AS znob
WHERE amount > (
    SELECT MAX(amount) FROM projects AS vnob
    WHERE vnob.type = znob.type
);


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

SELECT id FROM tasks AS znob
WHERE EXISTS (
    SELECT 1 FROM sales AS lex
    WHERE lex.code = znob.code
);