CBSE Class 12 Sample Paper for 2024 Boards

Computer Science - Class 12
Solutions to CBSE Sample Paper - Computer Science Class 12

## d. 6,9

b. 6,20

Let us go through each of the options and explain why they are correct or incorrect:

• a. 20,6 . This option is incorrect because it assumes that varchar(20) always occupies 20 bytes of space, regardless of the actual value of the attribute. This is not true, as varchar only uses the space required by the value.
• b. 6,20 . This option is correct because it correctly reflects the space occupied by varchar and char data types. Varchar only uses the space required by the value, which is 6 bytes in this case. Char always uses the maximum space defined by the data type, which is 20 bytes in this case.
• c. 9,6 . This option is incorrect because it assumes that char(20) only occupies 6 bytes of space, which is equal to the length of the value “Meenakshi”. This is not true, as char always uses the maximum space defined by the data type.
• d. 6,9 . This option is incorrect because it assumes that char(20) only occupies 9 bytes of space, which is equal to the length of the value “Meenakshi”. This is not true, as char always uses the maximum space defined by the data type.

The correct answer is b. 6,20 because:

• varchar stores variable-length strings and uses the space required by the value.
• char stores fixed-length strings and uses the maximum space defined by the data type.
• Attribute A of datatype varchar(20) has the value “Keshav” (6 bytes).
• Attribute B of datatype char(20) has the value “Meenakshi” (20 bytes).

So, the correct answer is b. 6,20.

Learn in your speed, with individual attention - Teachoo Maths 1-on-1 Class 