Slashdot Mirror


Beginning SQL?

$ynergy writes "I have been seeing more and more job listings for SQL programmers so, naturally, my interest as been sparked. I have picked up a few materials but, soon realized that it would be easier to apply if I had experience using database software. Would everyone agree? So I am looking for resources, online or in print, that would give a beginner a real in depth look at using database SW." There are at least two issues here: a) learning standard SQL (pick a standard, any standard :) and b) learning all the idiosyncracies of a particular database system. Probably learning basic SQL is the way to start.

6 of 50 comments (clear)

  1. SQL for web nerds by Pathwalker · · Score: 4, Informative

    Phillip Greenspun's book SQL for Web Nerds is a very nice introduction to SQL. It would be a good idea to grab a copy of PostgreSQL or one of those Oracle demo cds that are as common as AOL cds, and work through the exercises in it.

    Please avoid MySQL if you are just learning SQL. You'll just have to unlearn all of the workarounds for the features (such as real transactions, and referential integrity to name two) which it is missing when you move to a real database.

  2. 2 Good Sites by UnifiedTechs · · Score: 5, Informative

    My favorites are:

    www.sqlcourse.com

    www.sqlcourse2.com

    These are good beginner sites that allow you to practice through a java app.

    1. Re:2 Good Sites by wrinkledshirt · · Score: 2, Informative

      I second the recommendation of these two sites. Great quick guides to the syntax.

      Another good way to learn SQL (don't laugh) is to practice using Access databases queries. You can design the query visually, and then switch views into SQL view to see what code you end up with. There's some inevitable mangling that goes on, but I regularly do this when I've got several tables and I can't remember where the brackets need to go for all those inner joins. I'm sure others offer this ability too, but if they don't, at least you have that one.

      There are a few free database engines out there that have command line interfaces, so that'll force you to learn the language.

      Also, if you're hoping to get into SQL in general, learn it for two different engines. That'll give you some idea of what to prepare for, since invariably every SQL implementation is a little bit different (the way they handle strings, escape characters or wildcards, or certain features available in one that aren't SQL-compliant, etc.).

      Finally, if you're hoping to learn an API with it, get into PHP. It has very clean interfaces with several different databases.

      --

      --------
      Bleah! Heh heh heh... BLEAH BLEAH!!! Ha ha ha ha...

  3. Re:I learned by cymen · · Score: 4, Informative

    Well that is kinda why people flame MySQL so much (*). In PostgreSQL and Oracle you have triggers and things like pl/sql and much more that I don't know about. Basically you can put a lot of the business logic in the database and use features that tie records together and protect against accidental deletions. Basically imagine another layer that handles a lot of checks and balances that free you from having to do the same in your perl/php/tcl/whatever code.

    That's why I have learned so far...

    * Plus of course ACID and all that other stuff that some people really love to argue about.

  4. Re:Size by rtaylor · · Score: 3, Informative

    Load a billion records into your MySQL database through 20 tables, then do random 10 table joins. Thats why.

    Postgresql doesn't do quite as well as Oracle (much much smaller gap now though) but it has a smaller starting size.

    --
    Rod Taylor
  5. Great SQL book for DB2 by Anonymous Coward · · Score: 1, Informative

    There is an amazing SQL book by Graeme Birchall called DB2 SQL Cookbook, downloadable as an PDF. It contains all the funky stuff you can do with SQL on DB2. DB2 is pretty close to the ANSI SQL standard so a most of the stuff should work on other databases as well... The url is: "http://ourworld.compuserve.com/homepages/Graeme_B irchall/HTM_COOK.HTM