In the context of this exercise, how does this statement tell us if a user is
This statement tells us if a user is active or not active based on conditions.
First, it will check whether the purchase date of the premium plan is earlier than or equal to the current date. If it is not, then there might have been some error or they are not yet signed up.
premium_users.purchase_date <= months.months
Second, it will check whether either of the following conditions is true:
If the user’s cancel date is the current date or is planned for the future, this means that they are still under the plan until their cancel date arrives,
premium_users.cancel_date >= months.months
Or, if the user has no cancel date yet, this means that they did not cancel nor plan to cancel,
premium_users.cancel_date is NULL.
If the first condition and either of the second conditions is true, this must mean they are still
active. Otherwise, they are