Live data from Hacker News

Learn SQL Interactively on Khan Academy

cs-blog.khanacademy.org

81–89 of 89 posts

Re: Learn SQL Interactively on Khan Academy

#81
post #2

This is great! I created http://sqlteaching.com , so it's wonderful to see Khan Academy's take. If anyone from KA would like to chat with me about SQL tutorials or anything else in general, feel free to reach out- rhc2104@columbia.edu

Hey. Thanks for this, it's absolutely fantastic. Been using SQL for a while now but never got the hang of joins and could never find an easy guide for them. This was the simplest explanation I could find.

Some people find graphics like this helpful for conceptualizing them :

http://www.codeproject.com/KB/database/Visual_SQL_Joins/Visu...

Re: Learn SQL Interactively on Khan Academy

#82

Earlier quoted context omitted.

In today's world you could probably be powerful using the NoSQL databases. But , imho, you will still have to understand the basics of set theory. Unions, intersects, etc. But I agree with the spirit of what you're saying. A good programmer will know SQL. It's definitely not going away anytime soon.

SQL has almost no practical overlap with set theory. Relational calculus, and relational algebra, sure, but SQL neither operates on nor produces sets.

SELECT column_1 FROM Strings_1 UNION SELECT column_1 FROM Strings_2

Is this set theory? A UNION of two sets? Oh I see your pedantic argument. They aren't sets because they are ordered, they are lists.

If I can't explain how UNIONS and INTERSECTS are relevant to SQL to you then I can't help you because you're simply being difficult. It has every practical application to SQL.

Re: Learn SQL Interactively on Khan Academy

#83
post #10

Imo every developer should be comfortable with sql, upto joins at least. Basic data modelling is also invaluable.

Serious question...what kind of developer can you be without knowing SQL?

As a game developer, I have a bunch of very talented programmers in my office, and afaik I know the most SQL in the office, which isn't much.

Re: Learn SQL Interactively on Khan Academy

#84
post #78

Earlier quoted context omitted.

Is the recording and playback of course content part open sourced somewhere?

The recording part is there as well, in particular https://github.com/Khan/live-editor/blob/master/js/ui/record... These slides give a little high level overview of that: https://speakerdeck.com/pamelafox/teaching-programming-onlin... (slide 26)

That's great, thanks for pointing in the right direction, and great job btw!

Re: Learn SQL Interactively on Khan Academy

#85

It's great to see KA getting involved in teaching SQL - I really think there's too little SQL literacy out there amongst devs in general. I created http://pgexercises.com a while back, which goes up to some relatively tougher exercises. I'd be very happy to help out with KA's effort if it would be useful. Email is in my profile.

Oh, nice! I'll add that to our final article in the course, for folks that want to learn PostGres. I'm hoping this course is a starting off point for people, and they can get more advanced with non-KA resources.

That's very kind of you - thanks!

Re: Learn SQL Interactively on Khan Academy

#86

Earlier quoted context omitted.

SQL has almost no practical overlap with set theory. Relational calculus, and relational algebra, sure, but SQL neither operates on nor produces sets.

SELECT column_1 FROM Strings_1 UNION SELECT column_1 FROM Strings_2 Is this set theory? A UNION of two sets? Oh I see your pedantic argument. They aren't sets because they are ordered, they are lists. If I can't explain how UNIONS and INTERSECTS are relevant to SQL to you then I can't help you because you're simply being difficult. It has every practical application to SQL.

    > They aren't sets because they are ordered, they are
    > lists.
Half correct - the other reason the results aren't sets are because they are also able to return duplicates, as evidenced by UNION ALL and INTERSECT ALL.

Were I being pedantic, I would turn to the (horrifyingly inconsistently written) SQL1992 standard, which explicitly says that your columnar inputs are multisets (which is a posh way of saying "not a set").

Coming back to your original assertion:

    >> you will still have to understand the basics of set
    >> theory. Unions, intersects
In 15 years of software development, open-source and commercial, mostly with databases, I've only used UNION, INTERSECT, and EXCEPT in SQL when doing academic homework, translating from relational algebra and relational calculus. I note the world's most popular open-source database doesn't support INTERSECT.

But most people don't write SQL by hand any more, they use an ORM - most of which have scant support for UNION, INTERSECT, and EXCEPT, because they are obvious vestigial details left over from archaic database theory. I have resisted the temptation to become actually pedantic by discussing the SQL treatment of NULLs.

This constitutes "almost no practical overlap".

But look, here's the meat: Fundamentally, sets are distinguished from other list-like data types by having no ordering, and having no repetition. Practical SQL usage requires you to understand that you will have duplicates, that you may well need to aggregate those duplicates somehow, and that order matters.

Re: Learn SQL Interactively on Khan Academy

#87

Earlier quoted context omitted.

SELECT column_1 FROM Strings_1 UNION SELECT column_1 FROM Strings_2 Is this set theory? A UNION of two sets? Oh I see your pedantic argument. They aren't sets because they are ordered, they are lists. If I can't explain how UNIONS and INTERSECTS are relevant to SQL to you then I can't help you because you're simply being difficult. It has every practical application to SQL.

> They aren't sets because they are ordered, they are > lists. Half correct - the other reason the results aren't sets are because they are also able to return duplicates, as evidenced by UNION ALL and INTERSECT ALL. Were I being pedantic, I would turn to the (horrifyingly inconsistently written) SQL1992 standard, which explicitly says that your columnar inputs are multisets (which is a posh way of saying "not a set"…

That's a nicely crafted response. Allow me to retort: http://lmgtfy.com/?q=set+theory+and+sql

Huh, I guess others think like I do.. I guess we're all morons. Shrugs.

Re: Learn SQL Interactively on Khan Academy

#88

Earlier quoted context omitted.

> They aren't sets because they are ordered, they are > lists. Half correct - the other reason the results aren't sets are because they are also able to return duplicates, as evidenced by UNION ALL and INTERSECT ALL. Were I being pedantic, I would turn to the (horrifyingly inconsistently written) SQL1992 standard, which explicitly says that your columnar inputs are multisets (which is a posh way of saying "not a set"…

That's a nicely crafted response. Allow me to retort: http://lmgtfy.com/?q=set+theory+and+sql Huh, I guess others think like I do.. I guess we're all morons. Shrugs .

    > Huh, I guess others think like I do..
There is absolutely no safety in numbers:

http://lmgtfy.com/?q=columbus+discovered+america

http://lmgtfy.com/?q=aspartame+dangerous

http://lmgtfy.com/?q=indigo+children

    > I guess we're all morons
Maybe, but it's more likely you're just wrong.

Re: Learn SQL Interactively on Khan Academy

#89

Earlier quoted context omitted.

That's a nicely crafted response. Allow me to retort: http://lmgtfy.com/?q=set+theory+and+sql Huh, I guess others think like I do.. I guess we're all morons. Shrugs .

> Huh, I guess others think like I do.. There is absolutely no safety in numbers: http://lmgtfy.com/?q=columbus+discovered+america http://lmgtfy.com/?q=aspartame+dangerous http://lmgtfy.com/?q=indigo+children > I guess we're all morons Maybe, but it's more likely you're just wrong.

I'm not exactly sure why you're so opposed to the idea, but okay. You've won. I will never ever say SQL relates to sets. Thanks!
Post reply on HN