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

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

难度入门
时长 4小时14分
学习人数
综合评分9.67
338人评价 查看评价
9.8 内容实用
9.7 简洁易懂
9.5 逻辑清晰
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);
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);
课程须知
只要知道数据库是什么就可以来学习本课程呦!
老师告诉你能学到什么?
掌握Oracle的SQL语句基础,为后续的课程学习打好基础。

微信扫码,参与3人拼团

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

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

本次提问将花费2个积分

你的积分不足,无法发表

为什么扣积分?

本次提问将花费2个积分

继续发表请点击 "确定"

为什么扣积分?

举报

0/150
提交
取消