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

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

难度入门
时长 4小时14分
学习人数
综合评分9.67
338人评价 查看评价
9.8 内容实用
9.7 简洁易懂
9.5 逻辑清晰
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;
select constraint_name from user_constraints where table_name='USERINFO_P1';
select constraint_name from user_constraints where table_name='USERINFO_P';
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
create table userinfo_p(id number(6,0) primary key,username varchar2(20),userpwd varchar2(20));
desc userinfo_p
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;
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);
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;
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;
课程须知
只要知道数据库是什么就可以来学习本课程呦!
老师告诉你能学到什么?
掌握Oracle的SQL语句基础,为后续的课程学习打好基础。

微信扫码,参与3人拼团

意见反馈 帮助中心 APP下载
官方微信
友情提示:

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

本次提问将花费2个积分

你的积分不足,无法发表

为什么扣积分?

本次提问将花费2个积分

继续发表请点击 "确定"

为什么扣积分?

举报

0/150
提交
取消