Speaking SQL (part 1) (
Page 1 of 7 )
Structured Query Language is the language used to communicate
with databases of all shapes, sizes and varieties. If you're building a Web
application which needs to communicate with a database, and don't know
where to start, this article will get you up to speed on the basics of
creating tables and inserting data into them.In the Internet age, information is no longer represented in filing cabinets;
instead, it's stored as digital ones and zeroes in databases, data storage
"containers" that impose a certain structure on information, so as to simplify
the task of managing and using it.
Of course, putting data into a
database is only half the battle - the other half involves using it effectively.
Which brings us to the point of this article - using SQL, or Structured Query
Language, to communicate with a database in order to extract the data you
require from it.
Over the next few pages, I'll be explaining some of the
basic SQL commands to create and enter information into a database, together
with examples that should make things clearer. In case you've never used a
database before, or the thought of learning another language scares you, don't
worry - SQL is considerably simpler than most programming languages, and you
should have no trouble picking it up.
Onwards!{mospagebreak title=The
Tools} Before we can get started, you need to get a database up and running -
your SQL commands will be interpreted by this, and appropriate results
generated.
Now, there are a number of database engines out there; you've
probably heard of Oracle (for large, data-intensive Web applications) and
Microsoft Access (for desktops and servers). Unfortunately, though both these
come with powerful capabilities, neither of them is free - a fact which
displeases many of those used to open-source software.
However, there is
a database engine out there that is both free and effective, and will serve our
purpose for this tutorial - it's called mySQL and you can download it from
http://www.mysql.com/ (it's available for both
UNIX and Windows platforms). Once you've downloaded and installed it (or had
your network administrator do it for you), you're ready to begin your first
foray into the world of SQL.