DavidSzczesniak
1/19/2018 - 4:07 PM

Table column structure

\!h The basic syntax:
-- <name> <type> [NOT NULL | NULL] [DEFAULT <value>]

\!h Example:
+-------------+-------------+------+-----+---------+-------+
| Field       | Type        | Null | Key | Default | Extra |
+-------------+-------------+------+-----+---------+-------+
| artist_id   | smallint(5) | NO   | PRI | 0       |       |
| artist_name | char(128)   | YES  |     | NULL    |       |
+-------------+-------------+------+-----+---------+-------+

\!h Explanation:
-- name           - column name
-- type           - how and what is stored (e.g. CHAR for strings, SMALLINT for numbers etc.)
-- NOT NULL       - a row isn't valid without a value for the column
-- NULL           - a row can exist without a value for the column
-- if DEFAULT set - will be used as the default value for that column when nothing is entered in the future