Hacker News new | past | comments | ask | show | jobs | submit login

If you use Firefox or a similar program that makes use of SQLite, that would be the best place to start -- you'll get experience working with a database populated with real data that is relevant to you, and one that has been designed for practical use instead of just a book example.

Copy ~/.mozilla/firefox/<profile_name>/*.sqlite into another directory and start playing with those files. It should be easy to come up with things you want to find out. Start with some basic single-table ones like 'what are my 10 most visited pages'. Then expand to use multiple tables ('what are my 10 most visited pages that I have not bookmarked').

Once you have an idea of how queries work, think about the database design and the decisions that led to it -- why did the developers choose to relate tables to each other that way? What kinds of queries are the indexes there to optimize for?

Once you've done this, rinse and repeat with a variety of programs so you can get multiple perspectives. http://www.sqlite.org/famous.html or google around for others.




SQLite is such a beautiful program. It doesn't do much, but what it does do, it does very well. If I need to analyze some data, say in a logfile, I'll often write a trivial bit of Python to load it into SQLite and do my work in SQL. For a few 10s of Gs of data, this works brilliantly. I'd go so far as to say it's the least-buggy program I use day to day, and that includes the OSs I run it on and "real" commercial databases.


Yep I like to think of sqlite as being to relational databases as memcache is to caches. Both are super simple and straightforward, with a minimum of moving parts, and yet does something really well. You can start with each, and then later evolve into something more featureful. But often you'll not need to!


Re: SQLIte, OReilly is coming out with a new book, Using SQLite, in August. It's not clear to me how much of an introduction it offers to SQL (versus SQLite specifics), but I'm guessing there's some introductory material in there as well.

http://oreilly.com/catalog/9780596521196/


Michael Owens's _The Definitive Guide to SQLite_ is good, too. It's a couple years old, but provides a good overview of both SQLite (standalone, its C API, and a couple wrappers) and the relational model. SQLite's biggest change since its publication is that it now has optional foreign key (http://www.sqlite.org/foreignkeys.html) support.

If you want a more academic treatment, I would recommend C. J. Date's _An Introduction to Database Systems_.

Also, it's been my experience that books which claim to cover relational databases in general, but which actually assume MySQL throughout, are usually pretty bad.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: