LoginSignup
16
13

More than 5 years have passed since last update.

MySQLでテーブルやカラムにコメントをつける

Posted at

書き方

テーブルのコメントは、CREATE文の最後にcomment='table comment'という形。
カラムの場合は、columnName int comment 'column comment'となる。

CREATE TABLE tableName (
    columnName1 int comment '1つ目のカラム',
    columnName2 text comment '2つ目のカラム'
)
default charset=utf8
comment='テーブルに対するコメント';
16
13
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
16
13