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;
举一反三
- 以下语句不正确的是( ) A: select * from emp; B: select ename,hiredate,sal from emp; C: select * from emp order deptno; D: select * from where deptno=1
- 以下语句不正确的是( ) A: select * from emp B: select ename,hiredate,sal from emp C: select * from emp order deptno D: select * from where deptno=1 and sal<300
- 智慧职教: 表结构如下:dept(deptno,dname),emp(empno,ename,job,hiredate,sal,deptno)。创建视图查询系部名称、教师姓名,职位,工资信息。
- SQL语句“SELECT<br/>* FROM emp WHERE ename LIKE 'A_'”能够查询字母A开头的所有雇员信息。()
- 列出所有部门的部门名称和部门员工人数。如果部门没有员工,人数显示为0。正确的查询语句有_________。 A: SELECT dname,COUNT(ename) AS ecount <br>FROM dept,emp <br>WHERE emp.deptno(+)=dept.deptno <br>GROUP BY dept.dname B: SELECT dname,(SELECT COUNT(*) AS ecount FROM emp WHERE emp.deptno=dept.deptno) <br>FROM dept C: SELECT dname,COUNT(ename) AS ecount <br>FROM dept LEFT JOIN emp ON emp.deptno=dept.deptno <br>GROUP BY dept.dname D: SELECT dname,COUNT(*) AS ecount <br>FROM dept LEFT JOIN emp ON emp.deptno=dept.deptno <br>GROUP BY dept.dname
内容
- 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=’女’