[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: List all employees and their salaries.

[Assistant] SELECT name, salary FROM employees;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Show all departments.

[Assistant] SELECT * FROM departments;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Find all products in the Software category.

[Assistant] SELECT * FROM products WHERE category = 'Software';


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: List products that cost more than 500 dollars.

[Assistant] SELECT * FROM products WHERE price > 500;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Find the salary of Bob Smith.

[Assistant] SELECT salary FROM employees WHERE name = 'Bob Smith';


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Who was hired after January 1st, 2024?

[Assistant] SELECT name, hire_date FROM employees WHERE hire_date > '2024-01-01';


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Show the name and price of the product with ID 3.

[Assistant] SELECT name, price FROM products WHERE id = 3;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Find the sales records for product ID 1.

[Assistant] SELECT * FROM sales WHERE product_id = 1;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: List employees who earn less than 70000.

[Assistant] SELECT name, salary FROM employees WHERE salary < 70000;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Show the department name of department with ID 2.

[Assistant] SELECT name FROM departments WHERE id = 2;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: What is the average salary of all employees?

[Assistant] SELECT AVG(salary) AS average_salary FROM employees;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: How many employees are there in total?

[Assistant] SELECT COUNT(*) AS total_employees FROM employees;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: What is the highest salary among employees?

[Assistant] SELECT MAX(salary) AS max_salary FROM employees;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: What is the lowest salary among employees?

[Assistant] SELECT MIN(salary) AS min_salary FROM employees;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Find the total revenue generated from all sales.

[Assistant] SELECT SUM(amount) AS total_revenue FROM sales;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: How many items were sold in total?

[Assistant] SELECT SUM(quantity) AS total_quantity_sold FROM sales;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: What is the average price of a software product?

[Assistant] SELECT AVG(price) AS avg_price FROM products WHERE category = 'Software';


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: How many products are in each category?

[Assistant] SELECT category, COUNT(*) AS product_count FROM products GROUP BY category;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Find the average salary by department.

[Assistant] SELECT department_id, AVG(salary) AS avg_salary FROM employees GROUP BY department_id;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Count the number of sales made by employee 6.

[Assistant] SELECT COUNT(*) FROM sales WHERE employee_id = 6;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: List the names of employees alongside their department names.

[Assistant] SELECT e.name, d.name AS department FROM employees e JOIN departments d ON e.department_id = d.id;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Find the total quantity of CRM products sold.

[Assistant] SELECT SUM(s.quantity) FROM sales s JOIN products p ON s.product_id = p.id WHERE p.name = 'Enterprise CRM';


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Show the manager's name for each department.

[Assistant] SELECT d.name AS department, e.name AS manager FROM departments d JOIN employees e ON d.manager_id = e.id;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Show the names of employees in the Engineering department.

[Assistant] SELECT e.name FROM employees e JOIN departments d ON e.department_id = d.id WHERE d.name = 'Engineering';


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Who made a sale on Collaboration Tools?

[Assistant] SELECT DISTINCT e.name FROM employees e JOIN sales s ON e.id = s.employee_id JOIN products p ON s.product_id = p.id WHERE p.name = 'Collaboration Tools';


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: List all products sold by Alice Vance.

[Assistant] SELECT DISTINCT p.name FROM products p JOIN sales s ON p.id = s.product_id JOIN employees e ON s.employee_id = e.id WHERE e.name = 'Alice Vance';


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Show all sales details, including employee name and product name.

[Assistant] SELECT s.id, e.name AS employee_name, p.name AS product_name, s.amount, s.quantity, s.sale_date FROM sales s JOIN employees e ON s.employee_id = e.id JOIN products p ON s.product_id = p.id;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Which employees generated sales of more than 1000 in a single transaction?

[Assistant] SELECT DISTINCT e.name FROM employees e JOIN sales s ON e.id = s.employee_id WHERE s.amount > 1000;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Find the total sales revenue generated by each employee in the Sales department.

[Assistant] SELECT e.name, SUM(s.amount) AS total_revenue FROM employees e JOIN sales s ON e.id = s.employee_id JOIN departments d ON e.department_id = d.id WHERE d.name = 'Sales' GROUP BY e.name;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Show the total amount of sales for each product, ordered by total revenue descending.

[Assistant] SELECT p.name, SUM(s.amount) AS total_revenue FROM products p JOIN sales s ON p.id = s.product_id GROUP BY p.name ORDER BY total_revenue DESC;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Which department has the highest average salary?

[Assistant] SELECT d.name, AVG(e.salary) AS avg_salary FROM departments d JOIN employees e ON d.id = e.department_id GROUP d.name ORDER BY avg_salary DESC LIMIT 1;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Find the employee who has made the most sales transactions.

[Assistant] SELECT e.name, COUNT(s.id) AS transaction_count FROM employees e JOIN sales s ON e.id = s.employee_id GROUP BY e.name ORDER BY transaction_count DESC LIMIT 1;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: List departments that have an average employee salary greater than 80000.

[Assistant] SELECT d.name, AVG(e.salary) AS avg_salary FROM departments d JOIN employees e ON d.id = e.department_id GROUP BY d.name HAVING avg_salary > 80000;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Find all sales made in 2024.

[Assistant] SELECT * FROM sales WHERE sale_date BETWEEN '2024-01-01' AND '2024-12-31';


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Find all sales made in the month of May 2024.

[Assistant] SELECT * FROM sales WHERE sale_date BETWEEN '2024-05-01' AND '2024-05-31';


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: List the names of employees hired in 2023.

[Assistant] SELECT name FROM employees WHERE hire_date BETWEEN '2023-01-01' AND '2023-12-31';


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Show the sales revenue generated in the second half of 2024.

[Assistant] SELECT SUM(amount) FROM sales WHERE sale_date BETWEEN '2024-07-01' AND '2024-12-31';


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: List the products that have never been sold.

[Assistant] SELECT p.name FROM products p LEFT JOIN sales s ON p.id = s.product_id WHERE s.id IS NULL;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Which employees earn more than their manager?

[Assistant] SELECT e.name FROM employees e JOIN employees m ON e.manager_id = m.id WHERE e.salary > m.salary;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: List all employees who report to Bob Smith.

[Assistant] SELECT e.name FROM employees e JOIN employees m ON e.manager_id = m.id WHERE m.name = 'Bob Smith';


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Show the names of employees who have not made any sales.

[Assistant] SELECT e.name FROM employees e LEFT JOIN sales s ON e.id = s.employee_id WHERE s.id IS NULL AND e.department_id = 1;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Find products with a price higher than the average product price.

[Assistant] SELECT name, price FROM products WHERE price > (SELECT AVG(price) FROM products);


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Which product had the highest single sales transaction amount?

[Assistant] SELECT p.name, s.amount FROM products p JOIN sales s ON p.id = s.product_id ORDER BY s.amount DESC LIMIT 1;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Show all employees who have the same manager as Grace Hopper.

[Assistant] SELECT e.name FROM employees e WHERE e.manager_id = (SELECT manager_id FROM employees WHERE name = 'Grace Hopper') AND e.name != 'Grace Hopper';


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Find the total revenue by product category in 2025.

[Assistant] SELECT p.category, SUM(s.amount) AS total_revenue FROM products p JOIN sales s ON p.id = s.product_id WHERE s.sale_date BETWEEN '2025-01-01' AND '2025-12-31' GROUP BY p.category;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Find the department manager for Alice Vance's department.

[Assistant] SELECT m.name FROM employees e JOIN departments d ON e.department_id = d.id JOIN employees m ON d.manager_id = m.id WHERE e.name = 'Alice Vance';


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Show the products whose total sales quantity exceeds 15 items.

[Assistant] SELECT p.name, SUM(s.quantity) AS total_qty FROM products p JOIN sales s ON p.id = s.product_id GROUP BY p.name HAVING total_qty > 15;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: Find the most expensive product in the Hardware category.

[Assistant] SELECT name, price FROM products WHERE category = 'Hardware' ORDER BY price DESC LIMIT 1;


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: What is the average salary of employees hired in 2024?

[Assistant] SELECT AVG(salary) FROM employees WHERE hire_date BETWEEN '2024-01-01' AND '2024-12-31';


[User]
You are a Text-to-SQL generator. Given a database schema and a natural language question, write a valid SQLite query that answers the question. Do not explain the query, just output the raw SQL.

Database Schema:
Table departments:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)
  - manager_id: INTEGER (references employees.id)

Table employees:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL)
  - department_id: INTEGER (references departments.id)
  - salary: INTEGER (NOT NULL)
  - hire_date: TEXT (NOT NULL, YYYY-MM-DD)
  - manager_id: INTEGER (references employees.id)

Table products:
  - id: INTEGER (PRIMARY KEY)
  - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')
  - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')
  - price: REAL (NOT NULL)

Table sales:
  - id: INTEGER (PRIMARY KEY)
  - employee_id: INTEGER (NOT NULL, references employees.id)
  - product_id: INTEGER (NOT NULL, references products.id)
  - amount: REAL (NOT NULL)
  - quantity: INTEGER (NOT NULL)
  - sale_date: TEXT (NOT NULL, YYYY-MM-DD)

Question: List all employees along with their manager's name.

[Assistant] SELECT e.name AS employee, m.name AS manager FROM employees e LEFT JOIN employees m ON e.manager_id = m.id;