You execute the following code:
You need to select the task that has an IsFinished value of true from the Project that has an
Id value of 1.
Which code segment should you use?
A.
Option A
B.
Option B
C.
Option C
D.
Option D
You execute the following code:
You need to select the task that has an IsFinished value of true from the Project that has an
Id value of 1.
Which code segment should you use?
A.
Option A
B.
Option B
C.
Option C
D.
Option D
the right Answer would be:
SELECT Projects.details.query(‘Project/Tasks/Task[IsFinished=”true”]’)
FROM Projects
WHERE Projects.ID = 1;
or
SELECT Projects.details.query(‘//Task[IsFinished=”true”]’)
FROM Projects
WHERE Projects.ID = 1;
Errors in answer A:
there is a ‘/’ in front of the ‘[‘
and a ‘@’ behind the ‘[‘ (the ‘@’ would have been right if ‘IsFinished’ had been an attribute, but it is an element)
Errors in answer B:
the ‘]’ is missing and the ‘/’ between Task and IsFinished has to be a ‘[‘
Error in answer C:
doesn’t work with xml as type for the column ‘details’
Error in answer A:
there is a ‘@’ behind the ‘[‘
(this would have been right if ‘IsFinished’ had been an attribute, but it is an element)
sry the last passage should be:
Error in answer D:
there is a ‘@’ behind the ‘[‘
(this would have been right if ‘IsFinished’ had been an attribute, but it is an element)