Earlier quoted context omitted.
The breakthrough for me was thinking in terms of sets and not in terms of "how would I do this imperatively." If you see SQL where someone wrote a SELECT and is then using a cursor to loop through those results and do other queries, you've found the person who is still thinking imperatively.
> If you see SQL where someone wrote a SELECT and is then using a cursor to loop through those results and do other queries, you've found the person who is still thinking imperatively. To a first approximation, yes. But 'client-side joins' can be a valuable tool when the database engine won't cooperate. For some queries and some engines, you can do a select with a join to get everything you need in one query, but a s…
Learn SQL Once, Use It for 30 Years
171–180 of 243 posts
Re: Learn SQL Once, Use It for 30 Years
#172Earlier quoted context omitted.
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 yet have to see someone actually argue that you don’t need to understand SQL and ORM will suffice Well that's because decades of bitter experience has told us all that object graphs rarely map cleanly to sets of relationships. However, I do think that must have been the original idea as tools such as Hibernate tried so hard to obscure the underlying SQL and database. As a result all Hibernate objects have their o…
Like an early article having headline "ORM will replace SQL knowledge".
I am professional dev for 15 years and hobbyist for 20 years and I might have missed something. But only thing I do remember was "anti ORM" people nagging how "one should really know SQL" - where I never heard anyone saying "don't learn SQL" maybe only NoSQL hype... but no one else.
Re: Learn SQL Once, Use It for 30 Years
#173Earlier quoted context omitted.
> If you see SQL where someone wrote a SELECT and is then using a cursor to loop through those results and do other queries, you've found the person who is still thinking imperatively. To a first approximation, yes. But 'client-side joins' can be a valuable tool when the database engine won't cooperate. For some queries and some engines, you can do a select with a join to get everything you need in one query, but a s…
I'm not sure I follow. Fetching the data in one query should almost always be faster and more efficient - the same work is being done regardless, except now you have the additional overhead involved with a second query (network and connection overhead, parsing etc.)
Same with UNION vs IN. If you union 10 queries for one row each by id, it'll hit the index every time; but if you do it with IN, maybe it decides to do an index scan which takes longer.
You could say well the database engine is broken if client-side join works better than database-side join, and sure it probably is, but given the choice of fix the database engine or do a client-side join, I know which one is feasible in the short term.
Re: Learn SQL Once, Use It for 30 Years
#174Earlier quoted context omitted.
I was reacting to the parent post. And F and LL are very different. I'd say F is a more subjective metric.
I was reacting to the parent post as well, suggesting that they should have used “fundamental” rather than “low-level”, and that “fundamental” would also match the article picture.
SQL is still very useful after all these years: that's the point that anyone will agree on.
Not low level. Not "fundamental" (by most definitions I can think of).
Re: Learn SQL Once, Use It for 30 Years
#175But you cannot learn it “once”. You need to continuously use it (over those 30 years, for example) to be proficient at it. It’s not that you can study sql for let’s say, 30 days, and never touch/study it again. I did “learn” sql at uni… but had to study it again at every company i worked for (different problems triggered different solutions). Im still learning it.
Re: Learn SQL Once, Use It for 30 Years
#176Re: Learn SQL Once, Use It for 30 Years
#177Strong agreement. Also applies to regular expressions.
Writing a regex involves always looking up the syntax, and being unable to read it an hour later without having to carefully disect it. I say this with 20+ YOE and I think I am better than the average bear with them.
That said, knowing what they can do is important and very useful. Its just the implementation that never quite sticks.
Re: Learn SQL Once, Use It for 30 Years
#178> 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…
The breakthrough for me was thinking in terms of sets and not in terms of "how would I do this imperatively." If you see SQL where someone wrote a SELECT and is then using a cursor to loop through those results and do other queries, you've found the person who is still thinking imperatively.
Re: Learn SQL Once, Use It for 30 Years
#179Re: Learn SQL Once, Use It for 30 Years
#180> 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'm by no means a senior dev, but I don't know if I fit in the box of a junior either.
Regardless, SQL is proving enjoyable. But I really like logic, so it fits.