70-464 Exam QuestionsBrowse all questions from this exam

70-464 Exam - Question 48


You execute the following code:

Exam 70-464 Question 48

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?

Exam 70-464 Question 48
Show Answer
Correct Answer: B

To retrieve a task with an IsFinished value of true from the project with Id value of 1, we should use an XQuery expression that correctly navigates the XML structure and filters tasks based on the IsFinished attribute. The correct query should specifically target elements with the IsFinished attribute set to 'true'. Option B uses the correct XQuery syntax to achieve this by querying the details column of the Projects table with the appropriate path and condition.

Discussion

3 comments
Sign in to comment
Luzix
Nov 4, 2020

I think is the A due to if you choose de B you should use //*:task[IsFinished="True"]

Kepty
Nov 23, 2020

No its not neccessary to use wildcards in xquery, the right answer is D.. https://stackoverflow.com/questions/17055000/filtering-xml-query-by-attribute-value

Williamzhou
Dec 1, 2020

Agree with Kepty, D is correct.

Dolous
Jan 17, 2021

@isfinished would be for an attribute

LiamLin
Aug 30, 2021

A Error XQuery [dbo.Projects.details.query()]: Syntax error near '[', expected a step expression. B Correct C Error Argument data type xml is invalid for argument 1 of like function. D Error XQuery [dbo.Projects.details.query()]: Syntax error near '[', expected a step expression.