DP-900 · Question #36
Consider the JSON document for your cosmetics e-commerce website: What will be the SQL command to retrieve the product name from the given document?
The correct answer is B. SELECT c.productName FROM Items c. To retrieve the product name, the correct SQL query will be: SELECT c.productName FROM Items c Option A is incorrect: db.Items.find({ },{productName:1,_id:0}) is a MongoDB query, not SQL. Option B is correct: SELECT c.productName FROM Items c is the correct SQL command to…
Question
Exhibit
Options
- Adb.Items.find({ },{productName:1,_id:0})
- BSELECT c.productName FROM Items c
- Cdb.Items.find({ },{quantity:1,_id:0})
- DSELECT c.unitCost FROM Items c
How the community answered
(43 responses)- A2% (1)
- B77% (33)
- C14% (6)
- D7% (3)
Explanation
To retrieve the product name, the correct SQL query will be: SELECT c.productName FROM Items c Option A is incorrect: db.Items.find({ },{productName:1,_id:0}) is a MongoDB query, not SQL. Option B is correct: SELECT c.productName FROM Items c is the correct SQL command to retrieve the product name from the given JSON document Option C is incorrect: db.Items.find( {},{quantity:1,_id:0}) is a MongoDB query and we need to find the productName, not the quantity. Option D is incorrect: SELECT c.unitCost FROM Items c is the SQL query but not correct. We need to retrieve the productName, not the unitCost. https://docs.microsoft.com/en-us/learn/modules/choose-api-for-cosmos-db/2-identify-the- technology-options
Topics
Community Discussion
No community discussion yet for this question.
