Friday, 26 February 2016

DELETE and SELECT WITH WHERE CLAUSE,ORDER BY CLAUSE

DELETE with WHERE clause:
SYNTAX:DELETE  from TABLE_NAME where condition;
EXAMPLE:DELETE from Emp where Empno=7788;

SELECT with WHERE clause:
SYNTAX: Select * from Table_Name where Condition;
Example:Select * from Emp where Empno=7788;

ORDER BY CLAUSE:

  1. This clause is used to arrange the data either Ascending or Descending
  2. By Default Order by clause will arrange the data in Ascending Order.
  3. If we want to arrange the Data in Descending order then we need to use an option called DESC.
  4. By Default Order By clause will arrange the Data in Ascending  Order.
  5. We can apply the Order By clause on any column in the table.
  6. If we apply the Order By clause on character columns then it will arranges the data in alphabetical order.
  7. We can apply the order by clause on more than one column in same table.
SYNTAX: Select * from Table_Name Order By Column_Name [asc][desc]
Example: Select *  From Emp Order By Eid;

PRIORITY OF USING CLAUSES:
1.WHERE 2.GROUP BY 3.HAVING 4.ORDER BY







No comments:

Post a Comment

If you Like my blog Spread it and help friends for whom this blog is useful for their career.