How would you use SQL to analyze user behavior over time with window functions like RANK, LEAD, and LAG?