修改数据库字段名称类型:
alter table tableName rename column oldCName to newCName; -- 修改字段名
alter table tableName modify (cloumnName 数据类型); -- 修改数据类型
1、创建表:
CREATE TABLE TABLE_NAME(
id varchar2(32) primary key,
name varchar2(8) not null,
);
2、修改字段名:
alter table TABLE_NAME rename name to re_name;
3、修改数据类型:
alter table table_name modify (id varchar2(64));
4、创建视图:
create or replace view view_name as select * from table_name
5、查询数据库外键关联
select *
from user_constraints a, user_constraints b
where a.constraint_type = 'R'
and b.constraint_type = 'P'
and a.r_constraint_name = b.constraint_name
--and a.CONSTRAINT_NAME like '%FK_DEL_IT_IN%'