Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Join Date
    Feb 2009
    Location
    Bournemouth, Dorset
    Posts
    20

    Unanswered: Newbie Question...

    Good morning,

    I have a quick question: is it best to learn ANSI SQL first, or learn SQL that's specific to a particular database server (MySQL is the RDBMS that I'd like to work with)?

    The reason I ask is that I recently completed reading a introductory SQL book whose examples ran from a MySQL server with much of the syntax specific to it. I have now purchased the highly recommended SQL for Smarties book by Joe Celko, and he focuses mainly on ANSI SQL, and I almost feel like I'm starting from scratch again.

    Thanks in advance for your help.

    Regards,

    Alex

  2. #2
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    you have both books already?

    the next step is to install mysql and start to practice, practice, practice
    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  3. #3
    Join Date
    Feb 2009
    Location
    Bournemouth, Dorset
    Posts
    20
    Quote Originally Posted by r937
    you have both books already?

    the next step is to install mysql and start to practice, practice, practice
    Hi r937,

    I'm not sure that you fully understood my question.

    I have Joe Celko's 'for Smarties' book and the RDBMS that I want to specialise in is MySQL as I'm aiming to become a LAMP developer. However, some of the SQL that I've learned so far has been specific to MySQL and I'm worried that reading the for Smarties book will be a backward step as it focuses mainly on ANSI SQL - or so I'm told - a different 'variant' of the language, and won't that result in not all of the examples in the book working when they're run on a MySQL server?

    Correct me if I'm wrong. I'm not sure, hence the question.

  4. #4
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by Alex Wright
    won't that result in not all of the examples in the book working when they're run on a MySQL server?
    no

    ("these aren't the droids you're looking for")

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  5. #5
    Join Date
    Feb 2009
    Location
    Bournemouth, Dorset
    Posts
    20
    OK, thanks for the clarification.

    If I'm honest though, I'm still a little confused as to why each of the different RDBMS's require their own 'flavour' of the language if ANSI SQL's platform independant.

    For example: why does MS SQL Server need T-SQL if queries submitted using ANSI SQL will do exactly the same job?

    I feel stupid!

  6. #6
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    there are several factors at play

    first, database systems are a very competitive field (larry elison is a billionaire)

    second, the dbms vendors developed their own sql dialects because the standard was woefully behind the times

    as the standard started to catch up, vendors "deprecated" some of their features -- for example, you should never write an outer join with any syntax other than OUTER JOIN syntax

    T-SQL is actually a superset of SQL, and has all sorts of additional commands

    Celko's book will stand the test of time, you cannot go wrong learning from it

    but if you want to roll up your sleeves and start using a database, you simply must read da fine manual, too

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  7. #7
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote Originally Posted by Alex Wright
    If I'm honest though, I'm still a little confused as to why each of the different RDBMS's require their own 'flavour' of the language if ANSI SQL's platform independant.
    Going back to a popular argument from around 1970: Since Assembler can do anything that the machine can do, why do you need any other language?

    The answer is obvious today. Assembler can do anything that the machine can do, but it takes a lot longer to write a complex program in Assembler than it takes to write the same program in COBOL, VB, or Perl (depending on your personal bias). As r937 pointed out, at one time the ANSI (now ISO) standard SQL lagged far behind other SQL dialects in features. Different languages bring different features to the programming table that the "grandaddy" language (be that Assembler or ANSI-89 SQL).

    The important part is that the current ISO standard SQL is pretty good. It still needs some work in areas that I find important (especially DATE and location datatypes and functions), but those can be worked around at the application server or presentation layer if necessary.
    Quote Originally Posted by Alex Wright
    I feel stupid!
    Welcome to the club! In this field, that indicates that you're paying attention!

    -PatP

  8. #8
    Join Date
    Feb 2009
    Location
    Bournemouth, Dorset
    Posts
    20
    Thank you for your comments.

    I will start reading the book this evening.

    Momentary panic over!

  9. #9
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    Me recommendation would be to learn the concepts of ANSI/ISO SQL. The problem is that some systems have specifics that often don't make a lot of sense and once people try to apply those specifics to another DBMS, they fail and don't know why. So understanding the principles is a really good start. Everything else is just applying those principles in the specific environment.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  10. #10
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    I think that we (r937, stolze, and I) are all recommending the same thing, using very slightly different language.

    Joe Celko's SQL For Smarties book is nothing short of excellent in my opinion. The concepts and topics that are covered are beyond what the average LAMP programmer will need, but they are the bread-and-buter of the extrordinary programmer! Reading SQL For Smarties and learning what Joe has to offer is an excellent use of your time.

    ANSI/ISO SQL is the standard which EVERY SQL database engine should implement. While most vendors will choose to incorporate extensions to the standard (many of which are often then incorporated into later versions of the standard), I think that if a vendor chooses not to include full ANSI/ISO standard support, then they should be required to footnote their use of the term SQL to indicate what standard features they've chosen not to support!

    -PatP

  11. #11
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    I think that if a vendor chooses not to include full ANSI/ISO standard support, then they should be required to footnote their use of the term SQL to indicate what standard features they've chosen not to support!
    That would apply to all vendors because there is no database system out there that fully implements the SQL standard. (Part of this is due to bugs in the standard, which would prevent an implementation, part is due to different focus of the vendors.)
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

  12. #12
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Anyone else think SQL for Smarties is perhaps a volume better suited to a practitioner with some hands on experience rather than a good introductory text?

    There is no "narrative" or progressive building of concepts. None of the stuff in there could be described as introductory and much could be described as advanced.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  13. #13
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    Quote Originally Posted by pootle flump
    Anyone else think SQL for Smarties is perhaps a volume better suited to a practitioner with some hands on experience rather than a good introductory text?
    yeah, Joe Celko thinks so...
    This book, like the first and second editions before it, is for the working SQL programmer who wants to pick up some advanced programming tips and techniques. It assumes that the reader is an SQL programmer with a year or more of experience.
    these are the very first two sentences in the book

    rudy.ca | @rudydotca
    Buy my SitePoint book: Simply SQL

  14. #14
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Then Joe will be reassured that, on this point, he has my full support.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  15. #15
    Join Date
    Feb 2004
    Location
    In front of the computer
    Posts
    15,579
    Provided Answers: 54
    Quote Originally Posted by stolze
    That would apply to all vendors because there is no database system out there that fully implements the SQL standard. (Part of this is due to bugs in the standard, which would prevent an implementation, part is due to different focus of the vendors.)
    I actually threw that comment in to provoke comment, although I really do believe it... When a vendor only implements part of a standard, I don't think they should be allowed to proclaim standards compliance without a footnote or reservation. In the United States, there were actually laws that prohibited citing ANSI compliance without appropriate footnotes.

    As a completely separate issue, I believe that Mimer actually does implement the full SQL-99 standard.

    -PatP

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •