KnowledgeBoat Logo

Informatics Practices

Identify the correct statement(s):

Statement 1 (S1): Char data type in MySQL stores fixed length strings.

Statement 2 (S2): Char data type stores string smaller than the maximum field size.

  1. (S1) : Correct, (S2) : Correct
  2. (S1): Incorrect, (S2) : Correct
  3. (S1): Correct, (S2) : Incorrect
  4. (S1) : Incorrect, (S2) : Incorrect

Relational Database

3 Likes

Answer

(S1): Correct, (S2) : Incorrect

Reason — The CHAR data type provides fixed-length memory storage. It specifies a fixed-length character string. If the input string is shorter, MySQL pads it with spaces to fill the fixed length. If the input string is longer, it is truncated to fit the fixed length.

Answered By

1 Like


Related Questions