Noos
PT EN
RAN-DBDEA-00230
Ranvier · DBDEA

Prova DBDEA Tópicos: transformation Dificuldade: hard A questão está em en.

A reporting query must return every order, joined to its payment when one exists, while showing only approved payment details: ```sql SELECT o.order_id, p.status FROM orders o LEFT JOIN payments p ON o.order_id = p.order_id WHERE p.status = 'APPROVED'; ``` After running it, the analyst notices that orders without any payment are missing from the results. Why did they disappear, and what is the fix?

Alternativas (Modo Leitura) Clique para filtrar a discussão →
  1. A. The WHERE clause runs after the join: NULL-padded orders fail p.status = 'APPROVED', turning the LEFT JOIN into an inner join — move the predicate to ON
  2. B. ON and WHERE are interchangeable in outer joins, so the missing orders must have been lost by a different filter somewhere upstream
  3. C. Spark automatically rewrites WHERE predicates on the right table into the ON clause, so rewriting the query manually is pointless
  4. D. A LEFT JOIN by definition never returns orders that lack a matching payment; preserving them requires a FULL OUTER JOIN instead
Revelar gabarito

Resposta correta: The WHERE clause runs after the join: NULL-padded orders fail p.status = 'APPROVED', turning the LEFT JOIN into an inner join — move the predicate to ON

Referência: https://docs.databricks.com/aws/en/pyspark/reference

02 — Camada de Mielina · Discussão Canônica

Onde a prova tenta te enganar — e como quem passou resolveu.

0 Aprovados

contribuíram nesta questão

Matriz de Dissecção de Alternativas Clique numa alternativa para filtrar ou inaugurar a dissecção.
✦ Síntese Consolidada (Wiki) rev. #1 (baseline) · CC BY-SA 4.0
Inaugurar síntese desta questão →

Ainda não há síntese comunitária consolidada para esta questão. Abaixo está o ponto de partida oficial verificável — se você passou na prova, inaugure a dissecção das alternativas.

Gabarito Oficial (A): The WHERE clause runs after the join: NULL-padded orders fail p.status = 'APPROVED', turning the LEFT JOIN into an inner join — move the predicate to ON

Ranvier · DBDEA

Contribuir com a Questão

Sua contribuição constrói sua Bainha Orbital

Contribuições dos pares

Nenhuma contribuição pública ainda. Seja o primeiro aprovado a explicar por que as alternativas incorretas enganam — sua contribuição constrói sua Bainha Orbital.