为了账号安全,请及时绑定邮箱和手机立即绑定

Oracle数据库开发必备利器之SQL基础

难度入门
时长 4小时14分
学习人数
综合评分9.67
338人评价 查看评价
9.8 内容实用
9.7 简洁易懂
9.5 逻辑清晰
alter table userinfo_u2 drop constraint un_username_new;
select constraint_name,constraint_type,status from user_constraints where table_name='USERINFO_U2';
alter table userinfo_u2 disable constraint un_username_new;
select constraint_name,constraint_type,status from user_constraints where table_name='USERINFO_U2';
create table userinfo_u2(id varchar2(10) primary key,username varchar2(20));
alter table userinfo_u2 add constraint un_username_new unique(username);
create table userinfo_u(id varchar2(10) primary key,username varchar2(20) unique,userpwd varchar2(20));
create table userinfo_u1(id varchar2(10) primary key,username varchar(20),userpwd varchar2(20) ,constrait un_username unique(username));
alter table userinfo_f4 drop constraint fk_typeid_alter;
select constraint_name,constraint_type,status from user_constraints where table_name='USERINFO_F4';
select constraint_name,constraint_type,status from user_constraints where table_name='USERINFO_F4';
alter table userinfo_f4 fisable constraint fk_typeid_alter;
select constraint_name,constraint_type,status from user_constraints where table_name='USERINFO_F4';
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);
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);
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));
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);
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));
再见了心爱的梦中女孩
我将要去远方寻找未来
假如我有一天荣归故里
再到你窗外诉说情怀
select constraint_name,tatus from user_constraints where table_name='USERINFO';
alter table userinfo_p drop primary key;
desc userinfo_p
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;
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;
课程须知
只要知道数据库是什么就可以来学习本课程呦!
老师告诉你能学到什么?
掌握Oracle的SQL语句基础,为后续的课程学习打好基础。

微信扫码,参与3人拼团

微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

友情提示:

您好,此课程属于迁移课程,您已购买该课程,无需重复购买,感谢您对慕课网的支持!

本次提问将花费2个积分

你的积分不足,无法发表

为什么扣积分?

本次提问将花费2个积分

继续发表请点击 "确定"

为什么扣积分?

举报

0/150
提交
取消