exam questions

Exam AZ-303 All Questions

View all questions & answers for the AZ-303 exam

Exam AZ-303 topic 1 question 31 discussion

Actual exam question from Microsoft's AZ-303
Question #: 31
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.

You set the EnableCrossPartitionQuery property to True.
Does this meet the goal?

  • A. Yes
  • B. No
Show Suggested Answer Hide Answer
Suggested Answer: A 🗳️
Returns Item1 and Item2 only.
Reference:
https://docs.microsoft.com/en-us/azure/cosmos-db/sql-query-where https://docs.microsoft.com/en-us/dotnet/api/microsoft.azure.documents.client.feedoptions.enablecrosspartitionquery?view=azure-dotnet

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
MKA1976
Highly Voted 4 years, 3 months ago
Incorrect query. Each selected columns should be prefixed with c.
upvoted 26 times
GetulioJr
3 years, 11 months ago
This is correct, it needs to be select c.id from c and in the text it is select id from c. So it would not work.
upvoted 5 times
GetulioJr
3 years, 11 months ago
To be clear, the response is B - NO. as it needs to have the container as part of the name. without it it would not give the desired result. so @Mka1976 is correctly and the official answer right now is off.
upvoted 3 times
...
...
...
rocrock
Highly Voted 4 years, 3 months ago
To me given answer seems to be incorrect - sql statement should be * from c?
upvoted 13 times
...
burock
Most Recent 3 years, 1 month ago
The correct answer is A
upvoted 1 times
...
tomatosis
3 years, 4 months ago
On exam 23 Dec 2021, I chose A
upvoted 1 times
...
poplovic
3 years, 6 months ago
the syntax is fixed in the answer. The answer is correct (A)
upvoted 3 times
...
chris009
3 years, 7 months ago
All three cosmo DB questions seem to have this syntax problem.Answer should be NO
upvoted 1 times
...
tteesstt
3 years, 8 months ago
I think there was a typo when this question was created. All the questions are No due to incorrect synax.
upvoted 2 times
...
syu31svc
3 years, 8 months ago
Answer is No; wrong syntax
upvoted 1 times
...
kumarts
3 years, 8 months ago
Answer is No, tested in lab.
upvoted 2 times
...
kkstays
3 years, 9 months ago
9th Aug 21 - Was in today's exam. 54 Questions in total (4 Case study), No Lab
upvoted 2 times
...
laplaceliu
3 years, 9 months ago
https://docs.microsoft.com/en-us/azure/cosmos-db/how-to-query-container#cross-partition-query when you run a cross-partition query on a container, you are effectively running one query per physical partition. Azure Cosmos DB will automatically aggregate results across different physical partitions.
upvoted 1 times
...
MatiUllah
3 years, 10 months ago
Was on exam 3 July 2021 and correct
upvoted 2 times
Mkbala
3 years, 10 months ago
Which option you have answered? @MatiUllah
upvoted 1 times
...
...
kharangarh
3 years, 10 months ago
Answer should be B (No). I have tested this in Lab and query required SELECT c.id instead of just SELECT id : SELECT c.id FROM c WHERE c.day = "Mon" Results: { "id": "1" }, { "id": "2" }
upvoted 10 times
...
AravindITGuy
3 years, 10 months ago
Took exam today passed this morning was on there 6/21/2021
upvoted 3 times
...
Amit3
3 years, 11 months ago
On Exam 11-Jun-21, Answer is No
upvoted 3 times
...
TSMRE
3 years, 11 months ago
There were a lot of these in the exam (6/7/21), so study up. Given answer is incorrect though since syntax error.
upvoted 4 times
...
AlexD332
3 years, 11 months ago
invalid query as mentioned below but the answer seems correct Yes as all other questions from the set have the same syntax
upvoted 1 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 ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago