Search ⌘K
CVS Health
CVS Health

Analytics Reporting Track · Medium · 25 min

Vendor Delivery Gaps

The supply team wants to review long breaks between deliveries. For each vendor_id, return rows where the gap between one delivery and the previous delivery ...

Analytics Reporting Track
Medium
25 min
query basics
date functions
analytics reporting

Company labels are directional practice context, not official interview guidance.

Timer 00:00
Back to practice

Objective

Practice query basics through a CVS Health-tagged business scenario.

Approach

Use this track to train on SQL that mirrors day-to-day analytics workflows and recurring reporting asks.

Company context

Company labels are directional practice context, not official interview guidance.

Prereq: query basics
Prereq: filtering
Prereq: aggregation
Prereq: date functions

The supply team wants to review long breaks between deliveries. For each vendor_id, return rows where the gap between one delivery and the previous delivery is more than 10 days. Output vendor_id, previous_delivery, delivered_on, and gap_days. Sort by vendor_id, then delivered_on.

vendor_deliveries
vendor_id INT
delivered_on DATE
vendor_iddelivered_on
102024-04-01
102024-04-05
102024-04-22
202024-04-03
202024-04-10
202024-04-25
302024-04-07
302024-04-15
Editor
SQL workspace

Run queries against the protected question data, then submit once the result shape looks right.

Sign in to run SQL

Create a free account or sign in before running queries against protected question data.