LAG window function within partitioned ordering for prior-row comparison. Practice the 'detect repeated events per entity within a time window' pattern — the same shape that powers fraud detection, repeat-customer analysis, and any 'has this happened before recently' query.