Live data from Hacker News

SQLBolt – Interactive lessons and exercises to learn SQL

sqlbolt.com

21–30 of 87 posts

Re: SQLBolt – Interactive lessons and exercises to learn SQL

#21
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) it seems to me writing SQL queries manually is a way more efficient (not only in terms of execution speed but also for developing) solution than using an ORM, except you have to have some fluency in SQL which the most of the today coders seem to lack. Designing a normalized entity-relation model as well as writing the queries for it also feels great, very satisfying.

Re: SQLBolt – Interactive lessons and exercises to learn SQL

#22
post #14
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…

I’m very guilty of all those sins. Select all, then use array map, reduce and filter in the app code. I could draw a line in my life where I discovered window functions.

If the dataset is big enough, those operations actually do make sense because they can be translated to e.g. a Hadoop job - map / reduce / filter are all operations that don't depend on the sorting of a dataset, so in theory the dataset can be sharded across many machines.

Of course, that is a solution to a problem that people wish they had. Relational databases can run multi-million row queries in seconds, and then there's BigTable / BigQuery which scales SQL to improbable scales.

Re: SQLBolt – Interactive lessons and exercises to learn SQL

#23
post #11

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

DBA's definitely used to have - still have? - a reputation as being paid big. They likely have a decent job in modern-day "big data" as well.

Personally, unless there's a compelling reason, I'll stick to SQL for 'core' data storage. NoSQL is cute, but changing data structures over time is horror.

Re: SQLBolt – Interactive lessons and exercises to learn SQL

#24
post #17
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…

Oh wow, used to work with Kris Jenkins but had no idea he was a SQL-guru, I always went to someone else on the team with queries!

He's a comedic genius too!

Re: SQLBolt – Interactive lessons and exercises to learn SQL

#25
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…

I found that book really useful too, and it led me towards leaning more heavily on Postgres. For a long time using Postgres I just treated it as a ‘dumb’ data store with an ORM in front of it, but learning about CTEs, window functions, user defined functions, views, extensions, etc. has made me reconsider where a lot of application logic should go

Re: SQLBolt – Interactive lessons and exercises to learn SQL

#26
post #13
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…

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…

I have not used ORM, but used some basic SQL. Is ORM more performant? Why should I learn SQL if I can do all the things using ORM?

Re: SQLBolt – Interactive lessons and exercises to learn SQL

#27
post #11

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

We are trying to revive the art in our shop. Just got done building a really clean 3NF model for our problem domain and we are in the process of moving 100% of our custom configuration needs to SQL queries.

From a biz strategy perspective, we can scale up a lot faster if all we need to do is find people who know (or can be taught) SQL.

Consider the amount of time it would take to ramp someone on 1 SQL schema vs the entire C# ecosystem.

For us, the application is quickly turning into a dumb funnel that just gets data and requirements (queries) into SQLite databases for eval. We put a web interface around all this so it can be easily managed on a per-customer basis.

When everything is a SQL query, you can trivially export/import/clone customer configurations to rapidly bootstrap new ones.

Re: SQLBolt – Interactive lessons and exercises to learn SQL

#29
post #13
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…

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.

Re: SQLBolt – Interactive lessons and exercises to learn SQL

#30
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.

Post reply on HN