

Strings can be compared according to whether they are case sensitive. Strings can hold anything, even arbitrary binary data such as images or sounds. Table 3.3 shows the MySQL string data types.
#Mysql data types series#
A special attribute enables sequential integer or floating-point column values to be generated automatically, which is useful in applications that require a series of unique identification numbers. Numeric types other than BIT can be signed or unsigned. MySQL has numeric data types for integer, fixed-point, floating-point, and bit values, as shown in Table 3.2.

On the other hand, for VARCHAR( M ), the lack of brackets indicates that ( M ) is required. For example, the syntax MEDIUMINT indicates that the maximum display width, specified as ( M ), is optional. Optional information is indicated by square brackets ( ). The type specifications are shown as you use them in CREATE TABLE statements. The following discussion surveys MySQL’s data types briefly, and then describes in more detail the syntax for defining them and the properties that characterize each type, such as their range and storage requirements.

A data type is more specific than a general category such as “number” or “string.” For a column, the data type is the means by which you precisely characterize the kind of values the column may contain, such as SMALLINT or VARCHAR(32). When you create a table using a CREATE TABLE statement, you specify a data type for each column. Each table in a database contains one or more columns.
