# Generate a SQL Notebook Using AI

If you choose the **'Generate Using AI'** option, follow these steps:

1. **Input Details:**
   * You’ll be prompted to input the following:
     * **Prompt**: Describe the objective of your notebook.
     * **Tables**: Select tables from the dropdown (multiple selections are allowed).
   * Once completed, click **'Generate'** to create the notebook.
2. **Navigating the AI-Generated Notebook:**
   * The generated notebook will display code blocks, with an **Analysis Introduction** at the start and an **Analysis Summary** at the end.
   * You can insert new SQL queries, text, or edit between steps as needed. All changes are automatically saved.
   * The notebook’s sidebar allows you to view and search through your database’s schema and tables.
3. **Working with Code Blocks:**
   * Each code block provides options to:
     * **Run the query**.
     * **Modify variable names**.
     * **Use AI Copilot** for suggestions (pencil icon).
     * **Hide, move up/down, or delete the step**.
4. **Additional Features:**
   * At the top of the notebook, you'll find CTAs to:
     * **Save** the notebook.
     * **Publish or Share** using the vertical ellipsis menu.
     * **Show variables** and **Run all code blocks**.
   * Explore the three tabs:
     * **Notebook** (default view).
     * **Storybook**: Displays the notebook's analysis in narrative form.
     * **Dashboard**: Allows for creating dashboards from generated metrics and charts.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.autonmis.com/create-and-manage-your-first-sql-notebook/generate-a-sql-notebook-using-ai.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
