SQL(ite): markov.sql: Higher Order Markov Chains