Rephrase some SQL queries

No changes in meaning, just consistent AS names.