1、查询SMITH所在部门,职位,工资
SQL> select DNAME,JOB,SAL from emp,dept where emp.deptno=dept.deptno and ename='SMITH';
DNAME JOB SAL
-------------- --------- ----------
RESEARCH CLERK 800
2、显示每个雇员的年薪(12月的工资+奖金),并根据年薪排序
SQL> select ename,(sal*12+comm) as money from emp order by money;
ENAME MONEY
---------- ----------
WARD 15500
MARTIN 16400
TURNER 18000
ALLEN 19500
SCOTT
KING
ADAMS
JAMES
FORD
MILLER
BLAKE
ENAME MONEY
---------- ----------
JONES
SMITH
CLARK
sele
3、工资在2000到2500的员工
SQL> select empno,ename,sal from emp where sal>=2000 and sal<=2500;
EMPNO ENAME SAL
---------- ---------- ----------
7782 CLARK 2450
4、查找1982.1.1后入职的员工,并根据入职时间排序
SQL> select empno,ename,hiredate from emp where hiredate >to_date('1982/1/1','yyyy/mm/dd') order by hiredate;
EMPNO ENAME HIREDATE
---------- ---------- --------------
7934 MILLER 23-1月 -82
7788 SCOTT 19-4月 -87
7876 ADAMS 23-5月 -87
5、显示首字符为S的员工姓名和工资
6、显示名字第三个字母为O的雇员信息
SQL> select ename,sal from emp where ename like 'S%';
ENAME SAL
---------- ----------
SMITH 800
SCOTT 3000
7、显示empno为 7369, 7499, 7521 的雇员信息
SQL> select * from emp where empno='7369' or empno='7499' or empno='7521';
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------------- ---------- ----------
DEPTNO
----------
7369 SMITH CLERK 7902 17-12月-80 800
20
7499 ALLEN SALESMAN 7698 20-2月 -81 1600 300
30
7521 WARD SALESMAN 7698 22-2月 -81 1250 500
30
8、显示没有上级的雇员的情况
SQL> select * from emp where mgr is null;
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------------- ---------- ----------
DEPTNO
----------
7839 KING PRESIDENT 17-11月-81 5000
10
9、查询工资高于500或岗位为Manager的雇员,同时姓名首写为大写字母J
SQL> select * from emp where (sal>500 or job='Manager') and ename like 'J%';
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------------- ---------- ----------
DEPTNO
----------
7566 JONES MANAGER 7839 02-4月 -81 2975
20
7900 JAMES CLERK 7698 03-12月-81 950
30
10、按照部门进行排序,再按照工资对雇员信息进行排序
SQL> select ename,sal,deptno from emp order by deptno,sal desc;
ENAME SAL DEPTNO
---------- ---------- ----------
KING 5000 10
CLARK 2450 10
MILLER 1300 10
SCOTT 3000 20
FORD 3000 20
JONES 2975 20
ADAMS 1100 20
SMITH 800 20
BLAKE 2850 30
ALLEN 1600 30
TURNER 1500 30
ENAME SAL DEPTNO
---------- ---------- ----------
MARTIN 1250 30
WARD 1250 30
JAMES 950 30
11、显示所有员工中最高工资和最低工资
SQL> select max(sal),min(sal) from emp;
MAX(SAL) MIN(SAL)
---------- ----------
5000 800
12、显示所有员工的平均工资和工资总和
SQL> select avg(sal),sum(sal) from emp;
AVG(SAL) SUM(SAL)
---------- ----------
2073.21429 29025
13、计算总共有多少员工
SQL> select count(empno) from emp;
COUNT(EMPNO)
------------
14
14、显示工资最高的员工名字和工作岗位
SQL> select ename,job,sal from emp where sal = (select max(sal) from emp);
ENAME JOB SAL
---------- --------- ----------
KING PRESIDENT 5000
15、显示每个部门的平均工资和最高工资
SQL> select deptno,avg(sal),max(sal) from emp group by deptno;
DEPTNO AVG(SAL) MAX(SAL)
---------- ---------- ----------
30 1566.66667 2850
20 2175 3000
10 2916.66667 5000
16、显示每个部门的每种岗位的平均工资和最高工资
SQL> select deptno,job,avg(sal),max(sal) from emp group by deptno,job;
DEPTNO JOB AVG(SAL) MAX(SAL)
---------- --------- ---------- ----------
20 CLERK 950 1100
30 SALESMAN 1400 1600
20 MANAGER 2975 2975
30 CLERK 950 950
10 PRESIDENT 5000 5000
30 MANAGER 2850 2850
10 CLERK 1300 1300
10 MANAGER 2450 2450
20 ANALYST 3000 3000
17、显示平均工资低于2000的部门号和它的平均工资
SQL> select deptno,avg(sal) as average from emp group by deptno having avg(sal)<2000;
DEPTNO AVERAGE
---------- ----------
30 1566.66667
18、显示部门号为10的部门名,员工名和工资
SQL> select ename,sal from emp where deptno=10;
ENAME SAL
---------- ----------
CLARK 2450
KING 5000
MILLER 1300
19、显示各个员工的姓名,工资以及工资的级别
SQL> select ename,sal,grade from emp join salgrade on sal between losal and hisal;
ENAME SAL GRADE
---------- ---------- ----------
SMITH 800 1
JAMES 950 1
ADAMS 1100 1
WARD 1250 2
MARTIN 1250 2
MILLER 1300 2
TURNER 1500 3
ALLEN 1600 3
CLARK 2450 4
BLAKE 2850 4
JONES 2975 4
ENAME SAL GRADE
---------- ---------- ----------
SCOTT 3000 4
FORD 3000 4
KING 5000 5
20、显示雇员名,雇员工资以及所在部门名称,按照部门排序
SQL> select ename,sal,dname from emp,dept where emp.deptno=dept.deptno order by emp.deptno;
ENAME SAL DNAME
---------- ---------- --------------
CLARK 2450 ACCOUNTING
KING 5000 ACCOUNTING
MILLER 1300 ACCOUNTING
JONES 2975 RESEARCH
FORD 3000 RESEARCH
ADAMS 1100 RESEARCH
SMITH 800 RESEARCH
SCOTT 3000 RESEARCH
WARD 1250 SALES
TURNER 1500 SALES
ALLEN 1600 SALES
ENAME SAL DNAME
---------- ---------- --------------
JAMES 950 SALES
BLAKE 2850 SALES
MARTIN 1250 SALES
21、显示某个员工的上级领导姓名
> select b.ename from emp a,emp b where b.empno=(select a.mgr from emp a where a.empno='3');
22、显示FORD的上级
SQL> select mgr from emp where ename='FORD';
MGR
----------
7566
23、显示与smith同一个部门的员工信息
SQL> select * from emp where deptno=(select deptno from emp where ename='SMITH');
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------------- ---------- ----------
DEPTNO
----------
7369 SMITH CLERK 7902 17-12月-80 800
20
7566 JONES MANAGER 7839 02-4月 -81 2975
20
7788 SCOTT ANALYST 7566 19-4月 -87 3000
20
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------------- ---------- ----------
DEPTNO
----------
7876 ADAMS CLERK 7788 23-5月 -87 1100
20
7902 FORD ANALYST 7566 03-12月-81 3000
20
24、查询和部门10的工作相同的雇员姓名、岗位、工资和部门号
SQL> select ename,job,sal from emp where job in (select distinct job from emp where deptno='10');
ENAME JOB SAL
---------- --------- ----------
CLARK MANAGER 2450
BLAKE MANAGER 2850
JONES MANAGER 2975
KING PRESIDENT 5000
MILLER CLERK 1300
JAMES CLERK 950
ADAMS CLERK 1100
SMITH CLERK 800
25、显示工资比部门30的所有员工的工资高的员工姓名、工资、部门号
SQL> select ename,sal,deptno from emp where sal>(select max(sal) from emp where deptno='30');
ENAME SAL DEPTNO
---------- ---------- ----------
JONES 2975 20
SCOTT 3000 20
KING 5000 10
FORD 3000 20
26、显示工资比30号部门任意一个员工的工资高的员工姓名、工资、部门号
SQL> select ename,sal,deptno from emp where sal> any(select sal from emp where deptno='30');
ENAME SAL DEPTNO
---------- ---------- ----------
JONES 2975 20
SCOTT 3000 20
FORD 3000 20
KING 5000 10
27、查询smith部门和岗位相同的雇员信息
SQL> select * from emp where deptno=(select deptno from emp where ename='SMITH') and job =(select job from emp where ename='SMITH');
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------------- ---------- ----------
DEPTNO
----------
7369 SMITH CLERK 7902 17-12月-80 800
20
7876 ADAMS CLERK 7788 23-5月 -87 1100
20
28、显示高于自己部门平均工资的员工信息
SQL> select * from emp e where e.sal > (select avg(sal) from emp where deptno=e.deptno);
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------------- ---------- ----------
DEPTNO
----------
7499 ALLEN SALESMAN 7698 20-2月 -81 1600 300
30
7566 JONES MANAGER 7839 02-4月 -81 2975
20
7698 BLAKE MANAGER 7839 01-5月 -81 2850
30
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------------- ---------- ----------
DEPTNO
----------
7788 SCOTT ANALYST 7566 19-4月 -87 3000
20
7839 KING PRESIDENT 17-11月-81 5000
10
7902 FORD ANALYST 7566 03-12月-81 3000
20
29、查询出在 1981 年雇佣的全部雇员信息(1981年1月1日到1981年12月31日之间的雇佣的雇员)
SQL> select * from emp where hiredate like '%81%';
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------------- ---------- ----------
DEPTNO
----------
7499 ALLEN SALESMAN 7698 20-2月 -81 1600 300
30
7521 WARD SALESMAN 7698 22-2月 -81 1250 500
30
7566 JONES MANAGER 7839 02-4月 -81 2975
20
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------------- ---------- ----------
DEPTNO
----------
7654 MARTIN SALESMAN 7698 28-9月 -81 1250 1400
30
7698 BLAKE MANAGER 7839 01-5月 -81 2850
30
7782 CLARK MANAGER 7839 09-6月 -81 2450
10
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------------- ---------- ----------
DEPTNO
----------
7839 KING PRESIDENT 17-11月-81 5000
10
7844 TURNER SALESMAN 7698 08-9月 -81 1500 0
30
7900 JAMES CLERK 7698 03-12月-81 950
30
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------------- ---------- ----------
DEPTNO
----------
7902 FORD ANALYST 7566 03-12月-81 3000
20
30、查询出所有雇员姓名中第二个字母包含 "M" 的雇员信息
SQL> select * from emp where ename like '_M%';
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------------- ---------- ----------
DEPTNO
----------
7369 SMITH CLERK 7902 17-12月-80 800
20
31、查询出雇员姓名中包含字母 M 的雇员信息
SQL> select * from emp where ename like '%M%';
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------------- ---------- ----------
DEPTNO
----------
7369 SMITH CLERK 7902 17-12月-80 800
20
7654 MARTIN SALESMAN 7698 28-9月 -81 1250 1400
30
7876 ADAMS CLERK 7788 23-5月 -87 1100
20
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------------- ---------- ----------
DEPTNO
----------
7900 JAMES CLERK 7698 03-12月-81 950
30
7934 MILLER CLERK 7782 23-1月 -82 1300
10
32、查询工资中包含 5 的雇员信息
SQL> select * from emp where sal like '%5%';
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------------- ---------- ----------
DEPTNO
----------
7521 WARD SALESMAN 7698 22-2月 -81 1250 500
30
7566 JONES MANAGER 7839 02-4月 -81 2975
20
7654 MARTIN SALESMAN 7698 28-9月 -81 1250 1400
30
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------------- ---------- ----------
DEPTNO
----------
7698 BLAKE MANAGER 7839 01-5月 -81 2850
30
7782 CLARK MANAGER 7839 09-6月 -81 2450
10
7839 KING PRESIDENT 17-11月-81 5000
10
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------------- ---------- ----------
DEPTNO
----------
7844 TURNER SALESMAN 7698 08-9月 -81 1500 0
30
7900 JAMES CLERK 7698 03-12月-81 950
30
33、查询雇员编号不是 7369 的雇员信息
SQL> select * from emp where empno!='7369';
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------------- ---------- ----------
DEPTNO
----------
7499 ALLEN SALESMAN 7698 20-2月 -81 1600 300
30
7521 WARD SALESMAN 7698 22-2月 -81 1250 500
30
7566 JONES MANAGER 7839 02-4月 -81 2975
20
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------------- ---------- ----------
DEPTNO
----------
7654 MARTIN SALESMAN 7698 28-9月 -81 1250 1400
30
7698 BLAKE MANAGER 7839 01-5月 -81 2850
30
7782 CLARK MANAGER 7839 09-6月 -81 2450
10
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------------- ---------- ----------
DEPTNO
----------
7788 SCOTT ANALYST 7566 19-4月 -87 3000
20
7839 KING PRESIDENT 17-11月-81 5000
10
7844 TURNER SALESMAN 7698 08-9月 -81 1500 0
30
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------------- ---------- ----------
DEPTNO
----------
7876 ADAMS CLERK 7788 23-5月 -87 1100
20
7900 JAMES CLERK 7698 03-12月-81 950
30
7902 FORD ANALYST 7566 03-12月-81 3000
20
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------------- ---------- ----------
DEPTNO
----------
7934 MILLER CLERK 7782 23-1月 -82 1300
10
34、将小写字母hello变为大写字母
SQL> select upper('hello') from dual;
UPPER
-----
HELLO
35、将大写字母HELLO变为小写字母
SQL> select lower('HELLO') from dual;
LOWER
-----
hello
36、将单词hello的第一个字母大写
SQL> select initcap('hello') from dual;
INITC
-----
Hello
37、将雇员表中的雇员姓名变为开头字母大写
SQL> select initcap(ename) from emp;
INITCAP(EN
----------
Smith
Allen
Ward
Jones
Martin
Blake
Clark
Scott
King
Turner
Adams
INITCAP(EN
----------
James
Ford
Miller
38、显示所有雇员的姓名及姓名的后三个字符
select ename, substr(ename, length(ename) -2) from emp;
SQL> select ename,substr(ename,-3,3) from emp;
ENAME SUBSTR
---------- ------
SMITH ITH
ALLEN LEN
WARD ARD
JONES NES
MARTIN TIN
BLAKE AKE
CLARK ARK
SCOTT OTT
KING ING
TURNER NER
ADAMS AMS
ENAME SUBSTR
---------- ------
JAMES MES
FORD ORD
MILLER LER
39、要求将 789.536 数值保留两位小数
SQL> select round(789.536,2) from dual;
ROUND(789.536,2)
----------------
789.54
40、要求将 789.536 数值中的整数的十位进行四舍五入进位
SQL> select round(789.536,-2) from dual;
ROUND(789.536,-2)
-----------------
800
41、要求查询出雇员的编号, 姓名, 部门的编号, 名称, 地址
SQL> select e.empno,e.ename,d.deptno,d.dname,d.loc from emp e,dept d where e.deptno=d.deptno;
EMPNO ENAME DEPTNO DNAME LOC
---------- ---------- ---------- -------------- -------------
7369 SMITH 20 RESEARCH DALLAS
7499 ALLEN 30 SALES CHICAGO
7521 WARD 30 SALES CHICAGO
7566 JONES 20 RESEARCH DALLAS
7654 MARTIN 30 SALES CHICAGO
7698 BLAKE 30 SALES CHICAGO
7782 CLARK 10 ACCOUNTING NEW YORK
7788 SCOTT 20 RESEARCH DALLAS
7839 KING 10 ACCOUNTING NEW YORK
7844 TURNER 30 SALES CHICAGO
7876 ADAMS 20 RESEARCH DALLAS
EMPNO ENAME DEPTNO DNAME LOC
---------- ---------- ---------- -------------- -------------
7900 JAMES 30 SALES CHICAGO
7902 FORD 20 RESEARCH DALLAS
7934 MILLER 10 ACCOUNTING NEW YORK
42、要求查询出雇员的姓名, 工作, 雇员的直接上级领导姓名
SQL> select e.ename,e.job,m.ename from emp e,emp m where e.mgr=m.empno;
ENAME JOB ENAME
---------- --------- ----------
FORD ANALYST JONES
SCOTT ANALYST JONES
JAMES CLERK BLAKE
TURNER SALESMAN BLAKE
MARTIN SALESMAN BLAKE
WARD SALESMAN BLAKE
ALLEN SALESMAN BLAKE
MILLER CLERK CLARK
ADAMS CLERK SCOTT
CLARK MANAGER KING
BLAKE MANAGER KING
ENAME JOB ENAME
---------- --------- ----------
JONES MANAGER KING
SMITH CLERK FORD
43、要求查询出雇员的姓名, 工作, 雇员的直接上级领导姓名以及部门名称
SQL> select e.ename,e.job,m.ename,d.dname from emp e,emp m,dept d where e.mgr=m.empno and e.deptno=d.deptno;
ENAME JOB ENAME DNAME
---------- --------- ---------- --------------
FORD ANALYST JONES RESEARCH
SCOTT ANALYST JONES RESEARCH
JAMES CLERK BLAKE SALES
TURNER SALESMAN BLAKE SALES
MARTIN SALESMAN BLAKE SALES
WARD SALESMAN BLAKE SALES
ALLEN SALESMAN BLAKE SALES
MILLER CLERK CLARK ACCOUNTING
ADAMS CLERK SCOTT RESEARCH
CLARK MANAGER KING ACCOUNTING
BLAKE MANAGER KING SALES
ENAME JOB ENAME DNAME
---------- --------- ---------- --------------
JONES MANAGER KING RESEARCH
SMITH CLERK FORD RESEARCH
44、要求查询出每个雇员的姓名, 工资, 部门名称, 工资在公司的等级(salgrade), 及其领导的姓名及工资所在公司的等级
SQL> select e.ename, e.sal, d.dname, s.grade, m.ename, m.sal, ms.grade from emp e, dept d, salgrade s, emp m, salgrade ms where e.deptno = d.deptno and e.sal between s.losal and s.hisal and e.mgr = m.empno and m.sal between ms.losal and ms.hisal;
ENAME SAL DNAME GRADE ENAME SAL GRADE
---------- ---------- -------------- ---------- ---------- ---------- ----------
SMITH 800 RESEARCH 1 FORD 3000 4
JAMES 950 SALES 1 BLAKE 2850 4
ADAMS 1100 RESEARCH 1 SCOTT 3000 4
WARD 1250 SALES 2 BLAKE 2850 4
MARTIN 1250 SALES 2 BLAKE 2850 4
MILLER 1300 ACCOUNTING 2 CLARK 2450 4
TURNER 1500 SALES 3 BLAKE 2850 4
ALLEN 1600 SALES 3 BLAKE 2850 4
CLARK 2450 ACCOUNTING 4 KING 5000 5
BLAKE 2850 SALES 4 KING 5000 5
JONES 2975 RESEARCH 4 KING 5000 5
ENAME SAL DNAME GRADE ENAME SAL GRADE
---------- ---------- -------------- ---------- ---------- ---------- ----------
SCOTT 3000 RESEARCH 4 JONES 2975 4
FORD 3000 RESEARCH 4 JONES 2975 4
45、按部门分组, 并显示部门的名称, 及每个部门的员工数
SQL> select d.dname,count(e.empno) from emp e,dept d where e.deptno=d.deptno group by d.dname;
DNAME COUNT(E.EMPNO)
-------------- --------------
ACCOUNTING 3
RESEARCH 5
SALES 6
46、要求显示出平均工资大于 2000 的部门编号和平均工资
SQL> select deptno,avg(sal) from emp group by deptno having avg(sal)>2000;
DEPTNO AVG(SAL)
---------- ----------
20 2175
10 2916.66667
47、显示非销售人员工作名称以及从事同一工作雇员的月工资的总和,并且要满足从事同一工作的雇员的月工资合计大于 5000, 输出结果按月工资的合计升序排序.
SQL> select job,sum(sal) from emp where job<>'SALESMAN' group by job having sum(sal)>5000 order by sum(sal);
JOB SUM(SAL)
--------- ----------
ANALYST 6000
MANAGER 8275
48、求出平均工资最高的部门工资
SQL> select max(avg(sal)) from emp group by deptno;
MAX(AVG(SAL))
-------------
2916.66667
49、要求查询出工资比 7654 高, 同时与 7788 从事相同工作的全部雇员信息
SQL> select * from emp where sal>(select sal from emp where empno='7654') and job=(select job from emp where empno='7788');
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------------- ---------- ----------
DEPTNO
----------
7788 SCOTT ANALYST 7566 19-4月 -87 3000
20
7902 FORD ANALYST 7566 03-12月-81 3000
20
50、要求查询出工资最低的雇员姓名, 工作, 工资
SQL> select ename,job,sal from emp where sal=(select min(sal) from emp);
ENAME JOB SAL
---------- --------- ----------
SMITH CLERK 800
51、部门名称,部门的员工数,部门的平均工资,部门的最低收入雇员的姓名
select d.dname, temp.c, temp.a, e.ename from dept d, (select deptno, count(empno) c, avg(sal) a, min(sal) m from emp group by deptno) temp, emp e where d.deptno = temp.deptno and e.sal = temp.m;
52、求出每个部SQL> select * from emp where sal in (select min(sal) from emp group by deptno);
EMPNO ENAME JOB MGR HIREDATE SAL COMM
---------- ---------- --------- ---------- -------------- ---------- ----------
DEPTNO
----------
7369 SMITH CLERK 7902 17-12月-80 800
20
7900 JAMES CLERK 7698 03-12月-81 950
30
7934 MILLER CLERK 7782 23-1月 -82 1300
10
门的最低工资的雇员的信息
53、显示正好为5个字符的员工的姓名
SQL> select ename from emp where ename like '_____';
ENAME
----------
SMITH
ALLEN
JONES
BLAKE
CLARK
SCOTT
ADAMS
JAMES
54、显示所有员工姓名的前三个字符
SQL> select substr(ename,0,3) from emp;
SUBSTR
------
SMI
ALL
WAR
JON
MAR
BLA
CLA
SCO
KIN
TUR
ADA
SUBSTR
------
JAM
FOR
MIL
55、以首字母大写的方式显示所有员工的姓名
SQL> select initcap(ename) from emp;
INITCAP(EN
----------
Smith
Allen
Ward
Jones
Martin
Blake
Clark
Scott
King
Turner
Adams
INITCAP(EN
----------
James
Ford
Miller
56、显示所有员工的姓名,用a替换所有的A
SQL> select translate(ename,'A','a') from emp;
TRANSLATE(ENAME,'A',
--------------------
SMITH
aLLEN
WaRD
JONES
MaRTIN
BLaKE
CLaRK
SCOTT
KING
TURNER
aDaMS
TRANSLATE(ENAME,'A',
--------------------
JaMES
FORD
MILLER