单选题Which of the following SQL statements will return the year and average salary for all employees hired within a given year that have a salary greater than $30,000?()A SELECT * FROM t1 UNION SELECT * FROM t2B SELECT * FROM t1 UNION DISTINCT SELECT * FROM

题目
单选题
Which of the following SQL statements will return the year and average salary for all employees hired within a given year that have a salary greater than $30,000?()
A

SELECT * FROM t1 UNION SELECT * FROM t2

B

SELECT * FROM t1 UNION DISTINCT SELECT * FROM t2

C

SELECT * FROM t1 INTERSECT SELECT * FROM t2

D

SELECT * FROM t1 WHERE (c1,c2)= (SELECT c1,c2 FROM t2)

参考答案和解析
正确答案: D
解析: 暂无解析
如果没有搜索结果或未解决您的问题,请直接 联系老师 获取答案。
相似问题和答案

第1题:

Click the Exhibit button and examine the data in the EMPLOYEES table.Which three subqueries work? ()

A.SELECT * FROM employees where salary > (SELECT MIN(salary) FROM employees GROUP BY department_id);

B.SELECT * FROM employees WHERE salary = (SELECT AVG(salary) FROM employees GROUP BY department_id);

C.SELECT distinct department_id FROM employees WHERE salary > ANY (SELECT AVG(salary) FROM employees GROUP BY department_id);

D.SELECT department_id FROM employees WHERE salary > ALL (SELECT AVG(salary) FROM employees GROUP BY department_id);

E.SELECT last_name FROM employees WHERE salary > ANY (SELECT MAX(salary) FROM employees GROUP BY department_id);

F.SELECT department_id FROM employees WHERE salary > ALL (SELECT AVG(salary) FROM employees GROUP BY AVG(SALARY));


参考答案:C, D, E

第2题:

Given that tables T1 and T2 contain the following rows:Table T1: C1 C2 1 4 1 3 1 2Table T2: C1 C2 1 1 1 2 1 3Which of the following queries will return only those rows that exist in both T1 and T2?()

A.SELECT * FROM t1 UNION SELECT * FROM t2

B.SELECT * FROM t1 UNION DISTINCT SELECT * FROM t2

C.SELECT * FROM t1 INTERSECT SELECT * FROM t2

D.SELECT * FROM t1 WHERE (c1,c2)= (SELECT c1,c2 FROM t2)


参考答案:C

第3题:

The EMPLOYEE tables has these columns:LAST_NAME VARCHAR2(35)SALARY NUMBER(8,2)COMMISSION_PCT NUMBER(5,2)You want to display the name and annual salary multiplied by the commission_pct for all employees. For records that have a NULL commission_pct, a zero must be displayed against the calculated column.Which SQL statement displays the desired results? ()

A. SELECT last_name, (salary * 12) * commission_pct FROM EMPLOYEES;

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

C. SELECT last_name, (salary * 12) * NVL2(commission_pct, 0) FROM EMPLOYEES;

D. SELECT last_name, (salary * 12) * NVL(commission_pct, 0) FROM EMPLOYEES;


参考答案:D

第4题:

下面哪条语句可以取出薪水最高的前三个人:()

  • A、SELECT * FROM (SELECT * FROM EMPLOYEES ORDER BY SALARY );
  • B、SELECT * FROM (SELECT * FROM EMPLOYEES ORDER BY SALARY ) WHERE ROWNUM<=3;
  • C、SELECT * FROM (SELECT * FROM EMPLOYEES ORDER BY SALARY DESC) WHERE ROWNUM<=3;
  • D、SELECT * FROM EMPLOYEES WHERE ROWNUM<=3 ORDER BY SALARY DESC;

正确答案:C

第5题:

Which of the following statements eliminates all but one of each set of duplicate rows in the DEPT column in the STAFF table?()

A.SELECT UNIQUE dept FROM staff

B.SELECT DISTINCT dept FROM staff

C.SELECT (dept) UNIQUE FROM staff

D.SELECT (dept) DISTINCT FROM staff


参考答案:B

第6题:

Which of the following SQL statements will return the year and average salary for all employees hired within a given year that have a salary greater than $30,000?()

A.SELECT * FROM t1 UNION SELECT * FROM t2

B.SELECT * FROM t1 UNION DISTINCT SELECT * FROM t2

C.SELECT * FROM t1 INTERSECT SELECT * FROM t2

D.SELECT * FROM t1 WHERE (c1,c2)= (SELECT c1,c2 FROM t2)


参考答案:B

第7题:

Given that tables T1 and T2 contain the following rows: Table T1:C1 C25 4 5 2 5 5Table T2: C1 C2 5 1 5 2 5 3Which of the following queries will return only those rows that exist in T1 and not in T2?()

A.SELECT * FROM T1 MINUS SELECT * FROM T2

B.SELECT * FROM T1 EXCEPT SELECT * FROM T2

C.SELECT * FROM T2 UNION EXCEPT SELECT * FROM T1

D.SELECT * FROM T1 NOT EXISTS SELECT * FROM T2


参考答案:B

第8题:

Examine the data in the EMPLOYEES table:LAST_NAME DEPARTMENT_ID SALARYGetz 10 3000Davis 20 1500Bill 20 2200Davis 30 5000...Which three subqueries work? ()

A. SELECT * FROM employees where salary > (SELECT MIN(salary) FROM employees GROUP BY department _ id);

B. SELECT * FROM employees WHERE salary = (SELECT AVG(salary) FROM employees GROUP BY department _ id);

C. SELECT distinct department_id FROM employees Where salary > ANY (SELECT AVG(salary) FROM employees GROUP BY department _ id);

D. SELECT department_id FROM employees WHERE SALARY > ALL (SELECT AVG(salary) FROM employees GROUP BY department _ id);

E. SELECT last_name FROM employees Where salary > ANY (SELECT MAX(salary) FROM employees GROUP BY department _ id);

F. SELECT department_id FROM employees WHERE salary > ALL (SELECT AVG(salary) FROM employees GROUP BY ANG (SALARY));


参考答案:C, D, E

第9题:

Given that tables T1 and T2 contain the following rows: Table T1: C1 C2 1 4 1 3 1 2 Table T2: C1 C2 1 1 1 2 1 3 Which of the following queries will return only those rows that exist in both T1 and T2?()

  • A、SELECT * FROM t1 UNION SELECT * FROM t2
  • B、SELECT * FROM t1 UNION DISTINCT SELECT * FROM t2
  • C、SELECT * FROM t1 INTERSECT SELECT * FROM t2
  • D、SELECT * FROM t1 WHERE (c1,c2)= (SELECT c1,c2 FROM t2)

正确答案:C

第10题:

Which of the following statements eliminates all but one of each set of duplicate rows in the DEPT column in the STAFF table?()

  • A、SELECT UNIQUE dept FROM staff
  • B、SELECT DISTINCT dept FROM staff
  • C、SELECT (dept) UNIQUE FROM staff
  • D、SELECT (dept) DISTINCT FROM staff

正确答案:B

更多相关问题