oracle 第1章oracle11g入门.ppt

  1. 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
  2. 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  3. 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
oracle 第1章oracle11g入门

数据库发展史 人工管理阶段(20世纪50年代中期以前) 数据不保存;没有文件的概念;没有对数据进行管理的软件系统 文件系统阶段(20世纪50年代后期到60年代中期) 使用磁盘文件来存储数据 数据库系统阶段(从20世纪60年代后期) 层次模型;网状模型 第二代数据库系统--关系数据库管理系统(RDBMS) 关系型数据库和结构化查询语言 新一代数据库技术 “关系-对象”型数据库(O/R mapping) 创建表空间,用户 创建表空间. create tablespace hk datafile d:\db\hk.dmp size 10m; 创建用户 create user hk identified by fendou default tablespace hk; 授予权限 grant dba,connect,resource to hk; 用system用户登陆 服务器ip:192.168.1.8 DATABASE使用192.168.1.8/ORCL 先来认识一下scott模式中的表 EMP 员工表 DEPT 部门表 SALGRADE 工资等级表 BONUS 奖金表 查询 查询全部列 Select * from emp; select * from scott.emp; 查询部分列 Select empno,ename,job from emp; 给列起个别名 Select empno 员工工号,ename 员工姓名,job 工作 from emp; 查询emp表的行数 Select count(*) from emp; 查询表下的字段 Select emp.job from emp; 会有十四条结果 去除重复的查询distinct Select distinct job from emp; 有五条结果 拼结查询结果 select 编号:||empno|| 员工姓名:||ename|| 所从事工作:|| job from emp; 使用四则运算符查询 Sal是月薪, 以下是查姓名,年薪 select ename,sal*12 from emp; 加上别名 Select ename 员工姓名,sal*12 年薪 from emp; 查询出月薪高于1500的员工 Select * from emp where sal1500; 查询每月可以得到奖金的员工信息 select * from emp where comm is not null; 查询没有奖金的员工信息 select * from emp where comm is null; 查询月薪高于1500 并且有奖金的雇员信息 Select * from emp where sal1500 and comm is not null; 查询月薪高于1500 或者有奖金的雇员信息 Select * from emp where sal1500 or comm is not null; 取反(查询月薪高于1500 或者有奖金的雇员信息) Select * from emp where not (sal1500 or comm is not null); 查询月薪高于1500,低于3000的雇员。 And方法 select * from emp where sal1500 and sal3000; Between and 方法 select * from emp where sal between 1500 and 3000; 入职时间介于,之间的职员 select * from emp where hiredate between 1-1月-1980 and 1-1月-1990; --月份前面不可加0但日前面可加可不加0 查询出是smith的员工 select * from emp where ename=SMITH; 查询出编号是 , 的员工 select * from emp where empno=7369 or empno=7499; select * from emp where empno in (7369,7499); 查询出编号不是 , 的员工 select * from emp where empno not in (7369,7499); 查询出姓名是?,?,?的员工 select * from emp where ename in (SMITH‘,’KING’); Like语句 ‘%’表示0~任何多个字符 ‘_’表示一个任意字符 第二个字符是‘M’的员工 select * from emp where ename like _M%; 任意五个字符的员工 select * from emp where ena

文档评论(0)

dajuhyy + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档