吴裕雄--天生自然ORACLE数据库学习笔记:SQL语言基础
select empno,ename,sal from scott.emp;
SELECT empno,ename,sal FROM scott.emp;
selECT empno,ename,sal frOM scott.emp;
select empno,ename,sal from scott.emp;
select EMPNO,ENAME,SAL from SCOTT.EMP;
select emPNO,ename,sAL from scott.EmP;
select empno,ename,job
from scott.emp
where job='SALESMAN'
order by empno;
connect scott/tiger
select table_name from user_tables;
connect scott/1qaz2wsx
select empno as "员工编号",ename as "员工名称",job as "职务" from emp;
connect hr/hr;
select street_address from locations where state_province is null;
connect scott/1qaz2wsx
select empno,ename,sal from emp where sal < 2000 or sal > 3000;
select e.empno as 员工编号, e.ename as 员工名称, d.dname as 部门
from emp e,dept d
where e.deptno=d.deptno
and e.job='MANAGER';
insert into emp(empno,ename,job) values(9527,'EAST','SALESMAN');
select e.empno,e.ename,e.job,d.deptno,d.dname
from emp e left join dept d
on e.deptno=d.deptno;
select e.empno,e.ename,e.job,d.deptno,d.dname
from emp e full join dept d
on e.deptno=d.deptno;
select employee_id,lower(first_name),upper(last_name) from employees where
lower(first_name) like 'a%';
select sysdate as 默认格式日期, to_char(sysdate,'YYYY-MM-DD') as 转换后日期
from dual;
select empno,ename,job from emp
where deptno=(select deptno from dept
where dname='RESEARCH');
select empno,ename,sal
from emp f
where sal > (select avg(sal) from emp where job = f.job)
order by job;
create table jobs_temp(
job_id varchar2(10) primary key,
job_title varchar2(35) not null,
min_salary number(6),
max_salary number(6)); insert into jobs_temp
select * from jobs
where jobs.max_salary > 10000;
truncate table jobs_temp;
insert into jobs_temp values('OFFICE','办公文员',3000,5000);
savepoint sp;
insert into jobs_temp values('FINANCE','财务人员',4000,8000);
select * from jobs_temp;
rollback to savepoint sp;
commit;
select * from jobs_temp;
select max(salary),min(salary) from employees where department_id = 30;
create table employees_copy as select * from employees;
吴裕雄--天生自然ORACLE数据库学习笔记:SQL语言基础的更多相关文章
- 吴裕雄--天生自然ORACLE数据库学习笔记:Oracle数据备份与恢复
run{ allocate channel ch_1 device type disk format = 'd:\oraclebf\%u_%c.bak'; backup tablespace syst ...
- 吴裕雄--天生自然ORACLE数据库学习笔记:过程、函数、触发器和包
create procedure pro_insertDept is begin ,'市场拓展部','JILIN'); --插入数据记录 commit; --提交数据 dbms_output.put_ ...
- 吴裕雄--天生自然ORACLE数据库学习笔记:PL/SQL编程
set serveroutput on declare a ; b ; c number; begin c:=(a+b)/(a-b); dbms_output.put_line(c); excepti ...
- 吴裕雄--天生自然ORACLE数据库学习笔记:Oracle 11g的闪回技术
alter system set db_recovery_file_dest_size=4g scope=both; connect system/1qaz2wsx as sysdba; archiv ...
- 吴裕雄--天生自然ORACLE数据库学习笔记:数据导出与导入
create directory dump_dir as 'd:\dump'; grant read,write on directory dump_dir to scott; --在cmd下 exp ...
- 吴裕雄--天生自然ORACLE数据库学习笔记:优化SQL语句
create or replace procedure trun_table(table_deleted in varchar2) as --创建一个存储过程,传入一个表示表名称的参数,实现清空指定的 ...
- 吴裕雄--天生自然ORACLE数据库学习笔记:Oracle系统调优
--修改 alter system set large_pool_size=64m; --显示 show parameter large_pool_size; select sum(getmisses ...
- 吴裕雄--天生自然ORACLE数据库学习笔记:用户管理与权限分配
create user mr identified by mrsoft default tablespace users temporary tablespace temp; create user ...
- 吴裕雄--天生自然ORACLE数据库学习笔记:表分区与索引分区
create table ware_retail_part --创建一个描述商品零售的数据表 ( id integer primary key,--销售编号 retail_date date,--销售 ...
- 吴裕雄--天生自然ORACLE数据库学习笔记:其它数据对象
create index emp_deptno_index on emp(deptno) pctfree tablespace users; create bitmap index emp_salar ...
随机推荐
- Azure IoT Hub 十分钟入门系列 (2)- 使用模拟设备发送设备到云(d2c)的消息
本文主要分享一个案例: 10分钟- 使用Python 示例代码和SDK向IoT Hub 发送遥测消息 本文主要有如下内容: 了解C2D/D2C消息: 了解IoT Hub中Device的概念 了解并下载 ...
- Apache和Nginx配置默认访问index.php
Apache: .htaccess文件配置 Options +FollowSymLinks RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-d R ...
- Servlet线程安全问题(转载)
转载地址:https://www.cnblogs.com/LipeiNet/p/5699944.html 前言:前面说了很多关于Servlet的一些基础知识,这一篇主要说一下关于Servlet的线程安 ...
- hadoop学习笔记(二):hdfs优点和缺点
优点 其中的10k+,指的是每一个块必须>=1M 缺点 低延迟:是指hadoop处理数据都是以分钟为单位的,而不像storm那样的是以毫秒级为单位的. 高吞吐率:是指你分布式存储的文件块的大小必 ...
- .NET Core快速入门教程 3、使用VS Code开发.NET Core控制台应用程序
一.前言 本篇开发环境 1.操作系统: Windows 10 X642.SDK: .NET Core 2.0 Preview3.VS Code:1.14 二.安装&配置 1.VS Code下载 ...
- linu后台执行py文件和关闭的后台py文件
后台执行py nohup python xxx.py 关闭后台执行py 查看进程pid ps -aux|grep main.py 根据pid关闭关闭进程 kill -9 (pid)
- opencv python:模糊操作
均值模糊 中值模糊 自定义模糊 模糊操作的基本原理 基于离散卷积 定义好每个卷积核 不同卷积核得到不同的卷积效果 模糊是卷积的一种表象 blur cv2.blur(image, (1, 3)) 第二个 ...
- Linux中限制用户邮件的大小
Linux系统使用sendmail发送邮件,配置文件是/etc/sendmail.cf,缺省使用TCP/IP协议. 我们的Linux机器上往往会有多个用户同时工作,或者干脆就用它作邮件服务器,在同一时 ...
- WinForm开发(5)——DataGridView控件(3)——DataGridView控件操作
一.禁止用户改变DataGridView的列宽.行高.列头高度 1.// 禁止用户改变DataGridView1的所有列的列宽 DataGridView1.AllowUserToResizeColum ...
- Qt应用程序的打包
Windows系统下打包: qt用realse版本编译然后打包发行 debug编译后的文件比realse版本大很多先在编译好的debug或者realse执行程序的目录下将执行该城西对应的所有dell文 ...