fix SQL statements in cli-tools