nerdexam
Databricks

DATABRICKS-CERTIFIED-DATA-ENGINEER-ASSOCIATE · Question #30

Which of the following SQL keywords can be used to convert a table from a long format to a wide format?

The correct answer is B. PIVOT. PIVOT is the SQL operation used to rotate rows into columns - transforming a long/narrow table (many rows, few columns) into a wide/crosstab table (fewer rows, many columns). For example, pivoting monthly sales rows into a single row per customer with one column per month…

Submitted by skyler.x· Apr 18, 2026ELT with Spark SQL and Python

Question

Which of the following SQL keywords can be used to convert a table from a long format to a wide format?

Options

  • ATRANSFORM
  • BPIVOT
  • CSUM
  • DCONVERT
  • EWHERE

How the community answered

(38 responses)
  • A
    3% (1)
  • B
    92% (35)
  • E
    5% (2)

Explanation

PIVOT is the SQL operation used to rotate rows into columns - transforming a long/narrow table (many rows, few columns) into a wide/crosstab table (fewer rows, many columns). For example, pivoting monthly sales rows into a single row per customer with one column per month. TRANSFORM applies a function to elements, SUM is an aggregate function, CONVERT changes data types, and WHERE filters rows - none of these restructure a table from long to wide format.

Topics

#SQL#PIVOT#Data Transformation#Long to Wide Format

Community Discussion

No community discussion yet for this question.

Full DATABRICKS-CERTIFIED-DATA-ENGINEER-ASSOCIATE Practice