Better Living Through Queries
March 1, 2012 1:54 PM   Subscribe

Help me help myself- Please recommend books or websites that will help me to better understand SQL.

I'm a learn-through-projects kind of person. My personal project of the week is playing around with the Lahman Baseball Database in MS Access. I'm a novice, but not a complete beginner. All of my simple queries are working out fine, but now that I'm beginning to write queries that calculate complex stats using multiple JOINs (is that bad?), I'm getting all kinds of screwy results.

I'd like to get a solid understanding of JOINS, nested JOINS, subqueries, etc. All of the examples I have found on the internet are either so simple that I don't think they'll scale or too complex and without good explanations.

Also, I am sticking with Access. It's what I have. I realize it's not great.

So, SQL guru's and DIY'ers, what are your recommendations?
posted by bluejayway to Computers & Internet (11 answers total) 32 users marked this as a favorite
 
Best answer: Try Galaxql. It is a tutorial that lets you control a galaxy of something like 20000 stars with randomized planets and moons...
I always get stuck somewhere around question 14 I think....but it's fun and informative at the same time. :)
posted by AltReality at 2:06 PM on March 1, 2012 [13 favorites]


Stack Overflow has hundreds of questions and some very detailed answers about SQL in general and joins in particular.
posted by Currer Belfry at 2:17 PM on March 1, 2012


I went to my local library and checked out "SQL Weekend Crash Course". Several of the hours took less than the proscribed hour.
posted by Mad_Carew at 3:09 PM on March 1, 2012


So, SQL guru's and DIY'ers, what are your recommendations?

I know you said you're using access, but if you're just using it because that's what you've got, you can download MYSQL for free. The manual is great and has tons of examples.

Access makes me want to break things just looking at it, but I love working in MySql.
posted by empath at 3:29 PM on March 1, 2012 [1 favorite]


Access SQL is actually pretty close to ANSI standard SQL. There are some differences, but that's true for every dialect. The deficiencies of Access as a database solution mostly have to do with it being a file-based database, which handles concurrent connections poorly. It also is not ACID compliant, and doesn't have triggers, but this won't hurt you in learning the basics of joins, aggregate queries, etc. It's actually, in my opinion, not a bad way at all to get started in SQL, provided that you actually write queries in the SQL view, rather than stick to the query designer interface. If you want to do serious work in the field, you'll want to move on to working with MySQL or Oracle or Postgres, however.

This book has a good introductory discussion of nulls, joins, subqueries, and so on, in the context of Access.
posted by thelonius at 3:34 PM on March 1, 2012 [1 favorite]


Stanford's Database Class (free online!) looks like a great intro - I haven't gotten very far (yet), but the first or second video jumps right into joins and it's really helpful to have someone talk through the logic as they're constructing the query.
posted by ella wren at 3:52 PM on March 1, 2012 [1 favorite]


N'thing GalaXQL.

Also, you might be interested in this thread.
posted by tinymegalo at 4:29 PM on March 1, 2012


Seconding Galaxql. Reminds me of the Mefi post I wrote about it a long time ago...
posted by Blazecock Pileon at 5:00 PM on March 1, 2012


This publishing Co. seems to have some very up-to-date books available and they have a sale on at the moment.

http://www.packtpub.com/books/all?keys=sql
posted by jacobean at 5:02 PM on March 1, 2012


Another vote for Galaxql.
posted by estherbester at 8:04 PM on March 1, 2012


Since you're familiar with Access already.. If you can handle the grar factor that comes with installing (it's a struggle to get started), you can use Access as a front-end with SQL Server Express (freeee) as a back-end. I believe you write T-SQL using the Access user interface... best of both worlds. Not for the faint of heart, but Access as a back-end lets you get away with too many SQL no-nos.
posted by Yowser at 8:55 PM on March 1, 2012


« Older Does Buying a Nice Toilet Make Sense when...   |   Help identify the origins of this neon sign! Newer »
This thread is closed to new comments.