0
0
DynamoDBquery~10 mins

NoSQL vs relational database comparison in DynamoDB - Interactive Practice

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

Complete the code to create a DynamoDB table with a primary key.

DynamoDB
aws dynamodb create-table --table-name Users --attribute-definitions AttributeName=UserId,AttributeType=S --key-schema AttributeName=[1],KeyType=HASH --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5
Drag options to blanks, or click blank then click option'
AUserId
BUsername
CEmail
DPassword
Attempts:
3 left
💡 Hint
Common Mistakes
Using an attribute not defined in attribute-definitions as the key.
2fill in blank
medium

Complete the code to insert an item into the DynamoDB table.

DynamoDB
aws dynamodb put-item --table-name Users --item '{"UserId": {"S": "123"}, "Name": {"S": [1]'
Drag options to blanks, or click blank then click option'
AName
B"Alice"
CAlice
D'Alice'
Attempts:
3 left
💡 Hint
Common Mistakes
Using unquoted or single-quoted strings inside the JSON.
3fill in blank
hard

Fix the error in the query to get an item by primary key.

DynamoDB
aws dynamodb get-item --table-name Users --key '{"UserId": {"S": [1]'
Drag options to blanks, or click blank then click option'
A123
BUserId
C'123'
D"123"
Attempts:
3 left
💡 Hint
Common Mistakes
Using unquoted or single-quoted string values in JSON.
4fill in blank
hard

Fill both blanks to create a DynamoDB query filtering items by attribute.

DynamoDB
aws dynamodb scan --table-name Users --filter-expression "[1] = :val" --expression-attribute-values '{":val": {"S": [2]'
Drag options to blanks, or click blank then click option'
AName
B"Alice"
C"Bob"
DUserId
Attempts:
3 left
💡 Hint
Common Mistakes
Using attribute names not in the table or wrong quoting for values.
5fill in blank
hard

Fill all three blanks to update an item attribute in DynamoDB.

DynamoDB
aws dynamodb update-item --table-name Users --key '{"UserId": {"S": [1]' --update-expression "SET [2] = :val" --expression-attribute-values '{":val": {"S": [3]'
Drag options to blanks, or click blank then click option'
A"123"
BName
C"Charlie"
DEmail
Attempts:
3 left
💡 Hint
Common Mistakes
Wrong quoting of strings or wrong attribute names.