If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ANSI SQL > Newbie Question...

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 02-25-09, 03:38
Alex Wright Alex Wright is offline
Registered User
 
Join Date: Feb 2009
Location: Bournemouth, Dorset
Posts: 20
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
Reply With Quote
  #2 (permalink)  
Old 02-25-09, 03:45
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,511
you have both books already?

the next step is to install mysql and start to practice, practice, practice
__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #3 (permalink)  
Old 02-25-09, 05:09
Alex Wright Alex Wright is offline
Registered User
 
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.
Reply With Quote
  #4 (permalink)  
Old 02-25-09, 08:44
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,511
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")

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #5 (permalink)  
Old 02-25-09, 09:59
Alex Wright Alex Wright is offline
Registered User
 
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!
Reply With Quote
  #6 (permalink)  
Old 02-25-09, 10:14
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,511
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

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #7 (permalink)  
Old 02-25-09, 11:15
Pat Phelan Pat Phelan is online now
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,595
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
Reply With Quote
  #8 (permalink)  
Old 02-25-09, 12:23
Alex Wright Alex Wright is offline
Registered User
 
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!
Reply With Quote
  #9 (permalink)  
Old 02-25-09, 17:44
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
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
Reply With Quote
  #10 (permalink)  
Old 02-25-09, 18:11
Pat Phelan Pat Phelan is online now
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,595
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
Reply With Quote
  #11 (permalink)  
Old 02-26-09, 08:01
stolze stolze is offline
Registered User
 
Join Date: Jan 2007
Location: Jena, Germany
Posts: 2,662
Quote:
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
Reply With Quote
  #12 (permalink)  
Old 02-26-09, 08:09
pootle flump pootle flump is offline
King of Understatement
 
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
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:
Quote:
pootle flump
ur codings are working excelent.
Reply With Quote
  #13 (permalink)  
Old 02-26-09, 08:22
r937 r937 is offline
SQL Consultant
 
Join Date: Apr 2002
Location: Toronto, Canada
Posts: 19,511
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...
Quote:
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

__________________
r937.com | rudy.ca
please visit Simply SQL and buy my book
Reply With Quote
  #14 (permalink)  
Old 02-26-09, 08:25
pootle flump pootle flump is offline
King of Understatement
 
Join Date: Feb 2004
Location: One Flump in One Place
Posts: 14,905
Then Joe will be reassured that, on this point, he has my full support.
__________________
Testimonial:
Quote:
pootle flump
ur codings are working excelent.
Reply With Quote
  #15 (permalink)  
Old 02-26-09, 20:40
Pat Phelan Pat Phelan is online now
Resident Curmudgeon
 
Join Date: Feb 2004
Location: In front of the computer
Posts: 12,595
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
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On