Thursday, 25 February 2016

SELECT command & OPERATORS

Using select command we can retrieve the data in three ways
1.PROJECTION
2.SELECTION
3.JOINS

1.PROJECTION:Retrieving the Data from specific columns in the Table is known as Projection.
SYNTAX:Select column1,cloumn2,..columnn from Table_Name;
EXAMPLE:Select Eid,Ename,Sal from Emp;

2.SELECTION:Retrieve the Data Based on some condition is known as selection.

OPERATOR:It is a Special symbol which performs some specific operations.

ARITHMATIC OPERATORS:+,_,/,mod,*

LOGICAL OPERATORS:AND,OR,NOT

RELATIONAL OPERATORS:>,<,>=,<=,=,((<>,!=,^=)THREE WAYS TO WRITE NOT EQUAL OPERATOR).

CONCATINATION OPERATORS:  ||

ASSIGNMENT OPERATOR:  =

MISCELLENEOUS OPERATORS:There are seventeen(17) operators are there

(BETWEEN,NOT BETWEEN),(LIKE,NOT LIKE),(EXISTS,NOT EXISTS),(IS NULL,IS NOT NULL),(UNION,UNION ALL),(INTERSECT,MINUS,ANY,ALL,SOME),(IN,NOT IN).

WHERE CLAUSE:This clause is used to check the condition.Using this clause we can modify some specific records in the table and also we can delete some specific records in the table and we can retrieve some records in the table.

WHERE-UPDATE:Update table_name set Column_Name=value where condition;
Example:Update Emp set sal=1000 where eid=101;

NOTE: SQL commands are not case sensitive but data in Table is case sensitive.
Note: 'Between' in the sense including both first & last value.

DELETE WITH WHERE CLAUSE:
SYNTAX:Delete from Table_Name where condition
Example:Delete from Emp where Empno=7788;

NOTE:  *,? are called wild cards
               * It represents all characters /any character
                In SQL we use % instead of *


No comments:

Post a Comment

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