Skip to content

Latest commit

 

History

History
51 lines (37 loc) · 2.16 KB

Task2-Create-Tables-and-Insert-Data.md

File metadata and controls

51 lines (37 loc) · 2.16 KB

Home - Next Task (Query Tables) >

Task 2: Create Tables and Insert Data

  1. Open Power BI

  2. In PowerBI, click 'Workspaces' and select 'FabricWarehouseWS'

  3. In 'FabricWarehouseWS' workspace, click on 'Warehouse1' Warehouse.

  4. We'll create a table called DimProduct and insert data into it. To create a table using T-SQL, click on New SQL Query and paste below code,

CREATE TABLE dbo.DimProduct
(
    ProductKey INTEGER NOT NULL,
    ProductAltKey VARCHAR(25) NULL,
    ProductName VARCHAR(50) NOT NULL,
    Category VARCHAR(50) NULL,
    ListPrice DECIMAL(5,2) NULL
);
GO

  1. Use the ▷ Run button to run the SQL script, which creates a new table named DimProduct in the dbo schema of the data warehouse.
  2. Use the Refresh button on the toolbar to refresh the view. Then, in the Explorer pane, expand Schemas > dbo > Tables and verify that the DimProduct table has been created.
  3. On the Home menu tab, use the New SQL Query button to create a new query, and enter the following INSERT statement:
INSERT INTO dbo.DimProduct
VALUES
(1, 'RING1', 'Bicycle bell', 'Accessories', 5.99),
(2, 'BRITE1', 'Front light', 'Accessories', 15.49),
(3, 'BRITE2', 'Rear light', 'Accessories', 15.49);
GO

  1. Run the new query to insert three rows into the DimProduct table.
  2. When the query has finished, select the Data tab at the bottom of the page in the data warehouse. In the Explorer pane, select the DimProduct table and verify that the three rows have been added to the table.
  3. On the Home menu tab, use the New SQL Query button to create a new query. Then copy and paste the Transact-SQL code from HERE into the new query pane.
  4. Run the query, which creates a simple data warehouse schema and loads some data. The script should take around 30 seconds to run.
  5. Use the Refresh button on the toolbar to refresh the view. Then in the Explorer pane, verify that the dbo schema in the data warehouse now contains the following three tables:

    DimDate
    DimProduct
    FactSalesOrder

Continue >