Question:

In SQL, which data type is best suited for storing large texts such as articles or comments ?

Show Hint

Use `VARCHAR` for short texts (like names, titles) and `TEXT` for long texts (like blog posts, descriptions). Use `CHAR` only when the text length is always the same (like a country code 'US').
  • Text
  • Varchar
  • Char
  • Blob
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is A

Solution and Explanation

Step 1: Analyze the requirement. The need is to store a large amount of text, like an article, which can exceed the limits of standard string types.
Step 2: Compare the given data types.

(A) \text{Text}: A data type specifically designed for holding long-form text strings.
(B) \text{Varchar}: Used for variable-length strings, but typically has a specified maximum length (e.g., `VARCHAR(255)`) and is not suitable for very large texts.
(C) \text{Char}: Used for fixed-length strings. Inefficient for variable-length text like comments.
(D) \text{Blob} (Binary Large Object): Used for storing binary data, such as images or files, not plain text.
The \text{Text} data type is the most appropriate choice for storing large amounts of text.
Was this answer helpful?
0
0