Live data from Hacker News

Learn SQL Once, Use It for 30 Years

fagnerbrack.com

91–100 of 243 posts

Re: Learn SQL Once, Use It for 30 Years

#92

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…

I think this is a tad too contrarian. I think SQL does (did?) a great job of giving common-language terms for fundamental data table operations, which in turn creates a shared mental model that everyone can use to describe what can and should be done to tables.

I agree with you in terms of syntax, though, it leaves something to be desired. But learning SQL was a pretty fundamental step in my journey to becoming a data scientist. It helped form the basis for how I reason about tabular data.

Re: Learn SQL Once, Use It for 30 Years

#94
post #53

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…

I found PRQL[1] to be good fix for nearly everything I dont like about SQL. But then it's only a query lang (DDL you still do in SQL then I guess). Bottom line for me now is that I dont write much of my SQL by hand. AI does a much better job at it. I just read it back and point out mistakes and/or inefficiencies. 1: https://prql-lang.org/

This looks somewhat similar to LINQ in how it order clauses.

Re: Learn SQL Once, Use It for 30 Years

#95

Earlier quoted context omitted.

> Learning relational modelling is great, but learning SQL itself, unless you actively have to work with it, is a waste of time. What a wild statement. SQL is one of the most useful tools ever developed, as evidence that it's BY FAR the most widely used programming language in the world. The idea that it is an ABSOLUTE LAST RESORT that should never be used unless you ABSOLUTELY HAVE TO is insane...

Even wilder: > SQL was not designed for application development, and every attempt to integrate it into higher level programs (ORM, fluent query builders, raw strings, macros/preprocessors) comes with unpleasant rough edges. Forgetting that interactive SQL queries, and to an even greater degree the underlying databases, are applications.

The issue is that most of these tools try to reinvent the wheel. Instead of using sql, you use 'fluent builders' or whatever, and they have their own tricks and cevats.

Sqlc is the best thing I've personally used because it produces models and repositories based on plain sql queries.

Re: Learn SQL Once, Use It for 30 Years

#96
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 that can leverage relational set theory) and what work stays in the application. Once you figure the true capabilities of databases, SQL as the language interface is a side note - about as important as the leather on your steering wheel.

Re: Learn SQL Once, Use It for 30 Years

#97

Earlier quoted context omitted.

Even wilder: > SQL was not designed for application development, and every attempt to integrate it into higher level programs (ORM, fluent query builders, raw strings, macros/preprocessors) comes with unpleasant rough edges. Forgetting that interactive SQL queries, and to an even greater degree the underlying databases, are applications.

The issue is that most of these tools try to reinvent the wheel. Instead of using sql, you use 'fluent builders' or whatever, and they have their own tricks and cevats. Sqlc is the best thing I've personally used because it produces models and repositories based on plain sql queries.

It's much easier to reinvent one of the most used tools in the world as a far worse version than better.

It's almost as if it was easy to reinvent something highly used that someone would've already done it...

Re: Learn SQL Once, Use It for 30 Years

#99

At my first job in 1997, I learned SQL & Relational DB design with the book "Database Design for Mere Mortals: A Hands-On Guide to Relational Database Design"

As a student I used to work as a network administrator in the summer breaks. The place had a very nice library of technical books. I had the pleasure to read "Database Design for Mere Mortals" there, in the hours when work was slow.

Re: Learn SQL Once, Use It for 30 Years

#100
Not quite as simple as learning it once. SQL evolves like other languages, across vendor implementations.

The ClickHouse and DuckDB dialects for example extend the language with analytic options not found in ANSI SQL, nor T-SQL, Pl/PgSQL, etc. DuckDB QoL enhancements are greatly missed when not available.

Post reply on HN