Introductory book on T-SQL

  • Hi all

    I'd be very pleased if you could give me recommendations for an introductory book on SQL for a colleague who's just learning to move beyond simple select statements.

    I have been recommended 'Sams Teach Yourself SQL in 10 Minutes', but it's use of non-ANSI 92 joins upsets me!

    So a good book, ANSI-92 compliant, would be just the job.

    Thanks

    Jonathan

  • If you want strictly ANSI 92 compliant stuff, there's no need for a book on T-SQL...

    Try http://www.w3schools.com

    For the record, if you're one of those folks that insists on writing everything so it's "portable", try figuring out how to make SYSDate from Oracle portable without writing a hack.  Same goes for returning a date with no time and a whole bunch more.  ANSI-92 is fine for a lot but if you trully want to write some high performance code, then you need to use the non-ANSI extensions that every RDBMS has.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • I recommend (Philip) Pratt's "A Guide to SQL".  I used it for db classes I taught and thought it was excellent for students.

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • Many thanks for the response Scott - I'll take a look at the Pratt book, though it seems to be Oracle-based whereas for this purpose I'm looking at SQL Server.

    Jeff - I'm not that concerned by portability of code, but the 'Sams Teach Yourself SQL in 10 Minutes' book did not use ANSI-92 style joins at all, but rather put the criteria in the where clause which I find significantly less clear.

    Any other suggestions?

    Thanks

    Jonathan

  • Ah... I get it.  The W3Schools website does have both "equi-joins" (joins in the WHERE Clause) and ANSI Joins (INNER JOIN, LEFT OUTER, RIGHT OUTER, FULL OUTER, CROSS, etc) with some examples... I'm not 100% sure but I believe all of their SQL teachings and examples are ANSI-92.

    Additionally, the SQL Server Books Online has examples of both types of joins.  Neither type of join is paculiar to just T-SQL.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply