Ultimate access to all questions.
A view is registered with the following code:
CREATE VIEW recent_orders AS (
SELECT a.user_id, a.email, b.order_id, b.order_date
FROM
(SELECT user_id, email
FROM users) a
INNER JOIN
(SELECT user_id, order_id, order_date
FROM orders
WHERE order_date >= (current_date() - 7)) b
ON a.user_id = b.user_id
)
Both users and orders are Delta Lake tables.
Which statement describes the results of querying recent_orders?
Explanation:
The CREATE VIEW
statement defines a view, which is a virtual table that executes its underlying query each time it is referenced. Since both users and orders are Delta Lake tables, Delta's transaction log ensures ACID transactions. When querying the view, Delta uses the version of the source tables valid at the start of the query to maintain consistency, even if the source tables are modified during query execution. The view does not store data (options A and B are incorrect). Option C is incorrect because it refers to versions at query completion, whereas Delta uses versions at query start (D).