[plug] Optimise MySQL query
James L. Clarke
jamesc at global.net.au
Wed Mar 29 12:55:40 WST 2006
Nigel,
Knowing how to write SQL queries is one of the most useful skills you can aquire
if you are doing any type of programming that requires interaction with a
relational databases. Although each different database has special things it can
do with SQL, most databases support the ANSI Stardard SQL, so learning that
would be your first step.
When I first started using SQL I found the first thing to do was just solve
problems using plain SQL, after that I learnt how to put SQL into other
programming languages. A good book that I read on Databases and SQL (note you
need to have some programming experience before reading it) is "An Introduction
to Database Systems" by C.J. Date. Work through all of the excercises in that
book and you will know your ANSI Standard SQL pretty well.
I've been programming professionally for over 10 years now, and another 10 years
before that as a hoby. Most of my work has been writing software that interacts
with databases (including DB2, DBase 4, Access, Ingres, Sybase, Oracle, MySQL,
SQL Server). Using good SQL has saved me a lot of coding at times.
Another thing to get right especially if you start building databases is how to
design them properly using Normalisation. Knowing that will make your
systems a lot more robust and save you a lot of painful coding. Luckily C.J.
Date's book also covers Normalisation.
All the best,
James
P.S. I know some people on the Linux group will debate whether Access is a
relational database. For less than five users (ie small business) it is fine as
long spilt the code and data it two seperate files and you design the thing
properly, for more than five users you can still use the access for the
application but put the data in SQL Server, Oracle, DB2 or MySQL. I guess the
reason it has such a bad rap is that because it is cheep so many people who
don't really know what they are doing have used it and made a mess. However the
same could be said of MySQL now-a-days.
P.P.S also I wouldn't recommed writing any serious enterprise system using
Access (even with a strong back-end) unless you're a glutton for punishment.
However no matter what you develop in you have to be a glutton for punishment
for most enterprise systems when you try to deal with the conflicting user
requirements!
---
homepage: http://www.global.net.au/~jamesc
------------------------------------------------------------------
This mail sent through Global Dial Mail http://mail.globaldial.com
More information about the plug
mailing list