Databricks Data Engineer Associate exam dumps

Databricks Data Engineer Associate practice question 97 of 532

Databricks Certified Data Engineer Associate. Associate level, Databricks. Free question with the correct answer and a full explanation.

Databricks Data Engineer Associate Question 97

Select 3

You are working with a CSV file stored in a Databricks workspace at the path '/mnt/data/sales.csv'. You need to create a reference to this file for querying purposes and decide to use a view, a temporary view, and a common table expression (CTE). Which of the following statements correctly create these references?

  1. A

    CREATE OR REPLACE VIEW sales_view AS SELECT * FROM csv./mnt/data/sales.csv;

  2. B

    CREATE OR REPLACE TEMP VIEW sales_temp_view AS SELECT * FROM csv./mnt/data/sales.csv;

  3. C

    WITH sales_cte AS (SELECT * FROM csv./mnt/data/sales.csv) SELECT * FROM sales_cte;

  4. D

    CREATE TABLE sales_table AS SELECT * FROM csv./mnt/data/sales.csv;

Show answer and explanation

Correct answers: A, B, C

Explanation

Creating views, temporary views, and CTEs are common methods to reference external data sources like files in Databricks. Persistent views are stored in the metastore, temporary views are session-scoped, and CTEs are query-scoped, but all can reference a CSV file as shown. The CREATE TABLE statement, however, physically materializes data and does not meet the requirement for creating a reference to the file.

  • A. Correct.

    This is correct. The CREATE OR REPLACE VIEW syntax is used to create a persistent view in Databricks, and the csv. format allows querying the CSV file directly.

  • B. Correct.

    This is correct. The CREATE OR REPLACE TEMP VIEW syntax creates a temporary view that lasts only for the duration of the session and can reference the CSV file directly.

  • C. Correct.

    This is correct. A common table expression (CTE) uses the WITH keyword to define a temporary, reusable query structure, which can reference external data sources like a CSV file.

  • D. Incorrect.

    This is incorrect. The CREATE TABLE statement creates a physical table in Databricks and is not a method for creating a view, temporary view, or CTE. It materializes the data instead of referencing it.

Timed practice exam

Take a Databricks Data Engineer Associate practice test under exam conditions

45 questions in 90 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam