Skip to Main Content
Sams Teach Yourself MySQL in 21 Days, Second Edition
book

Sams Teach Yourself MySQL in 21 Days, Second Edition

by Tony Butcher
December 2002
Beginner content levelBeginner
640 pages
16h 41m
English
Sams
Content preview from Sams Teach Yourself MySQL in 21 Days, Second Edition

String Column Types

MySQL has a range of string column types. Although in name they are intended for storing string or textual data, you can in fact use them to store any kind of data you want, including numbers, images, sounds, and binary data.

Your choice of string column type for a given application largely depends on the length of data you want to store and how you want to work with the data. Table 5.3 shows MySQL's string column types.

Table 5.3. String Column Types
Type NameMaximum Size
CHAR(M)M bytes
VARCHAR(M)M bytes
TINYBLOB28-1 bytes
BLOB216-1 bytes
MEDIUMBLOB224-1 bytes
LONGBLOB232-1 bytes
TINYTEXT28-1 bytes
TEXT216-1 bytes
MEDIUMTEXT224-1 bytes
LONGTEXT232-1 bytes
ENUM('value1','value2',...)65565 values
SET('value1','value2',...)64 values

In essence, ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Sams Teach Yourself MySQL

Sams Teach Yourself MySQL

Chris Newman
Oracle® Database 10g Insider Solutions

Oracle® Database 10g Insider Solutions

Arun Kumar R., John Kanagaraj, Richard Stroupe
MySQL and mSQL

MySQL and mSQL

Tim King, George Reese, Randy Yarger
Jump Start MySQL

Jump Start MySQL

Timothy Boronczyk

Publisher Resources

ISBN: 0672323923Purchase book