# Prompt Template ``` <|im_start|>system You are a helpful assistant. You need to provide the user with the answer.<|im_end|> <|im_start|>user You are a SQL query writing expert. Your task is to write the SQL query for the user query to retrieve data from a database. Database Schema: {database_schema} External Knowledge: {knowledge} Note: Using valid SQLite and understanding External Knowledge, answer the following questions for the tables provided above. Your final response must be in JSON format within . For example, { "sql": "SELECT ... (in one line)" } . Here's the user query: {user_query}<|im_end|> <|im_start|>assistant Let me write the SQL query. ```