Live data from Hacker News

Learn SQL Once, Use It for 30 Years

fagnerbrack.com

201–210 of 243 posts

Re: Learn SQL Once, Use It for 30 Years

#201

That's true. SQL knowledge is one of the few skills that didn't age. 1. C language. 2. *nix tools (shell and friends). 3. SQL. 4. Basic IPv4 networking. These things I learned around 20 years ago, they didn't change much and they are useful for me to this day.

Well, IPv4 is obsolete.

All of the above are obsolete. But still what is regularly found out in the real world.

Re: Learn SQL Once, Use It for 30 Years

#202

Earlier quoted context omitted.

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?

You don't have to get very clever. Once you get beyond inner join it starts to stick out like a sore thumb that SQL isn't relational and that you should have chosen a relational engine instead. SQL shines when you have an ORM and need a reliable backing store, though. Tradeoffs, as always.

Re: Learn SQL Once, Use It for 30 Years

#204
I learned SQL when I was 13 or 14 (I'm 37 now). Fully agree with the article, but it's a shame some choices behind the syntax make it so clumsy. Some choices (minimal), like allowing "," (commas) after columns in the SELECT clause even on the last column declared would be minor in terms of compilation and a GREAT improvement in ergonomics (and composability). Some more recent SQL idioms do allow for tweaks/improvements on these, but it's far from a standard - still niche. Long live SQL.

Re: Learn SQL Once, Use It for 30 Years

#205

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

> Sometimes '=' is an identity test, sometimes it is `==`. Eh... Where did you find `==` used in SQL?

DuckDB and some other analytical databases lets you do

    SELECT 2==2
But maybe that’s on them and not on SQL

Re: Learn SQL Once, Use It for 30 Years

#206
post #82

Earlier quoted context omitted.

I’ve experienced what you’ve mentioned before, ORM or not you have issues if you’re shuffling the schema around. Cool.

It would be great if there was a compiler that would check your SQL queries against the schema, and you could even refactor a column name to update both the schema and the queries.

Microsoft SSDT (SQL Server Data Tools), but I think it only works against Microsoft SQL Server

https://learn.microsoft.com/en-us/sql/ssdt/sql-server-data-t...

Re: Learn SQL Once, Use It for 30 Years

#207

Earlier quoted context omitted.

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.

A pretty common request is to lift the FROM up before the select, like the below. I'm pretty fine with status quo since my mind is usually "hmm what do I need to get" first, then I figure out how to get it, but some engines (duckdb, I think?) support both so everyone gets their cake. What people often want:

Also helps with autocomplete, which is why LINQ starts with `from`

Re: Learn SQL Once, Use It for 30 Years

#208
I'm an existence proof of this. I learned SQL following my previous employer dying a slow death > layoffs. Having worked in a narrow field, there weren't options to continue working in it. That was 25 years ago.

SQL was the foundation of a second career in business data analytics. Moderately interesting and paid the bills.

I must say, it's not just select *, joins and so forth. The human side was important. Always being on the lookout in Big Corp for people hungry for data (lots of them), and working to find quick solutions.

Re: Learn SQL Once, Use It for 30 Years

#210
post #54
post #30

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

I find SQL a very thick "wrapper masking low-level logic". Think of the query planning, the index-maintaining, the upholding of guarantees, the writing-to-disk and caching that you are all not doing by using a RDBMS! I'd say SQL is a very high level language. "SQL teaches you to reason and approach problems logically" -- I kind of agree here. It teaches relational data mgmt. I think it is better to attack most softwa…

Not sure what you mean with higher level tools to start with, could you precise please?
Post reply on HN