
Learn SQL Interactively on Khan Academy - pamelafox
http://cs-blog.khanacademy.org/2015/05/just-released-full-introductory-sql.html
======
rhc2104
This is great!

I created [http://sqlteaching.com](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

~~~
tsumnia
I love your site and plan to use it as a teaching tool for my Wed Development
course I'm teaching.

As a request, are you working on a user system to record completed lessons? As
an extension, are you looking into making a classroom management system akin
to Codecademy? I'd love to create a classroom, have students log in, complete
the necessary lessons and have the means to know where they are in the overall
plan.

If you'd like some help getting that going, let me know! I'm in the process of
developing typing exercises for my courses to give students extra practice
with the basics.

~~~
rhc2104
Hi tsumnia,

Thanks for the feedback! One nice thing about SQL Teaching is that it is
_completely client-side_. This is possible because somebody compiled SQLite to
JavaScript:
[https://github.com/kripken/sql.js/](https://github.com/kripken/sql.js/)

Thus, I would have a bias against adding a classroom management system which
would require some kind of backend database that I would need to keep running
(funny, I know).

However, SQL Teaching is open source
[https://github.com/rhc2104/sqlteaching](https://github.com/rhc2104/sqlteaching)
, so I would update the site if you were to add the feature, or you could just
take the JavaScript files and integrate it into your site!

~~~
tsumnia
Not funny at all! Its something that I am toying with on my end as well. I'll
have to play with it this summer and let you know if I get anything rolling!

------
kremlin
I'm doing the course, as it's something I haven't learned in depth yet.

They mentioned pronunciation : 'S-Q-L' vs 'sequel'. I've always pronounced it
S-Q-L. The lecturer implies there's no right answer, that 'sequel' is
historical but 'S-Q-L' is preferred for international use.

The annoying thing, though, is that in writing a choice has to be made. If
someone pronounces it 'S-Q-L' then to read 'a SQL query' is weird -- it should
say 'an SQL query'. And vice versa for someone who pronounces it 'sequel'. 'an
sequel query' isn't right.

So, in writing, what is correct? 'An sql query' or 'a sql query'?

~~~
themartorana
This is a question for English.StackExchange.

[http://english.stackexchange.com/questions/5265/an-sql-
serve...](http://english.stackexchange.com/questions/5265/an-sql-server-
database-schema-or-a-sql-server-database-schema)

[http://english.stackexchange.com/questions/1016/do-you-
use-a...](http://english.stackexchange.com/questions/1016/do-you-use-a-or-an-
before-acronyms)

That said... As a native English speaker, I can infer your pronunciation from
which of the options of "a" and "an" you decide to use.

FWIW, "an" is appropriate for any word starting with a vowel sound (whether or
not it _actually_ starts with a vowel) and inappropriate for any word that
doesn't. "An historic" drives me nuts, but I'm one of _those_ jerks. (My
mother was an English teacher - I never stood an chance!)

~~~
oalders
On some level, I think you can still apply the "starts with a vowel" rule for
SQL, since in this case "S" is really standing in for "ess" (assuming you're
not saying "sequel", which I've never gotten into the habit of doing).

~~~
themartorana
Yes - exactly my point. It _is_ interesting to learn, as another commented
somewhere in this thread, that my brain just invokes the appropriate "sequel"
vs. S.Q.L. just from whether or not someone includes the ever-so-important
"n."

~~~
kremlin
It's not automatic for me, which is why I found it annoying enough to ask. If
a writer writes 'an SQL query', that doesn't bother me at all, but if a writer
writes 'a SQL query', it takes me a while before I start hearing it in my head
as 'a sequel query' \-- until then, it just sounds wrong.

Worse is that some writers seem to mix it up, use both periodically.

------
aprdm
This was posted sometime ago and I really enjoyed :
[http://sqlbolt.com/?rp](http://sqlbolt.com/?rp) I will definitely check out
Khan's academy course as well!

~~~
pbreit
I like that SQLBolt starts with querying (Khan does not). Even though a
logical proceeding would start with CREATE and INSERT, many/most people will
probably never do anything more than SELECT.

------
ivan_ah
Wow, KA hits another one in the outfield!

The audio that highlights part of the code is awesome (much better than
watching a passive video), and the fact that everything can be executed in
real time is awesome. Good job!

~~~
pamelafox
Thanks! That environment is all open source, if you're ever looking for some
OSS bugs to tackle :-)

[https://github.com/Khan/live-editor](https://github.com/Khan/live-editor)

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

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

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

------
AlisdairO
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](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.

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

~~~
AlisdairO
That's very kind of you - thanks!

------
jeffdavis
This is great... but I am torn because, as someone who has spent a lot of time
with databases, I feel like there are many mistakes that can lead to
confusion.

First, it's not teaching standard SQL, it appears to be teaching MySQL. That
means any user who tries out any other system will immediately run into
confusing error messages about the double quotes. Not ideal, and totally
unnecessary -- sticking to standard SQL should work reasonably well in MySQL
anyway (at the beginner level, at least).

Second, in the section "Creating Tables and Inserting Data", the teacher jumps
into surrogate keys immediately. Again, I feel that is unnecessary and will
just lead to confusion. The beauty of a relational database is that it
connects with the real world; and having arbitrary numbers floating around
destroys that beauty.

I really hate to criticize, because I really support the effort. Hopefully my
feedback is useful.

~~~
rhc2104
Khan Academy is using SQLite (because there is a JavaScript version of it)

~~~
jeffdavis
Can't they use the standard single quotes then?

~~~
Sammi
[https://www.sqlite.org/lang_keywords.html](https://www.sqlite.org/lang_keywords.html)

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

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

~~~
threeseed
Big Data Developers can use Spark, Cascdading or Pig to do pretty advanced
data warehouse, analytics, ETL tasks. Web app developers accessing databases
can use an ORM e.g. Hibernate to abstract away the SQL layer or use JSON to
query MongoDB, CouchDB etc.

You could write every application under the sun without knowing a single bit
of SQL.

~~~
parasubvert
One can't seriously use an ORM without knowing SQL, because they all come with
their own proprietary incomplete wrapper language (HQL, etc.). ORM simplicity
breaks down the moment you push them even slightly hard.

Big data analytics is increasingly done with Hive's SQL dialect, or Impala, or
Hawq. Beyond all of these, relational data modelling is an essential skill for
anyone building server side applications if you have to deal with information
management, whether you use SQL or not.

------
graycat
So far my experience is that getting a SQL query correct is fairly easy and
usually fun but that the real difficulty, e.g., for SQL Server, is for the
rest:

(1) Installation.

Grim. Barbed wire enema.

Wiped out my Windows boot partition requiring that I reinstall everything
starting with the Windows DVD.

(2) Security.

The stuff with _users_ , _logins_ , etc. and nearly everything in SQL Server
Management Studio was clear as mud. In the end:

(A) Assume that basically what is there is essentially old _capabilities_ and
_access control lists_ , imagine how they might work, and make that a first
guess. It helped.

(B) Use SQL Server Management Studio only for passively reading but never for
actual _management_ where change things.

(C) For each of the important steps in setting up security, do searches on the
Internet, find standard text SQL statements, and try those. Save and profusely
document the statements that do work.

(D) Do _system management_ only with SQL statements in simple text files and
executed with the SQL Server command line utility SQLCMD.EXE.

(3) Connection String.

The last time I had to get a SQL Server connection string to work took a solid
week of throwing things against a wall to see if they would stick. The effort
was an unanesthetized upper molar root canal procedure.

~~~
jndsn402
If you want to get an understanding of basic SQL without all that overhead,
you can try Microsoft Access.

~~~
ufmace
Oh god, no more Access. Access has a weird semi-dialect of SQL where it's
insanely picky about how you position parenthesis in multiple join statements.
I found it impossible to get a query right without the graphical query
generator, and that's after routinely writing 5-10 table joins in T-SQL. No
thanks, I'd recommend Sqlite over it anyday for a lightweight database. Works
great on command line or in any of dozens of helper tools on any platform, and
it's Free.

~~~
marvel_boy
I agree with the SQLlite recommendation.

------
dannyp32
Does anyone know of a good data modeling course like this? I understand SQL,
but I think I could still improve at data modeling.

~~~
capkutay
Try Jennifer Widom's online course on databases:

[https://lagunita.stanford.edu/courses/Engineering/db/2014_1/...](https://lagunita.stanford.edu/courses/Engineering/db/2014_1/about)

------
foxwoods
It reminds me of the interactive SQL tutorial GalaXQL.

[GalaXQL]([http://sol.gfxile.net/galaxql.html](http://sol.gfxile.net/galaxql.html))

------
zachgalant
We also have an interactive online SQL course at CodeHS (completely client
side as well). You can check it out at
[https://codehs.com/sql](https://codehs.com/sql) or try out the first hour
free at [https://codehs.com/hoc](https://codehs.com/hoc)

------
SQL2219
very nice. and if you're looking for a sql job, check this out, still in beta:

[http://www.jobdensity.com/QueryGrid.aspx?q=661&t=sql&qt=5/11...](http://www.jobdensity.com/QueryGrid.aspx?q=661&t=sql&qt=5/11/2015%207:41:56%20PM)

------
marvel_boy
Could somebody confirm that SQLite is used to the course? By the way, this
seems great!

~~~
pamelafox
Yep, confirmed. Here's a blog post by Brian who implemented the SQLite support
in our editor: [http://www.brianbondy.com/blog/id/168/sql-on-khan-academy-
en...](http://www.brianbondy.com/blog/id/168/sql-on-khan-academy-enabled-by-
sqlite-sqljs-asmjs-and-emscripten/)

~~~
marvel_boy
Thanks pamelafox

