修改表的结构 更新数据

#######修改表的结构 

##1.添加一条新的字段 
alter table student
    add 专业 char(30);
    
##2.改变原有字段的数据类型 
alter table course
    modify 学分 smallint;
    
##3.删除某一个字段 
alter table student
    drop column 专业;
    
##4.更改表的名字 
alter table student
    rename as stu;

-- 注意添加字段和删除字段不同,一个需要指明column一个不需要 

#########更新数据 
update student set 出生日期='1995-02-01' where 姓名='kylin';



猜你喜欢

转载自blog.csdn.net/kylin_learn/article/details/81032982