Overview of Data and Column Types

Strictly speaking, data types are slightly different from column types: the term data types refers to how MySQL interprets and handles that data; column types refers to the declaration of the column in the table. For a given column type, there will be peculiarities in the manner of inserting and returning the data; there will be certain storage requirements and limitations on the values that can be represented.

MySQL can handle the following data types:

  • Numeric values

  • String values

  • Date and time values

  • The NULL value

For each data type (numeric, string, temporal), several column types usually are available. Most of this lesson explores these column types.

Examples of declaring column types will normally be in the ...

Get Sams Teach Yourself MySQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.