O'Reilly logo

Sams Teach Yourself MySQL by Chris Newman

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Data Types

When you create a new table, you must decide on the data types for each column. You already encountered some of the general column types, such as VARCHAR and INT, in Lesson 14. Now let’s look at the most common data types in more detail.

Data Types

For a complete list of the data types you can use, refer to Appendix D, “MySQL Data Type Reference,” which can be found on the book’s website at www.samspublishing.com.

INTEGER

An integer is a whole number. The range of values that can be stored in an integer data type depends on the size of the integer—MySQL has five different sizes:

  • TINYINT can store numbers from –128 to 127, or 0 to 255 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required