Working with columns
A table row can be seen as a collection of named properties are called columns or fields. So, columns must suit the units of data that make up the information.
In the previous sections, we learned the most important SQL statements for managing databases and tables. We have also seen some example column definitions. In this section, we will discuss the following:
Column definitions
The management of columns
A column definition has the following syntax:
<column_name> <data_type> [type_attributes] [NULL | NOT NULL] [DEFAULT <value>] [AUTO_INCREMENT] [COMMENT 'string']
The following subsections will explain the data types, the NULL
attribute, and the default values. The AUTO_INCREMENT
attribute and comments will be discussed later in the indexing section of this chapter.
Data types
The data type is the most important characteristic that we need to set: it determines the class of data that the column will contain, its size, the way it will be stored, and the operations...