AWS Certified Data Engineer Associate DEA-C01 Practice Question

An Amazon Redshift table named order_events contains multiple versions of each order identified by order_id. Each new version has a higher event_ts timestamp. You must write a single-pass SQL query that returns only the latest version of every order for a downstream ETL step. Which statement meets the requirement?

  • SELECT * FROM ( SELECT *, LEAD(event_ts) OVER (PARTITION BY order_id ORDER BY event_ts DESC) AS next_ts FROM order_events ) WHERE next_ts IS NULL;

  • SELECT DISTINCT ON (order_id) * FROM order_events ORDER BY event_ts DESC;

  • SELECT order_id, MAX(event_ts) AS event_ts FROM order_events GROUP BY order_id;

  • SELECT * FROM order_events QUALIFY ROW_NUMBER() OVER (PARTITION BY order_id ORDER BY event_ts DESC) = 1;

AWS Certified Data Engineer Associate DEA-C01
Data Ingestion and Transformation
Your Score:
Settings & Objectives
Random Mixed
Questions are selected randomly from all chosen topics, with a preference for those you haven’t seen before. You may see several questions from the same objective or domain in a row.
Rotate by Objective
Questions cycle through each objective or domain in turn, helping you avoid long streaks of questions from the same area. You may see some repeat questions, but the distribution will be more balanced across topics.

Check or uncheck an objective to set which questions you will receive.

Bash, the Crucial Exams Chat Bot
AI Bot