Partilhar via


Tutorial: Analisar dados em um bloco de anotações

Applies to:✅ SQL analytics endpoint and Warehouse in Microsoft Fabric

Neste tutorial, saiba como analisar dados com blocos de anotações em um Warehouse.

Observação

This tutorial forms part of an end-to-end scenario. Para concluir este tutorial, você deve primeiro concluir estes tutoriais:

  1. Criar um espaço de trabalho
  2. Criar um Armazém
  3. Ingest data into a Warehouse

Criar um bloco de anotações T-SQL

Nesta tarefa, saiba como criar um bloco de anotações T-SQL.

  1. Verifique se o espaço de trabalho criado no primeiro tutorial está aberto.

  2. On the Home ribbon, open the New SQL query dropdown, and then select New SQL query in notebook.

    Screenshot of the New SQL query in notebook option on the ribbon.

  3. In the Explorer pane, select Warehouses to reveal the objects of the Wide World Importers warehouse.

  4. To generate a SQL template to explore data, to the right of the dimension_city table, select the ellipsis (…), and then select SELECT TOP 100.

    Captura de tela do painel Explorer, destacando a seleção da opção SELECT TOP 100.

  5. Para executar o código T-SQL nesta célula, selecione o botão Executar célula para a célula de código.

    Screenshot of the notebook, highlighting the Run cell button for the code cell.

  6. Revise o resultado da consulta no painel de resultados.

Create a lakehouse shortcut and analyze data with a notebook

Nesta tarefa, aprenda a criar um atalho para o lakehouse e a analisar dados com um notebook.

  1. Abra a página inicial do espaço de trabalho Data Warehouse Tutorial.

  2. Selecione + Novo Item para exibir a lista completa de tipos de itens disponíveis.

  3. From the list, in the Store data section, select the Lakehouse item type.

  4. In the New lakehouse window, enter the name Shortcut_Exercise.

    Captura de tela da janela New lakehouse, destacando o nome digitado.

  5. Select Create.

  6. When the new lakehouse opens, in the landing page, select the New shortcut option.

    Captura de tela da página inicial do lakehouse, destacando o botão Novo atalho.

  7. In the New shortcut window, select the Microsoft OneLake option.

    Screenshot of the New shortcut window, highlighting the Microsoft OneLake internal source.

  8. In the Select a data source type window, select the Wide World Importers warehouse that you created in the Create a Warehouse tutorial, and then select Next.

  9. In the OneLake object browser, expand Tables, expand the dbo schema, and then select the checkbox for the dimension_customer table.

    Screenshot of the New shortcut window, highlighting the selection of the dimension customer table.

  10. Select Next.

  11. Select Create.

  12. No painel do Explorer, selecione a tabela para visualizar os dados e, em seguida, revise os dados recuperados da tabela no depósito.

  13. To create a notebook to query the dimension_customer table, on the Home ribbon, in the Open notebook dropdown, select New notebook.

    Screenshot of the New notebook option on the ribbon.

  14. In the Explorer pane, select Lakehouses.

  15. Drag the dimension_customer table to the open notebook cell.

    Screenshot of the Explorer pane, highlighting the dimension customer table drag to the notebook cell.

  16. Notice the PySpark query that was added to the notebook cell. Esta consulta recupera as primeiras 1.000 linhas do atalho Shortcut_Exercise.dimension_customer. This notebook experience is similar to Visual Studio Code Jupyter notebook experience. You can also open the notebook in VS Code.

    Screenshot of the notebook query, showing the automatically generated PySpark query.

  17. On the Home ribbon, select the Run all button.

    Screenshot of the Home ribbon, highlighting the Run all button.

  18. Revise o resultado da consulta no painel de resultados.

Next step