Introduction of SQL
The
Structured Query Language, or SQL, is one of the most powerful tools available
today when it comes to working with data sets and getting the information you
need from databases. This course will introduce you to SQL and explain how you
can quickly start using it to query databases and how you can start to
fine-tune your use of SQL.
Q) What SQL is used
for??
SQL is a bit different
from developing applications that gather this information from the database by
manipulating the database directly. In those cases, the application is
responsible for determining how the information is analyzed and retrieved. With
SQL, you do not have to indicate how you want information retrieved, you only
indicate what criteria you want to use. This is called a declarative language.
Declarative language:
A declarative language
is a language in which you simply indicate what you need and let the database
engine get it for you. How the information is actually gathered is irrelevant
to the user.
Capabilities of SELECT statement
SELECT statement is used
to retrieves information form the database. Oracle, SQL, MySQL etc. supports
SELECT statement. As SELECT statement retrieves data, it can do three types of
work This page describes the capabilities of SQL SELECT statements.
SQL SELECT statement can
do the following three types of work:
. Projection
. Selection
. Joining
PROJECTION :
By using SQL SELECT
statement you can project or select all or the specific columns. It's primary
goal is to select only the columns. The selected columns may be all the columns
of the table. You can choose few or all the columns according to your queries.
Using SELECT statement,
you can select all or several columns of a table. The orange column of this
picture means that only those columns are selected.
Using SELECT statement,
you can select specific rows of a table. The orange rows of this picture means
that only those rows are selected.
SELECTION :
By using SELECT
statement, you can select the specific no of rows form the table. You can
restrict the rows by applying several conditions. In this case, SELECT
statement is used as filtering.
JOINING :
By using SELECT
statement, you can join different types of table. Use join capabilities to
bring together data that is stored in different tables by creating a link
between different tables.