Clean up sql