Sometimes wee need to add a comment to a column for understanding purpose means to easily identify what is the use of that particular column.
We can add comment to a column by two ways- at the time of table creation or by ALTER command after creating the table with the help of COMMENT attribute.
- At the time of table creation:
CREATE TABLE `white_words` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`word` varchar(45) DEFAULT NULL COMMENT 'Use column to contain white words.',
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
- After creating table:
ALTER TABLE white_words CHANGE COLUMN `word` `word` VARCHAR(45) NULL DEFAULT NULL COMMENT 'Use column to contain white words.';
Hope this will help you :)