4 ms·
Not in my experience. Please show me actual examples of "well-written modular SQL" in a real application.
by Grue3 10y ago
Not in my experience. Please show me actual examples of "well-written modular SQL" in a real application.
- Something1234 10y agoWould modular sql be wrapping up subqueries inside of views, and then selecting from those views?
- jsmeaton 10y agoCommon Table Expressions (CTEs) help with modular SQL.
- bdcravens 10y agoI'm taking a bit of creative license with the term "modular". CTEs and views can help with this, and are closer to true modules. I like to encapsulate inside of stored procedures, and write my code in such a way that it reads almost like a a procedural language. Heavy use of indentation, subqueries, and temp tables lets you carry results through the proc. I like to hang conditions off of joins, so related logic is in the same place.