
Ultimate access to all questions.
Which of the following SQL keywords can be used to convert a table from a long format to a wide format?
A
TRANSFORM
B
PIVOT
C
SUM
D
CONVERT
E
WHERE
Explanation:
The PIVOT keyword in SQL is specifically designed to convert data from a long format (where each row represents a single observation) to a wide format (where each row represents multiple observations across columns).
Key Points:
In Databricks SQL and Spark SQL, PIVOT is the correct operation for converting long format data to wide format by specifying which column values should become new column headers.