Nullable varchar column : Varchar « Data Type « SQL / MySQL






Nullable varchar column

     
mysql>
mysql> CREATE TABLE member
    -> (
    ->     member_id   INT UNSIGNED NOT NULL AUTO_INCREMENT,
    ->     PRIMARY KEY (member_id),
    ->     last_name   VARCHAR(20) NOT NULL,
    ->     first_name  VARCHAR(20) NOT NULL,
    ->     suffix      VARCHAR(5) NULL,
    ->     expiration  DATE NULL DEFAULT '0000-00-00',
    ->     email       VARCHAR(100) NULL,
    ->     street      VARCHAR(50) NULL,
    ->     city        VARCHAR(50) NULL,
    ->     state       VARCHAR(2) NULL,
    ->     zip         VARCHAR(10) NULL,
    ->     phone       VARCHAR(20) NULL,
    ->     interests   VARCHAR(255) NULL
    -> );
Query OK, 0 rows affected (0.00 sec)

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

   
    
    
    
    
  








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.Not null varchar column
6.Compare varchar value