1 添加字段:
alter table 表名 add (字段 字段类型)[default'默认值'][非空];
alter table student add (name varchar2(10))[default'张三'][not null];2.添加备注:
comment on column 库名.表名.字段名 is '备注';
comment on column ocal.student.name is '姓名';
2、删除字段
alter table 表名 drop (字段);
alter table student drop (name);
3、修改字段
alter table 表名 modiy
(字段1 字段类型 [default'输入默认值'][null/not null],
字段2 字段类型 [default'输入默认值'][null/not null]);
修改多个字段用逗号隔开
alter table student modiy
(name varchar2(10)[default'李四'][not null],
age number(2));
4、查询字段
select A.COLUMN_NAME,A.DATA_TYPE from user_tab_columns A
where TABLE_NAME ='表名';
表名一定要大写
select A.COLUMN_NAME,A.DATA_TYPE from user_tab_columns A
where TABLE_NAME ='STUDENT';