Noos
PT EN
RAN-DBDEA-00228
Ranvier · DBDEA

Exam DBDEA Topics: transformation Difficulty: medium

A monthly revenue report must show one row per month with two separate columns, web_revenue and store_revenue. The source is a large orders table with the columns event_month, channel, and amount, and the report must compute both totals in a single pass over the table. Which construct computes the two metrics in one aggregation?

Options (Reading Mode) Click to filter discussion →
  1. A. One query per channel, each filtering WHERE channel = 'web' or WHERE channel = 'store', whose result sets are combined into the report afterwards
  2. B. GROUP BY channel with SUM(amount), which yields one row per channel carrying that channel's revenue total
  3. C. PIVOT on channel, which is limited to count aggregations and therefore cannot produce revenue sums per channel
  4. D. SUM(amount) FILTER (WHERE channel = 'web') and SUM(amount) FILTER (WHERE channel = 'store') within one GROUP BY event_month
Reveal answer

Correct answer: SUM(amount) FILTER (WHERE channel = 'web') and SUM(amount) FILTER (WHERE channel = 'store') within one GROUP BY event_month

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 (D): SUM(amount) FILTER (WHERE channel = 'web') and SUM(amount) FILTER (WHERE channel = 'store') within one GROUP BY event_month

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.