I understood the difference between CHAR
and VARCHAR
.
If I want to insert the word 'house' into a field VARCHAR(10)
, this word in the database will occupy 4 bytes.
If I want to insert the word 'home' in a field CHAR(10)
, this word in the database will occupy 10 bytes.
The difference is clear to me, my only doubt is that amount of bytes in relation to NULL
. If I leave the field VARCHAR NULL
will be 0 bytes , in case the CHAR
will be 10 bytes locked even though NULL
?