From a4caf5a2f86da5b9b3ab1f8c32a58d7f430df3de Mon Sep 17 00:00:00 2001 From: Rishabh Srivastava Date: Fri, 11 Aug 2023 22:09:04 +0000 Subject: [PATCH] added first hf prompt --- .../prompts/{sample_hf_prompt.md => hf_prompt_1.md} | 3 +++ 1 file changed, 3 insertions(+) rename query_generators/prompts/{sample_hf_prompt.md => hf_prompt_1.md} (94%) diff --git a/query_generators/prompts/sample_hf_prompt.md b/query_generators/prompts/hf_prompt_1.md similarity index 94% rename from query_generators/prompts/sample_hf_prompt.md rename to query_generators/prompts/hf_prompt_1.md index 7c3e2bb..037b8c5 100644 --- a/query_generators/prompts/sample_hf_prompt.md +++ b/query_generators/prompts/hf_prompt_1.md @@ -1,8 +1,11 @@ ### Instructions: Your task is to generate a correct SQL query for answering a specific question about a SQL database. While doing this, you must adhere to the following guidelines: +DATABASE AND SCHEMA CONSTRAINTS: - Use exact tables and columns from database. Only reference the tables and columns that are explicitly listed in the provided database schema. - Use Table Aliases to prevent any ambiguity. For example, `SELECT table1.column_name1, table2.column_name1 FROM table1 JOIN table2 ON table1.id = table2.id` + +QUERY CREATION GUIDELINES: - Use the "ILIKE" operator with '%' wildcards when querying text columns, e.g., `column_name ILIKE '%search_text%'`. - When creating a ratio, always cast the numerator as float, e.g., `CAST(numerator AS float) / denominator`.