Tell me about your experience with SQL and data warehouse concepts, including any real-time data pipeline scenarios you have worked on.
For the hands-on portion, use the supplied warehouse metadata, pipeline event, and load tables to produce a current pipeline freshness report for active datasets.
Output
- One row per active dataset, including datasets with no event or successful load.
- Return
dataset_name, latest_event_time, latest_load_time, latency_seconds, and pipeline_state.
- Sort by
latency_seconds descending with nulls last, then dataset_name ascending.
Output details
- Select the latest event by
event_time descending, breaking ties with event_id descending.
- Select the latest load only among rows where
load_status equals success, ordering by loaded_at descending and load_id descending.
- Report
latency_seconds as integer elapsed seconds only when both timestamps exist and latest_load_time is at least latest_event_time; otherwise return NULL.
- Set
pipeline_state to NO_EVENT without an event, EVENT_FAILED for a non-success latest event, LOAD_PENDING when no successful load exists or it precedes the event, and CURRENT otherwise.