0
0
AWScloud~10 mins

Partition key and sort key in AWS - Interactive Code Practice

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

Complete the code to define a DynamoDB table with a partition key.

AWS
TableName: "Users"
KeySchema:
  - AttributeName: "UserId"
    KeyType: [1]
Drag options to blanks, or click blank then click option'
ASORT
BRANGE
CPRIMARY
DHASH
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'SORT' or 'RANGE' instead of 'HASH' for partition key.
2fill in blank
medium

Complete the code to add a sort key to the DynamoDB table.

AWS
KeySchema:
  - AttributeName: "UserId"
    KeyType: "HASH"
  - AttributeName: "Timestamp"
    KeyType: [1]
Drag options to blanks, or click blank then click option'
ARANGE
BPRIMARY
CHASH
DSORT
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'HASH' or 'PRIMARY' instead of 'RANGE' for sort key.
3fill in blank
hard

Fix the error in the attribute definitions for the partition and sort keys.

AWS
AttributeDefinitions:
  - AttributeName: "UserId"
    AttributeType: [1]
  - AttributeName: "Timestamp"
    AttributeType: "S"
Drag options to blanks, or click blank then click option'
AN
BB
CS
DBOOL
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'N' (number) or 'B' (binary) incorrectly for string keys.
4fill in blank
hard

Fill both blanks to complete the DynamoDB table creation snippet with partition and sort keys.

AWS
KeySchema:
  - AttributeName: [1]
    KeyType: "HASH"
  - AttributeName: [2]
    KeyType: "RANGE"
Drag options to blanks, or click blank then click option'
AUserId
BTimestamp
COrderId
DCreatedAt
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping partition and sort key names.
5fill in blank
hard

Fill all three blanks to define attribute types and key schema for a DynamoDB table with partition and sort keys.

AWS
AttributeDefinitions:
  - AttributeName: [1]
    AttributeType: [2]
  - AttributeName: [3]
    AttributeType: "N"
KeySchema:
  - AttributeName: [1]
    KeyType: "HASH"
  - AttributeName: [3]
    KeyType: "RANGE"
Drag options to blanks, or click blank then click option'
AUserId
BS
CTimestamp
DN
Attempts:
3 left
💡 Hint
Common Mistakes
Mismatching attribute names or types between definitions and key schema.