Check sibling questions

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

 

 

549 people joined Teachoo Black. What are you waiting for?


Transcript

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

Davneet Singh's photo - Teacher, Engineer, Marketer

Made by

Davneet Singh

Davneet Singh is a graduate from Indian Institute of Technology, Kanpur. He has been teaching from the past 12 years. He provides courses for Maths and Science at Teachoo.