1.

Which mode does not remove trailing spaces when CHAR values are retrieved?(a) PAD_CHAR_TO_FULL_LENGTH(b) TO_FULL_LENGTH_CHAR_PAD(c) CHAR_PAD_TO_FULL_LENGTH(d) PAD_CHAR_TO_LENGTHI got this question during an interview for a job.This intriguing question comes from String Data Types topic in portion Data Type Reference, Operators and Functions of MySQL

Answer»

Right choice is (a) PAD_CHAR_TO_FULL_LENGTH

For EXPLANATION: When the CHAR VALUES are stored, they are right-padded with spaces to the specified length. When CHAR values are retrieved, TRAILING spaces are removed unless the SQL mode ‘PAD_CHAR_TO_FULL_LENGTH’ is enabled.



Discussion

No Comment Found

Related InterviewSolutions