都是最基本的操作,最好多看看相关的资料。
create table TEST_0
(
ID NUMBER(2),
NAME VARCHAR2(5)
);create table TEST_1
(
ID NUMBER not null
);
alter table TEST_1
add constraint PK_TEST_1 primary key (ID);alter table TEST_0
add constraint TEST_ST foreign key (ID)
references TEST_1 (ID);1、给字段增加注释
SQL> comment on column test_0.id is '序列号';注释被添加
2、删除外键
SQL> alter table test_0 drop constraint test_st;表被改变
3、调整字段长度
SQL> alter table test_0 modify(name varchar2(20));表被改变
create table TEST_0
(
ID NUMBER(2),
NAME VARCHAR2(5)
);create table TEST_1
(
ID NUMBER not null
);
alter table TEST_1
add constraint PK_TEST_1 primary key (ID);alter table TEST_0
add constraint TEST_ST foreign key (ID)
references TEST_1 (ID);1、给字段增加注释
SQL> comment on column test_0.id is '序列号';注释被添加
2、删除外键
SQL> alter table test_0 drop constraint test_st;表被改变
3、调整字段长度
SQL> alter table test_0 modify(name varchar2(20));表被改变
is '注释';alter table tablename
drop constraint SYS_C0012604;
alter table tablename modify colname VARCHAR2(30);