+ 2
What is the basic difference char and varchar?
Please give the explanation for this
5 Answers
+ 1
The difference is not only about the amount of characters in int, which it max is 255 and varchar is specify by the developer.
Varchar is also the modem type of int which handles things like email, regular expressions, and etc, while int bundle limited formats of data.
0
For char data type, the maximum size is fixed whereas for varchar data type, user can set the maximum size of the data type.The name varchar is shortform of variable character.
0
in char the storage space s fixed as given during declaration but in varchar e storage space s dynamic. it only takes amount of space needed to store data.
0
@yash
Char and varchar main big difference yeh hain
If varchar(10) hain toh humnae Ismai 5 value take input Kar Diya toh Baki ki 5 value ki storage Bach jayengi waste nahi hongi
And char mai if char(10) hain then hum 5 tak value dali then baki ki bachi storage waste ho jayengi
I hope this will help u.
- 1
char is a fixed length character and have max of 255 byte size whereas varchar have variable character length and max length can be specified in the parentheses