Mega Code Archive

 
Categories / MySQL / Table Index
 

To disallow NULL values in any of the columns, add NOT NULL to the definition of each one

mysql> mysql> CREATE TABLE people     -> (     ->     id         INT UNSIGNED NOT NULL,     ->     first_name CHAR(30) NOT NULL,     ->     last_name  CHAR(30) NOT NULL     -> ); Query OK, 0 rows affected (0.00 sec) mysql> mysql> drop table people; Query OK, 0 rows affected (0.00 sec) mysql>