ROW_NUMBER()
window function to assign a sequential integer to each date, ordered by the date.DENSE_RANK()
window function to assign a rank to each date, ordered by the date, within each state.erDiagram FAILED ||--|| FAILED : fail_date SUCCEEDED ||--|| SUCCEEDED : success_date FAILED { date fail_date PK } SUCCEEDED { date success_date PK }