MEDIUMBLOB
MEDIUMBLOB is a BLOB (Binary Large OBject) data type in SQL. It is used to store binary data, specifically variable-length data as series of bytes, up to a size of approximately 16 megabytes. It is typically used for columns that need to hold large amounts of data, such as images or files.
Example
Output
Explanation
In the above example, a table ‘employees’ is created with a MEDIUMBLOB data type column named ‘resume’. Then, a PDF file located at ‘tmp/resume.pdf’ on the server is inserted into the ‘resume’ column of the ‘employees’ table. The MEDIUMBLOB data type is capable of storing binary data up to 16MB, making it suitable for storage of larger files such as images, audio, or PDFs within the database.