trying sqlite for loops