How to Implement a for Loop in SQL
towardsdatascience.com