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 ...

Get MariaDB Essentials 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.