I have a table when I do describethis:
mysql> DESC my_table;
+------------+-------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+------------+-------------+------+-----+---------+----------------+
| contact_id | int(11) | NO | PRI | NULL | auto_increment |
| location | varchar(20) | YES | | NULL | |
| city | varchar(20) | YES | | NULL | |
| state | varchar(2) | YES | | NULL | |
+------------+-------------+------+-----+---------+----------------+
4 rows in set (0.01 sec)
My question is: why is it contact_id Defaultdisplayed for the primary key as NULL?
I created a table with NOT NULLfor a column, but Primary Keyin any case it cannot be NULL.
How to NULLbe NOand Defaultbe NULL?
source
share