Can we take a moment to appreciate the simplicity of Structured Query Language?
5 comments
I remember doing a presentation about how SQL would remove the need for programmers to be involved in the process at all.
I’m a developer whose experience with SQL is limited to writing basic queries, window functions and combining those with CTEs.
All my business logic is written in a highly expressive language. It’s conveniently easy to read, change, and test.
And still, I’d like to learn how to implement complex business logic within the realm of my database so I can use it when appropriate.
What resources would you recommend for learning and practicing to write business logic in SQL, including good practices and testing?
All my business logic is written in a highly expressive language. It’s conveniently easy to read, change, and test.
And still, I’d like to learn how to implement complex business logic within the realm of my database so I can use it when appropriate.
What resources would you recommend for learning and practicing to write business logic in SQL, including good practices and testing?
The problem with SQL is not SQL itself, but how it integrates with modern programming languages. It’s the gap that it’s painful. My SELECT query is very elegant, but if it takes tons of custom code or even a library to transform the resulting rows in objects in the PL of choice, well then the elegance is worthless.
If the world could do normalisation...
I don't want to normalise the world. A new generation born, a new generation figuring out how to throw a ball, tie shoe laces, but not store data in a flat table.
I don't want to normalise the world. A new generation born, a new generation figuring out how to throw a ball, tie shoe laces, but not store data in a flat table.
since you like it so much, you should check other 4GL languages...SQL is not the only one
https://en.wikipedia.org/wiki/Fourth-generation_programming_...
https://en.wikipedia.org/wiki/Fourth-generation_programming_...
With all their expressive tokens and syntaxes, languages like C and Java and Python are often appreciated and rightly so, but I think SQL also deserves a place up there in the list of "do more with less jargon" things out there. In fact, the four basic DML/DDL statements (create, insert, update, delete) are all you need to get started with creating tables and manipulating data on most projects. And learning additional features like alter, drop, truncate, etc. is both fun and interesting.
And once you go even further with things like stored procedure and triggers, the real fun then begins! If you consider the below stored procedure of some hypothetical SQL dialect, it is no less elegant than any of the other popular expressive languages like Python or Ruby, don't you agree?