A SQL-Based Approach to Cohort Retention and Analysis