Data Types RunningNotes 15JUN2023
Data Types RunningNotes 15JUN2023
ASCII UNICODE
-------- ----------
CHAR NCHAR
VARCHAR NVARCHAR
VARCHAR(MAX) NVARCHAR(MAX)
CHAR:-
* This Datatype is USed for Storing the character Data
* IT Allows to store upto '0 to 8000' Characters
* This Datatype is Recommended for the Fixed Length Column Values
VARCHAR:-
* Just like CHAR Datatype VARCHAR Datatype allows the Character Data
upto '0 to 8000' Characters
* Recommended for Variable Length Fiels/Columns.
* IN VARCHAR Extra Bytes are Released.
VARCHAR(MAX):-
* This Datatype is similar to VARCHAR Datatype. only Difference is it
will allow the Data upto 2GB.
NOTE:-
*"NCHAR,NVARCHAR,NVARCHAR(MAX)" Are similar to "CHAR,VARCHAR,VARCHAR(MAX)"
*"CHAR,VARCHAR,VARCHAR(MAX)" Allows ASCII Charaters
that includes (256 charchers) (A-z,0-9,special charchers)
*"NCHAR,NVARCHAR,NVARCHAR(MAX)" Along with ASCII values
it ALLows UNICODE values as well 'Chinese', 'Japanese','Hindi'
etc.;
----> NUMERIC(P):-
* Allows Numbers Without Decimal Particular
* USe this Datatype When the Values is based on the Number of Digits
* Allow Numbers upto 38 Characters
Eg:- BankAccNumber NUMERIC(11)-- Allows numbers upto 11 digits
09916786161 ------> VALID (As length is 11 digits it is
valid)
099167 ------> VALID (As Length is less than 11
digits it is invalid)
099167861611------> INVALID (As Length is More than 11
digits it is invalid)
B9916786161------> INVALID (Even though length is 11
digits it is invalid
----> NUMERIC(P,S):-
* Allows Numbers with Decimal Values (floats)
* 'P' Stands for Precision. It defines Total Number of digits to be
allowed (includes after decimal part)
* 'S' Stands for Scale. It Defines number of digits to be allowed
after Decimal
---->Binary Types:-
* Binary Datatypes are used fro storing the Multimedia Objects
Like :- Audio,Video,Images etc.;
* Differnt types of Binary datatypes are :
1)Binary --------> Allows upto o-8000 Bytes
2)VARBiary --------> Allows upto 0-8000 Bytes ( Extra
Bytes will be released)
3)VARBiary(MAX) --------> Allows upto 2GB