Tuesday 28 May 2013

Unit 1 :- SELECT Staments (With Example)

A SELECT statement retrieves information from the database. Using a SELECT statement you can do the following things:

> Projection: You can choose as few or many columns of the table as you required. (Column filtration)
> Selection: You can use various criteria to restrict the rows that you see. (Row filtration)
> Joining: You can use the join capability in SQL to bring together data that is stored in different tables by creating a link between them.

In this section I am going to use two table (emp and dept) shown below.
Here are the topics that I'll cover in SELECT Statement Section.

1) Basic Select Statement or Selecting ALL Columns
2) Selecting Specific Columns
3) Use of Arithmetic Expressions in SELECT statement.
4) Operator Precedence in SELECT statement and using Parenthesis
5) Column Aliases in SELECT statement. (With Example)
6) Concatenation Operator in SELECT statement (With Example)
7) Literal Character String in SELECT statement (With Example)
8) DISTINCT - Eliminating Duplicate Rows (With Example)

In this Tutorial I've used TWO TABLES named: emp and dept.
Here are the Structure of Two Table:  ( CLICK on the image to see better)




Data in EMP and DEPT Table: ( CLICK on the image to see better)




No comments:

Post a Comment