Dataford
Interview QuestionsInterview GuidesExperiencesMock InterviewsPricing
Get started
SQL and Data Warehouse Concepts
00:00
5 left

SQL and Data Warehouse Concepts

MediumSQL · PostgreSQL

Problem

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

  1. One row per active dataset, including datasets with no event or successful load.
  2. Return dataset_name, latest_event_time, latest_load_time, latency_seconds, and pipeline_state.
  3. Sort by latency_seconds descending with nulls last, then dataset_name ascending.

Schema

datasets
ColumnTypeDescription
dataset_idPKINTUnique dataset identifier
dataset_nameVARCHAR(100)Display name of the dataset
source_systemVARCHAR(100)System that produces the dataset
is_activeBOOLEANWhether the dataset is currently monitored
pipeline_events
ColumnTypeDescription
event_idPKINTUnique pipeline event identifier
dataset_idINTDataset associated with the event
event_timeTIMESTAMPTime the pipeline event was recorded
event_typeVARCHAR(40)Type of pipeline event
event_statusVARCHAR(20)Outcome of the pipeline event
records_receivedINTNumber of records received by the pipeline
warehouse_loads
ColumnTypeDescription
load_idPKINTUnique warehouse load identifier
dataset_idINTDataset loaded into the warehouse
loaded_atTIMESTAMPTime the warehouse load completed or was attempted
load_statusVARCHAR(20)Outcome of the warehouse load
records_loadedINTNumber of records loaded successfully
Tablesdatasetspipeline_eventswarehouse_loads
Interviewer

Your question is SQL and Data Warehouse Concepts. Start with the requirements and the three tables in the Question tab.

Run and submit as often as you like. When you're ready, talk me through your approach or go straight to the code.

You need to log in / sign up to run or submit.
CodePostgreSQL
You need to log in / sign up to run or submit.Ln 1
Run your query to see results here.