Labels

Sunday, 20 December 2015

DQL Commands in SQL Server .

                                                        Data Query Language (DQL)
                                                                               
In general , in any language we can retrieve the data from the existing table totally in 3 ways

                                                * Selection
                                                * Projection
                                                * Joins

SELECT :

                   * We can retrieve the records from 1/more existing tables.

                   * With this command we can retrieve all the records or specific records from the tables.

Syntax : 

      SELECT CN1
      ,CN2
      ,----- ,CNn [(*)]
      FROM < TableName >
      WHERE < Condition >
      GROUP BY < COLUMN - names >
      HAVING < condition >
      ORDER BY < C.N > [asc/desc]

Projection :

  * Retrieving data from specific columns is known as Projection

            Syntax :     Select CN1,CN2 --------- CNn from <T.N>
                
                               *  Represents all columns

Note:
                * In SQL Server , by default all rows selected , if you want to select particular  rows you                        need to use where clause .

                * In a query the execution process is from left to right .

                * In a table values will be modified from top to bottom .


2 comments:

  1. Thanks for posting this Article.. very informative

    ReplyDelete
    Replies
    1. Thank you for visiting the blog. Keep in touch as I will post mny advanced concepts soon.

      Delete