Slashdot Mirror


SQL Fundamentals

Slashdot's own Robo takes a look at SQL Fundamentals, writing "This beginner book takes a traditional look at the ever-popular Structured Query Language. Never bothered to learn SQL? Here's your chance. SQL Fundamentals, by John Patrick, takes a 834-page beginners look at the application of SQL to Access and Oracle. Read more for SQL Fundamentals' strengths, weaknesses and everything in-between." SQL Fundamentals author John Patrick pages 800 publisher Pearson Education rating 7 reviewer Rob ("robo") Oostendorp ISBN 0130669474 summary Truly a beginner friendly book for anyone needing a crash course in the basics of SQL; of limited but real use to those who already are familiar with SQL.

This beginner book takes a traditional look at the ever-popular Structured Query Language. Never bothered to learn SQL? Here's your chance. SQL Fundamentals, by John Patrick, takes the first layer of SQL in Access and Oracle [robo, I find this a confusing phrase, not sure how best to recast, but somehow] and sums it up in this 834-page manual. Read more for SQL Fundamental's strengths, weaknesses and everything in-between.

The Basics SQL Fundamentals discusses the practical realities of extracting information from a database. Patrick shows the reader how to use SQL in both Oracle and Access. The book starts with a brief overview of the roots of SQL and relational databases; after this introduction, the book covers select statements and the basics of a query. Each chapter builds on the next, and the book follows a simple progression, adding complexity as it goes along.

This book is a very easy read -- it flows much better than a textbook, yet still conveys the information it promises. However, it's definitely for newcomers to SQL. So, if you have any experience in SQL this would not be the best choice. (Chapter 1 explains the concepts of a cell, row, column, and table, which might be enough to let you decide if this book is at the right level for you.) Throughout the book, the author relies on applying each newly introduced concept to a single relational database example. This hypothetical database (a table of employees trying to calculate their meal credits) makes the book feel consistent, and helps eliminate confusion about where the example information comes from, but it's also limiting for readers who want a broader range of examples.

One of the greatest strengths of this book is its wealth of code examples and accompanying tables. In contrast to many other manuals, this book illustrates queries along with their effects on the tables. Other SQL books (ones I consider going up to "layer 2" SQL) have many example queries, but some of them fail to show any sort of results from their example tables. Also, much of the code in SQL Fundamentals is well documented, with footnotes explaining any changes that occurred.

Caution: Beginner Book The book is called SQL Fundamentals. However, in this case, the fundamentals are only as they apply to the Oracle and Access databases. It mentions the existence of other distributions at the beginning of the book: "Oracle, Access, DB2, MS SQL, Informix, SQL Windows, Sybase, SAS sql procedure, FoxPro, dBase, Tandem SQL, MySQL, SQLBase, Cold Fusion, SAP, Business Objects, ODBC, Ingres, Ocelot SQL, OsloData, PostgreSQL, Rapid SQL, XDB, SQL/DS, Mini SQL, Empress, Interbase, Progress, Supra, SQL Report Writer, Paradox, Delphi, VAX SQL, Essbase, Beagle SQL, GNU SQL Server, Just Logic/SQL, PrimeBase, Altera SQL Server, DataScope, and PowerBuilder." However, Patrick never speaks of them again; perhaps he should re-title this book SQL Fundamentals: Applied to Oracle and Access? Readers considering this book should keep this in mind. The book explains things well, but the book's overall logic is geared toward those using one of those databases, and the examples are relevant only in that context.

I primarily use MySQL and Progress, so a book explaining SQL fundamentals applied to Access and Oracle isn't going to help me unless I specifically take on projects which use these particular databases. Also, The book often goes into unneeded repetition of subjects: for instance, the first 150 pages are all about select statements. I've never seen so many select statements picking apart one table. I personally think it would benefit from being trimmed down, and leaving further study to the reader.

The Plug I would recommend this book to a newcomer to SQL. It covers the fundamentals just like it claims. After finishing this book, you will have a grasp on things ranging from the most basic select statements to unions, self joins, & cross-joins.

Something to consider might be what SQL database you will be working with. If you'll be working with either Oracle or Access this book will be helpful. If not, I suggest looking at things like Managing Using MySQL by O'Reilly.

Finally, from the text comes this concise answer to the question "Who Should Read This Book?"

Everyone with an interest in getting information from a database can read this book. It can be a first book about databases for people who are new to the subject. You do not need to be a computer programmer. The discussion begins at the beginning and it does not assume any prior knowledge about databases.

That seems like a fair summary; with the caveats already mentioned, I can recommend it for newcomers to SQL looking for a thorough but not patronizing introduction.

You can purchase SQL Fundamentals from bn.com. Slashdot welcomes readers' book reviews -- to see your own review here, read the book review guidelines, then visit the submission page.

