How to define the default values for a column when creating tables in MySQL? How to define the default values for a column when creating tables in MySQL? mysql mysql

How to define the default values for a column when creating tables in MySQL?


IsObsolete           CHAR(1) NOT NULL DEFAULT 'N'


You probably want to put quotes around it:

CREATE TABLE Team(    TeamId              CHAR(16) NOT NULL,    DateCreated          TIMESTAMP NOT NULL,    IsObsolete           CHAR(1) NOT NULL DEFAULT 'N',    UpdateTime           TIMESTAMP NOT NULL);


If your are changing your structure via phpMyAdmin, you should just type in the char (e.g N) as opposed to 'N'