Live data from Hacker News

Learn SQL Once, Use It for 30 Years

fagnerbrack.com

221–230 of 243 posts

Re: Learn SQL Once, Use It for 30 Years

#221

Earlier quoted context omitted.

Well, IPv4 is obsolete.

I inquired about getting a static IP(s) for a small business, and only v4 is available.... and that was this year!

Personally, I'm not a great fan of IPv6, but this says more about your provider than anything else.

Assuming you mean for a VPS, the majority of providers provide IPv6, and a good many would advertise your IPv6 prefix and route it to your box for a nominal fee. It's far cheaper to do anycast IPv6 than IPv4 because of the cost of IPv4 address space.

If you actually meant on-site for a business, that again depends on your provider, but again most providers should be able to give you a static IPv6 prefix from their own range if they're able to provide you a static IPv4 address. If not, you can always tunnel IPv6 to your site.

Re: Learn SQL Once, Use It for 30 Years

#222
post #202

Earlier quoted context omitted.

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.

The only true relational database engine I’m aware of is Rel [0], which is a learning tool at best, not a production-capable DBMS.

I understand that SQL is pseudo-relational, but it’s as good as you’re going to get if you want something you can use for actual workloads.

0: https://reldb.org

Re: Learn SQL Once, Use It for 30 Years

#223
post #202

Earlier quoted context omitted.

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.

The only true relational database engine I’m aware of is Rel [0], which is a learning tool at best, not a production-capable DBMS. I understand that SQL is pseudo-relational, but it’s as good as you’re going to get if you want something you can use for actual workloads. 0: https://reldb.org

Postgres was relational for the first decade of its life, until the infamous '95 release when it sold its soul to the devil. You could dig up on old version, perhaps. But, yes, the tradeoff for real-world use was already mentioned.

The relational model is superior as complexity grows (although arguably the deductive model is even better), but the tablational model is superior for simple line-of-business stuff, so pick your poison. Like with all things engineering, there is never one perfect solution that satisfies everything. If, like the earlier comment suggested, you keep your SQL simple then you'll be fine.

Re: Learn SQL Once, Use It for 30 Years

#224
post #145

Earlier quoted context omitted.

> Not a tutorial. Not an ORM. Actual SQL ah, this is an Ai article

So AI also thinks people somehow get away only with ORM without understanding SQL? Funny thing is, that is always argument of „anti ORM” people. I yet have to see someone actually argue that you don’t need to understand SQL and ORM will suffice in the wild. Then also find devs who can’t do a simple join as joins and index usage is not some black magic and is still required to use ORM properly.

I worked with people who argued that exact point and considered SQL outdated now that everything could be done with ORM.

Re: Learn SQL Once, Use It for 30 Years

#225
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 still have not ever needed more than select, update, insert and create.

Re: Learn SQL Once, Use It for 30 Years

#226

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…

the I in ACID stands for isolation, not idempotency

Re: Learn SQL Once, Use It for 30 Years

#227
post #126

Earlier quoted context omitted.

A thousand times this. I've resolved performance issues in so many stored procedures written by programmers who don't grasp set theory and reach for the CURSOR early and often. The quote that comes to mind: "His pattern indicates two-dimensional thinking."

Also from that film comes the quote: > I've done far worse than kill you. I've hurt you. And I wish to go on hurting you. Which I believe is a paraphrase of the Oracle Master Agreement.

Is that before or after, "You're going to give us all your money"?

Re: Learn SQL Once, Use It for 30 Years

#228
I'm not sure I really consider SQL a programming language though. Certainly doesn't seem fair to compare it to anything turing complete (at least, unless you're going to lump in extensions such as PL/SQL or T-SQL.

Doesn't detract from the advice to learn it though. Picking up books on Perl and C as a teenager always left me feeling like I was missing something key that'd make programming more accessible, and I learned FAR later that what that was was an appreciation for making better use of structured data. In lieu of either larger data structures or microcontrollers, everything I looked at felt like a much more complicated and slightly more capable calculator; the access to large relational data models is really where the super powers of turing complete languages clicked.

Re: Learn SQL Once, Use It for 30 Years

#229
post #155

Earlier quoted context omitted.

> Not a tutorial. Not an ORM. Actual SQL ah, this is an Ai article

Darn. I write exactly like this. You need to consider that people write in different ways, and the LLM is choosing from among the different styles.

> I write exactly like this. You need to consider that people write in different ways, and the LLM is choosing from among the different styles.

I'm skeptical. Give us an link to something you wrote prior to 2022.

Re: Learn SQL Once, Use It for 30 Years

#230
post #155

Earlier quoted context omitted.

Darn. I write exactly like this. You need to consider that people write in different ways, and the LLM is choosing from among the different styles.

> I write exactly like this. You need to consider that people write in different ways, and the LLM is choosing from among the different styles. I'm skeptical. Give us an link to something you wrote prior to 2022.

https://news.ycombinator.com/item?id=25985705
Post reply on HN