Independence Day Deal! Unlock 25% OFF Today – Limited-Time Offer - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Databricks Exam Databricks Certified Data Engineer Professional Topic 1 Question 6 Discussion

Actual exam question for Databricks's Databricks Certified Data Engineer Professional exam
Question #: 6
Topic #: 1
[All Databricks Certified Data Engineer Professional Questions]

The view updates represents an incremental batch of all newly ingested data to be inserted or updated in the customers table.

The following logic is used to process these records.

MERGE INTO customers

USING (

SELECT updates.customer_id as merge_ey, updates .*

FROM updates

UNION ALL

SELECT NULL as merge_key, updates .*

FROM updates JOIN customers

ON updates.customer_id = customers.customer_id

WHERE customers.current = true AND updates.address <> customers.address

) staged_updates

ON customers.customer_id = mergekey

WHEN MATCHED AND customers. current = true AND customers.address <> staged_updates.address THEN

UPDATE SET current = false, end_date = staged_updates.effective_date

WHEN NOT MATCHED THEN

INSERT (customer_id, address, current, effective_date, end_date)

VALUES (staged_updates.customer_id, staged_updates.address, true, staged_updates.effective_date, null)

Which statement describes this implementation?

Show Suggested Answer Hide Answer

Contribute your Thoughts:

Catherin
1 years ago
I would go with option A. It makes sense to me that old values would be overwritten by the new ones.
upvoted 0 times
...
Sueann
1 years ago
I see what you mean. In Type 2 tables, old values are kept for historical reference while new values are added.
upvoted 0 times
...
Catarina
1 years ago
I think the correct answer is C. The implementation described follows typical Type 2 table behavior.
upvoted 0 times
...
Sueann
1 years ago
I feel like this question is testing our understanding of how data updates are handled in a database.
upvoted 0 times
...
Georgeanna
1 years ago
That's a good point, Carma. The logic does seem to support Type 2 implementation.
upvoted 0 times
...
Kallie
1 years ago
But in the logic given, it mentions that old values are maintained but marked as no longer current, which aligns with Type 2.
upvoted 0 times
...
Carma
1 years ago
I'm not so sure, I think it might be B instead.
upvoted 0 times
...
Georgeanna
1 years ago
I agree with Kallie, it seems like the customers table is implemented as a Type 2 table.
upvoted 0 times
...
Kallie
1 years ago
I think the answer is C.
upvoted 0 times
...

Save Cancel