oracle 数据库默认的scott.emp表的各种查询

oracle 数据库默认的scott.emp表的各种查询,第1张

--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 e0ENAME, e1ename from emp e0, emp e1 where e0MGR = e1empno;

--4

select e0, e1 from emp e0, emp e1 where e0mgr = e1empno(+) and e0hiredate < e1hiredate;

--5

select ddname, e from dept d, emp e where ddeptno = edeptno(+);

--6

select eename, ddname from emp e join dept d on edeptno = ddeptno where job = 'CLERK';

--7

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

--8

select eename from emp e, dept d where ddname = 'SALES' and edeptno(+) = ddeptno;

--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 emphiredate)) 平均雇佣期限 from dual, emp group by deptno;

--14

select eename, ddname, esal from emp e, dept d  where edeptno = ddeptno(+);

--15

select d, tcount from dept d, (select deptno, count(empno) count from emp group by deptno) t where ddeptno = tdeptno(+);

--16

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

--17

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

scott用户的密码不对,进入管理员用户,修改scott用户密码即可

或者这样修改密码:

在运行栏里面敲:sqlplus(空格)/nolog 回车

接着在d出框里面敲:conn sys/password as sysdba回车

提示已连接

最后敲:alter user scott identified by tiger;回车

alter user scott account unlock;回车(对SCOTT解锁)

这样就解决了。

以上就是关于oracle 数据库默认的scott.emp表的各种查询全部的内容,包括:oracle 数据库默认的scott.emp表的各种查询、Oracle Scott用户不能登录、等相关内容解答,如果想了解更多相关内容,可以关注我们,你们的支持是我们更新的动力!

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

原文地址:https://54852.com/sjk/9305766.html

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

发表评论

登录后才能评论

评论列表(0条)

    保存