Piero,
The basic structure of a SQL query (also called a 'script' or a 'SELECT
statement') is as follows:
SELECT <name of column1>[, <name of column2>...]
FROM <name of table1>,[<name of table2...>]
Select indicates the name(s) of the columns you want to retrieve. You can
also specify SELECT * to get all of the columns in a particular table
Two other sections of a query are:
WHERE <column conditions>
ORDER BY <name of column>
WHERE lets you limit the number of rows that are returned. For example, if
you had a column called COUNTRY containing the name of a country, you could
limit your rows as follows: WHERE COUNTRY = 'Australia'
This would limit your query output to only those rows where the COUNTRY value
was Australia
ORDER BY is just what it implies -- it sorts the output of your query. For
examply, if you specified ORDER BY COUNTRY, the query data would be presented
to you in ascending order by COUNTRY.
As I'm sure others can attest, a SQL query can be as simple or complex as you
want it to be. It gets trickier when you want to join data from different
tables. One problem with the SQL code that MS/Access generates is that it
uses the full alias name for columns and tables. This (in my opinion) makes
it really difficult for a newbie to understand what's really going on with the
query).
The Transact SQL Reference guide that comes with Microsoft's SQL Server or
Sybase is a great guide to understanding SQL. There are also likely to be
web-based resources out there, too. I recommend doing a search on SQL92 (this
is the name of the most recent generally approved release of the SQL
language).
Good luck!
>Hello,
>i am discovering the world of databases actually...and i am performing good
>things with ms access.
>Now the problem is the fact that i have discovered SQL instructions: is SQL
>a language?
>Where can i find on the net info about the SQL instructions?
>Thanks a lot and answer via email
>Piero