| title | Data Warehouse Tutorial: Analyze Data in a Notebook |
|---|---|
| description | In this tutorial, learn how to analyze data with notebooks in a Warehouse. |
| ms.reviewer | prlangad |
| ms.date | 04/06/2025 |
| ms.topic | tutorial |
Applies to: [!INCLUDE fabric-se-and-dw]
In this tutorial, learn how to analyze data with notebooks in a Warehouse.
Note
This tutorial forms part of an end-to-end scenario. In order to complete this tutorial, you must first complete these tutorials:
In this task, learn how to create a T-SQL notebook.
-
Ensure that the workspace you created in the first tutorial is open.
-
On the Home ribbon, open the New SQL query dropdown list, and then select New SQL query in notebook.
:::image type="content" source="media/tutorial-analyze-data-notebook/ribbon-new-sql-query-notebook.png" alt-text="Screenshot of the New SQL query in notebook option on the ribbon." lightbox="media/tutorial-analyze-data-notebook/ribbon-new-sql-query-notebook.png":::
-
In the Explorer pane, select Warehouses to reveal the objects of the
Wide World Importerswarehouse. -
To generate a SQL template to explore data, to the right of the
dimension_citytable, select the ellipsis (...), and then select SELECT TOP 100.:::image type="content" source="media/tutorial-analyze-data-notebook/tsql-notebook-select-top-100.png" alt-text="Screenshot of Explorer pane, highlighting the selection of the SELECT TOP 100 option.":::
-
To run the T-SQL code in this cell, select the Run cell button for the code cell.
:::image type="content" source="media/tutorial-analyze-data-notebook/run-tsql-code-cell.png" alt-text="Screenshot of the notebook, highlighting the Run cell button for the code cell.":::
-
Review the query result in the results pane.
In this task, learn how to create a lakehouse shortcut and analyze data with a notebook.
-
Open the
Data Warehouse Tutorialworkspace landing page. -
Select + New Item to display the full list of available item types.
-
From the list, in the Store data section, select the Lakehouse item type.
-
In the New lakehouse window, enter the name
Shortcut_Exercise.:::image type="content" source="media/tutorial-analyze-data-notebook/create-new-lakehouse.png" alt-text="Screenshot of the New lakehouse window, highlighting the entered name.":::
-
Select Create.
-
When the new lakehouse opens, in the landing page, select the New shortcut option.
:::image type="content" source="media/tutorial-analyze-data-notebook/lakehouse-new-shortcut.png" alt-text="Screenshot of lakehouse landing page, highlighting the New shortcut button." lightbox="media/tutorial-analyze-data-notebook/lakehouse-new-shortcut.png":::
-
In the New shortcut window, select the Microsoft OneLake option.
:::image type="content" source="media/tutorial-analyze-data-notebook/lakehouse-new-shortcut-microsoft-onelake.png" alt-text="Screenshot of the New shortcut window, highlighting the Microsoft OneLake internal source.":::
-
In the Select a data source type window, select the
Wide World Importerswarehouse that you created in the Create a Warehouse tutorial, and then select Next. -
In the OneLake object browser, expand Tables, expand the
dboschema, and then select the checkbox for thedimension_customertable.:::image type="content" source="media/tutorial-analyze-data-notebook/new-shortcut-select-dimension-customer.png" alt-text="Screenshot of the New shortcut window, highlighting the selection of the dimension customer table.":::
-
Select Next.
-
Select Create.
-
In the Explorer pane, select the
dimension_customertable to preview the data, and then review the data retrieved from thedimension_customertable in the warehouse. -
To create a notebook to query the
dimension_customertable, on the Home ribbon, in the Open notebook dropdown list, select New notebook.:::image type="content" source="media/tutorial-analyze-data-notebook/create-new-notebook.png" alt-text="Screenshot of the New notebook option on the ribbon.":::
-
In the Explorer pane, select Lakehouses.
-
Drag the
dimension_customertable to the open notebook cell.:::image type="content" source="media/tutorial-analyze-data-notebook/drag-customer-dimension-table-notebook-cell.png" alt-text="Screenshot of the Explorer pane, highlighting the dimension customer table drag to the notebook cell.":::
-
Notice the PySpark query that was added to the notebook cell. This query retrieves the first 1,000 rows from the
Shortcut_Exercise.dimension_customershortcut. This notebook experience is similar to Visual Studio Code Jupyter notebook experience. You can also open the notebook in VS Code.:::image type="content" source="media/tutorial-analyze-data-notebook/notebook-query.png" alt-text="Screenshot of the notebook query, showing the automatically generated PySpark query." lightbox="media/tutorial-analyze-data-notebook/notebook-query.png":::
-
On the Home ribbon, select the Run all button.
:::image type="content" source="media/tutorial-analyze-data-notebook/ribbon-run-all.png" alt-text="Screenshot of the Home ribbon, highlighting the Run all button.":::
-
Review the query result in the results pane.
[!div class="nextstepaction"] Tutorial: Create a cross-warehouse query in Warehouse