Slashdot Mirror


SQL Cookbook

Simon P. Chappell writes "One of the staples of corporate I.S. development is processing data, and increasingly these days that data lives in a relational database. The lingua franca of relational database programming is the Structured Query Language (SQL), often pronounced "sequel". Many programmers find that the basics of SQL are easy to learn, but after that, it tends to get complicated. Enter the SQL Cookbook from O'Reilly." Read the rest of Simon's review. SQL Cookbook author Anthony Molinaro pages 595 (9 page index) publisher O'Reilly rating 8/10 reviewer Simon P. Chappell ISBN 0596009763 summary If you need help working with a database, this is the book for you.

The book is not for beginners and makes no efforts to teach any SQL. It concentrates purely on building on the base level of SQL knowledge that most programmers have. If you know the basics: Create, Read, Update and Delete (an unfortunate, yet memorable acronym) but rarely go beyond that, this book is for you. I know that I fall into this target market.

The point of the cookbook is that you need to get something done and you need to get it done sooner rather than later. Now, most of us can figure out most things given enough time, but in the real world, we rarely have enough time. The cookbooks objective is to save you time by giving you a successful approach that you could have figured out eventually anyway.

If you've previously read any other technology cookbook from O'Reilly, then you already know the structure of the recipes. For those new to the O'Reilly cookbook format, it's actually fairly straightforward. Each recipe starts out with a problem statement. Recipe one in chapter one, titled "Retrieving all Rows and Columns from a Table" has the problem statement "You have a table and want to see all of the data in it." Nice and clear. Then comes the solution. Naturally, for this problem statement we end up with a SELECT that looks like this:


select * from emp


Then the recipe has a discussion section where the solution is explained in more detail and the reasoning behind it is provided. For recipe one, the discussion explores the trade-offs between using the "*" to signify all columns versus naming each column explicitly.

The chapter structure through the book is very much one of building on the previous material. The first chapter starts with the fundamentals, the retrieving of records and then chapter two takes over with sorting the results of your query, while chapter three looks at using multiple tables.

Chapter four covers inserting, updating and deleting records. After that it's back into the world of queries, with chapter five exploring metadata queries for those times when you need to know just a little more about what's going on under the covers. Chapter six looks at working with Strings, a much harder topic than it would seem at first thought. Chapter seven addresses working with numbers and chapter eight does the same for date arithmetic with chapter nine bringing more understanding to general date manipulation. Chapter ten looks at working with ranges.

Chapter eleven dives into advanced searching in preparation for chapter twelve's information on reporting and (data) warehousing. Hierarchical queries are always challenging, so they're reserved for chapter thirteen. Finally, chapter fourteen is titled "Odds 'n' Ends" and is a general catch-all for some pretty advanced, but very infrequent problems.

I guess you either like the recipe approach or not. I love it, so I'm listing it as something to like about this book. The recipes are very well explained and while each one presents only one approach, where there are obviously multiple options, the discussion takes care to explain the reasoning behind the selection.

The writing is clear and the explanations are well laid out. Both the SQL code and the query results are presented well and are easy to read.

A very important part of the book is that it covers SQL variations for Oracle, IBM's DB2, Microsoft SQL Server and the open-source databases PostgresSQL and MySQL. Each of the recipes includes solutions for each of the five databases. While SQL is a standard, there seems to be some very relaxed definitions of full adherence to that standard; hence the book has to present up to five solutions for each problem.

Many of the recipes are advanced. While the front of the book has the entry level material, it ramps up in complexity pretty quickly. For some of us with very straightforward SQL knowledge, some of the recipes are going to take a while to fully understand and be able to use.

Many of the recipes are obviously oriented towards corporate reporting. If this is a big need for you, then this book goes along way to meeting your needs. If you have no need for corporate reporting, it's wasted paper.

This is an excellent book; it does exactly what it sets out to do and fully equips you to handle the most sophisticated database transactions.

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

