Learn SQL Once, Use It for 30 Years
61–70 of 243 posts
Re: Learn SQL Once, Use It for 30 Years
#62Re: Learn SQL Once, Use It for 30 Years
#63Well-written SQL is about thinking in sets. I cannot tell you how many poorly written procedural stored procedures I’ve replaced with a single performant SQL query over the years.
This is because the most impressive part of the SQL ecosystem is the DBMS engine’s query plan. Though, yes, you have to know how to influence it.
I find ORMs also tend to keep devs thinking procedurally.
Yes learn SQL! But don’t just learn the syntax. Learn the underlying mathematical models and ways of thinking that SQL supports implementing.
Re: Learn SQL Once, Use It for 30 Years
#64I’ve always felt that SQL is somewhat easy to grasp for basic queries, but gets complex and difficult for even moderate to higher complexity use cases. My eyes glaze over when I read long stored procedures that someone else has written. Any recommended resources to go from beginner/beginner-intermediate to advanced?
PRQL, or https://www.malloydata.dev/
Re: Learn SQL Once, Use It for 30 Years
#65I've been slowly transitioning from using an ORM to just plain SQL. It's so much simpler. Less magic, more explicitness, and more control. Also, much better performance. I think the thing is to construct your model around the different queries you need to perform. In many cases, especially a CRUD-type situation, you'll end up with 10-20 different SQL queries, and that's it.
Once you break free of ORM’s I find the code so much simpler to maintain. Here’s the query(typically multiple different subqueries and return types), here’s the params, give me all the data back and something like Dapper in .net is an absolute godsend to convert it.
Re: Learn SQL Once, Use It for 30 Years
#66I think the pretext of this articles is ridiculous. Yes, SQL is based around relational algebra, but all programming languages are built on a theoretical foundation. And SQL is very much a "fad" language - it just somehow managed to stick around. The goal was not some sort of mathematical purity, but rather to built a natural language data interface (sounds like something currently very hyped?) and it failed spectacu…
While true on some level, I don't think this is a very useful statement. The importance of mathematical foundations lies in the extent to which they constrain the features of a programming language.
That extent is not the same for all languages. Many programming languages do not appear to be constrained by anything other than some pragmatic hunch of their designers plus the theoretical limits of computability.
SQL is a mess. The author acknowledged that. But the relational model and relational algebra are more serious attempts at creating a small but expressive theory than many of our mainstream programming languages.
Re: Learn SQL Once, Use It for 30 Years
#67>The Only Programming Language Built on Mathematics, Not Fashion As a modern array language D4M is the natural successor for SQL [1]. D4M is based on mathematics like SQL, specifically associative array algebra but not relational unlike SQL. It's more generic since can it caters to most modern data abstractions including spreadsheets, database tables, matrices, and graphs [2]. You can achieve 100M database inserts pe…
* D4M rolls off the tongue
* Make me buy a book to see the language.Re: Learn SQL Once, Use It for 30 Years
#68You know what has stuck around though?
Thumping great Unix boxes running SQL databases.
Yes, there's a lot wrong with the whole concept, but everything else is in some important way worse.
Re: Learn SQL Once, Use It for 30 Years
#69Additionally learn stored procedures. Helps simplify complex SQL queries and no need to waste network traffic on data that client side is never going to use, and waste CPU cycles processing it. Yes, what about database portability? I am on my 50s and it only mattered on a single project, which was anyway a middleware for application servers.
Re: Learn SQL Once, Use It for 30 Years
#70> If you are a junior developer, “learn SQL properly” is the most valuable 40 hours you can spend. Not a tutorial. Not an ORM. Actual SQL: joins, subqueries, window functions, query plans. That investment pays you back at every job, in every stack, for decades This is the power of low-level reasoning. Today, even for a junior developers, even if they have AI that solves syntax problems, SQL teaches you to reason and…