Live data from Hacker News

SQLBolt – Interactive lessons and exercises to learn SQL

sqlbolt.com

51–60 of 87 posts

Re: SQLBolt – Interactive lessons and exercises to learn SQL

#51

SQL is both slightly ugly (which I attribute to the historical decision to use natural language words instead of the mathematical symbols of the relational algebra notation - the symbols make the expressions more readable once you learn them) and very beautiful. I'm sad most of the people have forgotten it and prefer to use ORMs today. Most often (except when coding a stupid low-feature phonebook/todolist tutorial) i…

A little more detail on the history: https://twitter.com/mike_seekwell/status/1412777805759365120

> For people that complain about SQL being hard to read/write... it could have been worse.

Thank you for the link. To me, however, this sounds like writing "ADD a TO b" instead of "a + b" and saying using the latter would be worse. Surely the former can be easier for a totally uneducated person to pick up immediately but as soon as you invest some humble time into learning the notation the latter becomes much easier to read than the former.

Re: SQLBolt – Interactive lessons and exercises to learn SQL

#53

Earlier quoted context omitted.

A little more detail on the history: https://twitter.com/mike_seekwell/status/1412777805759365120

> For people that complain about SQL being hard to read/write... it could have been worse. Thank you for the link. To me, however, this sounds like writing "ADD a TO b" instead of "a + b" and saying using the latter would be worse. Surely the former can be easier for a totally uneducated person to pick up immediately but as soon as you invest some humble time into learning the notation the latter becomes much easier…

SQL lets you do "a + b". The issue was with the notation, really hard to do that in a text editor.

Re: SQLBolt – Interactive lessons and exercises to learn SQL

#54
post #11

I'm of the firm opinion that you can have a very successful career purely as an SQL genie.

I feel fairly confident that I can write SQL queries for basically any result set (On a well designed DB). But the project I am working on is close to breaking me (VERY bad DB design, in progress) Also: I think knowing your way around triggers and such is quite important too though. I should learn them properly some day.

I remember looking at a MS Dynamics AX database, not hugely complex by ERP standards with about 5000 tables, and realising it didn't use foreign keys. That was fun.

Re: SQLBolt – Interactive lessons and exercises to learn SQL

#55

Earlier quoted context omitted.

> For people that complain about SQL being hard to read/write... it could have been worse. Thank you for the link. To me, however, this sounds like writing "ADD a TO b" instead of "a + b" and saying using the latter would be worse. Surely the former can be easier for a totally uneducated person to pick up immediately but as soon as you invest some humble time into learning the notation the latter becomes much easier…

SQL lets you do "a + b". The issue was with the notation, really hard to do that in a text editor.

> SQL lets you do "a + b".

When it's about actually adding 2 integers - sure. But when it's about the relational algebra - does it? Can you actually just write ⟖ instead of RIGHT OUTER JOIN when querying a real database?

Also, I don't really understand why is it supposed to be hard to do in a text editor.

Re: SQLBolt – Interactive lessons and exercises to learn SQL

#56

Earlier quoted context omitted.

I feel fairly confident that I can write SQL queries for basically any result set (On a well designed DB). But the project I am working on is close to breaking me (VERY bad DB design, in progress) Also: I think knowing your way around triggers and such is quite important too though. I should learn them properly some day.

I remember looking at a MS Dynamics AX database, not hugely complex by ERP standards with about 5000 tables, and realising it didn't use foreign keys. That was fun.

I can, sadly, one up you on that:

The same table stores: Addresses (primary, secondary), sex, names (up to 3), date of birth, what currency, and many MANY more values.

Yes, that's one table.

Also: Another table literally stores full tables in it. (Basically some kinda key with which to identify the subtable so you can select on it.)

Progress has no real concept of set based queries, instead it accesses all tables like a cursor.

And that's not even scratching the surface. The DB is bad and should feel bad. Just yesterday I went into a 2 hr rant about it with some people I often talk to.

Foreign keys, too, are a foreign concept to progress. But hey, work is work.

Re: SQLBolt – Interactive lessons and exercises to learn SQL

#57
post #9

My favorite book for learning SQL is “The Art of PostgreSQL”. https://theartofpostgresql.com/ I found the combination of real-world problems, general SQL advice, and the broad range of topics to be a really good book. It took my SQL from “the database is not much more than a place to persist application data” to “the application is not much more than a way to match commands to the database”. It’s amazing how much bes…

Definitely going to take a look at this. I'm one of the few traditional developers in a company that's got a lot more analytics and database people than application or web people. In such a situation the company is loathe to use ORMs and the old adage of "never do your business logic in the database" doesn't really apply in practice. I've managed to learn enough SQL to get by and fulfill the software's requirements out of sheer necessity and I've actually got to the point I prefer to use it over an ORM, but I'd love to have a more systematic education in the language.

Re: SQLBolt – Interactive lessons and exercises to learn SQL

#58
post #29
post #13

Earlier quoted context omitted.

I haven’t read this yet but I love your take. Far too often do I see developers doing analytics by slurping an entire table across the network and performing calculations on it in the application. Of course it appears to work in development with tens of kilobytes of records and a local database, but as soon as it’s deployed to production it unleashes chaos. I consider myself very good at SQL but I do prefer to use OR…

One argument I've often heard is that since it's easier to scale your application compared to your database, pushing the calculations on your application is a way to get a better scalability in the long term. I wonder how true that is though.

That depends a lot on the workload, of course. But quite often the DB is not constrained on CPU, but rathen on IO or memory (or even networking), and calculations mostly consume CPU.

Moreover, calculations usually require just a small subset of columns in a table, and thus can use indexes efficiently, whereas grabbing all the columns to then filter them in application (because that's how many ORMs work, at least by default) becomes not only worse in terms of memory and networking, but also in terms of IO and CPU required on the DB side.

So overall I'm sceptical of that argument, unless there's clear proof from profiling that it's indeed the case.

Re: SQLBolt – Interactive lessons and exercises to learn SQL

#59
post #40

Earlier quoted context omitted.

I look at it that I spent $100 on this book, and got a $20K payrise. At that order of magnitude, the difference between spending $10 and $100 didn't matter.

You didn’t get the pay raise because spent $100, you got the pay raise because you spent hours, days, months. It’s time, not money, you are spending.

From that point of view the $100 for the book is even less relevant.

Re: SQLBolt – Interactive lessons and exercises to learn SQL

#60
post #20
post #9

My favorite book for learning SQL is “The Art of PostgreSQL”. https://theartofpostgresql.com/ I found the combination of real-world problems, general SQL advice, and the broad range of topics to be a really good book. It took my SQL from “the database is not much more than a place to persist application data” to “the application is not much more than a way to match commands to the database”. It’s amazing how much bes…

That's one of the most expensive technical books I've ever seen.

The eBook bundle is $49 which is perhaps a little higher than average but doesn’t seem unreasonable.
Post reply on HN