5 update_dt last_update_dt,
6 (current_date - (update_dt::date)) number_of_days,
7 (current_date - (update_dt::date))-30 number_of_days_past_30,
8 (current_date - (update_dt::date)-31)/7 penalty,
9 greatest(100, elo - ((current_date - (update_dt::date)-31)/7)) new_elo
12 update_dt < (current_timestamp at time zone 'UTC' - interval '30 days')