• 2022-11-04
    以下哪个查询操作能够实现将员工的参加工作日期按如下格式显示:月份/年份。
    A: select ename,hiredate,to_char(hiredate,'HH/RR') from emp;
    B: select ename,hiredate,to_char(hiredate,'MM/RR') from emp;
    C: select ename,hiredate,to_char(hiredate,'MON') from emp;
    D: select ename,hiredate,to_char(hiredate,'DD/YY') from emp;
  • B

    内容

    • 0

      SQL语句“SELECT<br/>* FROM emp WHERE ename LIKE 'A_'”能够查询字母<br/>A<br/>开头的所有雇员信息。()

    • 1

      查询部门20的员工数量,每个月的工资总和及平均工资( ) A: SELECT sum(nvl(sal,0)),avg(nvl(sal,0)) from emp B: SELECT ename,sum(nvl(sal,0)),avg(nvl(sal,0)) from emp where deptno =20 group by deptno C: SELECT ename,count(empno),sum(nvl(sal,0)),avg(nvl(sal,0)) from emp where deptno =20 group by deptno D: SELECT count(empno),sum(nvl(sal,0)),avg(nvl(sal,0)) from emp where deptno =20 group by deptno

    • 2

      查询员工表emp中的第3条到第8条记录。显示emp表中的全部字段。( ) A: select rownum rn,emp.* from emp where rownum3; B: select * from(select rownum RN,emp.* from emp where RN3; C: select * from(select rownum RN,emp.* from emp where rownum3; D: select rownum RN,emp.* from emp where RN3;

    • 3

      Consider the following query:SELECT dname, ename FROM dept d, emp e Where d.deptno=c.deptno ORDER BY dname, ename;What type of join is shown?() A: Self-join B: Equijoin C: Outerjoin D: Non-equijoin

    • 4

      设有职工基本表:EMP(ENO,ENAME,AGE,SEX,SALARY),其属性分别表示职工号、姓名、年龄、性别、工资。为每个工资低于平均工资的女职工加薪200元,以下SQL语句正确的是______。 A: UPDATE EMP SET SALARY=SALARY+200 B: WHERE SALAEY<(SELECT AVG(SALARY)FROM EMP) AND SEX=’女’ C: UPDATE FROM EMP SET SALARY=200 D: WHERE SALAEY<(SELECT SUM(SALARY)FROM EMP)AND SEX=’女’ E: UPDATE EMP SET SALARY=200 F: WHERE SALAEY<(SELECT AVG(SALARY)FROM EMP)AND SEX=’女’ G: UPDATE FROM EMP SET SALARY=SALARY+200 H: WHERE SALAEY<(SELECT SUM(SALARY)FROM EMP)AND SEX=’女’