Microsoft

DP-420 practice question 8

Designing and Implementing Cloud-Native Applications Using Microsoft Azure Cosmos DB · free question 8 of 20

Question

You have an Azure Cosmos DB for NoSQL account. You run the following query against a container in the account. ```sql SELECT IS_NUMBER("1234") AS A, IS_NUMBER(1234) AS B, IS_NUMBER({prop: 1234}) AS C ``` What is the output of the query?
  • A. [{"A": false, "B": true, "C": false}] Correct
  • B. [{"A": true, "B": false, "C": true}]
  • C. [{"A": true, "B": true, "C": false}]
  • D. [{"A": true, "B": true, "C": true}]

Explanation

IS_NUMBER returns true only when the expression's type is a JSON number. "1234" is a string, so A is false; 1234 is a number, so B is true; {prop: 1234} is an object, so C is false even though it contains a number. IS_NUMBER does not convert strings or inspect object properties, which rules out the other outputs.

Need the theory? Learn it free in the DP-420 course on Godlike Academy

Practice the whole free set

Answer all 20 free DP-420 questions with instant feedback, or unlock all 211 questions with Learn and Exam modes.