exam questions

Exam AZ-303 All Questions

View all questions & answers for the AZ-303 exam

Exam AZ-303 topic 1 question 30 discussion

Actual exam question from Microsoft's AZ-303
Question #: 30
Topic #: 1
[All AZ-303 Questions]

Note: This question is part of a series of questions that present the same scenario. Each question in the series contains a unique solution that might meet the stated goals. Some question sets might have more than one correct solution, while others might not have a correct solution.
After you answer a question in this section, you will NOT be able to return to it. As a result, these questions will not appear in the review screen.
You have an Azure Cosmos DB database that contains a container named Container1. The partition key for Container1 is set to /day. Container1 contains the items shown in the following table.

You need to programmatically query Azure Cosmos DB and retrieve Item1 and Item2 only.
Solution: You run the following query.

SELECT day FROM c -
WHERE c.value = "10" OR c.value = "15"
You set the EnableCrossPartitionQuery property to True.
Does this meet the goal?

  • A. Yes
  • B. No
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️
Returns Item1, Item2, Item3, and Item4.
Reference:
https://docs.microsoft.com/en-us/azure/cosmos-db/sql-query-where

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Ramkid
Highly Voted 4 years, 5 months ago
Yes, the answer is correct
upvoted 16 times
...
justfordevelopment
Most Recent 3 years, 3 months ago
In the exam on 12-03-2022. Total 50 questions including case study. "Litware Acquired Fabricam" case study.
upvoted 1 times
...
ranjitklive
3 years, 3 months ago
syntax error. SELECT should always say c.column_name
upvoted 1 times
...
SST2408
3 years, 5 months ago
The value is a reserved keyword in CosmosDB so the query will fail.
upvoted 1 times
...
tomatosis
3 years, 5 months ago
On exam 23 Dec 2021, I chose the same answer
upvoted 1 times
...
syu31svc
3 years, 9 months ago
The optional WHERE clause specifies condition(s) that the source JSON items must satisfy for the query to include them in results. A JSON item must evaluate the specified conditions to true to be considered for the result. This query will return Item1, Item2, Item3 and Item4. Answer is No
upvoted 2 times
...
kkstays
3 years, 10 months ago
9th Aug 21 - Was in today's exam. 54 Questions in total (4 Case study), No Lab
upvoted 1 times
arifno1
3 years, 10 months ago
hello, kkstays can u please confirm me Practical labs LIKE (Azure portal question) include in exam or just M.C.Q based exam .waiting for your response. its highly appreciated.
upvoted 1 times
...
...
leo_az300
3 years, 10 months ago
The query is executable but will return all 4 items. So it's No If the query does not have a filter on partition key, then it is executed in all partitions, and results are merged client side. In this case, partition key is day which not in query
upvoted 3 times
...
MatiUllah
3 years, 11 months ago
Was on exam 3 July 2021 and correct
upvoted 3 times
...
AravindITGuy
3 years, 11 months ago
Took exam today passed this morning was on there 6/21/2021
upvoted 2 times
...
TSMRE
4 years ago
On exam 6/7/21. All of the ones on there were false, so just read carefully
upvoted 3 times
...
nfett
4 years ago
B is the answer. same as previous question.
upvoted 3 times
...
azurellc
4 years ago
On exam 5/15/2021
upvoted 1 times
...
rsaintt
4 years, 1 month ago
Agree B.
upvoted 1 times
...
yaiba
4 years, 2 months ago
what will be returned if EnableCrossPartitionQuery property is set to False?
upvoted 2 times
bigngster
3 years, 10 months ago
ground beef ● minced beef - 800 g ● ground black pepper - ⅓ tsp. ● salt - 1 tsp. ● corn starch - 1 tbsp. ● paprika - 1 tsp. ● sour cream - 2 tbsp. ● milk - 100 ml ● egg - 1 pc. ● onion - 100 g my guess is in addition to the syntax error, the query would return an error as you didn't include the partition id value in the query. This means c.day must be included in the SELECT query if you set EnableCrossPartitionQuery to False. in other words, EnableCrossPartitionQuery must be set to true if you don't want to include the partition id in the query (essentially executing across more than one partition). https://docs.microsoft.com/en-us/azure/cosmos-db/sql-api-query-metrics (interpreting the section where they explain the parameter EnableCrossPartitionQuery: Must be set to true for any query that requires to be executed across more than one partition. This is an explicit flag to enable you to make conscious performance tradeoffs during development time.)
upvoted 1 times
...
...
awsazurelearner
4 years, 3 months ago
s0850test123 is correct. The given query will provide a Syntax error. In either case though, if the syntax was correct, the query would return items 2, 2, 3, and 4. So the answer is B - No.
upvoted 2 times
...
smoothbrain
4 years, 4 months ago
Was in today's exam.
upvoted 2 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...