Skip to main content

Prompt Library

Explore a collection of useful prompts for getting the most out of nao. Use these examples to accelerate your workflow and discover new ways to interact with your data.

dbt​

dbt
Create a dbt model
Create a dbt model called {model_name} that {description}, as well as its yaml documentation. {Start from existing dbt models {ref_names}} {Final output should include these columns: {column list}} {Create this model in the {layer_name} layer / {folder_name} folder}
dbt
Create staging dbt model from table
table
Create a staging model from this table, as well as its yaml documentation.
dbt
Convert SQL to dbt model
file.sql
Create a dbt model called {model_name} from this SQL code, as well as its yaml documentation. {Create this model in the {layer_name} layer / {folder_name} folder}
dbt
Explain a dbt model
dbtdbt_model.sql
Explain what this dbt model does, including: - Business purpose and use case - Data sources and transformations - Key metrics and calculations - Downstream usage
dbt
Improve a dbt model
dbtdbt_model.sql
Review this dbt model and suggest improvements for: - Performance optimization - Code readability and maintainability - dbt best practices compliance - repository best practices compliance
dbt
Write documentation of a model
dbtdbt_model.sql
Add yaml documentation for this dbt model, following these rules: - Add documentation in the relevant yaml file if it already exists, otherwise create it in the relevant folder. - Compare dbt model schema and yaml documentation, so that documentation is up to date with dbt model - Follow existing yaml best practices of repository. - Reuse existing documentation already written for some columns.
dbt
Write tests for a model
dbtdbt_model.sql
Add dbt tests for this dbt model, following these rules: - Add basic tests in the relevant yaml file if it already exists, otherwise create it in the relevant folder. - Add unique and not null tests for key/relevant columns only - Follow existing yaml tests best practices of repository.
dbt
Write custom dbt test
dbtdbt_model.sql
Create a custom dbt test for this dbt model that validates {business_rule}. The test should render all the lines where {conditions when the test fails}
dbt
Write dbt unit tests
dbtdbt_model.sql
Generate unit tests for this dbt model using dbt's unit testing framework. Include test scenarios for {test_scenarios} with mock input data and expected outputs.
dbt
Get dependencies of a dbt model
dbtdbt_model.sql
Show me all the upstream and downstream dependencies for this dbt model. Include both direct and indirect dependencies with their relationship types.
dbt
Get dependencies of a column in dbt lineage
Find all models that use the column {column_name}. Show me the complete lineage and how this column flows through the data pipeline.
dbt
Rename a column through the lineage
dbtdbt_model.sql
Rename the column {column_name} to {new_column_name} in {this model / all models} Identify all downstream models that will be impacted and provide the necessary changes. Update all related documentation and tests accordingly.
dbt
Remove a column through the lineage
dbtdbt_model.sql
Remove the column {column_name} from {this model / all models} Identify all downstream models that will be impacted and provide the necessary changes. Update all related documentation and tests accordingly.
dbt
Add a column in final layer
dbtdbt_model.sql
Add a new column {column_name} int his model. If column is not directly available in this model, add the necessary ref to the model to make it available. Make sure you follow the layers rules in doing so. Update all related documentation and tests accordingly.
dbt
Turning a model into incremental
dbtdbt_model.sql
Convert this model to use incremental materialization. Set up appropriate unique keys, incremental strategy, and handle late-arriving data.
dbt
Optimize data model
Audit dbt project for better consistency and scalability: - Detect code logics that can be factorized - Detect dbt models that can be broken into smaller logics - Detect dbt models that are not used - Detect inconsistencies in fields / metrics definitions - Detect inconsistencies in the different data layers rules
dbt
Rename a dbt model
dbtdbt_model.sql
Rename this model to {new_model_name}. Update all references, dependencies, and documentation throughout the project.

SQL​

SQL
Write SQL query
Write a SQL query that {description}. {Start from these tables: {table_names}} {Final output should include these columns: {column list}} {Create this SQL query in {folder_name} folder / an SQL worksheet}
SQL
Improve an SQL query
file.sql
Review this query and suggest improvements for: - Performance optimization - Code readability and maintainability - repository best practices compliance
SQL
Explain an SQL query
file.sql
Explain what this SQL query does, including: - Business purpose and use case - Data sources and transformations - Key metrics and calculations
SQL
Fix an SQL error
file.sql
Fix this SQL error: Error: {error_message}

Data exploration​

Data exploration
What are the values for a column?
table
What are the distinct values in the column {column_name}?
Data exploration
What's the value distribution for a column?
table
Analyze the distribution of values in {column_name} from this table.
Data exploration
What's the granularity of a table?
table
Determine the granularity of this table. Identify the primary key and explain what each row represents in business terms.
Data exploration
Json keys extraction in a column
table
Extract the JSON keys from the column {json_column} in this table. Output the list of all the keys.
Data exploration
Find relevant table for an analysis
What are the most relevant tables and columns in the data warehouse to analyze: {analysis to run / information to find}
Data exploration
Run analytics on your data
Run this analysis: {analysis description} Write SQL query, and execute it to answer the question.

Data quality checks​

Data quality checks
Are there null values in a column?
table
What's the percentage of null values in this column: {column_name}?
Data quality checks
Are there outlier values in a column?
table
Detect any outlier values in this column: {column_name}
Data quality checks
Data diff between dev and production
Profile these 2 tables of dev and production and compare them. Provide a summary of differences in number of rows, schema, value distribution.

Git​

Git
Write PR description
Generate a pull request description for the changes made. Include: - Business description of changes - Summary of code changes - Summary of data output changes

Data service desk​

Data service desk
Write full PR to answer to a business user request
Create all necessary code changes for this business request: {business_request} Including models, tests, documentation, and PR description. Make sure you check the code changes don't break any dependencies in the repository. Run any data quality checks needed to validate the code changes.
Data service desk
Run full analysis to answer a business user request
Run full analysis to answer this business request: {business_request} Find the relevant tables/columns to answer the request, and write the corresponding queries. Answer with answer in plain english + raw query results to illustrate answer.

Pandas​

Pandas
Write pandas code to clean data
table
Write python code to import this data as a pandas dataframe. Prepare the dataset with the following transformations: - Filter data on these rules: {filtering rules} - Create these new columns: {columns to create}

Machine Learning​

Machine Learning
Write python code for feature engineering
table
We want to create a ML model for {describe ML model} Write feature engineering Python code to prepare the dataset for this ML model: - Import this data as a pandas dataframe - Filter data on these rules: {filtering rules} - Create these new columns: {columns to create} - Generate features relevant for the model
Machine Learning
Write python code to create forecasting model
table
We want to create a ML model for forcasting {describe forecasting target} Write Python code to: - Import this data as a pandas dataframe - Prepare the dataset for this ML model - Write the training and test framework - Implement ML model - Measure performance of ML model
Machine Learning
Write python code to create scoring model
table
We want to create a ML model for scoring {describe scoring target} Write Python code to: - Import this data as a pandas dataframe - Prepare the dataset for this ML model - Write the training and test framework - Implement ML model - Measure performance of ML model