MEDIUMTEXT
MEDIUMTEXT is a column type in SQL databases. It is used to store large blocks of text, capable of storing up to 16MB or approximately 16,777,215 characters. Encoding can dictate the maximum nubmer of characters, as one character can occupy more than one byte of storage. MEDIUMTEXT is part of the TEXT data type category in SQL. It is used when TEXT's 64KB of storage is insufficient, but LONGTEXT's 4GB is excessive.
Example
Output
Explanation
In the provided example, initially a table ‘example_table’ is created with two columns, ‘id’ and ‘text_column’. The ‘id’ column is set as the primary key which auto increments with every new row addition. The ‘text_column’ is defined as ‘MEDIUMTEXT’, a type that can store up to 16 million characters.
A record is inserted into ‘example_table’ with a lengthy string “This is a very long text…” in the ‘text_column’. The Output reflects the successful execution of these operations.