Not null varchar column : Varchar « Data Type « SQL / MySQL






Not null varchar column

     
mysql>
mysql> CREATE TABLE president
    -> (
    ->     last_name   VARCHAR(15) NOT NULL,
    ->     first_name  VARCHAR(15) NOT NULL,
    ->     suffix      VARCHAR(5) NULL,
    ->     city        VARCHAR(20) NOT NULL,
    ->     state       VARCHAR(2) NOT NULL,
    ->     birth       DATE NOT NULL,
    ->     death       DATE NULL
    -> );
Query OK, 0 rows affected (0.00 sec)

mysql>
mysql>
mysql> drop table president;
Query OK, 0 rows affected (0.00 sec)

mysql>

   
    
    
    
    
  








Related examples in the same category

1.Define and use varchar
2.VARCHAR(n) character string with variable length, maximum 65,535 characters
3.Varchar type column with collate latin1_german1_ci
4.CHAR and VARCHAR types are searched case insensitively, unless you use the BINARY keyword.
5.Nullable varchar column
6.Compare varchar value