Advertisement: Over 100,000 Jobs Worldwide. Click here to find one for you.

MySQL FAQs
FAQs Categories
Client Server Commands
Database Structure
Table Types or Storage Engines
Indexes
SQL Statements
Table Joins
Funtions and Operators
Tricky Select Queries
Speed Up Queries
Data Back Up
General Questions
Errors


http://www.careermidway.com
 
Home / Database Structure / Data Types / Question No: 109

What are string data types in MySQL 5?

I need string data types description. Any help?

Answer No: 109

The string data types include binary and non-binary string data.

The CHAR, VARCHAR, and TEXT data types store non-binary strings (that is, strings of characters that have a character set and collation).

The BINARY, VARBINARY, and BLOB data types are the binary string equivalents of the non-binary CHAR, VARCHAR, and TEXT data types. That is, they store strings that consist of bytes rather than characters, and they have no character set or collation.

The following table summarizes the non-binary string data types. For the storage requirement values, M represents the maximum length of a column. L represents the actual length of a given value, which may be 0 to M.

TypeStorage RequiredMaximum Length
CHAR(M)M characters255 characters
VARCHAR(M)L characters plus 1 or 2 bytes65,535 characters (subject to limitations)
TINYTEXTL characters + 1 byte255 characters
TEXTL characters + 2 bytes65,535 characters
MEDIUMTEXTL characters + 3 bytes16,777,215 characters
LONGTEXTL characters + 4 bytes4,294,967,295 characters

The following table summarizes the binary string data types. For the storage requirement values, M represents the maximum length of a column. L represents the actual length of a given value, which may be 0 to M.

TypeStorage RequiredMaximum Length
BINARY(M)M bytes255 bytes
VARBINARY(M)L bytes plus 1 or 2 bytes65,535 bytes (subject to limitations)
TINYBLOBL + 1 bytes255 bytes
BLOBL + 2 bytes65,535 bytes
MEDIUMBLOBL + 3 bytes16,777,215 bytes
LONGBLOBL + 4 bytes4,294,967,295 bytes

Related MySQL FAQs to the Above FAQ

What-is-BIT-Data-Type-in-MySQL What is BIT Data Type in MySQL?

What-are-numeric-data-types-in-MySQL What are numeric data types in MySQL?

What-are-integer-data-types-in-MySQL What are integer data types in MySQL?

What-are-float-data-types-in-MySQL What are float data types in MySQL?

What-is-fixed-point-and-decimal-data-type-in-MySQL What is fixed point and decimal data type in MySQL?

What-is-MySQL-default-character-set What is MySQL default character set?

What-is-difference-between-binary-and-non-binary-string-data-types What is difference between binary and non-binary string data types?

What-are-ENUM-and-SET-Data-Types-in-MySQL What are ENUM and SET Data Types in MySQL?

What-is-difference-between-CHAR-AND-VARCHAR-data-types What is difference between CHAR AND VARCHAR data types?

How-to-reformat-date-values-in-MySQL How to reformat date values in MySQL?

How-to-reformat-Time-values-in-MySQL How to reformat Time values in MySQL?

What-are-Temporal-Data-Types-in-MySQL What are Temporal Data Types in MySQL?

What-are-DATE-TIME-DATETIME-and-YEAR-Data-Types-in-MySQL What are DATE, TIME, DATETIME and YEAR Data Types in MySQL?

What-is-TIMESTAMP-Data-Type-in-MySQL What is TIMESTAMP Data Type in MySQL?

About SiteAbout FAQsAffiliates and Sponsors
© 2007 - 2010  www.mysqlfaqs.net
All rights reserved. The site is owned and operated by Mr. Javed Bhatti - Pakistan.