
Answer-first summary for fast verification
Answer: PIVOT
The correct answer is B (PIVOT). The PIVOT keyword in SQL is used to transform the rows of a table by rotating unique values of a specified column list into separate columns. This process effectively converts a table from a long format (where data is stored in rows) to a wide format (where data is stored in columns). This operation is commonly used in data analysis to summarize and present data more effectively.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
When working with SQL data transformations, which keyword is used specifically for converting a table from a long (tall) format, where each row represents a single observation, to a wide format, where each row contains multiple observations split across columns?
A
TRANSFORM
B
PIVOT
C
SUM
D
CONVERT
E
WHERE
No comments yet.