Live data from Hacker News

Learn SQL Once, Use It for 30 Years

fagnerbrack.com

131–140 of 243 posts

Re: Learn SQL Once, Use It for 30 Years

#131
post #31

>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…

There is no SQL successor: SQL is here to stay. Applying the Lindy effect [1]: after half a century of SQL we can expect it to survive for at least as long. Disruption/displacement of SQL is like attempting to replace email. It's not going to happen. At best an alternative technology can carve out a small niche (and there's nothing wrong with that). [1]: https://en.wikipedia.org/wiki/Lindy_effect

Never heard of the Lindy effect either, learn something new from this site every day haha

Re: Learn SQL Once, Use It for 30 Years

#132

Learn SQL (because it's basically the only option) but much more importantly, learn databases. Know why atomicity, consistency, idempotency, and durability matter. Understand the wire protocol and the client-server model. Do relational data modeling; think beyond databases as a dumb store. Join. Know when to normalize. Internalize indexing strategies. Think deeply about what work belongs on the database server (work…

I agree with everything except this:

> Understand the wire protocol and the client-server model.

I'm a DBRE, and have locally compiled MySQL with debug symbols to step through something with gdb. I have yet to examine the wire protocol for MySQL or Postgres beyond a brief read from docs. I'm not saying it's not useful in some circumstances, but I can't think of a reason why a developer would ever need to know it.

Re: Learn SQL Once, Use It for 30 Years

#133
post #38

I’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?

My advice is: don't write complicated SQL. The best thing I learned about SQL is that it can do an awful lot of clever stuff but that the vast majority of the time you really don't need it. Learn the basics. Shrug the rest off.

What do you consider to be clever SQL?

Re: Learn SQL Once, Use It for 30 Years

#134
I thought this was about me.

I learned SQL 30 years ago and, well, pretty much stopped.

Through the years, as we added ORMs and were using the databases more for base dumb storage, and that I ventured away from report writing, focuses more and just services, workflow and CRUD, I never really learned modern SQL. I've just been able to muddle through with the SQL I learned long ago.

To the articles other point, I've been doing Java for almost 30 years, and while we have a much more modern language, the fundamentals of years ago are still sound and used every day.

Re: Learn SQL Once, Use It for 30 Years

#136
post #10

Just, for god's sake, move SELECT after GROUP BY, I beg you.

Current structure makes sense to me. SELECT .... what do I want FROM .... where is it WHERE .... what filters do I want to apply GROUP BY .... how do I want it aggregated Maybe it's just that I'm so used to it. I could see FROM being first, that would actually make a little more sense to me.

> I could see FROM being first, that would actually make a little more sense to me.

Personally, I disagree. In English, an imperative statement like "move that chair from the dining room to the living room" is generally verb-first (with respect to location, anyway). SQL's flow has always made perfect sense to me.

Re: Learn SQL Once, Use It for 30 Years

#137

> If you are a junior developer, “learn SQL properly” is the most valuable 40 hours you can spend. "Learn SQL Properly" is referenced as if it were a book or a course, but it seems to be a hallucination? I can't find any reference to this online.

It's ai written. The prompt likely contained the phrase hence the quotes

Re: Learn SQL Once, Use It for 30 Years

#138
post #31

Earlier quoted context omitted.

There is no SQL successor: SQL is here to stay. Applying the Lindy effect [1]: after half a century of SQL we can expect it to survive for at least as long. Disruption/displacement of SQL is like attempting to replace email. It's not going to happen. At best an alternative technology can carve out a small niche (and there's nothing wrong with that). [1]: https://en.wikipedia.org/wiki/Lindy_effect

Never heard of the Lindy effect either, learn something new from this site every day haha

It was made famous by Nassim Nicholas Taleb in Incerto.

Re: Learn SQL Once, Use It for 30 Years

#139
post #21

Earlier quoted context omitted.

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.

The code is simple to maintain until the database changes. Then you will experience the pain of SQL

By the time you really needs to change your database, updating your queries will be the easiest part, compared to reviewing the semantic changes and the data migration.
Post reply on HN