This question asked in CBSE SQP-2020
Which declaration doesn’t use the same number of bytes and consumption of bytes depend on the input data?
Answer:
The varchar declaration doesn’t use the same number of bytes and consumption of bytes depends on the input data.
Explanation:
Varchar is a datatype in SQL which is used to store character strings of variable length but with maximum length specified. If the length of the string is less than the set length then it will store the string as it is without adding any extra blank spaces.
Example:
Declaration |
Value assigned |
Number of Bytes |
Consumption of Bytes |
Name varchar(10) |
‘Rosa’ |
10 |
4 |
Place varchar(15) |
‘Chandigarh’ |
15 |
10 |