0
0
DynamoDBquery~10 mins

Why data protection is essential 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 DynamoDB table named 'Users'.

DynamoDB
aws dynamodb create-table --table-name [1] --attribute-definitions AttributeName=UserId,AttributeType=S --key-schema AttributeName=UserId,KeyType=HASH --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5
Drag options to blanks, or click blank then click option'
ACustomers
BOrders
CUsers
DProducts
Attempts:
3 left
💡 Hint
Common Mistakes
Using a wrong table name like 'Customers' or 'Orders'.
Leaving the table name blank.
2fill in blank
medium

Complete the code to add an item with UserId '123' to the 'Users' table.

DynamoDB
aws dynamodb put-item --table-name Users --item '{"UserId": {"S": "[1]"}}'
Drag options to blanks, or click blank then click option'
A001
B123
Cabc
Dxyz
Attempts:
3 left
💡 Hint
Common Mistakes
Using a different UserId value.
Forgetting to put quotes around the UserId.
3fill in blank
hard

Fix the error in the code to get an item with UserId '123' from the 'Users' table.

DynamoDB
aws dynamodb get-item --table-name Users --key '{"UserId": {"[1]": "123"}}'
Drag options to blanks, or click blank then click option'
ABOOL
BN
CB
DS
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'N' which is for numbers.
Using 'B' which is for binary data.
4fill in blank
hard

Fill both blanks to update the 'Email' attribute of user '123' in the 'Users' table.

DynamoDB
aws dynamodb update-item --table-name Users --key '{"UserId": {"S": "123"}}' --update-expression "set [1] = :e" --expression-attribute-values '{":e": {"[2]": "user@example.com"}}'
Drag options to blanks, or click blank then click option'
AEmail
BS
CN
DUserEmail
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong attribute names like 'UserEmail'.
Using wrong data types like 'N' for string values.
5fill in blank
hard

Fill all three blanks to delete the item with UserId '123' from the 'Users' table.

DynamoDB
aws dynamodb delete-item --table-name [1] --key '{"UserId": {"[2]": "[3]"}}'
Drag options to blanks, or click blank then click option'
AOrders
BUsers
CS
D123
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong table names like 'Orders'.
Using wrong key types or values.