免费试学 报名即可领取免费资料

成都市庆云南街69号红星国际3栋3楼

您现在的位置: IT培训 > OCP > OCP考试 > 正文

OCP 1Z0-047 考试题库解析(10)

发布时间:2018-08-09 17:31:27

  View the Exhibit and examine the description of the EMPLOYEES table. You want to display the EMPLOYEE_ID, FIRST_NAME, and DEPARTMENT_ID for all the employees who work in the same department and have the same manager as that of the employee having EMPLOYEE_ID 104. To accomplish the task, you execute the following SQL statement:

  SELECT employee_id, first_name, department_id FROM employees WHERE (manager_id, department_id) =(SELECT department_id, manager_id FROM employees WHERE employee_id = 104) AND employee_id <> 104

  When you execute the statement it does not produce the desired output. What is the reason for this?

  A. The WHERE clause condition in the main query is using the = comparison operator, instead of EXISTS.

  B. The WHERE clause condition in the main query is using the = comparison operator, instead of the IN operator.

  C. The WHERE clause condition in the main query is using the = comparison operator, instead of the = ANY operator.

  D. The columns in the WHERE clause condition of the main query and the columns selected in the subquery should be in the same order.

  答案: D

  分析: 本题考点是组合列

  where子句的(manager_id, department_id)作为组合列,要求子查询返回的也是一个结构相同的组合列,而不是(department_id, manager_id)

 

免费试学

在下方预约即可免费领取视频学习资料