SQL parsing and processing engine