mysql的相关命令整理(二)
1)向已有的表中加入新的列,即加入新的字段。
alter table personinfo
add address char(15) not null default 'hangzhou';

2)删除原先的字段,即删除一个列。
alter table personinfo
drop column age;

3)修改原先的字段,即修改一个列的信息。
alter table personinfo
modify age float;

4)表的重命名
rename table personinfo to personInfos;

5)删除表中的数据,即行数据。
delete from personinfo
where name = chenjiang;
select *from personinfo;

 
                    
                 
                
            
         浙公网安备 33010602011771号
浙公网安备 33010602011771号