TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Can we take a moment to appreciate the simplicity of Structured Query Language?

8 点作者 pyeri11 个月前
Now, I get that many programmers consider SQL to be too simple and noobish to be even considered a programming language. But of all languages, I think SQL stands out as not only one of the easiest to learn and practice, the sheer genius of this language is that it lets you do so much with so little expressiveness, while still trying to maintain standards across various kinds of databases as much as possible.<p>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 &quot;do more with less jargon&quot; things out there. In fact, the four basic DML&#x2F;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.<p>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&#x27;t you agree?<p><pre><code> create or replace procedure foo: begin select @test = select foo from bar; -- statement 2; -- statement 2; -- statement 3; end;</code></pre>

5 条评论

beardyw11 个月前
I remember doing a presentation about how SQL would remove the need for programmers to be involved in the process at all.
3by711 个月前
I’m a developer whose experience with SQL is limited to writing basic queries, window functions and combining those with CTEs.<p>All my business logic is written in a highly expressive language. It’s conveniently easy to read, change, and test.<p>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.<p>What resources would you recommend for learning and practicing to write business logic in SQL, including good practices and testing?
dakiol11 个月前
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.
throwaway21111 个月前
If the world could do normalisation...<p>I don&#x27;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.
pestatije11 个月前
since you like it so much, you should check other 4GL languages...SQL is not the only one<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Fourth-generation_programming_language" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Fourth-generation_programming_...</a>