文章摘要:mysql怎么给属性设置主键 mysql中如何设置主键
mysql给属性设置主键的sql语句:Alter table table_name add primary k […]
mysql给属性设置主键的sql语句:Alter table table_name add primary key(col_name);
mysql给属性设置主键的示例:
sql语法格式:
alter table table_name add primary key(col_name);
举个例子:将reader表的reader_id设置为主键,sql语句为
alter table reader add primary key(reader_id);