자습서: 데이터 웨어하우스에서 테이블 만들기

적용 대상: Microsoft Fabric의 SQL 분석 엔드포인트 및 웨어하우스

자습서의 이전 부분에서 만든 데이터 웨어하우스에서 테이블을 만드는 방법을 알아봅니다.

테이블 만들기

  1. 탐색 메뉴에서 작업 영역을 선택합니다.

  2. 자습서에서 만든 작업 영역 선택: 데이터 웨어하우스 자습서와 같은 Microsoft Fabric 데이터 작업 영역 만들기

  3. 항목 목록에서 Warehouse 유형을 선택합니다WideWorldImporters.

    Screenshot of the warehouse option that appears in the item list.

  4. 리본에서 새 SQL 쿼리를 선택합니다.

    Screenshot of the New SQL query option where it appears on the ribbon.

  5. 쿼리 편집기에서 다음 코드를 붙여넣습니다.

    /*
    1. Drop the dimension_city table if it already exists.
    2. Create the dimension_city table.
    3. Drop the fact_sale table if it already exists.
    4. Create the fact_sale table.
    */
    
    --dimension_city
    DROP TABLE IF EXISTS [dbo].[dimension_city];
    CREATE TABLE [dbo].[dimension_city]
        (
            [CityKey] [int] NULL,
            [WWICityID] [int] NULL,
            [City] [varchar](8000) NULL,
            [StateProvince] [varchar](8000) NULL,
            [Country] [varchar](8000) NULL,
            [Continent] [varchar](8000) NULL,
            [SalesTerritory] [varchar](8000) NULL,
            [Region] [varchar](8000) NULL,
            [Subregion] [varchar](8000) NULL,
            [Location] [varchar](8000) NULL,
            [LatestRecordedPopulation] [bigint] NULL,
            [ValidFrom] [datetime2](6) NULL,
            [ValidTo] [datetime2](6) NULL,
            [LineageKey] [int] NULL
        );
    
    --fact_sale
    
    DROP TABLE IF EXISTS [dbo].[fact_sale];
    
    CREATE TABLE [dbo].[fact_sale]
    
        (
            [SaleKey] [bigint] NULL,
            [CityKey] [int] NULL,
            [CustomerKey] [int] NULL,
            [BillToCustomerKey] [int] NULL,
            [StockItemKey] [int] NULL,
            [InvoiceDateKey] [datetime2](6) NULL,
            [DeliveryDateKey] [datetime2](6) NULL,
            [SalespersonKey] [int] NULL,
            [WWIInvoiceID] [int] NULL,
            [Description] [varchar](8000) NULL,
            [Package] [varchar](8000) NULL,
            [Quantity] [int] NULL,
            [UnitPrice] [decimal](18, 2) NULL,
            [TaxRate] [decimal](18, 3) NULL,
            [TotalExcludingTax] [decimal](29, 2) NULL,
            [TaxAmount] [decimal](38, 6) NULL,
            [Profit] [decimal](18, 2) NULL,
            [TotalIncludingTax] [decimal](38, 6) NULL,
            [TotalDryItems] [int] NULL,
            [TotalChillerItems] [int] NULL,
            [LineageKey] [int] NULL,
            [Month] [int] NULL,
            [Year] [int] NULL,
            [Quarter] [int] NULL
        );
    
  6. 실행을 선택하여 쿼리를 실행합니다.

    Screenshot of the top corner of the query editor screen, showing where to select Run.

  7. 나중에 참조를 위해 이 쿼리를 저장하려면 쿼리 탭을 마우스 오른쪽 단추로 클릭하고 이름 바꾸기를 선택합니다.

    Screenshot of the top corner of the query editor screen, showing where to right-click to select the Rename option.

  8. 쿼리 이름을 변경하려면 입력 Create Tables 합니다.

  9. 키보드에서 Enter 키를 누르거나 탭 외부의 아무 곳이나 선택하여 변경 사항을 저장합니다.

  10. 리본에서 새로 고침 단추를 선택하여 테이블이 성공적으로 만들어졌는지 확인합니다.

    Screenshot of the ribbon on the Home screen, showing where to select the refresh option.

  11. 개체 탐색기에서 새로 만든 테이블 만들기 쿼리, fact_sale 테이블dimension_city 테이블을 볼 수 있는지 확인합니다.

    Screenshot of the Explorer pane, showing where to find your tables and newly created query.

다음 단계