oracle数据库emp表是什么意思?

oracle数据库emp表是什么意思?,第1张

1:你说的应该是scott用户下的emp表吧,我们看下emp表的表结构你就知道保存的是什么信息了。

2:emp表是employee雇员信息表 。

3:empno就是雇员的员工编号, employee number。

4:ename员工姓名, emlployee name。

5:job员工的工作是什么比如推销员,经理等。

6:mgr上级编号。

7:hiredate受雇日期。

8:sal薪金。

9:comm佣金。

10:deptno部门编号。

11:emp是scott用户下的表。查询此表:select * from scott.emp。

12:假如说没有emp表,手动创建emp表。可以从其他有这个表的人那里照结构将表建立起来。

Oracle Database,又名Oracle RDBMS,或简称Oracle。是甲骨文公司的一款关系数据库管理系统。到目前仍在数据库市场上占有主要份额。劳伦斯·埃里森和他的朋友,之前的同事Bob Miner和Ed Oates在1977年建立了软件开发实验室咨询公司(SDL,Software Development Laboratories)。

作为一个通用的数据库系统,它具有完整的数据管理功能;作为一个关系数据库,它是一个完备关系的产品;作为分布式数据库它实现了分布式处理功能。但它的所有知识,只要在一种机型上学习了ORACLE知识,便能在各种类型的机器上使用它。

你登录的是sys用户,emp表是在scott用户下的,

在sys用户中要查询scott用户下的emp表,表名称格式如下:用户名.表名称

所以你可以这样查询: select * from scott.emp

--1

select deptno, count(*) from EMP group by DEPTNO having count(*) >1

--2

select * from emp where sal > (select sal from emp where ename = 'SMITH')

--3

select e0.ENAME, e1.ename from emp e0, emp e1 where e0.MGR = e1.empno

--4

select e0.*, e1.* from emp e0, emp e1 where e0.mgr = e1.empno(+) and e0.hiredate < e1.hiredate

--5

select d.dname, e.* from dept d, emp e where d.deptno = e.deptno(+)

--6

select e.ename, d.dname from emp e join dept d on e.deptno = d.deptno where job = 'CLERK'

--7

select job from emp group by job having min(sal) > 1500

--8

select e.ename from emp e, dept d where d.dname = 'SALES' and e.deptno(+) = d.deptno

--9

select * from emp where sal > (select avg(sal) from emp) 

--10

select * from emp where job = (select job from emp where ename = 'SCOTT')

--11

select * from emp where sal in (select sal from emp where deptno = 30)

--12

select * from emp where sal > all (select sal from emp where deptno = 30)

--13

select count(empno) 人数, avg(sal) 平均工资, avg(EXTRACT(year FROM sysdate) - EXTRACT(year FROM emp.hiredate)) 平均雇佣期限 from dual, emp group by deptno

--14

select e.ename, d.dname, e.sal from emp e, dept d  where e.deptno = d.deptno(+)

--15

select d.*, t.count from dept d, (select deptno, count(empno) count from emp group by deptno) t where d.deptno = t.deptno(+)

--16

select job, min(sal) from emp group by job

--17

select deptno, min(sal) from emp where job = 'MANAGER' group by deptno


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/sjk/6777304.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-03-28
下一篇 2023-03-28

发表评论

登录后才能评论

评论列表(0条)

保存