{"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: List all employees and their salaries."}, {"role": "assistant", "content": "SELECT name, salary FROM employees;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Show all departments."}, {"role": "assistant", "content": "SELECT * FROM departments;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Find all products in the Software category."}, {"role": "assistant", "content": "SELECT * FROM products WHERE category = 'Software';"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: List products that cost more than 500 dollars."}, {"role": "assistant", "content": "SELECT * FROM products WHERE price > 500;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Find the salary of Bob Smith."}, {"role": "assistant", "content": "SELECT salary FROM employees WHERE name = 'Bob Smith';"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Who was hired after January 1st, 2024?"}, {"role": "assistant", "content": "SELECT name, hire_date FROM employees WHERE hire_date > '2024-01-01';"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Show the name and price of the product with ID 3."}, {"role": "assistant", "content": "SELECT name, price FROM products WHERE id = 3;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Find the sales records for product ID 1."}, {"role": "assistant", "content": "SELECT * FROM sales WHERE product_id = 1;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: List employees who earn less than 70000."}, {"role": "assistant", "content": "SELECT name, salary FROM employees WHERE salary < 70000;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Show the department name of department with ID 2."}, {"role": "assistant", "content": "SELECT name FROM departments WHERE id = 2;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: What is the average salary of all employees?"}, {"role": "assistant", "content": "SELECT AVG(salary) AS average_salary FROM employees;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: How many employees are there in total?"}, {"role": "assistant", "content": "SELECT COUNT(*) AS total_employees FROM employees;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: What is the highest salary among employees?"}, {"role": "assistant", "content": "SELECT MAX(salary) AS max_salary FROM employees;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: What is the lowest salary among employees?"}, {"role": "assistant", "content": "SELECT MIN(salary) AS min_salary FROM employees;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Find the total revenue generated from all sales."}, {"role": "assistant", "content": "SELECT SUM(amount) AS total_revenue FROM sales;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: How many items were sold in total?"}, {"role": "assistant", "content": "SELECT SUM(quantity) AS total_quantity_sold FROM sales;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: What is the average price of a software product?"}, {"role": "assistant", "content": "SELECT AVG(price) AS avg_price FROM products WHERE category = 'Software';"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: How many products are in each category?"}, {"role": "assistant", "content": "SELECT category, COUNT(*) AS product_count FROM products GROUP BY category;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Find the average salary by department."}, {"role": "assistant", "content": "SELECT department_id, AVG(salary) AS avg_salary FROM employees GROUP BY department_id;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Count the number of sales made by employee 6."}, {"role": "assistant", "content": "SELECT COUNT(*) FROM sales WHERE employee_id = 6;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: List the names of employees alongside their department names."}, {"role": "assistant", "content": "SELECT e.name, d.name AS department FROM employees e JOIN departments d ON e.department_id = d.id;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Find the total quantity of CRM products sold."}, {"role": "assistant", "content": "SELECT SUM(s.quantity) FROM sales s JOIN products p ON s.product_id = p.id WHERE p.name = 'Enterprise CRM';"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Show the manager's name for each department."}, {"role": "assistant", "content": "SELECT d.name AS department, e.name AS manager FROM departments d JOIN employees e ON d.manager_id = e.id;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Show the names of employees in the Engineering department."}, {"role": "assistant", "content": "SELECT e.name FROM employees e JOIN departments d ON e.department_id = d.id WHERE d.name = 'Engineering';"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Who made a sale on Collaboration Tools?"}, {"role": "assistant", "content": "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';"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: List all products sold by Alice Vance."}, {"role": "assistant", "content": "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';"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Show all sales details, including employee name and product name."}, {"role": "assistant", "content": "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;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Which employees generated sales of more than 1000 in a single transaction?"}, {"role": "assistant", "content": "SELECT DISTINCT e.name FROM employees e JOIN sales s ON e.id = s.employee_id WHERE s.amount > 1000;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Find the total sales revenue generated by each employee in the Sales department."}, {"role": "assistant", "content": "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;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Show the total amount of sales for each product, ordered by total revenue descending."}, {"role": "assistant", "content": "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;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Which department has the highest average salary?"}, {"role": "assistant", "content": "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;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Find the employee who has made the most sales transactions."}, {"role": "assistant", "content": "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;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: List departments that have an average employee salary greater than 80000."}, {"role": "assistant", "content": "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;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Find all sales made in 2024."}, {"role": "assistant", "content": "SELECT * FROM sales WHERE sale_date BETWEEN '2024-01-01' AND '2024-12-31';"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Find all sales made in the month of May 2024."}, {"role": "assistant", "content": "SELECT * FROM sales WHERE sale_date BETWEEN '2024-05-01' AND '2024-05-31';"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: List the names of employees hired in 2023."}, {"role": "assistant", "content": "SELECT name FROM employees WHERE hire_date BETWEEN '2023-01-01' AND '2023-12-31';"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Show the sales revenue generated in the second half of 2024."}, {"role": "assistant", "content": "SELECT SUM(amount) FROM sales WHERE sale_date BETWEEN '2024-07-01' AND '2024-12-31';"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: List the products that have never been sold."}, {"role": "assistant", "content": "SELECT p.name FROM products p LEFT JOIN sales s ON p.id = s.product_id WHERE s.id IS NULL;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Which employees earn more than their manager?"}, {"role": "assistant", "content": "SELECT e.name FROM employees e JOIN employees m ON e.manager_id = m.id WHERE e.salary > m.salary;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: List all employees who report to Bob Smith."}, {"role": "assistant", "content": "SELECT e.name FROM employees e JOIN employees m ON e.manager_id = m.id WHERE m.name = 'Bob Smith';"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Show the names of employees who have not made any sales."}, {"role": "assistant", "content": "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;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Find products with a price higher than the average product price."}, {"role": "assistant", "content": "SELECT name, price FROM products WHERE price > (SELECT AVG(price) FROM products);"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Which product had the highest single sales transaction amount?"}, {"role": "assistant", "content": "SELECT p.name, s.amount FROM products p JOIN sales s ON p.id = s.product_id ORDER BY s.amount DESC LIMIT 1;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Show all employees who have the same manager as Grace Hopper."}, {"role": "assistant", "content": "SELECT e.name FROM employees e WHERE e.manager_id = (SELECT manager_id FROM employees WHERE name = 'Grace Hopper') AND e.name != 'Grace Hopper';"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Find the total revenue by product category in 2025."}, {"role": "assistant", "content": "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;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Find the department manager for Alice Vance's department."}, {"role": "assistant", "content": "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';"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Show the products whose total sales quantity exceeds 15 items."}, {"role": "assistant", "content": "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;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: Find the most expensive product in the Hardware category."}, {"role": "assistant", "content": "SELECT name, price FROM products WHERE category = 'Hardware' ORDER BY price DESC LIMIT 1;"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: What is the average salary of employees hired in 2024?"}, {"role": "assistant", "content": "SELECT AVG(salary) FROM employees WHERE hire_date BETWEEN '2024-01-01' AND '2024-12-31';"}]} {"messages": [{"role": "user", "content": "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.\n\nDatabase Schema:\nTable departments:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Sales', 'Engineering', etc.)\n - manager_id: INTEGER (references employees.id)\n\nTable employees:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL)\n - department_id: INTEGER (references departments.id)\n - salary: INTEGER (NOT NULL)\n - hire_date: TEXT (NOT NULL, YYYY-MM-DD)\n - manager_id: INTEGER (references employees.id)\n\nTable products:\n - id: INTEGER (PRIMARY KEY)\n - name: TEXT (NOT NULL, UNIQUE, e.g., 'Enterprise CRM')\n - category: TEXT (NOT NULL, e.g., 'Software', 'Hardware', 'Cloud')\n - price: REAL (NOT NULL)\n\nTable sales:\n - id: INTEGER (PRIMARY KEY)\n - employee_id: INTEGER (NOT NULL, references employees.id)\n - product_id: INTEGER (NOT NULL, references products.id)\n - amount: REAL (NOT NULL)\n - quantity: INTEGER (NOT NULL)\n - sale_date: TEXT (NOT NULL, YYYY-MM-DD)\n\nQuestion: List all employees along with their manager's name."}, {"role": "assistant", "content": "SELECT e.name AS employee, m.name AS manager FROM employees e LEFT JOIN employees m ON e.manager_id = m.id;"}]}