orginize sql chunk