LAG window function to get the previous transaction's amount and date for each customer, ordered by transaction date.CASE statement to assign a value indicating the start of a new sequence whenever the consecutive increasing condition is not met.
erDiagram
TRANSACTIONS {
int transaction_id PK
int customer_id
date transaction_date
int amount
}