|
SQL Query
With SQL Query a SQL
select statement is meant. SQL stands for
Standard Query Language. It is the language used
to
communicated with databases. A query or select statement
is a SQL command to retrieve information from the database.
It is called a query as usually a so
called where clause is given to the select statement to
indicate which data needs to be retrieved from the database.
A SQL Query or select statement in its most simpel form has the
following syntax: select columnames from table
It retrieves only a named set of columns from a particular table.
Which columns and tables are available need to be known. SQL Query
tools such as SQL*XL help you with that in that they present a list
of available database tables and show their constituent column
names.
To retrieve all columns use an asterisk: select * from table.
Example: select ename, sal from emp
This statement retrieves the ename and sal columns of the emp
table.
The optional where clause of the SQL Query is the place where you
can specify which data to retrieve. Simpel logical conditions can be
given to indicate what we want to return. Best to give an example:
select ename, sal from emp where sal > 1000 and job =
'consultant'
This query returns the name and salary of all employees from the
emp table having a salaray sal more than 1000 and that have a
consultant job.
To try SQL*XL download it now!
Further reading: SQL Tutorial http://www.w3schools.com/sql/default.asp
SQL - Wikipedia http://nl.wikipedia.org/wiki/Sql
|