修改数据库中表中的名字:exec sp_rename 'student.address','addr', 'column'
ps:Oracle:alter table tablename rename column col1 to col2;
增加一列:ALTER TABLE question ADD mulOption char(1);
增加默认值:alter table question add constraint df_mulOpt default('n') for mulOption;
增加检查约束:ALTER TABLE question ADD CONSTRAINT mul_pchk CHECK (mulOption in ('y','n'));
当然在创建表的时候可以直接写:
create table fuck (
id int primary key default 1 check (id in(1,2))
)