create table userinfo_f4(id varchar2(10) primary key,username varchar2(20),typeid_new varchar2(10));
alter table userinfo_f4 add constraint fk_typeid_alter foreign key(typeid_new) references typeinfo(typeid);
alter table userinfo_f4 add constraint fk_typeid_alter foreign key(typeid_new) references typeinfo(typeid);
2018-01-09
create table userinfo_f3(id varchar2(10) primary key,username varchar2(20),typeid_new varchar2(10),constraint fk_typeid_new1 freign key(typeid_new) references typeinfo(typeid) on delete cascade);
2018-01-09
create table userinfo_f2(id varchar2(10) primary key,username varchar2(20),typeid_new varchar2(10),constraint fk_typeid_new freign key(typeid_new) references typeinfo(typeid));
2018-01-09
insert into typeinfo values(1,1);
insert into userinfo_f(id,typeid_new) values(1,2);
insert into userinfo_f(id,typeid_new) values(1,1);
insert into userinfo_f(id,typeid_new) values(1,null);
insert into userinfo_f(id,typeid_new) values(1,2);
insert into userinfo_f(id,typeid_new) values(1,1);
insert into userinfo_f(id,typeid_new) values(1,null);
2018-01-09
create table typeinfo(tyoeid varchar2(10) primary key,typename varchar2(20));
create table userinfo_f(id varchar2(20) primary key,username varchar2(20),typeid_new varchar2(10) references typeinfo(typeid));
create table userinfo_f(id varchar2(20) primary key,username varchar2(20),typeid_new varchar2(10) references typeinfo(typeid));
2018-01-09
select constraint_name,tatus from user_constraints where table_name='USERINFO';
alter table userinfo_p drop primary key;
desc userinfo_p
alter table userinfo_p drop primary key;
desc userinfo_p
2018-01-08
select constraint_name from user_constraints where table_name='USERINFO';
alter table userinfo disable constraint new_pk_id;
select constraint_name,tatus from user_constraints where table_name='USERINFO';
alter table userinfo drop constraint new_pk_id;
alter table userinfo disable constraint new_pk_id;
select constraint_name,tatus from user_constraints where table_name='USERINFO';
alter table userinfo drop constraint new_pk_id;
2018-01-08
desc userinfo
alter table userinfo add constraint pk_id primary key(id);
desc user_constraint
select constraint_name from user_constraints where table_name='USERINFO';
alter table userinfo rename constraint pk_id to new_pk_id;
alter table userinfo add constraint pk_id primary key(id);
desc user_constraint
select constraint_name from user_constraints where table_name='USERINFO';
alter table userinfo rename constraint pk_id to new_pk_id;
2018-01-08
select constraint_name from user_constraints where table_name='USERINFO_P1';
select constraint_name from user_constraints where table_name='USERINFO_P';
select constraint_name from user_constraints where table_name='USERINFO_P';
2018-01-08
create table userinfo_p1(id number(6,0),username varchar2(20),userpwd varchar2(20),constraint pk_id_username primary key(id,username));
desc userinfo_p1
desc user_constraint
desc userinfo_p1
desc user_constraint
2018-01-08
create table userinfo_p(id number(6,0) primary key,username varchar2(20),userpwd varchar2(20));
desc userinfo_p
desc userinfo_p
2018-01-08
alter table userinfo modify username varchar2(20) not null;
delete fromuserinfo;
later table userinfo modify username varchar2(20) not null;
desc userinfo;
later table userinfo modify username varchar(20) null;
desc userinfo;
delete fromuserinfo;
later table userinfo modify username varchar2(20) not null;
desc userinfo;
later table userinfo modify username varchar(20) null;
desc userinfo;
2018-01-08
create table userinfo_1(id number(6,0), username varchar2(20) not null,userpwd varchar2(20) not null);
desc userinfo_1
insert into userinfo_1(id) values(1);
desc userinfo_1
insert into userinfo_1(id) values(1);
2018-01-08
create table testdel as select * from userinfo;
delete from testdel;
select * from testdel;
select username from userinfo;
delete from userinfo where username='yyy';
select username from userinfo;
delete from testdel;
select * from testdel;
select username from userinfo;
delete from userinfo where username='yyy';
select username from userinfo;
2018-01-08
update userinfo set userpwd='111111';
select userpwd from userinfo;
update userinfo set userpwd='111',email='111@126.com';
select userpwd,email from userinfo;
select username from userinfo;
update userinfo set userpwd='123456' where username='xxx';
select username,userpwd from userinfo;
select userpwd from userinfo;
update userinfo set userpwd='111',email='111@126.com';
select userpwd,email from userinfo;
select username from userinfo;
update userinfo set userpwd='123456' where username='xxx';
select username,userpwd from userinfo;
2018-01-08