-
ALTER TABLE userinfo ADD CONSTRAINT pk_id primary key(id); SELECT constraint_name from user_constraints where table_name='USERINFO'; alter table userinfo rename constraint pk_id to pk_id_new; alter table userinfo disable constraint pk_id_new; select constraint_name,status from user_constraints where table_name='USERINFO'; alter table userinfo drop constraint pk_id_new; alter table userinfo drop primary key; desc userinfo_2查看全部
-
create table userinfo_2(id number(6,0) PRIMARY KEY,username varchar2(20),userpwd varchar2(20)); desc userinfo_2 create table userinfo_3(id number(6,0),username varchar2(20),userpwd varchar2(20),constraint pk_id_username primary key(id,username)); desc user_constraints select constraint_name from user_constraints where table_name='USERINFO_3'; SELECT constraint_name from user_constraints where table_name='USERINFO_2'; pk_id_username查看全部
-
create table testdel as select * from userinfo; delete from testdel; delete from userinfo where username='xxx'; truncate table查看全部
-
update userinfo set userpwd='111111'; select userpwd from userinfo; update userinfo set userpwd='111',email='[email protected]'; update userinfo set userpwd='123456' where username='xxx';查看全部
-
rename table_name to new_table_name;查看全部
-
alter table table_name rename column column_name to new_column_name;查看全部
-
alter table table_name drop column column_name;查看全部
-
alter table userinfo modify coumn datatype;查看全部
-
alter table table_name add column_name datatype;查看全部
-
注意格式,并且同一個用戶下表名唯一查看全部
-
注意drop 的是DATAFILE,即刪除的是文件名,不是表名查看全部
-
修改數據文件:增加數據文件,刪除數據文件查看全部
-
表空間名稱用大寫查看全部
-
注意區別表空間的名字和文件名的區別查看全部
-
truncate table new_userinfo; drop table new_userinfo;查看全部
舉報
0/150
提交
取消