172 comments

  1. Recommendation by PFI_Optix · · Score: 3, Informative

    As most people I know learn SQL and PHP together, if you're to the point that this book would be of benefit to you, I'd suggest also getting the PHP Cookbook. That book has done wonders on improving the quality of my code.

    --
    120 characters for a sig? That's bloody useless.
    1. Re:Recommendation by SatanicPuppy · · Score: 3, Insightful

      If they write SQL like most people write PHP...yeesh.

      In my experience, the people who generally most need SQL books like this are the report guys...You know, not really IT, just kinda work on the fringes of things with Access and Crystal Reports...Don't know much about code, but are good with the data. I can see one of these being really useful. I have the Java Cookbook (and the Php cookbook, as it happens. =P), and they're pretty handy, though they fill a niche that I usually fill with google.

      --
      ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
    2. Re:Recommendation by PFI_Optix · · Score: 4, Informative

      Google has failed me a few times with PHP issues, the cookbook has helped fill in the gaps there.

      Problems with finding answers on the web:

      1) The code for the answers to problem A and problem B don't necessarily work together

      2) The code is of questionable quality. I'm six months in to teaching myself PHP (and CSS, SQL, and a few web server applications) and I can tell you that the code I wrote just two months ago was utter crap, largely because it was based on web tutorials that completely neglected good practices.

      3) I have no prior experience or training with programming, which makes it hard to even know where to start looking for a solution. Books like this have helped me learn how to know what I need to search for.

      --
      120 characters for a sig? That's bloody useless.
    3. Re:Recommendation by fh8510 · · Score: 5, Insightful

      Most people I know who use SQL work in Java, Ruby, Python, C++, JDBC, ODBC, ASP.NET, Hibernate, etc. Please, there are so many SQL related technologies. PHP is not the be-all, end-all one. The beauty of SQL is that it's a language, platform independent way to define and manipulate relational data. It's a data-centric way to deal with data. Adding one of the related language to the mix just muddles things.

    4. Re:Recommendation by drinkypoo · · Score: 1

      Now, I would like to have this book to support my own ends, but as a report guy, I don't particularly need it. Why not? Because Crystal does it for me. Anything so complicated that Crystal will screw it up, I wouldn't be doing in Crystal anyway. That's when I would need more SQL for actual work, but the fact is that I don't need it anyway, because I don't have to do any reports too complex for crystal.

      Meanwhile, no one with sense is going to write their own SQL (except for occasional SQL statements to retrieve some particular piece of data) for crystal reports, because it's just another thing to maintain, and crystal makes that agonizing enough. For instance, I work with Aristocrat OASIS casino management software. There are different tables with statistics compiled on a session, daily, DOW, weekly, monthly, yearly, or lifetime basis. If I have a report using one of these, and I need more detail, then I might have to go from (for example) the day stat table to the session stat table. You might think that it would make sense to just always do to the session table, and just use crystal reports' grouping function to present results in different types of views, but then I'd be pulling millions of records and crashing crystal reports, which happens disturbingly often (crashed it this morning just doing something innocuous, in fact.)

      Anyway, I'm kind of at a loss as to why the crystal guy would need to write any complicated SQL statements. I know I certainly don't need to. Now, in my job capacity as webmaster, it's very different...

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    5. Re:Recommendation by WindBourne · · Score: 3, Interesting

      Normally, I do staight coding on servers, sometimes the client. Most of my work does not involve huge amounts of DB work. So I get by on the DB, but I do not consider it a strength.

      Now, I am in a job where currently, I am testing data that is being modified through a series of transforms. We test by loading the end work and taking it back to the initial work (i.e. we reverse the process). We find it easy to load the data into a Postgres DB, create views with conversion functions to take end->initial and then run an assortment of queries over the data to make certain that it is correct. I have found that I do go back to several book to make sure of my sql as well as to improve the speeds (a subquery took 20 min to run while using a except gaves a similar answer in under several seconds. BIG difference considering that we are looking at many tables with a number of tests each).

      The books help.

      --
      I prefer the "u" in honour as it seems to be missing these days.
    6. Re:Recommendation by flogic42 · · Score: 1
      Select *
      From US
      Where grits=hot AND natalieportman=naked
      --
      Check out my women's designer clothing store.
    7. Re:Recommendation by jbarket · · Score: 4, Informative

      The PHP manual is the absolute must use resource.

      Not only is it obviously a complete reference guide to the language, but the user comments on each function often cover a wide variety of uses that can help solve your particular problem. More importantly, if poor quality code is posted, someone will often post a cleaned up version.

      Not to knock books at all. Just saying, there's a great free resource out there that is vastly superior to the hundreds of ad ridden script sites.

      --

      -----
      jonathan barket
    8. Re:Recommendation by Amouth · · Score: 1

      i have found that the more books you can read on data Structures the better - they don't even have to be based on things you use it jsut gives you a good refrence..

      It is amazing how much you can optimize things if you know what your doing and can visualize things well..

      only issue i have is that i tend to over design/build things.. which makes them take longer.. but i have never had to restart from scratch to implement something new so it is worth while

      --
      '...if only "Jumping to a Conclusion" was an event in the Olympics.'
    9. Re:Recommendation by SatanicPuppy · · Score: 1

      Agreed. The php online manual is one of the best features of the language. I also like how it's presented; simple and esaily searchable.

      I went and picked up O'Reilly's Safari Service, and while it is perfectly sufficient for slogging through an entire book, it's pretty inadequate the day-to-day function reference stuff, mainly due to its clunky interface. Fine, you need to split the pages up, but if I have to load a new page more than once a chapter, I'm going to be pissed. I'm not pleasure reading here, I want an answer and I want it now.

      --
      ad logicam Claiming a proposition is false because it was presented as the conclusion of a fallacious argument.
    10. Re:Recommendation by rainman_bc · · Score: 2, Interesting

      Now, I would like to have this book to support my own ends, but as a report guy, I don't particularly need it. Why not? Because Crystal does it for me. Anything so complicated that Crystal will screw it up

      I'm a report guy, and let me tell you that you cannot count on Crystal to do it all for you. Sometimes the request comes in is too complex to solve without using correlated subqueries, derived tables, and the like which Crystal Won't properly use for you.

      Trust me, I work for an online gaming company, and some of the requests can get amazinhgly obscure.

      --
      09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
    11. Re:Recommendation by drinkypoo · · Score: 1

      Sure, but once it's that complicated, I'm more likely to abandon crystal entirely, and just go generate HTML with perl, unless I explicitly need to generate a PDF or XLS from the results, because Crystal is Crap.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
    12. Re:Recommendation by TechDogg · · Score: 0

      Report Guys are not really IT? I resent that.

      I find that doing reports is not what you aim for when finishing a CS diploma, but i find it to be a great entry level programming position. I agree that using MS Access can't be considered SQL, but some of us actually use MySQL, PostgreSQL or even MSSQL.

      I also happen to be using Perl (Spreasheet::WriteExcel). It's great for generating Excel files without actually using Excel.

      I considere myself to be a real IT guy; don't take anything from me just cause I'm programming reports.

      --
      Got MILF? It does a body good!
    13. Re:Recommendation by Crizp · · Score: 1

      I know most of you have read this one, but as a service to our new readers:

      The Art of Unix Programming. I read that one as a budding PHP coder; while very Unix/C centric (well, duh) the basic philosophies will benefit any coder. My code's not that good, really, but without the principles outlined in the book it would be absolutely horrid.

      If the PHP kiddies would read it we would at least have properly indented code.

      I forget; what's the official Slashdot position on ESR these days?

    14. Re:Recommendation by rainman_bc · · Score: 1

      unless I explicitly need to generate a PDF or XLS from the results, because Crystal is Crap.

      Then you don't know how to use Crystal well enough. Compared to Xreporter or Jasper or R&R Report writer, it's pretty damned good, don't kid yourself.

      --
      09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
    15. Re:Recommendation by rainman_bc · · Score: 1
      Just to point out I'm a report guy. I know Java, Ruby, PHP, and some Perl. I know VB.Net and C#. I know Coldfusion and ASP. I've worked with SQL Server, Sybase ASE, and DB2. I've got skills. Most girls like guys with skills :) I'm not a dumbass, and I get paid well because I'm not one.

      The problem is many report people and PHP guys can't use more advanced sql techniques like:
      • Derived Tables
      • Correlated Subqueries
      • Proper Utilization of Indexes
      • Query optimization


      The other problem is we're hired to do work no other developer wants to do. Here's the typical development cycle from what I've seen:

      1) We need an app that does x.
      2) Developer writes app, and creates a database that fits with need x.
      3) Company then realizes they want obscure reports and hires report guy.

      That's way more common than you think.

      Problem is, that by the time I get involved, the company has started down a path of doom. The database does not support what the company wants to create operational reports on. No one ever stopped and asked the question: "What do I want to get OUT of my application?" I always find good workarounds, but if I was involved in the beginning, their app would work both for putting data into the DB, and for pulling it out also.
      --
      09 F9 11 02 9D 74 E3 5B D8 41 56 C5 63 56 88 C0
    16. Re:Recommendation by drinkypoo · · Score: 1

      The least stinky turd in a row of turds is still stinky. I'm tired of crystal crashing all the time. Sad thing is, sometimes it does it when I'm only getting back a small record set.

      --
      "You're right," Fisheye says. "I should have set it on 'whip' or 'chop.'"
  2. sequel? by TechnoLust · · Score: 4, Funny

    Shit, I've been calling it squirrel all this time!

    --
    "Da ist ein Technölüst in mein Unterpanten!"
    1. Re:sequel? by iggymanz · · Score: 1

      doh! and I been calling it SUCKLE

    2. Re:sequel? by Anonymous Coward · · Score: 0

      SQL? 'S'kewl.

    3. Re:sequel? by Anonymous Coward · · Score: 0

      Squeal piggy.

    4. Re:sequel? by ottffssent · · Score: 2, Funny

      As well you should!

      "Sequel cookbook"? Yeah, that's appetizing.

    5. Re:sequel? by Anonymous Coward · · Score: 0

      I used to call it SQueaL.

    6. Re:sequel? by Anonymous Coward · · Score: 1, Funny

      I'd like to introduce you to rabid squirrel.

  3. Microsofties say "sequel" by Anonymous Coward · · Score: 1, Informative

    Unix MEN say S.Q.L.

    1. Re:Microsofties say "sequel" by east+coast · · Score: 2, Interesting

      Indeed. I was always under the impression that "sequel" came from an old precursor to SQL called Structured English Query Language (Thus SEQL). Oh well, what do I know. I still call it S.Q.L. myself.

      --
      Dedicated Cthulhu Cultist since 4523 BC.
    2. Re:Microsofties say "sequel" by gregarican · · Score: 2, Funny

      Ess-Cue-Ell. Yes indeedy. What about an Access Control List? Ayy-Cee-Ell or Ack-uhl?

    3. Re:Microsofties say "sequel" by filesiteguy · · Score: 4, Informative
      I believe you're correct. http://en.wikipedia.org/wiki/SQL#History
      During the 1970s, a group at IBM's San Jose research center developed a database system "System R" based upon, but not strictly faithful to, Codd's model. Structured English Query Language ("SEQUEL") was designed to manipulate and retrieve data stored in System R. The acronym SEQUEL was later condensed to SQL because the word 'SEQUEL' was held as a trademark by the Hawker-Siddeley aircraft company of the UK. Although SQL was influenced by Codd's work, Donald D. Chamberlin and Raymond F. Boyce at IBM were the authors of the SEQUEL language design.[1]. Their concepts were published to increase interest in SQL.

      Oh, and as to the OP stating that SQL is difficult, try IMS.

      I'll take any SQL system over an IMS or other heirarchical anyday. :P I had the unfortunate need to learn IMS after years of various SQL databases. Sure it is faster, but what a learning curve!

    4. Re:Microsofties say "sequel" by Nutria · · Score: 1

      Definitely ack-uhl. And S.Q.L. And Lie-nuhks, pronounced like Lucy's younger brother.

      --
      "I don't know, therefore Aliens" Wafflebox1
    5. Re:Microsofties say "sequel" by mcmonkey · · Score: 2

      And the Microsofties are correct, if referring to the server platform. 'MS-SQL Server' is 'Microsoft Sequel Server.' (It's MS's product; they can call it whatever they wish.)

      The structured query language is abbreviated 'ess cue ell.'

      So it's perfectly correct to say, "let's see how that ess cue ell code performs on the sequel server."

    6. Re:Microsofties say "sequel" by BillAtHRST · · Score: 1

      FWIW, I recently attended a webcast with Michael Stonebraker (Ingres, Postgres, Streambase, etc.) and he pronounces it as "sequel". Good enough for me...

    7. Re:Microsofties say "sequel" by mooingyak · · Score: 1

      FWIW

      Is that pronounced 'phew' or eff-double u-eye-double u?

      --
      William of Ockham had no beard. The most likely explanation is that it was chewed off by squirrels every morning.
    8. Re:Microsofties say "sequel" by AnonymousKev · · Score: 1

      I also call it S.Q.L. But there's a guy at work that pronounces it "squeal" (like a pig). This makes design meetings painful, since I spend a lot of time trying to delete this mental image of Ned Beatty doing DB administration. "Yew got a purty table, boy."

      --
      Anonymous Kev
      Proudly posting as AC since 1997
      (Finally got a dang account in 2004)
    9. Re:Microsofties say "sequel" by redalien · · Score: 2, Insightful

      Structured Query Language is a misnomer, as it is not a complete language, just a small syntax, it is not limited to queries, and anybody who has used it will agree it's not structured.

      For example, if you want to change data you use a different command to changing database structure.

    10. Re:Microsofties say "sequel" by jtvisona · · Score: 1

      Why would you waste your breath on an extra syllable?

      "S" "Q" "L"

      "SEE" "QUILL"

      Let's strive for efficiency people, lest we let Dr. Codd down...

    11. Re:Microsofties say "sequel" by geekoid · · Score: 1

      "So it's perfectly correct to say, "let's see how that ess cue ell code performs on the sequel server."

      yet, highly confusing.
      Other database companies call the database a sequel server.

      More accuratly:
      "So it's perfectly correct to say, "let's see how that ess cue ell code performs on the MS sequel server."

      This all goes to Microft naming things in an unclear manner to make people think everything in an area of computing is theirs.

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    12. Re:Microsofties say "sequel" by sankyuu · · Score: 1
      SQL allows you to seek well!

      /ducks

    13. Re:Microsofties say "sequel" by Unordained · · Score: 1

      For example, if you want to change data you use a different command to changing database structure.

      Nitpick: If an RDBMS has properly implemented updatable views for the catalogue, you should be able to run insert/update/delete statements against the catalogue tables and have DDL happen automatically. SQL itself doesn't prohibit this that I know of, though probably very few RDBMS's actually allow updatable system tables. In practice, you can sometimes get away with this for simple datatype changes (that don't require any work against the data proper), maybe some default-column-order changes ('set position'-equivalent), field name changes, etc. You probably won't get away with creating and dropping tables though.

    14. Re:Microsofties say "sequel" by Unordained · · Score: 1

      Yet I find it works against them in this day of search engines. If I search for a concept or problem relating to one of their products by the product's name, say, "word", "publisher", "sql server", "windows", etc. Google is in no way required to assume I'm referring to MS products; it also should not have to guess that the one random forum post I'm looking for was intended to refer to a Microsoft product, even though the author forgot to put 'Microsoft' in front of each reference to the product. I hate cutesy product names as much as the next guy, but as long as they're easy to spell and remember and actually make my googling easier, I'll be at least mildly satisfied. It's easier to find solutions to problems with Konqueror than with Explorer, on that basis alone.

  4. BN vs. Amazon by CheeseTroll · · Score: 4, Informative

    You could pay $39 from BN, or $26.37 at Amazon.

    This looks like a very handy reference for those of us who can read SQL statements alright, but have grown lazy with all the GUI SQL-statement builders that exist now.

    --
    A post a day keeps productivity at bay.
    1. Re:BN vs. Amazon by nuzak · · Score: 2, Informative

      Or you could install BookBurro and compare prices yourself.

      Just google for it. It's an extension these days, not a greasemonkey script, which has its good and bad points (hard to add another bookstore yourself).

      Too bad SKU's aren't common in the public-facing interface of online merchants ... you could expand bookburro to nearly any product at all in that case.

      --
      Done with slashdot, done with nerds, getting a life.
    2. Re:BN vs. Amazon by andreyw · · Score: 1

      BookBurro. Teehee. I just imagined a burro saddled with books.

    3. Re:BN vs. Amazon by Malc · · Score: 1

      GUI SQL statement builders? They're actually useful? Maybe I haven't seen the right tools, but the ones I have were dreadful. Only useful for writing the simplest select queries with perhaps simple joins. Chances are I can type faster than I can use the GUI. At the end, I have a readable SQL code that I can easily debug. Some queries just don't make sense doing in one go (performace sucks - e.g. doing a cross-tab report on big tables) and I find it's much easier to do a multi-step query by hand than building things up in a GUI, especially when going back and forth between the steps. Of course, going back to the cross-tab report example, sometimes it's easier just to bang out a simple query and dump the results in to Excel for final processing.

    4. Re:BN vs. Amazon by heffel · · Score: 1

      Here's the link to Amazon.

      Yes, it's an affiliate link, flame away, what do I care.

    5. Re:BN vs. Amazon by slashdotnickname · · Score: 1

      You could pay $39 from BN, or $26.37 at Amazon.

      Or get it in PDF format from your favorite torrent site for $0.

    6. Re:BN vs. Amazon by fm6 · · Score: 1

      Yes, but Slashdot's kickback deal is with BN, not Amazon!

    7. Re:BN vs. Amazon by fm6 · · Score: 1

      You have an exceptionally low teehee threshhold.

    8. Re:BN vs. Amazon by fm6 · · Score: 1

      I used to do affilliate links every time I talked about a book on Slashdot. Once I even snuck one into the main story. Not worth the trouble — I've earned maybe $15 doing that. Where's the Slashdot Effect when you really need it?

    9. Re:BN vs. Amazon by jmusits · · Score: 1

      $24.95 at bookpool.com

      I get all my tech books there, they have great prices on O'Reilly books usually 25-40% off list.

      Jason

      --
      -- 42 --
    10. Re:BN vs. Amazon by Anonymous Coward · · Score: 0

      It's against Amazon.com policy to spam forums with affiliate links. I'm reporting you right now.

    11. Re:BN vs. Amazon by CheeseTroll · · Score: 1

      They are pretty dreadful if you're creating a mildly complex query. But something like Access, or OpenOffice Base, or even Crystal, is very useful for browsing through the tables and fields when you can't remember how to spell every one of the 150+ tables, not to mention all the fields, in your company's system. The vast majority of queries are relatively simple select statements, anyway.

      --
      A post a day keeps productivity at bay.
  5. The practical SQL handbook by WindBourne · · Score: 4, Informative

    For those of you just starting out, try the the practical sql handbook. I recently glanced through edition 3. I started at edition one years ago. It still remains an awesome book.

    --
    I prefer the "u" in honour as it seems to be missing these days.
    1. Re:The practical SQL handbook by f_g_goss · · Score: 1

      I have also found this a very useful book. Cheaper than other SQL books such as those from Oracle.

    2. Re:The practical SQL handbook by Anonymous Coward · · Score: 0

      SQL Visual Start Guide remains the best introdutory SQL book.

    3. Re:The practical SQL handbook by Neologic · · Score: 1

      There is a fourth edition, with a different subtitle, 'Using SQL variants', it was published in 2001 (as opposed to the 3rd edition in 96). Also, the same authors have a second book, called Practical SQL: The Sequel. Haven't looked at it, but it might be worth looking at. Often with technology books, I find there are a decent number of introductory books, but a dearth of intermediate books. Economically it makes sense, but still frustrates me.

      --

      "I hate quotations. Tell me what you know." -Ralph Waldo Emerson

  6. Joe Celko by ytsejam-ppc · · Score: 4, Informative

    There are a few books by Joe Celko like SQL For Smarties that are in the position of honor on my bookshelf. If you're beyond "select * from emp" and want to really learn how to efficiently get things done in a relational database, Celko is your guy.

    1. Re:Joe Celko by andynms · · Score: 1

      Celko's SQL Puzzles and Answers is good too.

    2. Re:Joe Celko by Sezzler · · Score: 1

      Agreed: Celko's 'SQL for Smarties' rocks ! This guy knows what he's talking about. I've lost count of the number of times I've referred to that book. Yes, it ain't for beginners but it cuts the mustard when the PHBs are on your back ....

    3. Re:Joe Celko by Anonymous Coward · · Score: 0
    4. Re:Joe Celko by Anonymous Coward · · Score: 0

      Celko is your guy unless you're coding SQL sometime this century...
      His shit is old and sadly innefficient and he makes up for it by being
      a cranky little douche anytime he posts on google.
      His shit is outdated and he hides behind his "use ansi it's portable" crap.
      yeah, i'd love to see someone walk into a job and start coding some crap
      that was ansi and explain to their fellow developers not to use the more efficient
      proprietary code for the sake of portability.
      his stuff is good for the absolute beginner, but doesnt cut it in the real world.
      his attitude is certainly a turn off as well.

    5. Re:Joe Celko by ZenFu · · Score: 1

      With all the negative posts by AC's on Celko, I just had to recommend that folks read the reviews on Amazon before writing off Celko's books.

      I like the guys on DbDebunk (the site referred to in several of the anti-Celko links), and I recommend their books as well, but I wouldn't recommend their books or their site as the best place to learn practical SQL. But, check out their site and decide for yourself.

  7. More Cooking with SQL by digitaldc · · Score: 5, Funny

    SELECT eggs (*) AS ingredients
    FROM Refrigerator
    GROUP BY NO.dozen
    INSERT INTO my_fryingpan (eggs1, butter1)
    UPDATE my_table SET toast = 'lightly browned'
    INSERT hole INTO toast
    MERGE eggs INTO toast
    USING (
    SELECT Eggs, Toast)
    CREATE Breakfast eggy_toast
    DELETE FROM my_table WHERE plate = 'N'

    --
    He who knows best knows how little he knows. - Thomas Jefferson
    1. Re:More Cooking with SQL by UnknowingFool · · Score: 4, Funny
      SELECT eggs (*) AS ingredients
      FROM Refrigerator
      GROUP BY NO.dozen
      INSERT INTO my_fryingpan (eggs1, butter1)
      UPDATE my_table SET toast = 'lightly browned'
      INSERT hole INTO toast
      MERGE eggs INTO toast
      USING (
      SELECT Eggs, Toast)
      CREATE Breakfast eggy_toast DELETE FROM my_table WHERE plate = 'N'

      You fool! You didn't specify nolock in that first select statement
      . . .
      . . .
      and I don't know if it's sadder that you wrote that SQL statement or I critiqued it

      --
      Well, there's spam egg sausage and spam, that's not got much spam in it.
    2. Re:More Cooking with SQL by suggsjc · · Score: 2, Funny
      INSERT INTO TRASH (
      SELECT eggs (*) AS ingredients
      FROM Refrigerator
      GROUP BY NO.dozen
      INSERT INTO my_fryingpan (eggs1, butter1)
      UPDATE my_table SET toast = 'lightly browned'
      INSERT hole INTO toast
      MERGE eggs INTO toast
      USING (
      SELECT Eggs, Toast)
      CREATE Breakfast eggy_toast
      DELETE FROM my_table WHERE plate = 'N'
      )
      SELECT beverage
      FROM Refrigerator
      WHERE Type = 'Beer'
      AND ROWNUM < 12;
      --
      When I have a kid, I want to put him in one of those strollers for twins and then run around the mall looking frantic.
    3. Re:More Cooking with SQL by bmalia · · Score: 1

      nolock? Is that like a MS SQL Server thing? I've never seen/used a nolock in Oracle or MySQL.

      --
      There's no place like ~/
    4. Re:More Cooking with SQL by Anonymous Coward · · Score: 0

      from the T-SQL help
      nolock hint -
      Do not issue shared locks and do not honor exclusive locks. When this option is in effect, it is possible to read an uncommitted transaction or a set of pages that are rolled back in the middle of a read. Dirty reads are possible. Only applies to the SELECT statement


      I would not use that by default. Unless it is ok for data to be in a bad state. I have only ever used it once and then only because the fix was much worse.

    5. Re:More Cooking with SQL by hotdiggitydawg · · Score: 2, Funny

      by UnknowingFool (672806) ...
      You fool! You didn't specify nolock in that first select statement


      by bmalia (583394)
      nolock? Is that like a MS SQL Server thing? I've never seen/used a nolock in Oracle or MySQL.


      Ahh, the irony is almost as delicious as the breakfast!

    6. Re:More Cooking with SQL by rycamor · · Score: 1

      Arrggh... why do you have to write this in the morning? You're making me hungry. I need to start having a real breakfast.

      CREATE TRIGGER AFTER UPDATE TO Mental_Picture IF NEW.image = 'Eggs & Bacon' AND NEW.sound = 'Sizzle' EXECUTE PROCEDURE Salivate(NOW());

    7. Re:More Cooking with SQL by Doctor+Faustus · · Score: 2, Informative

      NoLock is a SQL Server and Sybase thing (and maybe InGres?). They force select queries to wait until any updates that would affect their results are done and committed, unless you tell it to read the uncertain data with a NoLock. What Oracle does is to give you the data as it was before any uncommitted transactions began.

  8. Re:PHP cookbook by gregarican · · Score: 1

    Don't forget a pinch of marquee tags.

  9. Bullshit by Reality+Master+201 · · Score: 2, Informative
    First, SQL comes from SEQUEL ( Structured English Query Language), created by IBM in the 70's for getting data from System R.

    Second, I know plenty of mainframe and UNIX guys from way back who say "sequel" for SQL, some former IBMers, others not. The only people I ever hear call it "ess-que-ell" are management types and some FOSS people who have only ever heard about databases from reading stuff on the web and have never had a real job working with real databases.

    1. Re:Bullshit by Anonymous Coward · · Score: 0

      Well your dumb and so are your UNIX guys. This unix guy got corrected for saying See-quel once by another more macho unix guy and ever since I've been enlightened and say S-Q-L.

    2. Re:Bullshit by haapi · · Score: 1

      I pronounce it "squirrel" just to piss DB types off.

      --
      Well, apparently, you only have to fool the majority of people for a little while.
    3. Re:Bullshit by Reality+Master+201 · · Score: 1

      I say "squirrel" too, but only in the context of MS SQL Server. Cause it's full of squirrels.

    4. Re:Bullshit by advance512 · · Score: 1

      I'm a developer with a rather broad experience in development under different architectures and technologies. Right now, I'm developing a DB-based system. I call SQL ess-que-ell. So there ya go :)

    5. Re:Bullshit by Reality+Master+201 · · Score: 1
      Well, it ain't my fault you're an ignoramus ;)

      I originally got caught in the heat of the moment - have to remember that it doesn't really matter, so long as everyone understands what everyone's talking about.

    6. Re:Bullshit by Anonymous Coward · · Score: 0

      I pronounce it "squeal" and then tell everyone they have a "purty" mouth.

    7. Re:Bullshit by Anonymous Coward · · Score: 0

      A propagated mistake is still a mistake.

      SQL =! SEQUEL

    8. Re:Bullshit by fbjon · · Score: 1

      Only in English. In Swedish I've never heard anything other than S.Q.L.

      --
      True confidence comes not from realising you are as good as your peers, but that your peers are as bad as you are.
  10. A book about SQL? Revolutionary! by jdbartlett · · Score: 1, Funny

    SQL, you say? Never heard of it. Must be something new.

  11. Speak more slowly, please... by TopShelf · · Score: 3, Funny

    One of the staples of corporate I.S. development is processing data, and increasingly these days that data lives in a relational database.

    Thank you, Mr. Obvious!

    --
    Stop by my site where I write about ERP systems & more
    1. Re:Speak more slowly, please... by Anonymous Coward · · Score: 0

      That's Captain Obvious to you!

  12. Re:Mispronunciation by pclminion · · Score: 1, Informative

    SQL started out being called SEQUEL (and pronounced as such) until it was changed to SQL due to trademark issues. IMHO, the historical pronunciation is a valid precedent. See the History section of the SQL Wikipedia entry.

  13. There is also a MySQL Cookbook by vrTeach · · Score: 2, Informative

    As with the author of this review, I really like the cookbook format. I've made heavy use of the MySQL cookbook, also from O'Reilly, by Paul DuBois. It is excelent, and just about everything that Simon P. Chappell says about the SQL Cookbook applies, except of course the focus on just MySQL. I'm glad to hear of the SQL cookbook because I'll be developing for postgresql as well as MySQL in the near future. Thanks.

    --
    -- Mein Systemadminstrator hat einen großen schwarzen Moustache.
    1. Re:There is also a MySQL Cookbook by henryhbk · · Score: 1

      The nice thing about the MySQL cookbook, is they demostrate database recipes from the major web programming CGI languages (not exhaustive, please don't flame) such as Python, Java, PHP and PERL (and shell scripts for that matter) which is a handy quick reference, when I forget how to do basic connectivity in the language I haven't used in a while... I don't need this for day-to-day programming in MySQL, but when the recipe fits, it is generally a huge time saver (like database validating of email or URL, or XML to MySQL connectivity)...

  14. sql by flogic42 · · Score: 3, Funny

    Select * From SovietRussia Where Article AND ReadsYOU

    --
    Check out my women's designer clothing store.
  15. CREATE? READ? by Topherbyte · · Score: 0

    Wow am I glad this book is finally out.

    Now if I happen to forget proper SELECT or INSERT syntax I can just fall back to idiotic acronyms to help me remember.

  16. You sound funny by mcmonkey · · Score: 4, Funny

    If SQL is pronounced 'ess cue ell', is MySQL pronounced 'emm why ess cue ell'?

    1. Re:You sound funny by Anonymous+Crowhead · · Score: 1

      If SQL is pronounced 'ess cue ell', is MySQL pronounced 'emm why ess cue ell'?

      From your post, I am assuming you think it's pronounced "mysequel" which it's not. Officially, it's pronounced "my ess que ell".

      http://dev.mysql.com/doc/refman/4.1/en/what-is.htm l

    2. Re:You sound funny by shutdown+-p+now · · Score: 1

      This is a very strong argument in favour of 'ess cue ell', I must admit.

    3. Re:You sound funny by Tablizer · · Score: 1

      MySQL pronounced 'emm why ess cue ell'?

      I pronounced this toward the lady at the front desk, and she slapped me.

    4. Re:You sound funny by marvinglenn · · Score: 1
      If SQL is pronounced 'ess cue ell', is MySQL pronounced 'emm why ess cue ell'?

      Only when the "y" in it is capitalized. Last time I checked, it was lower case.

      --
      The whores get mad when the sluts give it away for free.
    5. Re:You sound funny by Anonymous Coward · · Score: 0

      Right, sort of like the difference between "Computer" and "My Computer".

  17. SQL is a standard. Is it? by hypersql · · Score: 1, Informative
    What I have always found funny about SQL is that, while it's very 'old' (in software terms), and mature, and widely used, there is in fact no real standard. There never was. From the article:

    SQL variations ... While SQL is a standard, there seems to be some very relaxed definitions of full adherence to that standard...

    Or, as Jim Starkey said: 'SQL isn't a standard but a theme'. For a book, it means list 5 different dialects. For regular developers (not database specialists) it means knowing only one dialect really well. For an application it means, running only with one database (mostly). It would be really cool the industry could get together and define a 'real' standard. Could be a subset of SQL (http://ldbc.sf.net/) or a new language (http://newsql.sf.net/). Things would get simpler then.

    (Side note: LDBC and NewSQL are both projects I started, but interest was quite low; currently I'm working on a new database engine http://www.h2database.com/ where I try to be compatible as much as possible with existing databases)

    Or is there some other solution? I don't think that that O/R mapping tools will solve the problem completely, as there is always the need interactive database queries. Maybe the Microsoft extension to C# (forgot the name) could be a solution? Other ideas?

    1. Re:SQL is a standard. Is it? by Aladrin · · Score: 1

      Just because nobody adheres to the standard strictly doesn't mean it isn't a standard. The standard itself is fully documented. Blame the developers, not ANSI.

      http://en.wikipedia.org/wiki/SQL

      --
      "If you make people think they're thinking, they'll love you; But if you really make them think, they'll hate you." - DM
    2. Re:SQL is a standard. Is it? by hypersql · · Score: 1

      What does a standard help if nobody follows it?

      > The standard itself is fully documented.

      On how many pages? Maybe the size of the standard is the problem.

      > Blame the developers, not ANSI.

      I'm not blaming the developers, as it's quite impossible to implement this huge standard. I don't blame the commitee. They did what such a group usually does: they held meetings. Lots of them.

      Still, there is no standard. Otherwise, how do you explain having to list 5 dialects?

    3. Re:SQL is a standard. Is it? by Marcus+Green · · Score: 1

      There are ANSI standards for the C and C++ languages and yet there are multiple flavours, some with significant incompatibilities. Does this mean that the standard is not a standard?

    4. Re:SQL is a standard. Is it? by orthogonal · · Score: 4, Informative
      there is in fact no real standard

      Yes, there's a great deal of nonconformance and extensions.

      But, there is a standard, in fact, five: SQL-86, SQL-89, SQL-92, SQL:1999 and SQL:2003 (yeah, dashes replaced by colons, go figure). SQL:2003 can be purchased from ANSI or ISO, just like the C or C++ standards.

      Various sites list product conformance to the standards.

      When I write SQL, I pretty rigorously stick to SQL-99, as that's likely to be supported by most vendors. If I need to deviate from that, I make sure I know how to replicate the vendor-specific code in SQL-99 (e.g, postgresql's inherits keyword -- it's useful for sub-typing, but it can be effected by using joins and views).

      If the non-standard code is DML (not DDL), I'll do my best to encapsulate it in a stored procedure or a view, and let the rest of my code call the encapsulated abstraction. This is just the same layering you'd do in any programming language to wall off platform-specific code. And just as you'd typedef in C or create abstract types in C++, you create UDTs in SQL too.

      Here's an example, using a useful testing date "function" that is cross-dialect, doesn't rely on any user-supplied function support, and can be incorporated into live code.

      -- postgresql
      CREATE DOMAIN datetime_type timestamp null;
      create view system_datetime as select 1 as id, now() as date_now ;

      -- MS SQL server
      create type datetime_type from datetime null;
      create view system_datetime as select 1 as id, getdate() as date_now ;


      -- code below is SQL dialect independent
      -- works on postgresql or MS SQL server


      -- code to use actual current date or fake date for testing purposes
      -- all DML that wants the current system timestamp should instead join on (or subselect) the view date_now
      -- this view always returns a single row

      create table test_date ( id int, test_date datetime_type ) ;
      insert test_date values ( 1, null ) ;

      create view date_now as
      select
      coalesce(
      ( select test_date from test_date where id = 1) ,
      ( select date_now from system_datetime where id = 1)
      ) as date_now ;

      -- note: for Sybase, replace coalesce with isnull

      -- see what invoices were due as of January 1:
      update test_date set test_date = '1/1/2006' ;

      select * from invoices a, date_now b
      where a.issue_date <= b.date_now
      and ( a.paid_date > b.date_now or a.paid_date is null )

      -- look at real invoices due as of now
      -- Query is the same, we just null out the fake date:

      update test_date set test_date = null ;

      select * from invoices a, date_now b
      where a.issue_date <= b.date_now
      and ( a.paid_date > b.date_now or a.paid_date is null )


      (And yes, you can hire me.)
    5. Re:SQL is a standard. Is it? by oh_my_080980980 · · Score: 1

      Let me get this straight, you started a couple projects to replace SQL and you didn't know that SQL is an ANSI standard? I would certainly give you projects a major pass.

      As other people pointed out SQL is a standard. If database venders want to violate the standard so be it. But do not claim we need another query language because of the variations of SQL. Force the venders to comply. That's the point about standards venders are suppose to comply.

    6. Re:SQL is a standard. Is it? by clive_p · · Score: 2, Informative

      There is a series of official SQL Standards, but the trouble is nobody any longer measures the extent to which database vendors conform to the official standards. Once upon a time NIST used to do this, but that part of their work was cancelled after some lobbying by the big database vendors: naturally they much prefer it if you use their dialect then you get locked in to their product. Who allowed this to happen? I think it was Bill Clinton.

    7. Re:SQL is a standard. Is it? by plover · · Score: 1
      Well, remember how a standard is created. It's put together by a committee of people all of whom have a vested interest in using the standards process to give them some advantage.

      The Microsoft rep says "hey, we have to support language extensions for row locking this way, because that's how our engine works." Oracle says "Well, let's just agree to call row locking an 'extension' but not define it because we do it differently." The DB2 guy says "Everybody needs to be able to DROP TABLE, so that should be in the standard."

      Even representatives from the various users' groups have biases towards their preferred languages. And while it might be in the best interests of DBAs everywhere to have a completely common language, it's not going to happen because the Oracle users' group is going to have a different opinion of what's right than the MS SQL users' group.

      The point is they all want the language to go exactly their way for patent reasons, for ease-of-maintenance reasons, and for the ability to cripple their competitors who are unable to comply. And for the most part, these special little provisions find their way into the standard, mostly because all the vendors benefit from the vendor lock-in resulting from the fractures.

      It's not fair to say "don't blame ANSI" because the process producing these so-called standards really is to blame. Nobody from ANSI ensures that the meetings are attended by user groups, or that the users themselves have more or less voting authority than the manufacturers. If ANSI really cared about standardization, they'd say "no extensions." But that doesn't serve us well either, as there'd be no room for progress in the language.

      --
      John
    8. Re:SQL is a standard. Is it? by hypersql · · Score: 1
      Yes, exactly. There are so many fundamental differences in the products that call themselves 'standard compliant' that it's not funny. Examples:

      In Oracle, NULL is the same as an empty string (''). Data types are named differently for each database vendor. String concatenation is different in SQL Server. CREATE INDEX is not defined in the standard (but most databases support it). Some databases support sequences, some autoincrement columns. Schema and catalog behaviour is different. Date constants are different. SQL Exceptions are different. Dealing with BLOBs is different in most databases. MySQL used to (not sure if it still does) truncate empty spaces at the end of VARCHARs. PostgreSQL: after an exception occured, it is required to issue a commit or rollback (is this fixed?).

    9. Re:SQL is a standard. Is it? by hypersql · · Score: 1

      > you didn't know that SQL is an ANSI standard?
      Of course I did.

      > But do not claim we need another query language
      No. All we need is a _good_ standard. A subset without variations. Maybe with a reference implementation.

      > Force the venders to comply.
      The problem is, the standard is so huge it's impossible to comply. Again, a _good_ standard would be simpler, smaller, and it would be possible to comply. Like the Java language (I'm not saying this is a perfect example, see Java compiler problems, but it's at least better than SQL).

  18. How does this compare with SQL for Smarties? by jnowlan · · Score: 0, Redundant

    by Joe Celko?

  19. Sample chapter by sootman · · Score: 3, Informative

    Chapter 11: Searching
    40 pages, 500k PDF

    --
    Dear Slashdot: next time you want to mess with the site, add a rich-text editor for comments.
    1. Re:Sample chapter by Anonymous Coward · · Score: 0

      First mistake of the chapter: in the most popularly used version of Microsoft's SQL Server - 2000 - there is no row_number() function, so select row_number() over (order by sal) as rn, sal from emp will not work.

    2. Re:Sample chapter by Anonymous Coward · · Score: 0

      it's not a mistake, genius. read the preface and you'll see the sql server recipes are for 2005. make sense thoough, why show code for old software, partiocularly when other books have done it already? there isn't enough info on these olaps functions, particularly for sql server. i for one was glad to see it.

  20. Re:Mispronunciation by Anonymous Coward · · Score: 1, Interesting

    Chris Date has stated in many of his books on RDMS theory and practice, several of which were published before many Slashdotters were born, that SQL is pronounced 'sequel'. Good enough for me.

  21. Wrong by gregarican · · Score: 1

    Actually that is pronounced T3h-5ux-0r5.

  22. I prefer h3database by suggsjc · · Score: 0

    Smaller and more efficient, but doesn't quite the performance of its derivatives. If you've got a high volume/availibility site then you have to use h1database as it won't get "stuck"

    --
    When I have a kid, I want to put him in one of those strollers for twins and then run around the mall looking frantic.
  23. Yawn... by flyweight_of_fury · · Score: 1

    Great - yet another book that teaches me the "ins-and-outs" of the "Northwind" database. Seriously, when are publishers and authors going to come out with more original content? For instance - content for those of us that AREN'T designing HR or order entry apps?

    Ah well, it could be worse - it could be teaching me how to build another class registration system....

    1. Re:Yawn... by geekoid · · Score: 1

      Most software(and all databases) are written to track something, whether it's people, inventory, money, weather etc...

      --
      The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
    2. Re:Yawn... by RorthronTheWise · · Score: 1

      Read the book. It has NOTHING to do with the Northwind database. It is not even specifically for Microsoft SQL; it further covers DB2, Oracle, MySQL and PostgreSQL. Every example is provided with the respective variations for each system, which as a way to familiarize with other RDBMS is a terrific learning oportunity. Seriously, the book is extraordinary. I thought I knew SQL (and I teach that stuff!) but there are always some more tricks to learn. I would give it a 9/10.

    3. Re:Yawn... by flyweight_of_fury · · Score: 1
      ...hence the quotes around "Northwind", tiger. suggsjc got my drift - perhaps this quote from the review will illustrate my point better.
      Many of the recipes are obviously oriented towards corporate reporting. If this is a big need for you, then this book goes along way to meeting your needs. If you have no need for corporate reporting, it's wasted paper.
      ...which summarily explains my frustration with many of the modern 'IT' publishers. Advertising a book as containing 'answers to real world problems' is misleading, at best. Many real-world problems of SQL programming exist outside the range of corporate hierarchy representations or say: order/invoice relationships.
    4. Re:Yawn... by Anonymous Coward · · Score: 0

      sadly you miss the point...
      the examples exist to explain a technique. "converting rows into delimited lists", "generating a running total", "calculating subtotals"... these are real problems.
      who cares how the techique is shown, the value is in the technique itself.
      are you saying you can't understand how to apply the technique because it's using
      a different kind of db than you use?

  24. A standard amongst a non-standard language by suggsjc · · Score: 0

    Because all of the flavors have a sample "Northwind" db.
    It's not about showing you how to create a HR or order entry app, its about showing you how to go about basic tasks that are easily explainable problems under those types of schemas.

    --
    When I have a kid, I want to put him in one of those strollers for twins and then run around the mall looking frantic.
  25. What I could use... by tfcdesign · · Score: 1

    is a book full of sample queries.

    Half the time I am using PHP for something SQL could do in a couple simple commands.

    1. Re:What I could use... by snwobird122 · · Score: 1

      I actually see this all the time. I do a lot of refactoring of code which I didn't write. I can't tell you how many times I have seen people "select * from table" and then use application logic to: determine number of records determine maximum from a field search for existence What a waste. If people would just learn a little more SQL than "select * from blah", the world would be a better place.

  26. Create Read Update Delete by Anonymous Coward · · Score: 0

    I can think of a far more unfortunate acronym...

    SCRUM. I think it has something to do with smegma but I'm not sure.

  27. Pronouncing it as "sequel"... by Anonymous Coward · · Score: 1, Insightful

    ...is WRONG and is like shouting to everyone that your IQ is low and you're lazy and illiterate. It is properly pronounced like "Ess Queue Ell", because SEQUEL is an entirely different ancient IBM product altogether.

    You know how stupid it sounds when someone pronounces Linux as "Line-uhx"? Well that's exactly how smart you sound like when you pronounce SQL as "sequel".

    1. Re:Pronouncing it as "sequel"... by Anonymous Coward · · Score: 0

      That's why I minimize the duration of the vowel sounds. As "sequel" is to "seek well", so SQL is to "sequel". Unfortunately transliteration doesn't lend itself well to this: se'qu'l?

      SCSI: sexy, scuzzy, ess-cee-ess-eye, small computer system interface, or system can't see it?

    2. Re:Pronouncing it as "sequel"... by tehcyder · · Score: 0
      You know how stupid it sounds when someone pronounces Linux as "Line-uhx"?
      Oops.
      --
      To have a right to do a thing is not at all the same as to be right in doing it
    3. Re:Pronouncing it as "sequel"... by esper · · Score: 1

      You know how stupid it sounds when someone pronounces Linux as "Line-uhx"?

      It always amuses me when someone goes off on the pronunciation of "Linux"... Linus Torvalds pronounces it "lee-noox". Some years back, I saw a usenet post in which he was quoted as saying that, for natives of countries where his name would be pronounced "line-us", it is appropriate to pronounce it "line-ux".

      And yet the people who are dogmatic about the "correct" pronunciation almost invariably insist that it must be pronounced "lin-nix" - the only one of the three major pronunciations that I have not heard of Torvalds explicitly endorsing.

      (And, for the record, I say "ess cue ell", which is, incidentally, an abbreviation of SEQUEL, which was not "an entirely different... product", but rather the direct ancestor of SQL, according to the histories of SQL that I've read.)

  28. Re:Mispronunciation by n6kuy · · Score: 1

    RDMS is pronounced, "riddums", right?

    --
    If you disagree with me on social issues, then it's pretty clear that you are a narrow-minded bigot.
  29. I always thought it was Squirrel Server by sampas · · Score: 1

    I tell the business types whose reports I do that it was named for the little squirrels inside the machine that horde and organize your data like acorns. Except they call the acorns tuples, and they get stored in relations.

    To be in 1NF, your data must first be "acornic" in that it cannot be broken down further. There must be no repeating groups of acorns; and each row of acorns must depend entirely on the massive acorn (aka key acorn) that the squirrels use to organize the other acorns.

    This also explains why some of the acorns disappear during special seasons: the squirrels eat them.

    1. Re:I always thought it was Squirrel Server by orderb13 · · Score: 1

      You're confused. You've described 3NF. 1NF isn't normalized at all.

  30. Re:sequel? ...... Squeal by erbmjw · · Score: 1

    as in "Squeal like a little piggy!"

    Though outside of our office we do use the better known "sequel"

  31. Correction by geekoid · · Score: 1

    It's a crappy MSSQL thing.

    --
    The Kruger Dunning explains most post on /. http://en.wikipedia.org/wiki/Dunning%E2%80%93Kruger_effect
  32. Look OK but relies heavily new SQLServer features by Anonymous Coward · · Score: 0

    I had a look at the sample chapter, which looks mildly interesting, but the examples are a litte contrived in my opinion.

    I only know SQLServer in depth. Most of the techniques he shows rely on features introduced in SQLServer 2005.

    http://www.oreilly.com/catalog/sqlckbk/chapter/ind ex.html

  33. Provided... by C10H14N2 · · Score: 1

    I can onomatopoeically refer to PHP as fffffffffffffuupp.

    1. Re:Provided... by m.lp.ql.m · · Score: 0

      Cow-orker: "You learning some scripting language?"
      Me: "No, sorry, it's them beans I had for supper..."

  34. five stars by dankelley · · Score: 0

    (Average of 1 Customer Reviews)

  35. Save $13.58! by Anonymous Coward · · Score: 0

    Save yourself $13.58 by buying the book here: SQL Cookbook. And if you use the "secret" A9.com discount, you can save an extra 1.57%!

  36. Not for beginners?!? Doubtful by GalacticCmdr · · Score: 2, Informative

    I am not sure how anyone can resolve the following found in the review - emphasis mine.

    The book is not for beginners and makes no efforts to teach any SQL. It concentrates purely on building on the base level of SQL knowledge that most programmers have. If you know the basics: Create, Read, Update and Delete (an unfortunate, yet memorable acronym) but rarely go beyond that, this book is for you. I know that I fall into this target market.

    Recipe one in chapter one, titled "Retrieving all Rows and Columns from a Table" has the problem statement "You have a table and want to see all of the data in it." Nice and clear. Then comes the solution. Naturally, for this problem statement we end up with a SELECT that looks like this:

    select * from emp

    How can a book not be for beginners when the first recipe teaches the most basic SQL command possible? I have this book and it is a very good book, but like most technical books it kills a great deal of trees needlessly to pad its count. You can probably rip more than 100 pages out of the book that is mindless beginner crap and self-flogging and actually have a very good technical reference for mid-level SQL people.

    --
    Programming: Its not just a job - its an indenture.
  37. Re: Captain Obvious by Anonymous Coward · · Score: 0

    Uh, Captain Obvious. Have some respect for the accomplishment of others!

  38. Except... by Anonymous Coward · · Score: 0

    Except that "Linus" is pronounce Lee-nuss.

    1. Re:Except... by esper · · Score: 1

      ...and yet most people pronounce "Linux" as "lin-nix" instead of "lee-noox". (I would transliterate the Swedish pronunciation of his name as "lee-noos" rather than "lee-nuss", as it's a long "u".)

  39. I will, actually! by pestie · · Score: 2, Insightful

    You could pay $39 from BN, or $26.37 at Amazon.

    Yup, and I will, because Amazon sucks balls, what with their 1-click patents and "oh, by the way, all that stuff we promised before? Not so much!" privacy policies. Unlike some Slashdotters, I actually put my money where my mouth (or keyboard, if you prefer) is.

    1. Re:I will, actually! by Anonymous Coward · · Score: 0

      You can put your money where your mouth is and still not pay B&N's crappy prices - http://www.bestbookdeal.com/book/compare/%20%09059 6009763

  40. set theory by tabby · · Score: 1

    I spend a lot of work hours reading/debugging/re-writing other peoples MSSQL stored procs. While it seems the people before me didn't understand the idea of a set-based language at all (CURSORS! CURSORS! CURSORS!) I understand the concept but have little experience implementing it. Can anyone suggest a SQL reference that puts emphasis on teaching how to implement set-based logic in stored procs, rather than just procedural batches?

    --
    I've experiments to run, there is research to be done on the people who are still alive.
    1. Re:set theory by Anonymous Coward · · Score: 0

      "The Guru's Guide to Transact-SQL" by Ken Henderson (Addison Wesley Press)

  41. S.Q.L vs "Sequel by Anonymous Coward · · Score: 0
    Regarding the whole S.Q.L vs "Sequel" issue.

    [banging head against desk]WHO CARES! WHO CARES! WHO CARES![/banging head against desk]

    Jebus God and his black bastard brother Harry, can you people spend your time arguing about something more important!!!!

  42. Re:Mispronunciation by Anonymous Coward · · Score: 0

    Dates books are awful, unreadable trash. Take a look at how he explains set operators in "Introduction to Database Systems" - its like he is actively trying to obfuscate them. Who cares how he pronounces it.

  43. Isn't SQL Pronounced "Squeal"? by Anonymous Coward · · Score: 0
    As in "pigs SQL!"

    Much easier than "S-Q-L" or "sequel". And it gets an occasional laugh.

  44. Celko = idiot fucktard (demo provided) by Anonymous Coward · · Score: 0

    Celko, according to some real DB experts, knows squat about RDB. I agree. Follow Celko's lead at your peril.

    1. Re:Celko = idiot fucktard (demo provided) by Anonymous Coward · · Score: 0

      Thank you for the link. I've stopped using RDBMSs after reading Celko, now I go completely OO, but I couldn't quite spell out the reasons for my choice. Maybe it has to do with the 'idiot' thing

      Would someone please point me to some text books alternative to Celko's? In particular for schema design.. tnx

      No, 'pick one at random' does not cut :-)

    2. Re:Celko = idiot fucktard (demo provided) by Anonymous Coward · · Score: 0

      Would someone please point me to some text books alternative to Celko's? In particular for schema design.. tnx

      Good text books
  45. Re:MySQL pronunciation by TeknoHog · · Score: 1

    My Ass K3wl!!!!1

    --
    Escher was the first MC and Giger invented the HR department.
  46. You're a motherfucking dipshit by Reality+Master+201 · · Score: 0, Redundant

    And the person that modded you insightful is an even bigger dipshit for not seeing what an already astoundingly gigantic dipshit you are.

  47. safari by Jac_no_k · · Score: 1

    And for those of us not in an area where technical English texts are not available in a timely manner, there is the Safari Books Online from O'reilly. I don't know if they still have the referal program, but if they do, please use me.

  48. Time to put SQL out to pasture by Tablizer · · Score: 1

    SQL is growing long in the tooth. It is time to replace it with something better that learns from lessons of the past. One proposal is Tutorial D, by Chris Date. I have also proposed "TQL" (or SMEQL due to a name comflict with another product) as a draft SQL replacement. Unlike Tutorial D, SMEQL uses a prefix notation for the main relational operaters. This makes it easier to extend by DBA's. If you don't like the out-of-the-box set of relational operators, you can define your own (using the existing ones). I have even created a wannabe book cover for SMEQL.

  49. Re:Mispronunciation by Grail · · Score: 1

    SQL is an acronym. It's pronounced, "structured query language".

    But when I'm wearing my blue wizard hat, I refer to it by the convenient name, "sequel" which is actually a different product, but everyone knows what I'm talking about.

    "Ess cue ell" is what management types call it, because they love spelling out acronyms to make themselves sound important.

  50. ebooks / standards by lon3st4r · · Score: 1

    Are there any good e-books one could refer to for SQL? Is there a freely available standards document which describe how `base` SQL "should" be, like say the ANSI standards for C?

  51. Casing and layout of SQL-examples. by Dr.Ruud · · Score: 1

    From the pdf of _Chapter 11_

    select a.ename,
                  (select count(*)
                      from emp b
                    where b.ename <= a.ename) as rn
        from emp a

    I would layout that like

    SELECT a.ename,
                  (SELECT COUNT(*)
                      FROM emp AS b
                    WHERE b.ename <= a.ename) AS rn
        FROM emp AS a

    or like

    select a.ename,
                  (select count(*)
                      from emp as b
                    where b.ename <= a.ename) as rn
        from emp as a

  52. About the name MySQL by danro · · Score: 1

    MySQL is named after one of the original coders daughter My (relatively common swedish girls name).
    It just happens to mean "My SQL" in english.
    And, no, I didn't just make that up.
    A MySQL employee told me this when I asked why he didn't* pronounciate the products name as either "My sequel" or "My S.Q.L".

    *) This was in Sweden. Don't know how they say it other countries... Seems stupid from a sales standpoint to stick to a non-intuitive (for a native english speaker) pronounciation outside of MySQLs home country...

    --

    "First lesson," Jon said. "Stick them with the pointy end."
  53. SQL for Smarties by nrrd · · Score: 3, Informative

    SQL for smarties is the best advanced SQL book I've seen. Highly recommended for developers, and should be on the bookshelf of any DBA.

    --
    "Eye halve a spelling chequer, It came with my pea sea, It plainly marques four my revue, Miss steaks eye kin knot sea"
    1. Re:SQL for Smarties by Anonymous Coward · · Score: 0

      LOL. "advanced".
      it's outdated and useless if you're working on Oracle, SQL Server, or DB2.
      Sadly, even if you're on mysql or postgres (two popular vendors who do not yet
      support olap functions) Celko's books dont take advantage of proprietary features.
      So not only are his books outdated, they aren't even practical.
      please show me the person who works for a place that is paying $40,000 per cpu
      for an oracle license then tells their cto they refuse to use the proprietary features
      they are paying for cuz someone wrote in some book not to... please. enough already.
      i'd say his books work for a student learning sql, but take his techniques into
      the workplace and you're in for a shock. useless. does't help that he's a complete prick either.

  54. Re:You're funny looking by DennisInDallas · · Score: 1

    No, MYSQL would be pronounced as you describe. But the lower case 'y' clearly denotes that that is not part of the acronym

  55. DBDebunk by Anonymous Coward · · Score: 0

    Unfortunately, your "real experts", although brilliant, are just a couple of complete asshole, ivory tower theorists who refuse to accept the fact that the real world can get by quite well without their 1337 über-knowledge.

  56. Yes, but does it work in Europe? by DavidTurner · · Score: 1

    I'd buy this book in an instant if it could give me a good (efficient) solution for this query: return the set of most recent sales grouped by customer. [Stands back and smirks while flocks of geeks bang their heads against relational algebra]

    1. Re:Yes, but does it work in Europe? by Anonymous Coward · · Score: 0

      it does do that :)
      here ya go, the top five sales grouped by customer:

      SELECT *
          FROM (
      SELECT c.*,
                    DENSE_RANK()OVER(
                        PARTITION BY c.customer_id
                                ORDER BY c.sale_date) as ranking
          FROM customer c
                    ) cust
        WHERE ranking = 5

      too simple :)

      which is why this book is great - takes advantage of OLAP functions
      which makes most problems you can dream up simple to do in SQL.
      No need for views, temp tables, or multiple self-joins that typically
      made queries like this miserable to read/code.
      This is easily the book's strongest point; tons of examples using OLAP functions
      for the databases that support them.

    2. Re:Yes, but does it work in Europe? by DavidTurner · · Score: 1

      Cheating ever so slightly by using OLAP functions ;-) But forgiven. OP was slightly tongue-in-cheek; my point was that SQL is a bit dated.

  57. Re:Bull--- by mcc36 · · Score: 1

    Key phrase: "comes from" - SQL has come a long way since SEQUEL was created. Most specifically, after it was adopted ANSI in 1986, it essentially lost its meaning as an acronym for "Structured Query Language" and became a hapless three-letter name. Check the ANSI Standard - not only do they insist its pronunciation is letter-by-letter, but its official name is 'SQL' - short for...SQL.

  58. Pronounciation by Anonymous Coward · · Score: 0

    It's pronounced "SQueaL". As in "squeal like a pig".

  59. GUI SQL Builders by bnortman · · Score: 1

    The problem with the GUI SQL Builders is that you can end up with some pretty slow performing SQL statement. However there are tools available that can Tune/Optimize the SQL that these generate.