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

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

难度入门
时长 4小时14分
学习人数
综合评分9.67
338人评价 查看评价
9.8 内容实用
9.7 简洁易懂
9.5 逻辑清晰
select username,decode(username,'aaa','计算机部门','bbb','市场部门','其他') as 部门 from users;
select username,case when salary<800 then '工资低' when salary>5000 then '工资高' end as 工资水平 from users;
select username,case username when 'aaa' then '计算机部门' when'bbb' then '市场部门' else '其他部门' end as 部门 from users;
select username,case when usename='aaa' then '计算机部门' when username='bbb' then '市场部门' else '其他部门' end as 部门 from users;
select * from users order by id desc;
select * from users order by id desc,salary asc;
insert into users values(4,'aaa',1000);
select * from users order by username desc,salary asc;
select * from users where salary beteen 800 and 2000;
select * from users where salary not beteen 800 and 2000;
select * from users where username in ('aaa','bbb');
select * from users where username not in ('aaa','bbb');
select * from users;
select * from users where username like 'a%';
select * from users where username like 'a_';
select * from users where username like '_a%';
select * from users where username like '%a%';
select * from users;
select id,username,salary+200 from users;
select * from users;

select username from users where salary>800;

select username from users where salary>800 and salary<>1800.5;
select username form users where salary>800 or salary<>1800.5;
select id as 编号,username as 用户名,salary 工资 from users;
select distinct username as 用户名 from users;
select * from users;
col id heading 编号;
col username heading 用户名;
col salary heading 工资;
select * from users;
select username,salary from users;
col username heading 用户名;
select * from users;
col username format a10;
select * from users;
col salary format 9999.9;
select * from users;
col salary format 999.9;
select * from users;
col salary format $9999.9;
select * from users;
col username clear;
col salary clear;
select * from users;
alter table userinfo_c3 drop constraint ck_salary_new;
desc salary
select constraint_name,constraint_type,status from user_constraints where table_name='USERINFO_C3';
alter table userinfo_c3 disable constraint ck_salay_new;
select constraint_name,constraint_type,status from user_constraints where table_name='USERINFO_C3';
create table userinfo_c3(id varchar2(10) primary key, username varchar2(20), salary number(5,0));
alter table userinfo_c3 add constraint ck_salary_new check(salary>0);
create table userinfo_c1(id varchar2(10) primary key,username varchar2(20), salary number(5,0),constraint ck_salary chack(salary>0));
create table userinfo_c(id varvhar2(10) primary key, username varchar2(20), salary number(5,0) check(salary>0));
insert into userinfo_c values(1,'aa,-50);
课程须知
只要知道数据库是什么就可以来学习本课程呦!
老师告诉你能学到什么?
掌握Oracle的SQL语句基础,为后续的课程学习打好基础。

微信扫码,参与3人拼团

微信客服

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

帮助反馈 APP下载

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

公众号

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

友情提示:

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

本次提问将花费2个积分

你的积分不足,无法发表

为什么扣积分?

本次提问将花费2个积分

继续发表请点击 "确定"

为什么扣积分?

举报

0/150
提交
取消