Review best practices using Copilot in Microsoft Fabric's Data Warehouse
Crafting effective prompts is essential. Start with a clear and concise description of the specific information you're looking for, and avoid ambiguous or overly complex language. Simplify your questions while maintaining clarity to ensure Copilot can generate meaningful queries.
Using expressive and meaningful names for tables and columns in your data warehouse is crucial. Descriptive names help Copilot understand the schema and improve the accuracy of the generated queries.
For complex queries involving multiple tables or relationships, use comments to guide Copilot and provide extra context.
Providing context is another key aspect. Use natural language that aligns with your table and view names, column names, primary keys, and foreign keys. Specify the columns you wish to see, aggregations, and filtering criteria explicitly. Adding comments at the top of your query (using --) can further guide Copilot in understanding the query's intent.
Establishing schema relationships in the model view of your warehouse enhances the accuracy of JOIN statements in generated SQL queries. A well-structured schema with defined relationships allows Copilot to infer connections between tables effectively.
Copilot can handle typos or infer context based on your schema, but it's important to ensure your schema is well-structured and consistent. This improves the overall reliability of the generated queries.
Currently, natural language to SQL supports English to T-SQL. Ensure your prompts are written in English to take full advantage of this feature.
By following these best practices, you can effectively use Copilot to streamline your SQL query generation and improve your overall productivity.