6 ms·
> 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, wi
by aledevv 4mo ago
> 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 approach problems logically. Without any wrapper masking low-level logic.
It's something like the letters of the alphabet that form concepts: why should they change?
- qohen 4mo agoA couple of sites worth checking out to level up, both by Markus Winand: https://modern-sql.com/ https://modern-sql.com/ https://use-the-index-luke.com/ https://use-the-index-luke.com/
- oulipo2 4mo agoalso a few different para-sql languages that can be useful, to lower the complexity: - https://prql-lang.org/ https://prql-lang.org/ - https://www.malloydata.dev/ https://www.malloydata.dev/
- efromvt 4mo agoA self para-sql-lang plug if you like the direction of malloy but prefer something closer to native SQL syntax. (a controversial take at times) - https://trilogydata.dev/ https://trilogydata.dev/
- CobaltFire 4mo agoI ran across https://use-the-index-luke.com https://use-the-index-luke.com organically while learning SWL recently and I've been really enjoying it. I can't vouch for it from any perspective except as an SQL neophyte but for me it has been teaching me a lot.
- jasode 4mo ago>, SQL teaches you [...] Without any wrapper masking low-level logic. I understand the point you're trying to make, and yes, it does seem like SQL is "low-level" from the perspective a wrapper like ORMs or a GUI db browser tool with menus for filtering data. But it's also worth remembering that SQL itself is a high-level wrapper that hides the lower-level C/C++ code of the db engine that has the loops that iterate through b-trees, 8k data pages, memory blocks of the buffer cache, etc. And C/C++ itself is a high-level wrapper that hides the logic in lower-level Linux o/s system calls that manages RAM and disk i/o. And Linux itself is a high-level wrapper that hides low-level device drivers like SATA/SSD memory-mapped IO ... and so on and so on. Depending on the type of app, you can ignore all the lower levels and just work at the abstraction level of higher-level wrappers.
- flossly 4mo agoI 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 software design challenges at a higher level, and --once settled at that level-- consider how to "serialize" those solutions to an RDBMS (if that's the tech that you've chosen for persistence; still a very solid choice after 50+ years!).
- graemep 4mo agoYes, i think the right wording is something like "the power of understanding the concepts" or "having the right mental model" rather than "low level".
- flossly 4mo agoAnd this I think is best not done in SQL/ the relational-data paradigm. It's better to understand the problem in terms that do not tie you in to a specific technology. And once you have a clear picture of what need to be built, then choose persistence tech; if that happens to be SQL, you can then translate your solution to SQL. In my experience, SQL sorely misses sum-types. So I need to find a way to serialize the sum-types of my domain model to SQL.
- hdjrudni 4mo agoI think it'd be easier to work backwards. They tried teaching us this relational algebra (or whatever you call it) in university but most of it went over my head because it was too abstract. Using weird mathematical symbols. But when we started writing actual SQL, all of that made sense to me. I think it might be easier to see it in action and then go back and understand the fundamentals of how/why it works.
- flossly 4mo ago
- deleted 4mo ago[deleted]
- psychoslave 4mo agoThe whys will vary, but letters of alphabets do change indeed.
- nkmnz 4mo agoThat’s not low-level reasoning, but rather low-resolution thinking. SQL is a high level language. It’s so high level that you barely need to express how the computer should do things, but only declare what you want to have.
- SoftTalker 4mo agoThe 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.
- EvanAnderson 4mo agoA 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."
- steve_adams_86 4mo agoI guess I think in 2.5D because I’ll often sketch an imperative, dumb query and then refine it once I know I’ve got the data I need. But I have a hard time starting with elegance. I use a baseball bat to shape the garbage can into the desired form
- JALTU 4mo agoYou'd have a future in modern sculpture. ;-) Okay, sorry sculptors! I like the brute force of the bat/garbage symbolism that seems so fitting in this day and age.
- jl6 4mo agoAlso 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.
- bigbuppo 4mo agoIs that before or after, "You're going to give us all your money"?
- 4mo ago
- NooneAtAll3 4mo ago> Not a tutorial. Not an ORM. Actual SQL ah, this is an Ai article
- John23832 4mo agoIt's always AI until proven otherwise... even then I'm skeptical.
- waffletower 4mo agoJohn23832, you are still an AI to me too.
- sophacles 4mo agoEllipses where a comma would suffice? Definitely AI. Not even a good model.
- ozim 4mo agoSo 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.
- RegW 4mo ago> 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 own particular identity requirements which only made sense to a developer that knows what's going on under the hood.
- ozim 4mo ago
- CobaltFire 4mo agoI'm actually learning SQL now and finding it HIGHLY enjoyable. 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.
- stevoski 4mo ago> Actual SQL: joins, subqueries, window functions, query plans And indexes. Many times in my career, adding the right SQL index has solved a serious performance problem.
- fifilura 4mo agoI'd argue that indexes is an implementation detail here and exactly the kind that should not leak into the abstract "thinking about sets and how to combine them". It is valuable and critical in lots of real situations. But it may interfere with the actual learning.
- nicman23 4mo agoi still have not ever needed more than select, update, insert and create.