0
0
Azurecloud~10 mins

Cosmos DB overview and use cases in Azure - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a Cosmos DB account with the correct API type.

Azure
az cosmosdb create --name myCosmosDBAccount --resource-group myResourceGroup --kind [1]
Drag options to blanks, or click blank then click option'
AMongoDB
BTable
CGlobalDocumentDB
DCassandra
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing MongoDB API when the task is to create a SQL API account.
Selecting Table API which is for key-value storage.
2fill in blank
medium

Complete the code to create a new database inside the Cosmos DB account.

Azure
az cosmosdb sql database create --account-name myCosmosDBAccount --resource-group myResourceGroup --name [1]
Drag options to blanks, or click blank then click option'
AmyTable
BmyContainer
CmyCollection
DmyDatabase
Attempts:
3 left
💡 Hint
Common Mistakes
Using container or collection names instead of database name.
Confusing database with table names.
3fill in blank
hard

Fix the error in the code to create a container with a partition key.

Azure
az cosmosdb sql container create --account-name myCosmosDBAccount --database-name myDatabase --name myContainer --partition-key-path [1]
Drag options to blanks, or click blank then click option'
A/partitionKey
Bid
C/id
DpartitionKey
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting the leading slash in the partition key path.
Using property names without slashes.
4fill in blank
hard

Fill both blanks to configure the consistency level and throughput for the Cosmos DB account.

Azure
az cosmosdb update --name myCosmosDBAccount --resource-group myResourceGroup --default-consistency-level [1] --max-throughput [2]
Drag options to blanks, or click blank then click option'
ASession
BStrong
C400
D1000
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing Strong consistency which can reduce performance.
Setting throughput too low for expected workload.
5fill in blank
hard

Fill all three blanks to write a query that selects items with a price greater than 20 from a container.

Azure
SELECT * FROM c WHERE c.[1] [2] [3]
Drag options to blanks, or click blank then click option'
Aprice
B>
C20
Dquantity
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong property name like quantity.
Using incorrect operators like < or =.