PrepAway - Latest Free Exam Questions & Answers

Which of the following describes the result if this statement is executed?

Given the following UPDATE statement:
UPDATE employees SET workdept =
(SELECT deptno FROM department WHERE deptno = ‘A01’)
WHERE workdept IS NULL
Which of the following describes the result if this statement is executed?

PrepAway - Latest Free Exam Questions & Answers

A.
The statement will fail because an UPDATE statement cannot contain asubquery.

B.
The statement will only succeed if the data retrieved by thesubquery does not contain multiple
records.

C.
The statement will succeed; if the data retrieved by thesubquery contains multiple records, only
the first record will be used to perform the update.

D.
The statement will only succeed if every record in the EMPLOYEES table has a null value in
the WORKDEPT column.


Leave a Reply