0
0
DynamoDBquery~10 mins

Why secondary indexes enable flexible queries in DynamoDB - Test Your Understanding

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

Complete the code to create a secondary index with a partition key.

DynamoDB
Create a secondary index with partition key as [1].
Drag options to blanks, or click blank then click option'
AStatus
BTimestamp
CEmail
DUserId
Attempts:
3 left
💡 Hint
Common Mistakes
Choosing a non-unique attribute as partition key.
2fill in blank
medium

Complete the code to query the secondary index using the partition key.

DynamoDB
Query the index where partition key equals [1].
Drag options to blanks, or click blank then click option'
AUserId
BEmail
CStatus
DTimestamp
Attempts:
3 left
💡 Hint
Common Mistakes
Using a sort key or non-key attribute for partition key in query.
3fill in blank
hard

Fix the error in the query by selecting the correct sort key attribute.

DynamoDB
Query the index with partition key 'UserId' and sort key condition [1] = '2023-01-01'.
Drag options to blanks, or click blank then click option'
AEmail
BStatus
CTimestamp
DUserName
Attempts:
3 left
💡 Hint
Common Mistakes
Using a non-sort key attribute in the sort key condition.
4fill in blank
hard

Fill both blanks to define a global secondary index with partition and sort keys.

DynamoDB
Define GSI with partition key [1] and sort key [2].
Drag options to blanks, or click blank then click option'
ACategory
BUserId
CCreatedAt
DStatus
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up partition and sort keys.
5fill in blank
hard

Fill all three blanks to write a query using a secondary index with filter condition.

DynamoDB
Query index where partition key is [1], sort key [2] '2023-06-01', and filter [3] = 'active'.
Drag options to blanks, or click blank then click option'
AUserId
BTimestamp
CStatus
DCategory
Attempts:
3 left
💡 Hint
Common Mistakes
Using filter attribute as partition or sort key.