Live data from Hacker News

SQLBolt – Interactive lessons and exercises to learn SQL

sqlbolt.com

61–70 of 87 posts

Re: SQLBolt – Interactive lessons and exercises to learn SQL

#62
I'm surprised, no one mentioned https://www.sql-ex.ru/ It has few hundred graded SQL exercises (some of them are very hard) + there is a book http://www.sql-tutorial.ru/ that goes over most common errors from submissions. On top of that, there are competition problems with the leaderboard. On top of that, I highly advise everyone to read T-SQL Fundamentals, by Itzik Ben-Gan (and few other books by same author) and do the all exercises in the book.

Re: SQLBolt – Interactive lessons and exercises to learn SQL

#63
I recommend trying out https://www.sql-ex.ru which has some good exercises which can trip up a lot of people. I have used quite a few questions from here as an interviewer. Going through it completely is a solid foundation for tackling SQL at work.

As a baseline, if one can solve https://www.jitbit.com/news/181-jitbits-sql-interview-questi... then you can be confident you can nail entry-mid level positions involving SQL.

Re: SQLBolt – Interactive lessons and exercises to learn SQL

#64

I'm surprised, no one mentioned https://www.sql-ex.ru/ It has few hundred graded SQL exercises (some of them are very hard) + there is a book http://www.sql-tutorial.ru/ that goes over most common errors from submissions. On top of that, there are competition problems with the leaderboard. On top of that, I highly advise everyone to read T-SQL Fundamentals, by Itzik Ben-Gan (and few other books by same author) and do…

I guess we were just a few minutes apart in our comments. I have gone through the website and yes I highly recommend it.

Re: SQLBolt – Interactive lessons and exercises to learn SQL

#65

Earlier quoted context omitted.

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.

I'm not sure what arbitrary symbols* as operators gets you. "It's built on concepts from relational algebra" does not mean "it must literally be a 100% compatible relational algebra mathematical engine." That is not the purpose of an RDBMS, and the purpose of relational algebra isn't to find a use for sigma, pi, and rho. Nevermind how eye-bleeding the difference between ⟖, ⟕, ⟗, ⋈, ⋉, ⋊, and ▷ will be in a sea of table and field names.

(* Yes, I know those symbols are the conventional relational algebra symbols. They were still chosen arbitrarily as notations built on top of the multiplication symbol borrowed as the Cartesian product symbol.)

Re: SQLBolt – Interactive lessons and exercises to learn SQL

#66

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…

https://youtu.be/LEZv-kQUSi4?t=483 This talk goes into many anti-patterns, but he gets to the real problem with SQL, that it is ONLY a DSL and lacks either an API or a fundamental information model to program against. Composability when working with a DSL is a nightmare.

I also have been moving away from ORM to directly writing SQL, but lets be honest about the reasons that programmers are wary of working directly with SQL as they are legitimate issues.

Re: SQLBolt – Interactive lessons and exercises to learn SQL

#67
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 book is heavily biased toward doing everything you can in the database and boasts it as the only true way. Which IME is hardly true for many type of applications and phases of development. Many times having more brains in your application code leads to a simpler less decoupled solution.

Re: SQLBolt – Interactive lessons and exercises to learn SQL

#68

Earlier quoted context omitted.

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

I'm not sure what arbitrary symbols* as operators gets you. "It's built on concepts from relational algebra" does not mean "it must literally be a 100% compatible relational algebra mathematical engine." That is not the purpose of an RDBMS, and the purpose of relational algebra isn't to find a use for sigma, pi, and rho. Nevermind how eye-bleeding the difference between ⟖, ⟕, ⟗, ⋈, ⋉, ⋊, and ▷ will be in a sea of tab…

I just really hate seeing/typing RIGHT OUTER JOIN when it could be just ⟖. It feels like it takes me a microsecond to read the symbol, translating the glyph straight into its meaning in my head instead of subvocalizing it first and thinking what does this mean then. This takes way more time and struggle with the words. Also the whole query consisting of many such words becomes too big to read easily or split into logical parts visually and also looks ugly from the purely aesthetical point of view.

To me sea of the SQL language elements represented with words intermixed with table names and other words into one uniform ocean of words seems at least no better than the names intermixed with the distinct kind of symbols (each of which I recognize instantly).

Re: SQLBolt – Interactive lessons and exercises to learn SQL

#69

Earlier quoted context omitted.

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.

I've been looking on brushing up on my SQL lately and have been going through these resources.

- Practical SQL, No Starch Press. ($30)

https://nostarch.com/practicalSQL

- Use The Index Luke ($15)

https://use-the-index-luke.com/

- Database Systems Concepts & Design by Georgia Tech on Udacity (free)

https://www.udacity.com/course/database-systems-concepts-des...

I can easily pay the $100, I cannot easily find more time, especially when there are a bunch of other things I'm spending time on. At a lower price I would likely buy the book "just because".

Re: SQLBolt – Interactive lessons and exercises to learn SQL

#70
post #41

Earlier quoted context omitted.

> But if you support all RDBMS you only can support the smallest intersection between them and can't use advanced features like CTE, window functions, JSON support etc. That's not true at all, any more that it’s true of supporting all browsers with JS. You can use the advanced features where available, and implement logically (if not performance)-equivalent functionality using more basic functions where the advanced…

Yeah, sure, you can always write raw SQL queries, but that has nothing to do with your ORM, does it? I was talking about ORMs in general, not about the programmer in particular. So yes, you are right that if you have enough engineering resources you can support everything. But most ORMs don't help you with this, so it is not a feature of ORMs. You can always bypass it though. The comparison with JS doesn't fit realy…

When GP says 'you can use the advanced features', 'you' refers to the person developing the ORM, not to a developer using the ORM.

So the ORM author can do the hard work of allowing advanced features to work across databases. And it's transparent to the developer using the ORM.

Post reply on HN