From the course: MySQL Essential Training (2019)

Unlock this course with a free trial

Join today to access over 22,400 courses taught by industry experts.

String types

String types

- [Instructor] MySQL provides string types for a variety of purposes. Character strings are used to store text-based strings. Binary strings, store non-text-based data. Fixed length strings are padded and always use the same amount of storage. While variable length strings use less storage, when the strings are shorter. And large object storage is used for storing documents and media files and other large objects. Character strings come in two varieties, the C-H-A-R, CHAR string is a fixed-length string. The parameter is used to define the length of the string. For example, if you specify a length of five, the string will always be five characters in length. If put few than five characters in the string, it will add spaces at the end of the string, in order to pad it out to five characters. When you retrieve the string from a table, any padded spaces are removed first. The VARCHAR string is a variable length. The parameter is used to limit the length of the string. For example, if you…

Contents