QuestionQ157

Prepare data

You have a Fabric tenant that contains a warehouse named DW1 and a lakehouse named LH1. DW1 contains a table named Sales.Product. LH1 contains a table named Sales.Orders.

You plan to schedule an automated process that will create a new point-in-time (PIT) table named Sales.ProductOrder in DW1. Sales.ProductOrder will be built by using the results of a query that will join Sales.Product and Sales.Orders.

You need to ensure that the types of columns in Sales.ProductOrder match the column types in the source tables. The solution must minimize the number of operations required to create the new table.

Which operation should you use?

  • A INSERT INTO
  • B CREATE TABLE AS SELECT (CTAS)
  • C CREATE TABLE AS CLONE OF
  • D CREATE MATERIALIZED VIEW AS SELECT
Explanation

CREATE TABLE AS SELECT (CTAS) is the optimal operation for this scenario. It creates a new table directly from query results—including joins—and automatically infers column types from the source tables, ensuring type matching without additional steps. CTAS minimizes operations by combining table creation, data loading, and schema definition in a single statement.

Community Discussion

No comments yet. Be the first to start the discussion!