The Gateway to Computer Science Excellence
First time here? Checkout the FAQ!
0 votes

An attribute A of datatype varchar(20) has value ‘Ram’ and the attribute B of datatype char(20) has value ‘Sita’ in oracle. The attribute A has _______ memory spaces and B has _______ memory spaces.

  1. 20, 20
  2. 3, 20
  3. 3, 4
  4. 20, 4
asked in Others by Veteran (340k points) | 616 views

1 Answer

+3 votes
Best answer

The CHAR and VARCHAR types are similar, but differ in the way they are stored and retrieved. They also differ in maximum length and in whether trailing spaces are retained.

The CHAR and VARCHAR types are declared with a length that indicates the maximum number of characters you want to store. For example, CHAR(20) can hold up to 20 characters.

The length of a CHAR column is fixed to the length that you declare when you create the table.

 VARCHAR(20) can also hold up to 20 characters... but if cahracter is less.. it will take less space...


so a needs 3 space (for ram)

b needs 20(for sita)


option 2

answered by Active (3.7k points)
selected by

Quick search syntax
tags tag:apple
author user:martin
title title:apple
content content:apple
exclude -tag:apple
force match +apple
views views:100
score score:10
answers answers:2
is accepted isaccepted:true
is closed isclosed:true

34,947 questions
41,993 answers
41,485 users