Data Types
Data Types
3. tinytext
1.1. CHAR Usage: char(length)
• The char column type has a maximum length of
255 characters.
• This is a fixed length type, meaning that when a
value is inserted that has fewer characters than
the maximum length of the column, the field will
be right-padded with spaces.
1.1. CHAR Usage: char(length)
• So if a column has been defined as char(10) and
you want to store the value “happy”,
• MySQL will actually store “happy” and then five
spaces.
• The spaces are removed from the result when the
value is retrieved from the table.
1.2. VARCHAR Usage: varchar(length)
• This is nearly identical to char and is used in many
column type.
1.2. VARCHAR Usage: varchar(length)
• The values will not be padded with spaces.
varchar fields.
1.3. TINYTEXT Usage: tinytext
• This allows for zero or more values from the list you
specify to be included in a field.
2. Numeric column types
• MySQL has seven column types suitable for storing
numeric values.
Creating Indexes