215 comments

  1. Anyone Know? by laeraun2 · · Score: 3, Funny

    When the SQL to this book will be out? Har de har har har.

    --
    Error: Erection reset by beer.
    1. Re:Anyone Know? by Bi0h4z4rD · · Score: 1

      Most likely when they're able to provide information on using SQL against a real database.

      I'd take IBM or Sybase over these two any day! (Note: I am a Sybase employee)

      --

      Don't do today what you can put off until tomorrow. You'll most likely find a better way to do it!

    2. Re:Anyone Know? by Anonymous Coward · · Score: 0

      Sybase is close to the bottom of its death spiral.

    3. Re:Anyone Know? by Anonymous Coward · · Score: 1, Informative

      It is pronounced Es-Que-eL.
      I am serious, that is how it is REALLY pronounced. I have also noticed that most of the people from the Windows world incorrectly refer to it as Sequel, while most people from the *nix world refer to its proper name Es-Que-eL.
      Not that its all that big a deal or anything it is just aa trend that I have noticed.

  2. Sounds like a good read. by natron+2.0 · · Score: 1

    This books sounds like a good read for those of us who know nothing about SQL databases. I am always up for learning new code and systems. I still consider myself a newbie on many computer topics so books like these always seem to help out.

    1. Re:Sounds like a good read. by sphealey · · Score: 2
      A Visual Introduction to SQL by Chappell et. al. is another excellent introduction to the topic.

      sPh

  3. 834 pages?! by FyRE666 · · Score: 4, Insightful

    How big is the typeface? I mean, come on, it's not that big a language after all and you could easily fit the basics into 50 pages at most...

    1. Re:834 pages?! by frunch · · Score: 1

      834 pages would be a TON for ANSI-standard SQL, given that there are a lot of things left out of that language (it doesn't even have a method for if-then-elses). I'd say a good intro to ANSI-standard SQL could probably be done in 30 pages. But I could easily see dedicating 100 pages to the extensions provided by each of the major database vendors (MS SQL Server, Sybase ASE, Oracle, etc.)

    2. Re:834 pages?! by micromoog · · Score: 5, Insightful
      Not having seen the book, I'm assuming much of it is dedicated to relational database concepts, explained via SQL. 834 pages is about right for an introduction. "Real" relational database design is a lot more complicated than most people (programmers particularly) realize.

      You could list and explain all of the syntax for C++ in just a few pages, but I wouldn't call you a C++ programmer after reading it.

    3. Re:834 pages?! by Abcd1234 · · Score: 3, Informative

      Just a note, the whole point of SQL is that it's a *declarative* language. The addition of an if-then-else construct completely breaks that model, producing something which is sort-of-but-not-quite procedural. ie, PL-SQL and similar variants. So, no, of course ANSI SQL doesn't have an if-then-else construct... it was never meant to!

    4. Re:834 pages?! by sphealey · · Score: 5, Insightful
      I'd say a good intro to ANSI-standard SQL could probably be done in 30 pages.
      SQL is like chess: 1 hour to learn. 8-12 hours to figure out how to play. 5000 hours to determine whether or not you actually understand it.

      Don't get me wrong - you can do useful work in SQL with 20-30 hours of practice. But if you think that SQL can be taught in 30 pages you do not understand it.

      sPh

    5. Re:834 pages?! by Usquebaugh · · Score: 3, Insightful

      Rubbish, chess is a very poor analogy for SQL.

      SQL is a tool to interrogate RDBMS. For most IT people it takes a couple of hours to get to grips with basics of select, update etc Joins, sub queries come next.

      You can do useful work in one hour of tuition. We have users using SQL after maybe two hours. 20-30 hours of practice, what the hell are you trying to do?

    6. Re:834 pages?! by OneEyedApe · · Score: 1

      Perhaps a better analogy would be GNU Emacs. It took me under an hour to learn the basic editing, but there is far more to learn that could take hundreds of hours.

      --
      Life sucks, but death doesn't put out at all....
      --Thomas J. Kopp
    7. Re:834 pages?! by lostboy2 · · Score: 2, Insightful

      IMHO, comparing learning SQL (or m/any technical subjects) to learning chess is a good analogy:

      For most IT people it takes a couple of hours to get to grips with basics of select, update etc
      This coincides with the sphealey's "1 hour to learn"

      Joins, sub queries come next.
      This seems to fit with "8-12 hours to figure out how to play".

      The "5000 hours to determine whether or not you actually understand it" may be an exaggeration, but the point is that the nuances take a long time to master.

      "you can do useful work in SQL with 20-30 hours of practice" sounds like a ballpark figure to me, but seems reasonable. "useful work" might be a bad choice of words, but I think the point is valid.

      In my opinion, it's like the difference between someone who knows how to follow a recipe and someone who knows how to cook: after a couple of hours, one could be trained to follow recipes -- but it takes longer than that (and a lot of hands-on experience) in order to be a good cook.

    8. Re:834 pages?! by verloren · · Score: 1

      What amazes me most is that this is a book definitely aimed at the beginner. So rule out most CS students, and a lot of hobbyists, who will have picked up a moderate amount at some time. This is (presumably) for the person who isn't that familiar with computers, hasn't really done much 'programming', but needs to set up a database. So, are the 8 people who fall into that category *ever* going to read those 834 pages?

      But when they go into the bookstore, and see the big thick book, they'll think it must be the best, so they'll buy it and shelf it. I know I have in the past :(

    9. Re:834 pages?! by rodgerd · · Score: 2

      That would explain why CASE is now part of the SQL standard and supported in pretty much evey worthwhile SQL RDBMS.

    10. Re:834 pages?! by Unordained · · Score: 1

      i really hate running into programmers who suck at database design -- they usually also suck at memory-structure design, algorithm design, etc. because they can't think the problems through, logically. cardinality is not a simple thing for a lot of people -- but it's not complicated either. and yet i've met some bright programmers and accountants (ugh) who just couldn't get it. foreign keys for no reason, text fields used to contain comma-separated lists of text-versions of the names of departments (numeric id's anyone? that already exist? in another table? agh!)

    11. Re:834 pages?! by wilhelm9 · · Score: 1

      As other posters have noted, SQL is like learning chess. A moment to learn the rules, a lifetime to master.

      But also from a grammatical point of view, SQL is huge. A simple language like Java requires only a few hundred reduction rules, while SQL requires several thousands of them! The fact that SQL requires parsing tables many times larger than Java (and most other languages) does not mean SQL is a good language, but is more an effect of that SQL is the Cobol of query languages, which have been patched with features over and over again.

      Most other query languages are more clean and easier to understand than SQL. Quel is one such language, but sadly Quel and all other SQL competitors are nowadays more or less extinct.

    12. Re:834 pages?! by Anonymous Coward · · Score: 0
      there is far more to learn that could take hundreds of hours.

      Namely that vi is a superior editor. Of course some of us are faster learners than others.

    13. Re:834 pages?! by Morpeth · · Score: 1

      Using SQL after 20-30 hours sure, for really basic queries. But using it well and writing efficient queries, I highly doubt it.

      Anyone who's worked with large databases and complex business problems wouldn't trust a 20 hr SQL person with anything more than a single table select statement in a production environment. It's like saying if you know HTML, you're a web programmer, or calling someone who knows 1st Aid a doctor ;-)

      --

      'The unexamined life is not worth living' - Socrates
    14. Re:834 pages?! by duffer_01 · · Score: 2, Funny

      Did you not read it includes working with Oracle? I am surprised they could get it in under 1000 pages.

    15. Re:834 pages?! by cayle+clark · · Score: 1

      Publishers really like big, fat computer books, and pressure authors to produce them. Something like "The Elements of C Programming" wouldn't have a chance of being published today unless it could be inflated to 500pp minimum...

      Anyway, I know from personal experience that a good SQL tutorial can be written in 350pp, because I wrote one -- and it not only covered SQL statements, it had an introduction to schema design as well.

      That book is still in use 10 years after, although it has been revised by many hands since my time. This pdf is only a generation or two removed from the original and I can recognize much of the prose. Plus, it's free -- if you don't mind learning an out-of-date Informix variant of SQL...

    16. Re:834 pages?! by cayle+clark · · Score: 1

      awk! sppplbbt! But for a wad of catfur in my fingers, I would have correctly cited as an example of a short book, "The Elements of Programming Style" by Kernighan and Ritchie.

    17. Re:834 pages?! by rgehrig · · Score: 1

      This book was designed as a textbook. It contains chapter reviews, assignments and projects. It does a good job of giving a high level view to newbies. It focuses on Oracle and Access. If you wish to use Oracle you have to download a version from Oracle's site. I definitely recommend a high speed connection (3 cd's worth for 9i and 1 cd for 8i). The book is good for the beginner. Once you have the grasp of SQL this book will not be of much use, even as a reference.

    18. Re:834 pages?! by J.+Random+Software · · Score: 2

      SQL/PSM (stored procedures for ANSI SQL) was ratified six years ago, though implementations are still notably absent.

  4. The age old question... by Mr+Bill · · Score: 4, Interesting

    Do you pronounce it Sequel or S-Q-L???

    To me it is Postgres-Q-L and My-S-Q-L, but I think the Microsofties call it Microsoft Sequel Server...

    Maybe good for a /. poll!

  5. Learning Postgres Online by johnalex · · Score: 5, Informative

    If you need to expand your SQL to include PostgreSQL, try:

    PostgreSQL: Introduction and Concepts by Bruce Momjian

    Practical PostgreSQL, by Command Prompt, Inc. written by John Worsley and Joshua Drake of Command Prompt, Inc.

    Very practical definitions, examples, and procedures. I'm still scratching the surface of SQL, so I haven't found anything yet these sources can't handle.

    I've also found the Usenet Posgres groups useful.

    --
    JA
    http://www.johnalex.org/
  6. Outstanding book by Anonymous Coward · · Score: 0, Funny

    I recommend this book highly!

    Knowing SQL today is like being a literate man in the 15th century.

    It's a must have!

  7. open source databases by Anonymous Coward · · Score: 1, Informative

    I'm surprised they didn't mention FireBird. It's the actively developed version of interbase, and probably one of the best open source databases in existance, even though its relatively unknown. SAP DB (formerly Adabas) is another very mature open source database that is relatively unknown. MySQL and Postgres aren't the only options.

  8. SQL by sql*kitten · · Score: 5, Insightful

    Something to consider might be what SQL database you will be working with. If you'll be working with either Oracle or Access this book will be helpful. If not, I suggest looking at things like Managing Using MySQL by O'Reilly.

    I would suggest not, because you will learn bad habits, and they will be hard to shake once you start working on a real database (Oracle, Sybase, SAP-DB, etc). I have seen MySQL programmers do massively inefficient (and stupid) things like retrieve a list of keys from one table, store them in an in-memory array, then loop through the array executing a select for each key in another table - because they didn't know about subselects. I've seen them put all sorts of redundant validation crap in the middle tier because they didn't know about constraints and triggers. I could go on and on...

    If you want to learn SQL, you first need a solid general foundation like this (I have an earlier edition) then later study the extensions that each vendor provides (Oracle PL/SQL, Sybase T-SQL, etc).

  9. MySQL gains more users thanks to Apple by ekrout · · Score: 3, Interesting

    With OS X came a bundling of MySQL, and CTOs (Chief Technology Officers) across the country thought to themselves that "Hey, if a big profitable company puts this package of OpenSource software into their flagship OS, it must be OK to use. Let's stop dishing out tens of thousands of dollars a year to Oracle and let's just use this free RDBMS implementation. (Sure, PostreSQL is a bit more weathered, but both are pretty nice considering their price).

    Wider acceptance of MySQL and its related products/technologies is a good thing, and books such as this are only a good thing in my mind.

    --

    If you celebrate Xmas, befriend me (538
    1. Re:MySQL gains more users thanks to Apple by BShive · · Score: 1

      It isn't there by default. However, Fink makes it a snap to install and keep current - along with a ton of other OSS tools and software.

    2. Re:MySQL gains more users thanks to Apple by sql*kitten · · Score: 3, Interesting

      Let's stop dishing out tens of thousands of dollars a year to Oracle and let's just use this free RDBMS implementation

      For the last few years, my career has largely been based on Oracle products, so I have as vested an interest as anyone (save maybe Uncle Larry) in seeing Oracle continue to be the #1 choice for corporate databases, but I've got to say, if you even can run your application on MySQL, you really shouldn't have bought Oracle in the first place, because you've completely wasted your money. Only buy a product like Oracle (or Sybase, DB2, etc) if you know that you need its capabilities. If your application doesn't need subselects, triggers, real transactions, etc, then you might as well use MySQL, or even CSV on the filesystem!

      Oh, and the R in RDBMS means "relational". Correct me if I'm wrong, but MySQL needs a plugin to even do foreign keys - you should really say just DBMS.

    3. Re:MySQL gains more users thanks to Apple by MattRog · · Score: 3, Interesting

      Having FK support does not make one a Relational DBMS. To those who are 'in the know' Oracle, MS SQL Server, even my beloved :) Sybase ASE etc are SQL-Based DBMS. SQL, to put it mildly, butchers most relational tenets and is not how Codd wanted it to work in the first place (enter IBM and SQL language).

      But in the least case MySQL supports relations (tables) so it has, to some degree, a relational background. FK support is required according to Codd, but virtually all DBMS also break some of his other rules as well, so it depends on how deviant a product must be before it is declared non-relational.

      --

      Thanks,
      --
      Matt
    4. Re:MySQL gains more users thanks to Apple by Frater+219 · · Score: 3, Interesting
      Oh, and the R in RDBMS means "relational". Correct me if I'm wrong, but MySQL needs a plugin to even do foreign keys - you should really say just DBMS.

      Actually, I've heard some folks take issue with the "M", on the grounds that a system that does not ensure relational integrity and transactional atomicity is not providing database management. Considering that many mySQL supporters bracket their support by saying that it is strongest for read-mostly databases (placing it in a category with LDAP's slapd), I would feel comfortable calling mySQL a "database daemon".

      (For my own reasons to choose PostgreSQL, and some links on the subject, see my Slashdot journal about my current work project.)

      For what it's worth, I'm glad that the mySQL folks have largely quit telling untruths about relational databases. A few years ago, they were saying in the mySQL documentation that foreign key constraints are for lazy programmers, and that anything that can be done with transactions can be done just as reliably with application code. (Imagine here Jamie Lee Curtis saying "Those are all mistakes, Otto. I looked them up.")

    5. Re:MySQL gains more users thanks to Apple by Tablizer · · Score: 2

      but I've got to say, if you even can run your application on MySQL, you really shouldn't have bought Oracle in the first place, because you've completely wasted your money.

      The problem comes if/when you scale up. It is a pain to overhaul applications to accept a stronger DB from a different vendor.

      IMO, what OSS needs is a lite-duty DB and a heavier-duty one, but the smaller one is a clean subset of the bigger one. MySQL and Postgre have different conventions. It is not a matter of plug-and-play to switch. But, it *could* be if they coordinated efforts to make the language and features more consistent between them.

      Or, even an OSS Oracle clone. It might benefit Oracle to do such because people would use the OSS to get started, and later if they need more power then purchase the commercial version.

      The cost of incompatibility is often higher than the DB product cost itself. People want to be able to up-grade (and down-grade?) without overhaulling the application's SQL calls. Such a thing does not exist in OSS right now.

    6. Re:MySQL gains more users thanks to Apple by MattRog · · Score: 2

      I'm a CTO and choosing product worth on what a particular vendor says would get me fired. Products stand on their own merit and are evaluated as such.

      --

      Thanks,
      --
      Matt
  10. Oracle 9i is free for download by Anonymous Coward · · Score: 0

    For those who don't know, you can download Oracle 9i for free:
    http://otn.oracle.com/software/content.html

    And if you want a video introduction to SQL, you can get a video course at:
    nerdmaker.com

    1. Re:Oracle 9i is free for download by Anonymous Coward · · Score: 1

      Mod this up to five, and I'll post this class for free internet access.

      nerdmaker.com

  11. some thoughs by lfourrier · · Score: 2, Funny

    about the book:
    It mentions the existence of other distributions at the beginning of the book: "... and PowerBuilder."
    I know I stopped using PowwerBuilder with the version 7, and the version 9 is out, but at that time, it was not a SQL database, only a client for SQL databases.

    about SQL:
    SQL is a langage with which it is really easy to obtain a result that is not what you intended.

    1. Re:some thoughs by DevNull+Ogre · · Score: 2

      I know I stopped using PowwerBuilder with the version 7, and the version 9 is out, but at that time, it was not a SQL database, only a client for SQL databases.
      I'd place that in the same company as Access, which the book apparently talks about extensively. Sure Access has its own DB back end, but it sucks. People who need to do real work with it use it as a front end to a real database.

      Does anybody know if this book talks about using Access by itself, or if it treats Access more in the context of accessing Oracle?

    2. Re:some thoughs by Ed209 · · Score: 1

      Powerbuilder is not a database, it is a development tool, like VB, but much better geared to talk to a database. Powerbuilder comes with SQL Anywhere, or as its now called Adaptive Server Anywhere. A pretty slick little database server, with nifty remote user / remote database tools. Puts Access to shame. Sybase even has a linux port of ASA.

      --
      If at first you dont succeed, relax, success is overrated anyway.
  12. Re:Colclusion: by l33t+j03 · · Score: 0
    1) Linux will. SQL would if the OS would stay up long enough, like with BSD.

    2) Did I buy an iBook? Maybe I did and I was drunk and don't remember, but I don't hate Apple.

    3) I don't. You are thinking of cyborg_monkey.

    4) I don't know what happened to him.

    5) I'll have to go look through my posting history and see. I hadn't noticed until now.

  13. What a waste of trees :-( by Anonymous Coward · · Score: 1, Funny

    A "7"! Nowhere near the standard "9".

    I weep for the murdered trees who gave their lives for this. :-(

  14. Re:The age old question... by will_die · · Score: 1

    I personally prefer going with SQuirreL, but from dealing with other Oracle and ms DBAs most conformists go with sequel.

  15. Re:The age old question... by glwtta · · Score: 3, Informative

    It in fact is Postgres-Q-L and My-S-Q-L, but you use "sequel" to query both of those. I haven't seen anyone in a long time pronounce the language name S-Q-L, the names of the two products you mentioned are dictated by their respective developers, so it's a different matter. (incidentally, I'm as far from a Microsofty as it gets)

    --
    sic transit gloria mundi
  16. Re:The age old question... by CarlFairhurst · · Score: 1

    Actually, what I've found with the people I've dealt with is that most US based people tend to say Sequel whilst over in Europe it tends to be S Q L. I've just got into the habit of pronouncing it however the other person wants to refer to it, as I'm more than happy to use it either way.

    I know whenever I'm at a Microsoft event it's been pronounced the Sequel way, but I'm not sure if Oracle or IBM do.

  17. Username and password for oracle download by Anonymous Coward · · Score: 0

    Here is my username and password for a free download of Oracle 9i. You can get your own if you register.

    username: support@nerdmaker.com
    password: anon314

  18. Re:The age old question... by binaryDigit · · Score: 2

    AFAIK almost everyone says sequel, not just M$ites. What really has me wondering though is, is it Lynnucks or Line-ex and how do you say that Bjarne guys last name?

  19. First time web "programmer" by I_am_Rambi · · Score: 2

    When I first started making dynamic web pages, I used access. I used acces for various reasons. 1. It was on a computer at school. 2. I was running win 98 at the time. Not many good databases will run with 98. Even though I wanted a database to keep track of things, I only had one option.

    Even though I layed out the database in access, I didn't touch access after the file was created. I then moved to personal web server (an all the security holes that creates) to manipulate the database through ASP.

    I know there are many others that because of various reasons are unable to get their hands on other databases, if you get the fundementals of sql through access, you are able to understand the majority of sql statements having to deal with other databases. Even though,things do differ, you have somewhat of a foundation to understand sql.

    1. Re:First time web "programmer" by KoolyM · · Score: 1

      Actually, Access is indeed a pretty good learning tool, in that it *gently* weens you into SQL and other database concepts. Not something you should turn back to once you've outgrown it, but as a beginner's package, it isn't half bad.

  20. A Good Way To Scare A Beginner? by occamboy · · Score: 1

    SQL is an interesting critter: you can learn the basics in 10 minutes, but mastery is very tough.

    Seems to me that learning SQL requires a 10 page "which end is up" book (the PostgreSQL tutorial is good for this, if I recall correctly) -- enough so that one gets the basics, along with an 814 page reference for doing those big nasty queries that are needed in serious environments.

    834 pages seems might intimidate a newbie!

  21. Re:The age old question... by beacher · · Score: 4, Funny

    It's Microsoft Squeeeeeal! Server (say it in your best deliverance voice )

    Todd

  22. Standard SQL? by K-Man · · Score: 4, Interesting
    I primarily use MySQL and Progress, so a book explaining SQL fundamentals applied to Access and Oracle isn't going to help me unless I specifically take on projects which use these particular databases.
    A statement like this needs a bit of support. Does the book use proprietary features of Oracle and Access? Most of the basic parts of SQL are the same on all platforms.

    --
    ---- "If we have to go on with these damned quantum jumps, then I'm sorry that I ever got involved" - Erwin Schrodinger
    1. Re:Standard SQL? by bellings · · Score: 2

      Well, to start with, MySQL doesn't use anything even approaching standard SQL. As near as I can tell, some crack-addled monkeys briefly read a "Teach yourself SQL in 21 days" book before they wrote MySQL.

      I don't know what Access does now, but in the past it too basically just ignored the SQL standard. At least we can trust that the Microsoft programmers were aware of the existence of the standard while they ignored it.

      If you want a decent, reasonably compliant SQL engine, you'll probably use Oracle, Microsoft SQL Server, or PostgreSQL. Of course, once you actually use any of those, you'll quickly discover the huuuuuge differences in implementation... It turns out that following the standard hardly matters as much as anyone thought...

      --
      Slashdot is jumping the shark. I'm just driving the boat.
    2. Re:Standard SQL? by glwtta · · Score: 2
      Most of the basic parts of SQL are the same on all platforms.

      Yes, but most of the deliciously interesting features of Postgres (and other systems) is the proprietary stuff... mmmm, regular expressions...

      --
      sic transit gloria mundi
  23. O'Reilly? by BShive · · Score: 2

    I think the SQL in a Nutshell is a great resource, but if you're just starting with SQL this sounds like a decent book, would be nice to have a comparision though. I've lost track of how many times I've had to explain what the first chapter covers (cell, row, column, table, etc). Maybe I should keep a copy around just to loan out in such cases. "Go read chapter one and come back later, then try tell me what you want done."

    PS: Amazon has it for $34.99 [associate]

    1. Re:O'Reilly? by cjpez · · Score: 2
      PS: Amazon has it for $34.99 [associate]
      And Bookpool has it for $29.95 and has the added benefit of having 95% less Evil than amazon. (That's a rough guess on the Evil count, btw, not a scientific measurement.)
  24. Sql security/sql injsection papers by Anonymous Coward · · Score: 0

    This may be of interest. www.cgisecurity.com/lib

  25. Re:I don't get it! by binaryDigit · · Score: 3, Funny

    Actually for most /.ers you would get a nice fat result set back, however, you'd be forced to do an inner join with the "LikelyToBeInterestedInASlashdotReadingNerd" table and then you'd get no results.

  26. Re:The age old question... by sphealey · · Score: 2
    Actually, usage changed sometime around 1994. Prior to that most people said "Ess - Que - Ell"; after that date people started saying "see-quell". Never did understand why the change occured.

    sPh

  27. Don't click on slashdot book link by RedWolves2 · · Score: 2, Funny
    1. Re:Don't click on slashdot book link by draed · · Score: 1

      $29.95 at Bookpool

      bookpool is the cheapest place to buy new technical books like 99% of the time...

    2. Re:Don't click on slashdot book link by Anonymous Coward · · Score: 0

      What happens when someone reports your improper use of your affiliate ID to amazon?

      Let's find out....

    3. Re:Don't click on slashdot book link by Anonymous Coward · · Score: 0

      "like 99% of the time..."

      Is that an SQL statement, or an annoying piece of Buffyspeak?

    4. Re:Don't click on slashdot book link by Anonymous Coward · · Score: 0

      Soooo cool. You've got to follow up your post to tell us how Amazon responds. Seeya later, Ralphieboy!

    5. Re:Don't click on slashdot book link by sqrlbait5 · · Score: 1

      Hey dumbass, stop posting links with your amazon referer id in it. You do this EVERY SINGLE TIME a book review is posted. Somebody mod this moron down.

      --
      LDAA #$80 BITA 0x40 BNE END
  28. Re:The age old question... by Anonymous Coward · · Score: 0

    SQUEEEL

  29. Internet Vs books by phorm · · Score: 2

    Quick way (internet) Step 1: go to mysql.com and download mysql
    Step 2: go to google.com and enter:
    +mysql +sample

    Step 3: Spend some time reading, figure it out.

    Standardized way (book) The advantages of a good book are mainly in the way of standardization and security. While I've seen books that were crap in reference to this, most do a much better job of providing code samples than the underinformed indivuals writing "samples." That being said, major sites like Zend.com and php.net still provide good examples etc, but in that case you need some fore-knowledge to know what to look for.

    All IMHO of course. Many of us are "example learners" as opposed to "book learners".

    1. Re:Internet Vs books by Soggy_Cornflake · · Score: 1

      Many of us are "example learners" as opposed to "book learners".

      Considering the number of tetris clones I can find at Freshmeat I'd have to agree with you.

    2. Re:Internet Vs books by TardisX · · Score: 1
      Please don't start with MySQL. If you want to get into open source SQL, start with PostgreSQL.

      Unless you will like unlearning your crufty MySQL habits a couple of years down the track...

      Oh you want reasons?

      1. AUTO_INCREMENT is inefficient (no caching) and lacks any versatility. Postgres can use any arbitary function to define default values, the most common of which would get the next value from a sequence. Which needn't be specific to that table.
      2. Transactions. You need them, OK? If you think you don't you are wrong. And I shouldn't have to define my tables in some special way to get them either.
      3. Performance - get over it guys, MySQL isn't the speed demon it used to be, in comparison to PostgreSQL. It's not a selling point no more.
      4. Sub-selects, constraints. See point 2. If you don't think you need them, you probably do. Chances are you are doing a bunch of stuff in your code that you don't need to, that SQL should be doing for you much more safely and effeciently.
      Yes, MySQL 4.0 has support for some of these features. But hey, it's not here, and even when it is, it won't be a proven, mature product for quite some time after that.

      --

      Command attempted to use minibuffer while in minibuffer
  30. For More Advanced... by glenstar · · Score: 5, Informative
    For the more advanced, I *personally* would recommend Joe Celko's SQL for Smarties. Celko is a rather bizarre character, but there is no problem that he cannot solve using ANSI92 SQL. None.

    If you want to make the developers/DBAs/bosses in your company think you are an absolute god, get a copy of Celko's SQL Puzzles and Answers.

    1. Re:For More Advanced... by Anonymous Coward · · Score: 0

      yeah, i'll second that. SQL for Smarties is a frikkin good book. It doesn't cover a lot of vendor specific quirk code, but like dude said, it covers ansi92 wonderfully. Definitely worth the money.

    2. Re:For More Advanced... by SPiKe · · Score: 2, Informative

      Yes, but Celko's examples tedn to shoot off in the acamedic (read: features not implemented by any vendor).

      If one wants a fairly good book on SQL (though oriented towards T-SQL, and a lot towards Microsoft), Ken Henderson's "The Guru's Guide to Transact-SQL" is good. Ken also lists Celko as one of his major influences.

    3. Re:For More Advanced... by axxackall · · Score: 2
      Here another "Advanced SQL" books I can recommend for serious SQL developers: First book is the only good book about SQL standard I found. You can learn lots yourself and you can teach (if you are a teacher or a project leader) other developers.

      The second one very well explains when and why "pure" SQL doesn't work [well] anymore.

      By the way, Date is not less bizarre character than Celko, neither he is less productive author. Especially together with Darwen.

      --

      Less is more !
  31. Re:I don't get it! by r_j_prahad · · Score: 4, Funny

    Typical view error...

    CREATE VIEW girls AS SELECT * FROM slashdot WHERE sex = "F"

    ... returns an empty set iteself, so your subselect isn't going to do you any good, naturally.

  32. Re:SQL by Anonymous Coward · · Score: 0

    Oh yeah right. Like I'm going to take advice about SQL from someone named SQL*kitten. Pff.

    SarcasM Mode off

  33. Re:The age old question... by binaryDigit · · Score: 2

    Actually, usage changed sometime around 1994

    I think it started happening before then. I was doing SQL stuff back in the 1990 timeframe (even interviewed at Ingres and Sybase) and everyone I knew was saying sequel even back then. It might have been a Bay Area thing though, or maybe even specific to the "upstart" db's, don't know what the IBM or Oracle camp was calling it.

  34. Learning SQL doesn't give you all the skills by Anonymous Coward · · Score: 2, Interesting

    There is an element to database design that is a subfield of calculus. Just learning the syntax for CREATE TABLE and SELECT doesn't really get you very far. Understanding why relational sets are powerful, and being able to leverage that power to problem solving ends, is a far bigger learning process than simply understanding the syntax of SQL.

    In order to fully comprehend, say, the works of E. F. Codd, one really needs a background in automata and in abstract algebra.

    1. Re:Learning SQL doesn't give you all the skills by Anonymous Coward · · Score: 0
    2. Re:Learning SQL doesn't give you all the skills by Anonymous Coward · · Score: 0

      Damn dude, you had a monitor for lunch?

  35. I Found This Book Perfect by cmdr_beeftaco · · Score: 0, Troll

    Of course I took all the databases courses at DeVry but they never covered this obscure topic. I was recently laid off as an HTML Programmer for a Fortune 5000 Company. During my job search I found many other programming positions required knowledge of SQL in addition to HTML.
    I read this book in a long weekend and am ready to design mission critical HTML and SQL application for your business.

  36. Re:SQL by RevDobbs · · Score: 1

    The book is "Database Systems Concepts with Oracle CD", and here's the USian link for us over in the colonies. Seems like an interesting book, but there's only one left, so I'll probably end up getting it on Amazon's re-order.

  37. Off-topically on-topic. by eXtro · · Score: 2
    I've just started teaching myself SQL a bit. Languages are easy, the problem is I don't have any formal training in databases, so while I can make a database do what I want I'm also probably doing it terribly inefficiently.


    If I wanted to learn the theory behind designing databases what would be a good book to read? I'm thinking more along the lines of learning from a text book v.s. learning from The Blithering Idiot's Guide to Database Design.

    1. Re:Off-topically on-topic. by Lil'wombat · · Score: 1

      Database Design for Mere Mortals: A Hands-On Guide to Relational Database Design
      by Michael J. Hernandez

      Best book I've found for someone wanting to learn the basics of design. Covers normalization, referential integrity - the works.

      --

      Truth: If it's not one thing, it's another

    2. Re:Off-topically on-topic. by ddriver · · Score: 1

      Try Database Design by Ryan K. Stephens and Ronald R. Plew. 500 pages long, from Sams Books.

      They cover the most important part of db design first (understanding the business and developing a good logical data model) then they get into normalization permission control maintenance etc.... The way it should be done. Usually people just sort of get in there and start to code something that looks kind of like the last project. That is the number one mistake to make in any type of programming. Analyze first and save your self a bunch of reworking later.

      --
      I found my inner child, then I got caught abusing it...
  38. Perfect opportunity for OSS in gov't by Anonymous Coward · · Score: 1, Funny

    With the Free Software Movement gaining steam. MySQL is the perfect vehicle for getting more Free Software used in government.

    The IRS and Social Security should run all of their databases with MySQL!

  39. Re:The age old question... by sql*kitten · · Score: 5, Interesting

    It in fact is Postgres-Q-L and My-S-Q-L, but you use "sequel" to query both of those. I haven't seen anyone in a long time pronounce the language name S-Q-L, the names of the two products you mentioned are dictated by their respective developers, so it's a different matter. (incidentally, I'm as far from a Microsofty as it gets)

    It is properly S-Q-L because Sequel is something different (Structured English Query Language, an IBM project that never went anywhere). But the term "sequel" for SQL has come into common use, so it's the de facto pronounciation.

    Microsoft people just call the product "SQL Server" which IMHO is like calling Windows "Operating System" but it comes from the old days when Sybase and Microsoft cooperated (circa MSSQL 4-6/Sybase 10). Sybase's product was called "Sybase SQL Server", but people just call it "Sybase" (akin to calling Windows "Microsoft"). When they split, MS kept the rest of the name.

    You can easily spot a hardcore elite database guru by the fact that these people pronounce it "squirrel".

  40. Re:SQL by wikiwa · · Score: 0

    the only problem with that is that MySQL doesn't support subselects at this point. It's being added to the current dev version but not in production versions. so how would one using mysql go about doing a subselect if it's not there ?

  41. are you sure? by jstepka · · Score: 1

    pages 800 Fundamentals?

    Mabye it should be called a Bible! SQL in a Nutshell is a book about fundamentals.

    --
    Justen Stepka
  42. Access & Oracle? by SoCalChris · · Score: 2

    Does anyone else find their choice of databases funny? I could see MS SQL & Oracle, but aren't Access & Oracle two totally different beasts?

    Access is for small db's, usually personal ones or very small business databases. Oracle is a big enterprise database capable of storing huge amounts of data.

    Isn't that kind of like writing a book teaching you an introduction to writing batch files and mastering C++ all at once?

    1. Re:Access & Oracle? by rocjoe71 · · Score: 2
      ...It's just the number of people that actually use MS Access is like 10000 times greater than the number of MS SQL implementers. Besides, if you know the SQL part of MS Access well enough, you'll already hit the ground running with MS SQL's T-SQL.

      Oracle too is used alot more than MS SQL, but Oracle's PL-SQL is a different beast from T-SQL. Hence, you get 'reasonable' coverage of the SQL spectrum...

      In an age where there's entire sections of bookstores dedicated to "Dummies" it's great to see authors giving due credit to their reader's intellect by showing them not just 'where to begin' but 'how far up you can go'.

      --
      Height: 38U, Weight: 0 Newtons, Eyes: #0000FF, OS: Gray Matter 1.0 (Alpha)
    2. Re:Access & Oracle? by bje2 · · Score: 2

      i guess it shows you how to apply your newly found SQL knowledge on a small scale (access) and on an enterprise level (oracle)...also, i would think that access would be a good starting point for a someone who had no previous database experience...

      --

      "Facts are meaningless. You could use facts to prove anything that's even remotely true." - Homer Simpson
  43. Re:The age old question... by micromoog · · Score: 2

    "Linn uks" would be the closest American accent equivalent. In Torvalds' accent, it's "Leen ooks".

  44. Redwolves 2 Strikes Again by Anonymous Coward · · Score: 1

    You get the feeling this guy sits at his office all day, hitting refresh on Slashdot's main page every two minutes, waiting for a book review to come up. Not that he's interested at all in the book, but so he can be the first one to post a link to Amazon.com, with his affiliate's ID embedded. Mod this guy down!

  45. Or what about... by Vaulter · · Score: 2, Funny


    I here you. I always get confused with 'C'. Is it pronounced "See"? Or as I like to refer to it: "C".

    My coworkers like to read the "Fack" when they need help. If people ask me, I just tell them to consult the "Fa" "Q".

    --
    I don't have a sig...Do you??
  46. Even better... Bookpool by sweepkick · · Score: 1

    http://www.bookpool.com/.x/rzzwsost6n/ss/1?qs=sql+ fundamentals

    Bookpool is a great resource for technical manuals.

  47. Underestimating the complexity of SQL? by JohnDenver · · Score: 3, Insightful

    First of all, you do have a point. SQL isn't a big language with a lot of features, but if you had really spent a lot of time working with SQL, you would know that SQL is a language usually implemented with A LOT of nuances, and that many problems that are easy in procedural languages that take a lot of work with SQL.

    SQL is a powerful tool, but solving many problems with SQL can be very daunting at times, especially when you're dealing with vendor specific nuances.

    --
    "Communism is like having one [local] phone company " - Lenny Bruce
    1. Re:Underestimating the complexity of SQL? by redfiche · · Score: 1
      >>>that many problems that are easy in procedural languages that take a lot of work with SQL

      Right, that's why I use C++ or Java to solve those problems.

      --

      Brevity is the soul of wit

      -- Polonius

    2. Re:Underestimating the complexity of SQL? by JohnDenver · · Score: 2

      >>>that many problems that are easy in procedural languages that take a lot of work with SQL

      >>Right, that's why I use C++ or Java to solve those problems.

      ...and you usually trade off in performance (many calls to database vs. one), or writing a lot more code to handle indexing, sorting, etc.

      I'm not advocating awkward SQL implementations. All I'm saying is: I understand that many times, the awkward SQL implementation is the best choice.

      --
      "Communism is like having one [local] phone company " - Lenny Bruce
  48. An "official" answer by Anonymous Coward · · Score: 0

    Actually there is an official answer. I have an aquaintance that has spend time on and around the ANSI X3H2 committe, and acccording to him the official pronunciation (yep, they actually argued over this) was "ess-que-ell", and not "sequel" or "squeal".

    As if it was that important.

  49. Squeal by wiredog · · Score: 2

    Actually, in 93 I heard quite a few people calling SQL "squeal".

  50. 10 foot pole by Anonymous Coward · · Score: 0

    Go design your own porn site to make money, but don't come anywhere near my company. Do you think I'm going to let you design "mission critical" applications after you read a book about SQL on the weekend?

    Let me guess, you went to DeVry, didn't you.

    Oh... wait.. ;)

  51. Uh yeah right! by Codex+The+Sloth · · Score: 2

    With OS X came a bundling of MySQL, and CTOs (Chief Technology Officers) across the country thought to themselves that "Hey, if a big profitable company puts this package of OpenSource software into their flagship OS, it must be OK to use.

    Yes, the mindset of the fortune 500 lives or dies by what Apple does. "Hey I wouldn't buy any of their overpriced computers but if they think MySQL is great, it must be".

    MySQL is pretty good though. Ah hee ah hee hee

    --
    I am not a number! I am a man! And don't you ... oh wait, I'm #93427. Ha ha! In your face #93428!
  52. Re:Don't click on RedWolves2 book link by VP · · Score: 2

    Go to bookpool.com to save money, click on the Slashdot link, if you want to help Slashdot...

  53. Re:My favorite query by CableModemSniper · · Score: 1

    Don't you mean...

    SELECT * FROM Slashdot_Editors WHERE clue > 0 >

    because you forgot a semicolon? Oh wait maybe badder voodoo would happen...doesnt' the clue >0 part have to be in parens?

    --
    Why not fork?
  54. Well this is a first... by shoemakc · · Score: 2

    so a book explaining SQL fundamentals applied to Access and Oracle

    Wow! Oracle and Access mentioned in the same sentence without sarcasm or outright laughter. Someone please note the date and time.

    --
    --an unbreakable toy is useful for breaking other toys--
    1. Re:Well this is a first... by rodgerd · · Score: 2

      Access makes a perfectly acceptable UI for Oracle databases.

  55. Life query by DarkHelmet · · Score: 2, Funny
    select * from Programmers where MysqlKnowledge = 1 AND SexLife = 1;

    > Error, column SexLife does not exist in this table.

    --
    /^[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,4}$/i
    1. Re:Life query by Anonymous Coward · · Score: 0

      It's a good thing I use Postgres. Best of both worlds. ;-)

  56. Re:The age old question... by bellings · · Score: 2

    It's always pronounced S-Q-L. However, Microsoft (and Sybase) call their product "Sequel" Server. You see, Microsoft "Sequel" Server is basically the brand name of a satabase server that uses S-Q-L, in the same way that "Orace Enterprise Edition" is the brand name of a database server that uses S-Q-L, or "Apache" is the brand name of an HTTP server.

    So, it's correct to refer to Microsoft "Sequel", as long as you understand that you're talking about the product, and not the language.

    --
    Slashdot is jumping the shark. I'm just driving the boat.
  57. Re:SQL by bellings · · Score: 2

    It's being added to the current dev version but not in production versions.

    I've been reading that same statement for about 2 1/2 years. You can expect a subselects in MySQL at about the same time you'll see Duke Nukem Forever under your christmas tree -- in other words, "real soon now", for sufficiently ludicrous definitions of the word "soon."

    --
    Slashdot is jumping the shark. I'm just driving the boat.
  58. Re:SQL by joshv · · Score: 3, Interesting

    I've seen them put all sorts of redundant validation crap in the middle tier because they didn't know about constraints and triggers. I could go on and on...

    Validation logic belongs in the middle tier. The storage tier is just that - storage. It shouldn't be smart, and it very definitely should do anything else than storing the data I tell it to store.

    Triggers, constraints - bah. All very vendor specific and they lead to application logic being strewn all over the tiers. Application Logic should be in the middle tier, period.

    -josh

  59. Re:The age old question... by DunbarTheInept · · Score: 2
    Maybe good for a /. poll!
    And like most /. polls, my answer isn't listed.
    I pronounce it "squirrel". I worked in a place where everyone said "sequel" and I hated that name. The strange thing is, I don't know why. I just did.
    --

    Don't label something "offtopic" unless you know the topic well enough to tell what's on topic.

  60. Re:SQL by Anonymous Coward · · Score: 0

    Where did you learn database? From Sun? No wonder there are so many slow sites these days

  61. Re:My favorite query by Anonymous Coward · · Score: 0

    oh what a rip off. he stole this from that thinkgeek shirt, the 'select * from users where clue > 0' one. you unoriginal bastard. i can't believe you tried to get away with that. you should've known that SOMEONE on /. would catch that. mod this guy down for thinking so little of /.ers abilities to recognise ripoffs.

  62. Wrong by Anonymous Coward · · Score: 0
    The IRS and Social Security should run all of their databases with MySQL!

    No, they most assuredly should not do this.

    They should run all of their databases on stone tablets engraved with cardboard styluses. That would be a real step up for them. ;-)

  63. Re:SQL by HunkyBrewster · · Score: 2, Informative
    You would be much better off starting with an introduction to relational database theory. (Notice I did *NOT* say SQL database theory.)

    I have found http://www.dbdebunk.com/ very informative. If you insist on cutting down trees, I would recommend any of the books that this site links to.

    There are fundamental problems with SQL. You may well be forced to work with it but you should at least know what its limitations are.

    Hopefully, once you truly understand the problems with SQL, you will see the light, rebel, tell Oracle et al to go screw, and help develop some nice good Open Source alternative to the crappy SQL language.

    If you disagree, you are welcome to touch me lower.

  64. ANSI anyone? by oliverthered · · Score: 1

    Access and Oracle don't strike me as 'good' databases to learn SQL on, there just not ANSI compilent enough!.

    Maybe I'm a couple of years out of date but

    Oracle has a problem with Joins, they just don't work, and that's a big bit of SQL.

    Access has a poor SQL implementation, I can't remeber how poor, but very!.

    Prohaps it would have been better if the book used a free, more ANSI complient database and included on a CD) e.g. Postgres or Intrabase.

    --
    thank God the internet isn't a human right.
    1. Re:ANSI anyone? by corey_lawson · · Score: 1

      ...but no common database is very ANSI-compliant, and they all have non-ANSI extensions that make particular tasks much easier to do, code and understand than with straight ANSI SQL (Oracle has several, Access has PIVOT). I actually like Oracle's simpler join syntax. It is much easier to visually parse than a list of essentially recursive FROM Table INNER JOIN (table.field ON (inner join table3.field on table2.field)).

    2. Re:ANSI anyone? by NineNine · · Score: 2

      Oracle has a problem with Joins, they just don't work, and that's a big bit of SQL.


      ROTFL. Oh jesus... hang on, I gota wipe the tears from my eyes. Oh christ, that needs to be modded up to +5 ignorant/pathetic/funny.

      Joins in Oracle don't work? You're saying, Oracle, the oldest database on the market, the most widely used, made by he second largest software company in the world, doesn't work. You have got to be off of your fucking rocker. I can't even begin to argue with a statement like that, because you can't argue with people who are so delusional, that they can't possibly see the truth. That's like when some crackpot on the street walks up to you and says, "The sky is red and filled with demons!". How do you argue with that other than "no it isn't"?

      In the immortal words from Billy Madison:

      "Mr. Madison, what you've just said is one of the most insanely idiotic things I have ever heard. At no point in your rambling, incoherent response were you even close to anything that could be considered a rational thought. Everyone in this room is now dumber for having listened to it. I award you no points, and may God have mercy on your soul."

    3. Re:ANSI anyone? by 3770 · · Score: 1

      If you want to know if a statement is ANSI/ISO compliant, use the Mimer SQL Validator. It lets you validate against SQL-92, SQL:1999 and SQL:200x (Draft).

      --
      The Internet is full. Go Away!!!
    4. Re:ANSI anyone? by reidnc6 · · Score: 1

      In regards to Oracle not doing well with joins, I think you must be referring to the syntax. Please note that Oracle 9i which has been out for over a year now supports the CROSS JOIN, LEFT OUTER JOIN, RIGHT OUTER JOIN, etc. syntax. Yes, your comments are dated. And, I don't think you'll find any other database in the world that can create an index on a join condition.

    5. Re:ANSI anyone? by boy_afraid · · Score: 1

      Let bash his bloody head in, aye?!

      Heretic! WTF are you talking about? Of course Oracle does join correctly, in fact its one of the easiest to read:
      from a left outer join b on a.field1 = b.field1
      where a.field1 *= b.field1
      where a.field1 = b.field1 (+)

      PL/SQL has gone through a few modifications, but is still backwards compatible. All three are are the same, but all three were introduced at different times. (please excuse me if I didn't get the sytax correct, I might be brain dead from dealing with indexing woes at work right now.)

    6. Re:ANSI anyone? by Anonymous Coward · · Score: 0

      ANSI JOIN syntax did not in fact work with Oracle until the latest version, smart guy.

  65. Re:The age old question... by CySurflex · · Score: 2

    When my mom calls me and tells me she's having problems with her "microsoft", it takes an additional 10-20 minute to figure out if she's talking about Windows, Word or Outlook...

  66. SQL is BAD by HunkyBrewster · · Score: 2, Insightful
    You would be much better off starting with an introduction to relational database theory. (Notice I did *NOT* say SQL database theory.)

    I have found http://www.dbdebunk.com/ very informative. If you insist on cutting down trees, I would recommend any of the books that this site links to.

    There are fundamental problems with SQL. You may well be forced to work with it but you should at least know what its limitations are.

    Hopefully, once you truly understand the problems with SQL, you will see the light, rebel, tell Oracle et al to go screw, and help develop some nice good Open Source alternative to the crappy SQL language.

    If you disagree, you are welcome to touch me lower.

  67. Re:The age old question... by mtDNA · · Score: 4, Funny


    Dear Slash-Dotters,

    I can't believe how clueless you guys are. Everybody knows it's Structured QUERy Language, or
    SQUERL, which is properly pronounced _SQUIRREL_.

    Sincerely,
    Steve

    --


    If you watch TV news, you know less about the world than if you just drank gin straight from the bottle.
  68. Re:The age old question... by Max+Coffee · · Score: 1
    Bummer. The SQL project I'm most closely affiliated with is a restaurant point-of-sale system. Our closest competitor? Squirrel. Squirrel doesn't even use SQL.

    So I can't say "squirrel" for MS-SQL. I can't be 1337. Waah! :)

  69. Re:The age old question... by corey_lawson · · Score: 1

    No, the language is SQL (or "seequel").

    Only MS idiots refer to the MS SQL Server product as "Microsoft SQL" or "Microsoft Seequel". It's right up there with Windows or Word users who refer to either as "Microsoft".

    Oracle is just...Oracle.

  70. Check all Sites at once by Mr.+No+Skills · · Score: 1
    Try addall.com, searches all other sites and finds used books also. And, price listed includes shipping. FYI, they list Amazon as the best price at $27.82 (used).

    Sorry for the shameless plug -- I just use them, I don't get anything out of this.

    http://www.addall.com/New/submitNew.cgi?query=0130 669474&type=ISBN&location=10000&state=MD&dispCurr= USD

    Note, my location is in the URL and it uses this to calculate shipping. You will need to re-search for shipping costs...

    --
    Sleep is for the Weak
  71. Re:SQL by NineNine · · Score: 5, Insightful

    hahahahaha... After 10 years of doing development, all of it with databases in the back end, I know people like you very well. People who don't understand databases don't know how to use them, and code all of the logic into the middle tier. Very typical. It leads to horrendous bloat, very poor performance, and occasionally, complete project collapse. In one case that I was involved in, the company closed because their project couldn't be done on time since they decided to listen to this "expert" who spouted off similar stuff like what you're saying. The project became an OOP mess that was impossible to debug and maintain. More importantly, performance was never acceptable, so the project and the company died.

    Databases, especially "grown up" ones like Oracle and DB2 are designed and optimized to do a hell of a lot more than data storage. If you want storage, use flat files. You should maybe, I dunno... pick up a book. You can write entire applications in nothing but PL/SQL that perform several times better than a similar C++ or Java app.

    In fact, so much development is done in the databases themselves, that Oracle has a certification just for that, called the Oracle Certified Application Developer. But alas, generally these days everyone is still running around screaming "middle tier! middle tier" while the real database gurus just sit back and laugh as projects implode.

  72. 834-pages ? by avandesande · · Score: 2, Interesting

    How is this a beginner's book? A much smaller book will do. Maybe K&R should write one.

    --
    love is just extroverted narcissism
  73. Definitely Off-Topic now. by cjpez · · Score: 2
    I'm thinking more along the lines of learning from a text book v.s. learning from The Blithering Idiot's Guide to Database Design.
    On a somewhat-related but quite off-topic note, is anyone else totally sick of "Idiot's Guide to This" and "Whatever for Morons" books? I'm not an idiot or a moron! I'm a reasonably intelligent person who just happens to have little experience in the field you're writing a book about! That's the kind of book I'd buy. The Reasonably Intelligent Person's Guide to Database Design.

    I refuse to give money to companies that try and make me feel like an idiot.

    1. Re:Definitely Off-Topic now. by rodgerd · · Score: 2

      Run to your local trademark and patent attorney. Trademark the name. Sell it to a major publisher.

    2. Re:Definitely Off-Topic now. by SoupIsGoodFood_42 · · Score: 2
      I refuse to give money to companies that try and make me feel like an idiot.

      How about:
      "The Well-hung Guy's or Big Titted Girl's Guide to Database Design"?
      Or "Database Design for Males with Large Penises and Slim, Large Breasted Females?

      :P

  74. SQL and OOP in conflict? by Tablizer · · Score: 2, Interesting

    People who don't understand databases don't know how to use them, and code all of the logic into the middle tier. Very typical. It leads to horrendous bloat, very poor performance, and occasionally, complete project collapse. In one case that I was involved in, the company closed because their project couldn't be done on time since they decided to listen to this "expert" who spouted off similar stuff like what you're saying. The project became an OOP mess.... [emph. added]

    It seems that many OO fans have a desire to create their own "database" from scratch via programming code, and treat the RDBMS as mere "persistence". They end up using array-like things to manage their own indexes for one-to-many and many-to-many relationships, for example.

    This is a widely accepted practice in the OO community. I really don't want to maintain such code.

    It seems many OO fans want "control". If you use the database for such things instead, then you are more dependent on the DB vendor and DBA's, and that bothers them.

    I agree that DBA politics can be a bottleneck for developers at times (would make a great ./ topic), but the proper solution is NOT to write your own database and index managers from scratch. If you want to get out from under the DBA's thumb, then try some other approach besides using arrays for indexing and manually-written joins.

    (Note that I did *not* say that *all* OO fans avoid or mis-use databases. I am only saying that it is too common a practice. Thus, I am not really bashing OO here, but a bad practice often found in OO shops, for whatever reason.)

    1. Re:SQL and OOP in conflict? by rodgerd · · Score: 1, Flamebait

      Many OO fans are Java monkeys too stupid or arrogant to do anything as uncomfortable as learn the relational model. These people are about as much value to anyone as tits on a bull, and they certainly aren't programmers.

    2. Re:SQL and OOP in conflict? by Anonymous Coward · · Score: 0

      Many OO fans are Java monkeys too stupid or arrogant to do anything as uncomfortable as learn the relational model. These people are about as much value to anyone as tits on a bull, and they certainly aren't programmers.

      Yes, but if I said it that way, I would get modded as a "troll" (again), as you will probably be :-)

      I am trying to say it in a more diplomatic way. Such is good practice in a down tech market. We have to be nice to such people these days. Protects karma too. Good karma == good interview skills, perhaps.

    3. Re:SQL and OOP in conflict? by NineNine · · Score: 2

      I agree that DBA politics can be a bottleneck for developers at times

      In good teams of developers (in which I've only gotten to work a few times), the developers and the DBA's work very closely together. The DBA creates the sandbox for the developer to work in, handles backups, helps with occasional optimizations, etc. In most shops, developers think that they understand databases if they can write simple SELECT statement. They just have no clue, whatsoever, as to what databases can do and what they can be used for.

      I was lucky enough to learn the hard way... I was pushed straight into development with a very, very brutal Oracle DBA. He knew more than I've forgotten in my lifetime, so I learned the right way to write apps. Most programmers never get that opportunity, so you're right, they treat databases as nothing mroe than a data dump. Hell, most people have no idea as to the scope and size of just Oracle's product offerings that all work with their databases.

  75. 834 pages by cyranoVR · · Score: 1

    If you need a "quick introduction to SQL" try reading Teach Yourself SQL in 10 Minutes. 800+ pages??? If it was a reference book, maybe you could justify the pagecount, but who has the time to thumb through an 800 page introductory text?

    Most developers (read: non-DBAs) are just going to do simple SELECT queries. TY SQL in 10 Minutes does the trick for those 95% of cases.

  76. Re:SQL by Anonymous Coward · · Score: 0

    Where did you learn database? From Sun? No wonder there are so many slow sites these days

    It seems some of the slowest systems are indeed Sun. It appears that managers don't want to spend the big bucks upgrading, so stick with the slow box and push developers to focus on speed at the expense of other things.

    Hopefully Linux will change this, although you can kiss Sun's stock goodbye.

  77. Re:SQL by Anonymous Coward · · Score: 0

    > Triggers, constraints - bah

    So what if you're working with a large system that has 50+ forms/processes that update a table and you decide you want to write an audit record to another table whenever something gets modified. Do you
    A) recode all 50 forms/processes or
    B) write a database trigger to populate the audit table

    Seems to me that B would be the better option because you only have to change it in one place and don't have to worry about someone writing a new process that updates your table without writing the audit record.

  78. Re:The age old question... by nathanm · · Score: 2
    It's always pronounced S-Q-L.
    That's a pretty bold, and false, statement. Some people may pronounce it that way, but most DBAs and database programmers I know (myself included) pronounce the language SQL as 'sequel' and some implementations or extensions of SQL by their name plus the initials 'S Q L.' For instance, the database MySQL would be pronounced 'my S Q L,' PL-SQL as 'P L S Q L,' and so on.
  79. Overhaul SQL by Tablizer · · Score: 2

    I would like to see SQL overhauled. It could be replaced with a functional-like syntax (FP) where you reference stuff instead of only nest it. Nesting gets really messy for bigger stuff because it splits "lists" in halfs and separates the halfs by jillions of miles. Plus, you cannot reference repeating sections in SQL without writing views, which requires bothering the grumpy DBA.

    A functional syntax would also allow one to add extensions without worrying about ruining the parse tree. Thus, if Oracle had something that Sybase did not when you switched vendors, the DBA could write their own library function to match it. A shop can't add to SQL very easily on their own because of the complexity of the language. FP syntax is more modular.

    The longer we wait, the more SQL will become entrenched, due to books like this.

    1. Re:Overhaul SQL by axxackall · · Score: 2
      FP syntax is more modular

      I agree with you. Almost.

      But which FP syntax do you mean? Lisp? ML? Or Haskell? Their syntaxes are quite different. How would you define FP syntax?

      And why DB products with "ugly" SQL syntax are more popular than ""pure" FP DBMS FramerD?

      --

      Less is more !
    2. Re:Overhaul SQL by Tablizer · · Score: 1

      And why DB products with "ugly" SQL syntax are more popular than ""pure" FP DBMS (FramerD)[framerd.org]?

      Quote from site:

      "FramerD is a portable distributed object-oriented database designed to support the maintenance and sharing of knowledge bases. Unlike other object-oriented databases, FramerD is optimized for the sort of pointer-intensive data structures used by semantic networks, frame systems, and many intelligent agent applications."

      I meant *relational* databases (or DB language. No need to totally overhaul existing engines). I don't like OO nor 'network' databases. They resemble properlly dead 1960's technology. The biggest distinquisher is probably that relational DB's have "logical" links, not physical links (pointers). This gives you more ad-hoc choices of joining and cross-referencing because you are not limited to the explicitly-placed links between things.

    3. Re:Overhaul SQL by axxackall · · Score: 2
      The best "functional-relational" language I've ever read about was Datalog (1993). But there is still the same question - why hasn't it become popular?

      The only answer I can see myself is that most of limitations in "pure" ANSI SQL are compensated (somehow) by integration (embedding) SQL with conventional (mostly procedural) programming languages. I agree that the result of such integration is "dirty". However does anyone else (besides me and you) in the world understand it?

      Actually, there other such people, but their ideas about post-SQL are considered as crazy and no one commercial company wants to adopt it.

      Perhaps open source can? How about functional programming extention to PostgreSQL? It's already got PL/* extension to integrate SQL with procedural languages. How about FL/*? It would be exciting to have FL/Haskell, FL/Lisp, FL/Scheme and FL/ML in PostgreSQL! Just remember, when I mean FL/Schema I don't mean pgsql *client* library linked to the guile or gauche interpreter. I mean that the scheme interpreter library will be added (embedded) to PostgreSQL *server* as a server-side FL/Scheme programming extension in a way similar how Python interpreter library is added (embedded) to PostgreSQL *server* as a PL/Python server-side language extension.

      And why stop on FL? How about Logical and Function-Logical programming language extensions in PostgreSQL? LL/Prolog, FLL/Curry - you name it! :)

      Now the question is who will do it and on what budget?

      --

      Less is more !
    4. Re:Overhaul SQL by Tablizer · · Score: 1

      Actually, there other such people, but their ideas about post-SQL [3rd Manifesto] are considered as crazy and no one commercial company wants to adopt it.

      I think the main reason the big-iron DB companies aren't interested is because a cleaner query/DB language would be more portable and consistent. The DB industry relies on proprietary extension lock-in for much of their cash-cow revenues.

      Thus, you are right in that probably only an OSS solution could light a fire under their behinds. It would probably have to have SQL also to be contendor. IOW, a better RDB language would probably have to come in on the *coattails* of an SQL-capable DB.

  80. here's a shorter version by Kallahar · · Score: 2

    "Beginners" guide should really be these three lines:

    To select something
    select columnname1, columnname2 from tablename where columnname1 = 'thevaluetogetby';

    To add a line to the DB
    insert into tablename (columnname1, columnname2) values('value1', 'value2');

    To update a line
    update tablename set columnname1 = 'value1', columname2 = 'value2' where columnname1 = 'thelinetoupdate'

    THAT is a beginners guide. I don't know what the other 833 1/2 pages have... Sure some people consider all the different joins to be "beginner" but I'd call that stuff intermediate.

    Travis

    1. Re:here's a shorter version by TardisX · · Score: 1

      Errr, no.

      If you can't join two tables together, you don't know SQL. Not even at beginner level. Zip, nada. Not for fun or profit.

      If you think you need SQL for a dataset represented by a single table, you don't.

      --

      Command attempted to use minibuffer while in minibuffer
    2. Re:here's a shorter version by Jack9 · · Score: 1

      I disagree. Joins are completely unnecessary for any 1 person web-project while almost every cgi and hell webhost provides one. Why bother setting up a flat file format on a foregin server? Multiple tables don't imply joins. Joins are not for beginners and you do know sql if you can do single table manipulations. You know syntax and understand the physical data relationship. The fact that you don't use structs in any project for your beginning C class doesnt mean you don't know C. You just don't know much and aren't using it properly. For fun, why would someone want to TRY to use joins as a beginner? Don't be silly.

      --

      Often wrong but never in doubt.
      I am Jack9.
      Everyone knows me.
    3. Re:here's a shorter version by TardisX · · Score: 1
      And that is why we get people doing things like this:

      SELECT id FROM table1;

      foreach (result) {
      SELECT * FROM table2 WHERE something = id
      do_stuff()
      }
      If you don't know how to use a tool, don't use it. Not knowing joins means you DO NOT know SQL.

      Just because it's easy to setup a table on your webhoster, doesn't mean it's the right tool for the job. That's incredibly naive.

      The 'R' in RDBMS is there for a reason.

      --

      Command attempted to use minibuffer while in minibuffer
    4. Re:here's a shorter version by Jack9 · · Score: 1

      your need for absolutes, either "proper use" by your undefined standard or no use at all betrays a dangerous incompetence. There are steps to knowledge. How can you be computer literate and turn around and say (in effect, since you already have a tacit knowledge of windows), dont use it unless you know how?

      Ancillary point: This has nothing to do with relation in databases.

      While your example is a valid abuse of the database, this also has nothing to do with joins...your example implies a stored-procedure, which is beyond the scope of beginner for sure.
      In my original post I did not make it clear that most webhosting companies provide MySQL already. I have to ask again, how can there be harm in beginners trying to use a database on their own projects? Why would those projects use joins?

      Your answer is "dont use what you dont know"? How did you get better without baby steps? You're like a kid who says "I'm too smart for school". You cant just magically "get" the fundamentals of calculus from experience. Calculus took Newton & Leibniz half their lives to come up with the fundamentals. Calculus is not something you just "pick up" or "infer" from lower math. As with SQL, you have to take small steps first.

      --

      Often wrong but never in doubt.
      I am Jack9.
      Everyone knows me.
  81. Re:SQL by sapgau · · Score: 1

    Wrong. If you 'just' want to store data and ignore the functionality available in your DBMS then you should use flat files.

    And have everything running local, or were you planning to deploy it on a network?

  82. which is why ... by Anonymous Coward · · Score: 0

    We keep our phone lists in text files and edit 'em with vi.

  83. Re:It works both ways by SNACKeR · · Score: 1

    I have seen MySQL programmers do massively inefficient (and stupid) things like retrieve a list of keys from one table, store them in an in-memory array, then loop through the array executing a select for each key in another table - because they didn't know about subselects.

    And I have seen Oracle programmers cursor through data and/or use sub-selects, because they don't have a good understanding of what you can do with JOIN or GROUP BY.

    The point is that all invocations of SQL have their idiosynracies/extensions, and getting to know them is part of the game. MySQL is as good a place to start as any. There is no right answer here.

  84. Squeel by IPFreely · · Score: 2
    I always pronounced it "squeel", as in:

    I'm gonna make this server squeel like a pig.

    --
    There is nothing so silly as other peoples traditions, and nothing so sacred as our own.
  85. Re:SQL by pnatural · · Score: 4, Informative

    No, no, no... how do I say this? NO!

    The OP is completely correct: triggers and such are rubbish (except to enforce data integrity when the integral RDBMS mechanisms cannot). DBs are for storage, period. You claim that a DB is a great place to shoe horn logic, but that leads to problems.

    1. The bloat is in a functional-programming layer (SQL) instead of a procedural/OO layer. Given a choice between lotsa logic down in a DB and lotsa logic in my app, I'll take the logic in my app any day of the week. SQL does not promote code reuse, whereas most procedural and OO languages do promote it to some degree.

    2. The more code you put in a DB, the less portable your schema is -- and I'm not talking about platform portability, I'm talking about RDBMS portability. Nothing is worse than [IBM|MS|ORA] database lock-in.

    3. The poor performance you site may be common in your experience, but code in the middle layer(s) is not the cause of that: bad design and poor testing are the causes. Don't confuse correlation with causation.

    These points are backed with experience: I've been programming for 15 years, 7 years of that using databases heavily. The company I work for now has terabytes of data stored in the schemas I've developed for my apps, and no one has ever complained about maintenance or performance on one of my designs.

  86. Re:The age old question... by glwtta · · Score: 2
    which IMHO is like calling Windows "Operating System"

    Heh, Windows is called Windows, as in "Windowing System" - not much better than "Operating System" if you ask me.

    --
    sic transit gloria mundi
  87. Re:The age old question... by Anonymous Coward · · Score: 0

    Stroustrup? Catch a Dane, make him SQueaL! *Cough*. Actually, it's something like Strowstrup.

    Apropos Bjarne, most Scandinavians I've met say S-Q-L, I've _never_ heard anyone call it sequel.

    As to Linux, isn't there a .au floating around with mr Torvalds himself pronouncing it?

  88. Re:The age old question... by weylin · · Score: 1

    IBM had a language QUEL which stood for something, the successor was naturally called SEQUEL but the name could not be used for copyright reasons so the vowels were dropped. This is why SQL is pronounced sequel and no it does not stand for Structured Query Language.

    --
    --- Nukes don't kill people psychopathic megalomaniacs do.
  89. Re:The age old question... by Anonymous Coward · · Score: 0

    "You can easily spot a hardcore elite database guru by the fact that these people pronounce it "squirrel". "

    Haha, that's mean. Planting fake little facts like that to weed out the people who read slashdot and the jargon file and try to sound all cool by using the terminology.

    Hardcore elite hackers also call OS/370 'ocelot' too. And the nerd term for Apple is actually 'Fuji', or 'Granny Smith' if you're from Washington.

    (disclaimer: I have no idea if SQL is pronounced as squirrel or not, it's just a joke)

  90. Re:The age old question... by opello · · Score: 1

    Ok, I've never said 'sequel' (like Star Wars ep. 2 is a sequel to ep. 1, both of which are prequils to eps. 4, 5 and 6). It's just S.Q.L. (you don't say issssbnn for ISBN).

    Anyhow .. just my opinions :)

  91. 834 pages? it's just a beginning by axxackall · · Score: 2
    For most IT people it takes a couple of hours to get to grips with basics of select, update etc Joins, sub queries come next.

    Year, right. Next after 5000 hours. Even professional SQL programmers keep doing serious mistakes in sub-queries. Not only in performance optimization area (waiting for results forever), but also in consistency are (getting unexpected result sets).

    When you have 2-3 tables with 1-2 foreign keys than you may learn sub-queries in 12 hours. But when you do a very specific data mining work, combining several huge historical journals, several classification graphs, lots of assotiation maps and many lots of lookup tables, then you might realize that you still have to learn SQL even after 5000 hours of using it. If you don't think so, then you've never done any serious data mining by yourself. I spoke with many SQL programmers who worked with ERP, CRM and Supply-Chain applications and they had the same opinion.

    --

    Less is more !
  92. Re:It works both ways by horster · · Score: 2

    thank you !

    I was waiting for someone to point out that the given example of a subselect is really just a simple join. That's really just SQL 101. Now, there are cases for subselects, but they do get hairy.

    btw - middle tier all the way - what do you do in sql when you want to say, check db value a, based on return of C function b? run home to mom that's what.
    middle tier promotes code re-use, but it also promotes a _logical_ data schema over the _physical_ data schema which is exactly what putting logic in things like triggers and such in does not do.

  93. good for newcomers by jkitchel · · Score: 1

    I would have to agree that this is definitely a book for newcomers. I am new to SQL and I can say that the examples and the index will make anything you need to find/do very easy, especially when I am trying to get my homework done right before it's due. :)

    The reviewer hits it right on the nose when he says the book should be renamed SQL Fundamentals: Applied to Oracle and Access (or something like that). This isn't necessarily a bad thing,though. Used in an academic setting (where schools would most likely use Oracle or MS Access) or at home (where most people run Windows with Office installed), you get the most for you value.

    If you want a book that covers MySQL (or a different version) so that you can read and use it, chances are that you already know how to install, set up, and configure it. While that may describe the majority of /. readers, it doesn't come close to and every day joe schmoe users.

  94. Re:The age old question... by trust_no_one · · Score: 1

    I work for a publishing company, and believe me, we all say "izbin" for ISBN all the time. I also go back and forth between ess-que-ell and sequel, depending on my mood.

    --
    I'm not an actor, but I play one on tv.
  95. Database lunacy driven by clients! by FyRE666 · · Score: 2

    Having redundant, or seemingly ludicrous table structures can sometimes be the fault of client specs changing under a programmer/designer's feet.

    I recently completed an app to handle load allocations for a haulage company. A weeks worth of deliveries are emailed over every Saturday, the app sucks it in and populates the db, then makes descisions based upon vehicle availability, capacity etc etc. This was all well and good UNTIL the supplier started reusing distribution point IDs as they changed! So one week we would have ID 65536 holding details for Fred Bloggs, the next, ID 65536 would be Joe Smith. This brilliant idea of reusing IDs was never mentioned, and only appeared after 2 months had passed and problems arose with deliveries appearing at the wrong addresses!

    When asked why they did this, the reply was "we just do it that way"?! Needless to say, since the distributor IDs were the foreign key for orders, which were in turn linked to delivery items, and also to the vehicles used for delivery, this lead to some "creative" changes in the db (now delivery points have the id plus another "version" id which doesn't help efficiency all that much, and must look ridiculous to anyone else viewing the code).

    Then there was the fact the haulage company wanted to be able to "squeeze" extra items into a vehicle after specifying its maximum capacity - and then asking me why the app wouldn't allow it - oh and also they often wanted to be able to route large vehicles to locations marked as "inaccesible" for that vehicle - which kind of screwed up the routing logic... In fact, just thinking about that project brings tears to my eyes ;-)

  96. Blah! by Anonymous Coward · · Score: 0
    We, mere mortals, have to deal with existing databases.

    you will see the light, rebel, tell Oracle et al to go screw, and help develop some nice good Open Source alternative to the crappy SQL language.

    The people you mention are very good preaching, but very bad providing a working alternative. Telling other people to do stuff is not the free software way.

    1. Re:Blah! by horster · · Score: 2

      yeah, I don't like the dbdebunk stuff either. they spend too much time talking about how ignorant everyone is and too little time talking about real practical solutions.

  97. In a perfect world, yes...... by Ride-My-Rocket · · Score: 1

    ... but when you're developing for a highly-scalable database, you want to wring out as much performance as possible. And that means accepting the fact that if you dump all of your application logic into the middle tier, you'll be sacrificing some potential performance gains for portability.

    I also think it's foolish to code all of your stuff to be 100% portable between different databases, since each RDBMS has its own set of customized extensions / improvements. Why would you sacrifice the potential performance of your app just so you can port stuff between SQL Server and Oracle easily, unless you're planning to go back-and-forth between the two?

    1. Re:In a perfect world, yes...... by joshv · · Score: 1

      ... but when you're developing for a highly-scalable database, you want to wring out as much performance as possible. And that means accepting the fact that if you dump all of your application logic into the middle tier, you'll be sacrificing some potential performance gains for portability.

      Things like validating user input and maintaining referential integrity don't require much overhead in the middle tier.

      Modern RDBMs are highy optimized to search through and locate large amounts of related data. That's what I use them for - and I will use every trick available to me to preformat and massage the data using standard SQL. But once I have the data out of the database, the data is the responsibility of the middle tier, until it is committed back to the database.

      There may be some performance enhancements to be had locating some of the business logic in something like a stored procedure, but this is almost always far outweighed by the overhead of maintaining code on multiple platforms and multiple locations. I strive to keep it simple.

      -josh

  98. Re:The age old question... by Anonymous Coward · · Score: 0

    Your mom is an idiot for repeating such ignorance. You are an idiot for taking up to 20 minutes (?!) to figure out if she's talking about her OS, word processor, or mail program.

  99. Re:SQL by mark_lybarger · · Score: 1

    there's a middle ground between all or no logic in the "storage layer". tables thems selves contain application logic, checking row types, etc.

    SQL does not promote code reuse,

    most database queries are reused thus prepared statements were born, and stored procedures. the database folks, bless their hearts, said "hey, you're using that querry quite a bit, how about we just compile it all up in the database for you and speed things up a bit, eh?".. bang, code reuse.

    The more code you put in a DB, the less portable your schema is

    databases aren't about portability, they're about stability. sure, the cheep database users (PostgreSQL, MySQL, etc) want to keep portable in case something better comes along, but those who spend 500,000$ for their RDBMS software package will keep it around for a tad. they're focused on making sure that their data is available when they need it and that it's reliable data. the RDBMS software ensures that, not some application programmer reading /. all day.

    The company I work for now has terabytes of data stored in the schemas I've developed for my apps

    bravo... most companies have terabytes of data stored in their schemas used by their applications written by their developers. they realize the advantages and disadvantages of using certain features of the rdbms and put them to use accordingly (sometimes they might get it right, some times they might not). it's interesting that you design the software that you develop that the company uses for it's terabytes of data. i've found in places i've worked that we create designs for applications to be developed for he company uses to run its business. you might find that if you take out all those i's and use lots of we's for the good of the compnay, you'll still get some credit ;).

  100. Re:The age old question... by Pinball+Wizard · · Score: 1

    Beg to differ. Here in the world of books, "izbin" is the common pronunciation - saying "eye-ess-bee-enn" confirms you to be a newbie.

    --

    No, Thursday's out. How about never - is never good for you?

  101. How does this help wanna-be DBDs? by CowbertPrime · · Score: 2

    Sure, this book will help you learn SQL syntax (maybe they ought to have named it "SQL-Primer Plus") and elucidate the schemas found in your favorite LAMP (linux, apache, mysql, perl/php/python) guides, but how will this help teach people the fundamentals of good database design? Sounds like this book will just churn out even more people who can just add "I know SQL and how to build databases" to their resume even though they will give you a blank stare when you ask about normalization. Like how using MySQL for 'learning' purposes leads to bad habits, I fear that this book might also promote loose discipline in web-based-database-applications. If I am contracting someone to build me an ecommerce site and know they have read this book, they won't be hired.

  102. MS SQL book by jcninwisc · · Score: 1

    In the coming months I am going to need to learn SQL, in particular, for use with MS SQL (as well the Oracle product). Does anyone have any suggestions for good books for using MS SQL? I am very new to SQL, so this should be an introductory text.

  103. Re:SQL by pnatural · · Score: 3, Insightful

    there's a middle ground between all or no logic in the "storage layer"

    of course. brilliant observation.

    tables thems selves contain application logic

    not my tables, and not any tables from the developers on my team.

    checking row types, etc.

    this isn't application logic, it's data integrity.

    "hey, you're using that querry quite a bit, how about we just compile it all up in the database for you and speed things up a bit, eh?".. bang, code reuse.

    sorry, that's not code reuse at all, not even close. give me a [stored proc|view|table] that i can inherit from or subclass, and that would be reuse.

    but those who spend 500,000$ for their RDBMS software package will keep it around for a tad.

    and one of the reasons that they'll "keep it around" is because they paid so damn much for it. why lock in an implementation decision for so long? it doesn't promote agility, nor does it promote flexibility. quite the opposite, it encourages poor SQL coding (i.e., vendor-specific features). it's called the "Golden Hammer" Anit-Pattern. look into it.

    most companies have terabytes of data stored in their schemas

    um, no. gigabytes, maybe, but most companies have databases in the terabyte range? i don't think so.

    you might find that if you take out all those i's and use lots of we's for the good of the compnay, you'll still get some credit

    funny, it sounds as if you haven't read _The Mythical Man-Month_, wherein Brooks asserts that the best software systems come from a single mind. if you're a professional software developer (it's hard to tell from your post), i strongly suggest you read it.

    as to credit, i'm not in it for that. rather, what motivates me is implementing solutions that help achieve the objectives of the company for which i work. see, i'm a stock holder as well as an employee, and i'm just as motivated by profit as the CEO.

    on another point, maybe should note that a great sense of ownership leads to pride in work and higher quality. (to be sure, there are pitfalls associated with too great a sense of ownership, but experienced developers know when and how to cut the cord, so to speak)

  104. Re:SQL by joshv · · Score: 1

    I don't ingnore the functionality that standard SQL provides. I use the more complex constructs standard SQL supports all the time to satify complex reporting requirements. This does take advantage of the relational schema to deliver data much more quickly than if I code the logic in the middle tier. This is an appropriate usage of the database tier and it is functionality that flat files will not provide.

  105. Hey, I was kidding .... by binaryDigit · · Score: 2

    No need to respond to my linux or bjarne comment, I was joking, I've heard the pronunciations, please, stop :)

  106. Re:The age old question... by ManxStef · · Score: 1
    It is properly S-Q-L because Sequel is something different (Structured English Query Language, an IBM project that never went anywhere). But the term "sequel" for SQL has come into common use, so it's the de facto pronounciation.
    I pretty sure it's interchangeable.

    SEQUEL is indeed Structured English QUEry Language, which was invented by IBM back in the 70's as the query language for their relational database System/R. But it did go somewhere: into the public domain, where the acronym was shortened to SQL.

    Its success is as much attributeable to Relational Software Inc. as IBM (who continued to use it in System/R's followup SQL/Data System, and SQL/DS's successor DB2), as Relational Software chose it as the query language for their fledgling RDBMS, which you may have heard of - ORACLE

    As it became apparent that SQL was here to stay, ANSI created a standard definition (the first of which was SQL-89). Today's SQL standard is based mostly on IBM's implementation, with a good few substantial additions.

    So as I understand it, SQL is not really something different to SEQUEL, it's just a newer evolution.

    Oh, and back on topic, here's an excellent online introduction to SQL by James Hoffman. I'd also recommend checking out the Google Directory's SQL FAQs, Help, and Tutorials.

    Cheers,
  107. Mere Mortals by jheywood · · Score: 1

    For beginners, I always recommend "SQL Queries for Mere Mortals" by Hernandez. Easy to understand and follow.

    --
    Madness takes its toll... ...Please have exact change ready...
  108. Re:SQL by joshv · · Score: 1

    After 10 years of doing development, all of it with databases in the back end, I know people like you very well. People who don't understand databases don't know how to use them, and code all of the logic into the middle tier

    I understand relational databases very well. Know how to use them very well, and program tons of code on a very successful platform that locates ALL of it's business logic in the middle tier. This is just good design. Period. It allows for maximal code reuse, and minimized maintenance issues.

    In one case that I was involved in, the company closed because their project couldn't be done on time since they decided to listen to this "expert" who spouted off similar stuff like what you're saying.

    I know nothing about your project, but I can guarantee you there were more extensive problems than your expert advice. Well designed database schemas which are properly indexed should perform well regardless of where business logic is located. In fact throwing on triggers and relational constraints will tend to slow down performance.

  109. Re:The age old question... by Anonymous Coward · · Score: 0

    From The "You Say Tomatoe..." Dept:

    Maybe it's the Southern boy in me, but does anyone else pronounce it see-kwuhl and not see-kwell?

    "The forecast for tonight is dark, with widely scattered light in the morning."

  110. Easiest way to learn SQL without reading this book by Anonymous Coward · · Score: 1, Informative

    I would vote for SQLCourse.com as the easiest way to get started in SQL.

    After it I had to read 4 other books, but that is the site that I refer all people who ask me about SQL. Simple, enjoyable, and hands-on practice.

    Since I was a moderator, I am posting as a logged out AC (my points are used up :).

    Anyhow sqlcourse.com, "Database design for mere mortals", "PHP & MySQL development" (on Sams), and "SQL Server 2000 Developer Guide" is all that I needed to learn database programming. For the Enterprise-inclined, I'd recommend "Instant SQL Server 2000 Applications". mySQL is OK for beginning programming in SQL. One quickly enough outgrows its capabilities.

    As far as Access goes, here's a not-so-obvious shortcut to its SQL interface.

    Open a database, go to Query, create query in design mode, right below the file menu is a button that looks either like a grid, or a triangle. If you click it, the last choice in the pull down menu is SQL.

    Select at will :-)

    I will also argue that Access 2002 (XP) uses MSDE as its engine, so the user has an excellent environment to work with. MDB format is bad, MSDE is nice as it's simply an embedded edition of SQL Server 2000.

    These are good resources.

    As long as someone tries to stick to ANSI-compliant SQL, it's nothing too difficult.

    For someone who understands relational theory tools such as Access Visual Query and Datanamic's DeZign for Databases greatly simplify their life.

    Lastly, using Safari saves quite a bit on books too.

    No affiliate links were used in this message. :-)

    Leonid S. Knyshov

  111. Re:It works both ways by sql*kitten · · Score: 2
    btw - middle tier all the way - what do you do in sql when you want to say, check db value a, based on return of C function b? run home to mom that's what.
    middle tier promotes code re-use, but it also promotes a _logical_ data schema over the _physical_ data schema which is exactly what putting logic in things like triggers and such in does not do.


    Let's say you want to access the same group of tables from multiple places in your application, in different objects running on different hosts written by different people, and you don't have source to some of them. You've got 3 choices:
    1. Write validation code into each object, or insist that the vendor writes it for you
    2. Write a wrapper for all the underlying database objects to do the validation
    3. Use triggers and constraints

    Option 1 is just silly - impossible to maintain for all but the most trivial cases. Option 2 adds an additional layer of indirection, hitting performance, it's another layer to test and another point of failure in production, and it's functionally the same as a trigger anyway. Or pick option 3, which has been refined over 2-3 decades in some of the toughest transactional processing apps in the world, keeps all you code in one place, and guarantees integrity even if you can't in your objects.

    As an experienced system architect, one of the mistakes I see newbies make all the time is that they think because their tiers are logically distinct, they have to be physically distinct too. In a professional shop, your logical design will be done by a theoretician who doesn't even know or care what the eventual platform will look like, then the physical design is done by a hardcore, grey-haired DBA who's been there and done that on a dozen major projects. The programmers who actually implement it almost always don't see the big picture, because they're the specialists that focus on their own personal bits of the code.
  112. Re:It works both ways by horster · · Score: 2

    > [schnip] and you don't have source to some of them.

    if I don't have the source to applications that are accessing my database, then I'm in pretty big trouble. not having the source means I don't trust the app, and at that point it's like having a wide open door to your db. Sure you could play catch up with some triggers and such, but really, you're already in a bit of a mess aren't you?

    Let's assume a reasonable environment though, we're you're building an app, and have control over the source. So - if twenty apps update 5 tables, then which sounds better - leave the database wide open and assume they can be updating it any which way, biting your nails worrying about a data integrity problem (like - maybe application a updates column a in one way and application b does it in another) or put the update code in one place, such that all applications go through the same api.

    Preferably this api is a middle ware api, but it could just be an object to, middle ware is easier to maintain, but perhaps has more up front infrastructure.

    As far as performance goes, that's just total bullshit. If anything, moving the core integrity checking off to another host, and freeing you're database server to do record management only will speed things up. Further, if reads and writes are funneled through a correct api you only need to change one set of code once when you want to change database schemas, which you _will_ want to do. Business requirements change, tables need to be added.

    btw - in you're description of what 'professionals' do, how do the programers ever know of the logical data model if they are hitting the physical data directly?

  113. Re:SQL by NineNine · · Score: 2

    there's a middle ground between all or no logic in the "storage layer"


    You can still have a business logic layer. It's just that in many projects, that logic is faster and more efficient running as PL/SQL or TSQL than it is in some compiled DLL.

    and one of the reasons that they'll "keep it around" is because they paid so damn much for it. why lock in an implementation decision for so long? it doesn't promote agility, nor does it promote flexibility. quite the opposite, it encourages poor SQL coding (i.e., vendor-specific features). it's called the "Golden Hammer" Anit-Pattern. look into it.


    If you're talking about a serious piece of software (as opposed, to say, a web app for a shopping cart or something similarly as silly), flexibility isn't an issue. You simply don't go around switching databases for say, a bank or a credit card company or a health care provider. Any IT guy that says "let's switch databases" mid-stream for no good reason is incompetent. Projects that use things like Oracle generally use it because the company is stable, the projects are stable, and the project is going to live largely intact for many years.

    um, no. gigabytes, maybe, but most companies have databases in the terabyte range? i don't think so.

    It sounds like you're used to working on smaller, perhaps not misson-critial projects for smaller companies. Terrabyte+ databases are very common in most Fortune 500 companies, gov't institutions, etc. Who do you think keeps Sun in business? You don't buy Sun hardware for a 100 gig database. You get a PC.

    Your assumption that flexibility is always so very important is wrong. No reasonable company is gonna be switching databases like they change their pencil suppliers. It just doesn't happen. Hell, I know of many instances where companies stay with the same *version* of database for 5+ years.

  114. MySQL's own manual? by Anonymous Coward · · Score: 0

    Why not download MySQL AB's own manual? It is good.

  115. Re:SQL by pnatural · · Score: 2

    If you're talking about a serious piece of software (as opposed, to say, a web app for a shopping cart or something similarly as silly), flexibility isn't an issue.

    Flexibility is always an issue because requirements always change. To think and to code otherwise is folly and professional laziness. Anytime you get a set of requirements and code to them blindly without considering the ramifications on maintenance and future business objectives you invite disaster.

    You simply don't go around switching databases for say, a bank or a credit card company or a health care provider.

    Of course you cannot when they've been coded as you suggest. It's simply not practical, and maybe even not possible under your guidelines. If you code to SQL-92 whenever it can be done, switching databases becomes a real possibility.

    Any IT guy that says "let's switch databases" mid-stream for no good reason is incompetent.

    Straw man. Of course if there is "no good reason" it would indicate incompetence. However, there are often many good reasons to switch databases, such as constantly shifting licensing terms *cough*Oracle*cough*, ridiculous licensing fees *cough*Oracle*cough*, lack of standards *cough*Oracle*cough*, etc.

    It sounds like you're used to working on smaller, perhaps not misson-critial projects for smaller companies. Terrabyte+ databases are very common in most Fortune 500 companies, gov't institutions, etc.

    The original poster said "most companies", and "most companies" are not Fortune 500 or even Fortune 1000 companies. I thus stand by my statement that most companies do not have database systems in the terabyte range. And it sounds like instead of refuting my original points, you'd rather try to dismiss them by suggesting I don't have experience with mission critical systems. Fact is, the databases and applications I design, develop and deploy are carrier-class because they have to be.

    Given your repeated mention of Oracle, it sounds like you're actually an Oracle developer as opposed to a SQL developer. That's okay, I suppose, as everyone needs to have a job.

    Hell, I know of many instances where companies stay with the same *version* of database for 5+ years.

    Uh-huh. And do the same companies have to maintain their code? How about extend it? Thought so.

  116. Re:SQL by J.+Random+Software · · Score: 2
    You simply don't go around switching databases

    You don't want to (unless, say, your organization grows rapidly and you need to migrate to a database and platform you couldn't previously afford), but what kind of leverage do you think you'll have with the vendor when it becomes known that you can't?

    Sure, many databases have crummy optimization and need to be coddled with proprietary query syntax, but failing to bundle a tested ANSI-conforming equivalent is negligent.

  117. Re:SQL by Anonymous Coward · · Score: 0

    Validation logic belongs in the middle tier. The storage tier is just that - storage. It shouldn't be smart, and it very definitely should do anything else than storing the data I tell it to store.

    Triggers, constraints - bah. All very vendor specific and they lead to application logic being strewn all over the tiers. Application Logic should be in the middle tier, period.

    There should always be enough validation logic in the database to enforce the consistency of the data. check constraints, triggers to manage foreign key relationships, etc. But I agree that general buisness logic shouldn't be there... just enough stuff to guarantee the correctness of the data. That's the whole point of a DBMS, to manage the database. Otherwise you're just wasting your time & money. Use flat files. or mysql.

    And this stuff is not vendor specific until you get too advanced. check constraints have the same syntax all over...

  118. A 834 page book is not a beginners book. by Anonymous Coward · · Score: 0

    A 834 page book is not a beginners book. This
    books really was'nt worth getting a review posted
    here. There are plenty of online SQL tutorials
    to get started.

  119. Re: Here's why by Anonymous Coward · · Score: 0

    It should be pronounced SEQUEL instead of spelled S-Q-L because you save one syllable that way and I'm a lazy freakin' sod.

  120. Re:SQL..Great this is My pet peeve. by Anonymous Coward · · Score: 0

    From my experience consulting ... I discovered that 80% of the Database pros (those actually in the field) have a very weak database foundation.
    And worst of all they tend to be arrogant.
    a bad combination

    So many clueless Database programmers, DBAs, & Instructors from all camps,(Even Oracle!),generally don't understand/appreciate the science behind database theory, don't fully understand the standard, confuse vendor extensions and quarks for the standard.
    It's a sad scary state of affairs out in the field.
    Many don't grasp basic principles like the cardinal rule: "Thy shall maintain Data integrity at all times".

    The guys at work bet me that I was wrong.
    So we decided to have a poll, silently quizing every expert we came across for 6 months.

    So far (5 months later) the numbers indicate 90% of the the gurus don't know much.

    Please before you master any DBMS product learn the standard practices & principles of handling data.
    You don't even have to study E. F. CODD's papers.

    Another handy resource: Database: Principles, Programming, Performance by Patrick O'Neil, Elizabeth O'Neil & Jim Gray (Editor)

  121. Excellent Docs on SQL + Design by Anonymous Coward · · Score: 0

    Re. SQL + design, the best literature I've read on the topic is the documentation published by informix (now IBM). Obviously some of it is informix specific but the publication below is definitely worth reading regardless of what DB you use. It contains an excellent chapter on design. You can get the book in PDF from IBM Here

    The general list of docs are Here

  122. Fundamentals of Database Systems by Anonymous Coward · · Score: 0

    Elmasri & Navathe

  123. Another great SQL book by Mr_Person · · Score: 2

    A book that I found very helpful for learning SQL is Sams Teach Yourself SQL in 10 Minutes. When I first started learning SQL I mostly got everything from the early Slashcode sources and the MySQL manual as I needed it - not the best way to learn :-). I was a bit skeptical about the "10 minutes" approach, but each of the chapters actually did work out to about 10 minutes and the information was easy to understand (may have helped that I already knew some about SQL) and was fairly thorough. Another point that I really liked about it is that for the most part it only talked about the SQL standard, not just how one vendor implemented it. However, if an important vendor differed in their implementation, they would talk about it. This worked out great for me because I just wanted to know SQL basics and "best practices" and could figure out vendor specifics from their manuals.

  124. Re:The age old question... by zonker · · Score: 0

    btw, can someone tell me what the heck postgres means? or where it comes from? thanks

  125. Hello from the past! by tigertigr · · Score: 1

    I just wanted to say hello to all the people linking from the future! HELLO!

  126. Re:SQL by spanky555 · · Score: 1

    Amen, brother.

    I'm not totally against writing stored procedures and such into the DB, but I am against doing it indiscriminately across the board, especially when it is dictated from "on high" by some poseur who knows vastly less than you do about maintaining a project or managing dependencies across development, QA, and production environments.

    At the last job I had (laid off due to the schemings of the same dumbfuck I'm about to describe), some new whiz comes in as the CTO and a totally pro-MS guy and tells the Java programmers, myself included, to just "as we go along, move all logic into DB."

    This was solely because HE DIDN'T KNOW JAVA. He thought it was because we didn't know RDBMS that we dug our heels in a bit - one of the co-workers who is too stupid and inexperienced to know better had been told to "always do stored procedures" by someone she worked with in the past, so she just started doing it, making us look like the ones who were not "team players", when in fact, we just wanted to avoid a maintenance nightmare or engaging in busywork so that a CTO can understand the codebase, all of which supplied no benefit. We gave the arguments in a rational manner - the CTO would go, "well, that sounds good, but do it, anyway", giving no argument for his side. Of course, the co-worker thought we didn't know how to do it, so she gave us a "lesson" in how to write stored procedures. I just about walked out of work that day - I have written stored procedures in at least five different types of databases, and called them from five different languages, and my junior is telling me how to do it. It got worse - because of this Benedict Arnold on our "team", we also had naming standards handed to us -- when we already HAD 170+ TABLES and a naming standard on those. But the new CTO could not perceive that we had naming conventions already, and by God, we were going to have to put those in, and "convert tables as we move forward, when we are in that code". Yes, there really are people that stupid out there running things, folks. It's not just in Dilbert strips. I was struck almost speechless by the depths of his stupidity. Unfortunately, the market doesn't always oust folks like this even in down markets, as much as they deserve it.

    Well, the rest of the programming team was canned by this jackass CTO who was a wanna-be DBA. And he is still there, still making my ex co-worker move logic into the DB for NO BENEFIT!!! Nothing is faster because of this, unless you know what you are doing - I know, I spent 2.5 years doing a lot of serious PL/SQL coding and tuning, and I know T-SQL pretty well, too. And neither of these people know what they are doing, trust me.

    I was glad when I got canned. Even in this economy, I'd rather look for something else than to work with and for ignorant dumbfucks who are posing as knowledgeable, and somehow respected by even dumber CEOs. Call me cynical. [Shrug]. Actually, I have a very good work attitude and ethic, but this was beyond the pale.

    But I will have marshmallows handy when they go down in flames for decisions and for hiring incompetent asskissers who can talk a good line to clueless CEOs.