Java程序设计

单选题执行如下两个查询,结果为() Select ename name,sal salary from emp order by salary Select ename name,sal“salary”from emp order by sal ascA 两个查询结果完全相同B 第一个查询正确,第二个查询错误C 两个查询结构不同D 第二个查询正确,第一个查询错误

题目
单选题
执行如下两个查询,结果为() Select ename name,sal salary from emp order by salary Select ename name,sal“salary”from emp order by sal asc
A

两个查询结果完全相同

B

第一个查询正确,第二个查询错误

C

两个查询结构不同

D

第二个查询正确,第一个查询错误

如果没有搜索结果,请直接 联系老师 获取答案。
如果没有搜索结果,请直接 联系老师 获取答案。
相似问题和答案

第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;


正确答案:C 

第2题:

Examine the following commands and their output:SQL> SELECT ename, sal FROM emp WHERE ename=‘JAMES‘; ENAME SAL JAMES 1050QL> UPDATE emp SET sal=sal+sal*1.2 WHERE ename=‘JAMES‘;1 row updated.SQL> SELECT ename, sal FROM emp WHERE ename=‘JAMES‘; ENAME SAL JAMES 2310View the exhibit and examine the Flashback Version Query that was executed after the preceding commands.What could be the possible cause for the query not displaying any row?()

A. Flashback logging is not enabled for the database.

B. The changes made to the table are not committed.

C. Supplemental logging is not enabled for the database.

D. The database is not configured in ARCHIVELOG mode.


参考答案:B

第3题:

客户需要计算EMP表中所有职工12*salary* commission_pct的值.EMP表结构如下:LAST NAME VARCNAR2(35)NOT NULL SALARY NUMBER(9,2)NOT NULL COMMISION_PCTNUMBER(4,2)哪个语句可以查询计算EMP表中所有职工行?()

A.SELECT last_name,12*salary* commission_pct FROM emp

B.SELECT last_name,12*salary*(commission_pct,0)FROM emp

C.SELECT last_name,12*salary*(nvl(commission_pct,0))FROM emp如果oracle第一个参数为空那么显示第二个参数的值,如果第一个参数的值不为空,则显示第一个参数本来的值

D.SELECT last_name,12*salary*(decode(commission_pct,0))FROM emp


参考答案:C

第4题:

● 设有职工表emp(Eno,Ename,Sex,Age)(Eno为职工号,Ename为职工姓名,Sex为性别,Age为年龄)和salary(Eno,Hour,Month,Wage)(Hour为工作时长为多少小时,Month表示几月份,Wage为薪水),建立一个视图V-Salary(Eno,Ename,Hour,Month,Wage),并按Eno升序排序的SQL语句为:

(1)CREATE ( )

AS SELECT emp.Eno,emp.Ename ,salary.Hour,salary.Month,salary.Wage

FROM emp, salary

WHERE emp.Eno=salary.Eno

ORDER BY ENO

在此视图上查均月工资在3000以上的职工工资情况的SQL语句为:

SELECT Eno,Ename,AVG(Wage)

FROM V-Salary

GROUP BY ( )

HAVING AVG(Wage)>3000

( )

A. CREATE TABLE V-Salary(emp.Eno,emp.Ename,salary.Hour,salary.Month,salary.Wage)

B. CREATE VIEW V-Salary(Eno,Ename,Hour,Month,Wage)

C. CREATE TABLE V-Salary(Eno,Ename,Hour,Month,Wage)

D. CREATE INDEX V-Salary(Eno,Ename,Hour,Month,Wage)

( )

A. Eno B.Ename

C.Month D.Wage


正确答案:B,A
此题第一空容易,考查考生是否了解建立视图的语法规则。第二空也比较明显,在salary中有字段Month,用于标识当前记录是哪个月的工资记录,这就意味着在数据表中,一个Eno对应着多个工资记录,要计算平均值,可以先按Eno进行分组,再求工资平均值,所以第2空填A。

第5题:

The EMP table has these columns:ENAME VARCHAR2(35)SALARY NUMBER(8,2)HIRE_DATE DATEManagement wants a list of names of employees who have been with the company for more than five years. Which SQL statement displays the required results? ()

A. SELECT ENAME FROM EMP WHERE SYSDATE-HIRE_DATE >5;

B. SELECT ENAME FROM EMP WHERE HIRE_DATE-SYSDATE >5;

C. SELECT ENAME FROM EMP WHERE (SYSDATE_HIRE_DATE)/365 >5;

D. SELECT ENAME FROM EMP WHERE (SYSDATE_HIRE_DATE)*/365 >5;


参考答案:C

第6题:

以下说法错误的是( )

A.SELECT max(sal),deptno,job FROM EMP group by sal;

B.SELECT max(sal),deptno,job FROM EMP group by deptno;

C.SELECT max(sal),deptno,job FROM EMP;

D.SELECT max(sal),deptno,job FROM EMP group by job;


正确答案:C 

第7题:

Evaluate this SQL statement:SELECT ename, sal, 12* sal+100 FROM emp;The SAL column stores the monthly salary of the employee. Which change must be made to the abovesyntax to calculate the annual compensation as "monthly salary plus a monthly bonus of $100, multiplied by 12"? ()

A. No change is required to achieve the desired results.

B. SELECT ename, sal, 12* (sal+100) FROM emp;

C. SELECT ename, sal, (12* sal)+100 FROM emp;

D. SELECT ename, sal +100,*12 FROM emp;


参考答案:B

第8题:

以下语句错误的是( )

A.select sal+1 from emp;

B.select sal*10,sal*deptno from emp;

C.不能使用运算符号

D.select sal*10,deptno*10 from emp;


正确答案:C 

第9题:

Management has asked you to calculate the value 12*salary* commission_pct for all the employees in the EMP table. The EMP table contains these columns:LAST NAME VARCNAR2(35) NOT NULLSALARY NUMBER(9,2) NOT NULLCOMMISION_PCT NUMBER(4,2)Which statement ensures that a value is displayed in the calculated columns for all employees? ()

A. SELECT last_name, 12*salary* commission_pct FROM emp;

B. SELECT last_name, 12*salary* (commission_pct,0) FROM emp;

C. SELECT last_name, 12*salary*(nvl(commission_pct,0)) FROM emp;

D. SELECT last_name, 12*salary*(decode(commission_pct,0)) FROM emp;


参考答案:C

第10题:

Select emp_id,emp_name,sex,title,wage from employee order by emp_name句子得到的结果集是按()排序。

A.emp_id

B.emp_name

C.sex

D.wage


本题答案:B

更多相关问题