Maintainable SQL in Data Warehousing

Since SQL isn't a programming language, and say you don't have the option of using a programming language to generate SQL, how do you go about making it maintainable? If I had the opportunity to build a new data warehouse from scratch, I'd probably tell myself these things to prevent…