Operators & datatype



Datatypes


Sql Identifiers

                     Used to indentify objects in the  databse,such as table name,view names and columns.The following rules apply on identifiers.
  • An Identifier can be no longer than 128 characters
  • An Identifier must start with a letter
  • An Identifier cannot contain spaces
                Somtimes,for manipulation purposes,Charactersand bit are refferd to as String data types,and exact numeric and approximate numeric are refferd to as numeric data type,as they share similar properties.

SQL scalar datatype 


     Boolean data
                       consists of the distinic truth values TRUE and False and also NULL

   
    Character data

                                  Character data consists of a sequence of characters from an implemention defined character set.Thus the exract Character that can apper in a Character type column will vary depending on the vender.


Character[VARYING][lengh]
Character= char
Character VARYING=VARCHAR

Default lenght of a charater column is 1 

 BIT data

                     Used define bit Strings,that is sequence of binary digits,each having either a values of  0/1

BIT[VARYING][length]

Exact numeric data
  • Appromimate and numeric data
  • Datetime data 
  • Inerval Data
  • Scalar Operators




Operators


                                                                                        More Complex expression can be generated using logical operators AND,OR and NOT with parentheses to show the Oder of evaluation.the rules for evaluating a conditional expression are:


  •  An expression is evaluated left to right 
  • subexpression  in brackets are evaluated first
  • NOTs are evaluated before ANDs and Ors
  • Ands are evaluated befor ORs

EX:



SELECT * FROM  Mark WHERE Student='80' OR '90'