【2019年8月版】OCP 071认证考试原题-第42题

Choose two

Examine this SQL statement:

DELETE FROM employees e

WHERE EXISTS

(SELECT ‘dummy‘

FROM emp_history

WHERE employee_id = e.employee_id)

Which two are true?

A) The subquery is executed for every row in the EMPLOYEES table.

B) The subquery is not a correlated subquery.

C) The subquery is executed before the DELETE statement is executed.

D) All existing rows in the EMPLOYEEE table are deleted.

E) The DELETE statement executes successfully even if the subquery selects multiple rows.

Answer::AE

(解析:这又是一个关联子查询的考题,出现过多次,A 答案大家要注意。)

关联子查询:

1、 先执行主查询,对于主查询返回的每一行数据,都会造成子查询执行一次

2、 然后子查询返回的结果又传给主查询

3、 主查询根据返回的记录做出判断

)

注意这道题答案 E 是对的,与前面第 14 题的答案 D 上有区别,要分别对待。

create table emp2 as select * from emp where deptno=20;

update emp2 set empno=7934 where ename=’SCOTT’;

DELETE FROM emp e

WHERE EXISTS

(SELECT ‘empno‘

FROM emp2

WHERE empno = e.empno);

UPDATE emp e

SET ename =

(SELECT ename

FROM emp2

WHERE empno = e.empno);

原文地址:https://blog.51cto.com/13854012/2459207

时间: 2024-10-01 20:54:38

【2019年8月版】OCP 071认证考试原题-第42题的相关文章

【2019年8月】OCP 071认证考试最新版本的考试原题-第28题

choose two The ORDERS table has a column ORDER_DATE of date type DATE The default display format for a date is DD-MON-RR Which two WHERE conditions demonstrate the correct usage of conversion functions? A) WHERE ordet_date > TO_CRAR(ADD_MONTHS(SYSDAT

【2019年8月】OCP 071认证考试最新版本的考试原题-第14题

Choose two. Examine this SQL statement: UPDATE orders o SET customer_name = (SELECT cust_last_name FROM customers WHERE customer_id=o.customer_id); Which two are true? A) The subquery is executed before the UPDATE statement is executed. B) All existi

【2019年8月】OCP 071认证考试最新版本的考试原题-第15题

Choone three Examine the description of the PRODUCTS table: Name Null? Type PRODUCT_ID NOT NULL NUMBER(2) PRODUCT_NANE VARCHAR2(10) UNIT_PRICE NUMBER(3) PURCHARGE VARCHAR2(2) EXPIRY_DATE DATE DELIVERY_DATE DATE Which three queres use valid expression

【2019年8月】OCP 071认证考试最新版本的考试原题-第16题

Choose two. Examine this partial command: CREATE TABLE cust ( cust_id NUMBER(2), credit_ limit NUMBER(10) ) ORGANIZATION EXTERNAL Which two clauses are required for this command to execute successfully? A) the DEFAULT DIRECTORY clause B) the REJECT L

【2019年8月】OCP 071认证考试最新版本的考试原题-第18题

Choose two Which two statements are true about the WHERE and HAVING clouses in a SELECT statement? A) The WHERE clause can be used to exclude rows after divding them into groups B) WHERE and HAVING clauses can be used In the same statement only if ap

【2019年8月】OCP 071认证考试最新版本的考试原题-第19题

Choose two The INVOICE table has a QTY_SOLD column of data type NUMBER and an INVOTCE_DATE column of data type DATE NLS_DATE_FORMAT is set to DD-MON-RR. Which two are true about data type conversions involving these columns in query expressions? A) i

【2019年8月】OCP 071认证考试最新版本的考试原题-第20题

Choose two The PRODUCT_INFORMATION table has a UNIT_PRICE column of data type NUMBER(8, 2). Evaluate this SQL statement: SELECT TO_CHAR(unit_price,'$9,999') FROM Product_intormation; Which two statements are true about the output? A) A row whose UNIT

【2019年8月】OCP 071认证考试最新版本的考试原题-第22题

Choose two Which two statements are true about transactions in the Oracle Database serve? A) An uncommitted transaction commits automatically if the user exits SQL*Plus B) Data Manipulation Language (DML) statements always start a new transaction. C)

【2019年8月】OCP 071认证考试最新版本的考试原题-第21题

choose two In the PROMOTIONS table, the PROMO_BEGTN_DATE columm is of datatype DATE and the default date format is DD-MON-RR. Which two statements are true about expressions using PROMO_BEGIN_DATE contained in a queny? A) TONUMBER(PROMO BEGIN_DATE) -

【2019年8月】OCP 071认证考试最新版本的考试原题-第23题

Choose two Which two statements are true about transactions in the Oracle Database serve? A) An uncommitted transaction commits automatically if the user exits SQL*Plus B) Data Manipulation Language (DML) statements always start a new transaction. C)