I went to Stanford! Okay, not really. But I did take their database MOOC.
MOOC? What's a MOOC? A MOOC is a Massive Open Online Course. There were tens of thousands of people from all over the world taking this course online at the same time! It was a fantastic experience! Congratulations to Professor Widom, Garrett the T/A, and everyone at Class2Go. Everything was really well done! And it was fun! It was a lot of work--- much more than I had anticipated--- but it really was fun.
You can do all of the exercises online in your web browser if you like, but you probably want to do some stuff locally. Here are some of the things I used on my Ubuntu Linux machine.
XMLYou may have used the xmllint command to pretty-print before. It also checks syntax and semantics (both DTD and XML Schema) for you.
You probably have an xpath command already, but the syntax is a little different from that used in the course. You are probably going to want to use SaxonB for XQuery and XSLT, so you might as well use it for XPath as well
sudo apt-get install libsaxonb-java
This gives you saxonb-xquery and saxonb-xslt commands. You can use saxonb-xquery for plain old XPath commands too and the syntax will be the same as theirs. That way you can work out the solution to an exercise locally and paste your answer as is into your browser.
JSONSimilar to xmllint for XML, there is a jsonlint command to pretty-print JSON. It also checks syntax, but offers no help with semantics (it knows nothing of JSON Schema). It's pretty easy to gin something up in Perl, Python or Ruby, though.
cpanm JSON::Schema pip install jsonschema gem install json-schema
Here is a Python script I wrote that just croaks with a stack trace if anything is wrong. This allowed me to work out the solution to an exercise locally and then paste the answer into my browser, just as with the XML exercises.
Relational AlgebraThe online exercises and quizzes use RA: A Relational Algebra Interpreter. You can install your own local copy with
$ git clone git://github.com/junyang/RA.git $ tar xf ra-2.1b.tgz $ alias ra='java -jar ~/ra/ra-2.1b/ra.jar' $ ra
There is no support for division. We must use this ugly identity instead
α ÷ β = π{A − B}(α) − π{A − B}((π{A − B}(α) × β) − α)
This is perhaps the weakest part of the course. There seems to be a decades-old tradition of teaching relational division poorly and blaming the student for not learning it. "I had to figure it out on my own, so you should too." I checked a number of books and countless online resources, but good explanations were scarce. I finally worked out what to do using this presentation (PDF). Relational division is a hard enough concept to begin with. Throwing in that identity (with repeated phrases, which RA also makes no allowance for) and the whole thing is nigh impenetrable.
SQL
This course discusses all three of the major open-source relational databases (MySQL, PostgreSQL, and SQLite), but most of the on-line exercises are done with SQLite as the back end, so you might as well practice with sqlite3 most of the time.
By the way, if you're doing SQL right after relational algebra, I think they've buried the lead. The basic SQL SELECT statement
SELECT A1, ..., An FROM R1, ..., Rm WHERE condition
is equivalent to the following in RA
\project_{A1,...,An} (\select_{condition}(R1 x ...x Rn))
That is, SELECT doesn't correspond to \select! She mentions that in the video, but just sort of off-handedly...it's easy to miss.
NoSQL
There was a nice explanation of NoSQL at the very end of the course, but no exercises or anything. It might have been nice to try a few examples with MongoDB or something. It was repeatedly pointed out that the information in this whole section was volatile, so maybe it would be just too hard to keep up-to-date examples.
Recent Comments