Differences between CHAR and VARCHAR : Char Varchar : Data Types MySQL TUTORIALS
Ajax
Ajax Examples
Ajax Tutorials
Scripts and Programs
Javascript
Javascript Examples Tutorials
DHTML Tutorials
Javascript References
Scripts and Programs
HTML
HTML Tutorials
HTML References
HTML DOM 0 References
HTML DOM 2 References
CSS
CSS Tutorials
CSS References
PHP
PHP Source Code
PHP References
Scripts and Programs
C#
C# Source Code
C# Examples
MySQL TUTORIALS
»
Data Types
»
Char Varchar
»
Differences between CHAR and VARCHAR
Value
CHAR(4)
Storage Required
VARCHAR(4)
Storage Required
''
' '
4 bytes
''
1 byte
'ab'
'ab '
4 bytes
'ab'
3 bytes
'abcd'
'abcd'
4 bytes
'abcd'
5 bytes
'abcdefgh'
'abcd'
4 bytes
'abcd'
5 bytes
Related Scripts with Example Source Code in same category :
CHAR and VARCHAR
Set column default value for VARCHAR
VARCHAR column with default value
All CHAR and VARCHAR values in MySQL are compared without regard to any trailing spaces
If a given value is stored into the CHAR(4) and VARCHAR(4) columns, the trailing spaces of values retrieved from the columns are removed from CHAR columns.
Leave a Comment / Note
Name (required)
email (will not be published) (required)
Website
Vérification
Refresh
Enter code
Verification is used to prevent unwanted posts (spam). .
MySQL TUTORIALS
Data Types
»
Char Varchar
BIGINT
INT
Bit
INTERVAL
BLOB
Introduction
Boolean
MEDIUMINT
Char Varchar
NULL
Date
Set
DATETIME
SMALLINT
Decimal
String
Double
TEXT
ENUM
TIME
FLOAT
Timestamp
FULLTEXT
TINYINT
Hexadecimal
YEAR
Aggregate Functions
Cast Functions Operators
Comparison Functions Operators
Control Flow Functions
Cursor
Data Dictionary
Data Types
Database
Date Time Functions
Encryption Compression Functions
Information Functions
Insert Update Delete
Introduction
Logic Operator
Math Numeric Functions
Miscellaneous Functions
MySQL Utilities
Privilege
Procedure Function
Regular Expressions
Select Query
String Functions
Subquery
Table
Table Join
Trigger
View