SQL_3
SQL_3
table students
Use of between in place of and ( when we use same column for creating a range using ‘and’ condition then we can
use ‘between’ in place of ‘and’. When we use ‘between’ both values are included in the range)
In following both query we are finding age from 16 to 20
Use of in in place of or ( when we use same column for creating a condition using ‘or’ then we can use ‘in’ in place of
‘or’.
In following both query we are finding age from 16 to 20
[third char in name is ‘a’, two underscore without space and ‘a’]
SQL> select name, fee from students
Where name like ’_ _a%' ;
[we can display any calculation from integer column, 10% of fee column of class ‘XII-A’ ]
SQL> select name, fee, fee*0.1 from students
Where class=’XII-A’ ;
[we can change any column name only for display purpose, using ‘ new column name’ method ]
SQL> select name ‘students name’ , fee, fee*0.1 ‘ discount’ from students;
Order By clause [used to display data in any order ascending or descending order] (by default ascending order for
descending order we have to write ‘desc’ with column name)
[when values are same in any column then we can use any other column for further sorting ]