break down the sql to it's pieces