edited by
1,337 views
0 votes
0 votes

​​​​​​​An attribute $A$ of datatype varchar($20$) has the value $‘xyz’$, and the attribute $B$ of datatype char($20$) has the value $“lmnop”$, then the attribute $A$ has _____ spaces and attribute $B$ has ____ spaces.

  1. $3, 5$
  2. $20, 20$
  3. $3, 20$
  4. $20, 5$
edited by

2 Answers

0 votes
0 votes

$char(20)$ means, a complete space of $20$ characters is allocated for the variable

$varchar(20)$ means, the variable can take space upto $20$ characters, but if assigned less characters it will take less space.

$A(varchar(20))='xyz',$ takes only $3$ characters space.

$B(char(20))='lmnop',$ takes $20$ characters space.

So, $(C)$ should be correct

0 votes
0 votes

option C is correct as  data type A is varchar (20) means upto 20 characters ans data tyoe B  char (20) means strictly 20 characters. Hence A (XYZ) correspond to 3 spaces and B (lmnop) will be correspond to 20 spaces.

Related questions

1 votes
1 votes
0 answers
3
0 votes
0 votes
2 answers
4
Arjun asked Jan 2, 2019
4,385 views
Consider the graph shown below:Use Kruskal’s algorithm to find the minimum spanning tree of the graph. The weight of this minimum spanning tree is$17$$14$$16$$13$