Live data from Hacker News

Show HN: Select Star SQL, an interactive SQL book

selectstarsql.com

91–100 of 121 posts

Re: Show HN: Select Star SQL, an interactive SQL book

#91

Awesome work Kao!! Earlier this year I launched a similar interactive SQL tutorial with similar goals. https://chartio.com/learn/sql/ With the writeup on why i made it here: https://medium.com/@__dave/why-i-wrote-yet-another-sql-tutor... Do let me know if there's any collaboration we could do!

Thanks Dave! I share many of the sentiments in your writeup, especially about existing tutorials. Admittedly, I have been impressed by the quality of a few of the tutorials that others have suggested here. Will let you know if I think of anything!

Re: Show HN: Select Star SQL, an interactive SQL book

#93
post #87

Why did you use death sentence cases as data? I've spent around 20 minutes just reading the last words of various executed people. It's... disturbing and distracting.

It's deep and moving, it makes this course more than just a course. I just fetched a few rows and read Beazley's last statement and I now have a great respect for the creator of this course.

I strongly agree. Rarely do I see such a humanistic approach in tech. It brings an important matter to our attention and is meaningful. As a side note, what is meaningful is pedagogically valuable, because what has meaning is easier to remember.

Re: Show HN: Select Star SQL, an interactive SQL book

#94
post #66
post #11

This is good intiative. We need to simplify pedagogy. On a related note, I always found the syntax of SQL to be great. Someone told me that simplicity of SQL made relational databases even more popular. It is one of the best designed language where even someone new to the field won't feel intimidated. I'm surprised designers of SQL haven't won the Turing Award yet.

I agree except one thing: SELECT cols FROM table. This should really be FROM table SELECT cols as every modern SQL editor will then be able to show you a list of available columns. See LINQ. There they had the opportunity to fix it and it works just great.

I concur. I always start with select * from table because I cannot possibly remember all the right column names

Re: Show HN: Select Star SQL, an interactive SQL book

#95
post #46

Earlier quoted context omitted.

I teach SQL to financial people and, for the most part, it isn't too bad. When I get to joins, I teach a subset of SQL where all joins are done through INNER JOIN / LEFT JOIN syntax and that helps a lot. Joins are the part that everyone has trouble with.

Can you explain when to really use a lateral join?

In my experience it’s relatively rare that you need them. I think of them as the for-each of joins. It evaluates row by row, not a single time. Another analogy would be a correlated subquery.

Re: Show HN: Select Star SQL, an interactive SQL book

#96
post #7

This is gorgeous, and a great topic. No matter what field you're working in, understanding databases is extraordinarily valuable...and SQL is among the longest lasting techs I've ever learned (e.g. name another programming language that is as valuable today as it was 20 years ago, if not moreso). Even with the rise of NoSQL databases, I suspect we'll all still need to know a little SQL in another 20 years (and it was…

> name another programming language that is as valuable today as it was 20 years ago, if not moreso * C * Python * Java 20 years ago was 1998.

JavaScript is probably also more valuable than it was in 1998. Still pretty much backwards compatible, too.

Re: Show HN: Select Star SQL, an interactive SQL book

#97
post #43
post #34

Earlier quoted context omitted.

Slightly embarrassing -- but the problem may be that the site isn't compatible with FireFox (at least pre-v63 FireFox). The site makes use of custom HTML elements which are not supported by default in pre-v63 FireFox ( https://developer.mozilla.org/en-US/docs/Web/Web_Components/... ). The good news is that all you need to do is to turn on a flag as set forth in the link provided. The bad news is that many other less…

It's 2018 and we're back in 1998 where website proudly showed "Optimized for Internet Explorer".

The difference is these are standard features, albeit ones that are just coming out.

Re: Show HN: Select Star SQL, an interactive SQL book

#98
post #4

I really like your explanations. I have never been able to wrap my head around joins. You say that: "Programming is best learned by doing", but I am struggling to do anything... It would be great if there was some online area like SQL Fiddle with the data loaded, so I can run queries and see results in my browser without having to set anything up or am I missing something.

My favorite version of sqlfiddle is dbfiddle.uk. Lots of databases and generally fast.

Re: Show HN: Select Star SQL, an interactive SQL book

#99
post #7

This is gorgeous, and a great topic. No matter what field you're working in, understanding databases is extraordinarily valuable...and SQL is among the longest lasting techs I've ever learned (e.g. name another programming language that is as valuable today as it was 20 years ago, if not moreso). Even with the rise of NoSQL databases, I suspect we'll all still need to know a little SQL in another 20 years (and it was…

To your point. I learned SQL almost 30 years ago. Along Unix, vi, Perl it is a skill that I still use often. It is one of the best learning investments that I ever made.

Re: Show HN: Select Star SQL, an interactive SQL book

#100
post #46

Earlier quoted context omitted.

Can you explain when to really use a lateral join?

In Postgresql, Lateral Joins enable function chaining for set returning functions. ie you can feed the results of earlier srf function to the arguments of following function. This gets around one of Postgresql most glaring omissions - table valued parameters. Is incredibly useful once you get used to them.

I might be misunderstanding your point, but Postgresql functions can take (and return) tables:

    CREATE FUNCTION fullname(person) RETURNS TEXT AS $$
    SELECT $1.firstname || ' ' || $1.lastname
    $$ LANGUAGE SQL
Could you go into a more detail wrt using lateral joins with set returning functions? I'm used to using them as a way to "extend" the row with later terms depending on prior terms as you say, but I'm not comprehending the srf case so well (or tbh the results that pop up when I search for "posrgresql set returning function").
Post reply on HN