MySQL

primary key

alter table テーブル名 add primary key(カラム);

auto increment

alter table テーブル名 modify catid int auto_increment;

確認

describe テーブル名;
+---------+-------------+------+-----+---------+----------------+
| Field   | Type        | Null | Key | Default | Extra          |
+---------+-------------+------+-----+---------+----------------+
| catid   | int(11)     | NO   | PRI | NULL    | auto_increment |
| catname | varchar(10) | YES  |     | NULL    |                |
+---------+-------------+------+-----+---------+----------------+

トップ   編集 凍結 差分 履歴 添付 複製 名前変更 リロード   新規 一覧 検索 最終更新   ヘルプ   最終更新のRSS
Last-modified: 2022-06-30 (木) 01:40:11