Home >> SQL >> Difference between varchar and char in SQL

Difference between varchar and char in SQL

1- CHAR used to store character string value of fixed length but VARCHAR store alphanumeric value of variable length.

2-CHAR maximum 255 characters  but VARCHAR maximum 65535 characters.

3-CHAR faster than VARCHAR.

4-CHAR uses static memory allocation but VARCHAR uses dynamic memory allocation

Post Your Comment

Next Questions
Difference between Tinyint and smallint
Difference between enum and set
Difference between signed and unsigned
Operators
Arithmetic Operators
Comparison Operators
Logical Operators
What is key
What is super key
What is candidate key
What is primary key
What is unique key
What is foreign key
What is join
What is cross join
What is natural join
What is outer join
What is self join
What is aggregate function
COUNT(*) aggregate function
AVG() aggregate function
MIN() aggregate function
MAX() aggregate function
SUM() aggregate function
STDED() aggregate function

Copyright ©2022 coderraj.com. All Rights Reserved.