Skip to main content

Posts

Showing posts with the label MySQL

MySQL - What should I use varchar, char, text or blob and when?

MySQL datatypes We all might have gone through the confusion of choosing among the different string related datatypes for data storage, and so have I, many a times. Thus here I have compiled all the info that I had, got and could gather into a single post so as to give a better understanding of things which need to be factored while much such critical decisions. As we all are aware that the following are the string data-types that are supported by MySQL CHAR   VARCHAR   BINARY   VARBINARY   BLOB   TEXT   ENUM   and SET .  Just for your reference I have put hyperlinks for the corresponding  mysql manual doc page. I have divided the post into 4 sets, each discussing about the two datatypes, and how to choose between them CHAR/VARCHAR BINARY/VARBINARY BLOB/TEXT ENUM/SET and in section with BLOB and TEXT we discuss about the things should be considered when deciding between all the the first 6 dataypes. We will start with discussing about their basic propeties