Noos
PT EN
RAN-DBDEA-00216
Ranvier · DBDEA

Exam DBDEA Topics: transformation Difficulty: medium

A monthly revenue report reads from a table with one row per month and region: the twelve months are values in a month column. The dashboard specification now requires one row per region with a separate output column for each month — Jan, Feb, and so on — each holding that month's revenue total. Which SQL capability produces this shape directly?

Options (Reading Mode) Click to filter discussion →
  1. A. Hand-written conditional aggregation — twelve CASE WHEN expressions are the only way to reshape rows into columns in SQL, one per month
  2. B. PIVOT — it turns each distinct value of the month column into its own output column, with the aggregation applied in the same statement
  3. C. UNPIVOT — it rotates the month rows into columns and computes the aggregates while transposing the table
  4. D. explode — it expands the month values across the width of the result set, giving one column per month in a single pass
Reveal answer

Correct answer: PIVOT — it turns each distinct value of the month column into its own output column, with the aggregation applied in the same statement

Reference: https://docs.databricks.com/aws/en/sql/language-manual/sql-ref-functions

02 — The Myelin Layer · Canonical Discussion

Where the exam tries to trick you — and how those who passed solved it.

0 Passed

contributed to this question

Answer Distractor Matrix Click an option to filter or open its dissection.
✦ Consolidated Synthesis (Wiki) rev. #1 (baseline) · CC BY-SA 4.0
Start synthesis for this question →

No community synthesis consolidated for this question yet. Below is the verifiable official starting point — if you passed the exam, open the option dissection.

Official Answer (B): PIVOT — it turns each distinct value of the month column into its own output column, with the aggregation applied in the same statement

Ranvier · DBDEA

Contribute to this Question

Your contribution builds your Orbital Sheath

Peer contributions

No public contribution yet. Be the first who passed to explain why the distractors trick candidates — your contribution builds your Orbital Sheath.