0
0
DynamoDBquery~20 mins

AWS CLI for DynamoDB - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
DynamoDB AWS CLI Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
service_behavior
intermediate
2:00remaining
What is the output of this AWS CLI command?
You run this command to list all tables in your DynamoDB account:

aws dynamodb list-tables --region us-east-1

What will the command output if you have exactly two tables named Users and Orders?
DynamoDB
aws dynamodb list-tables --region us-east-1
A{"TableNames": ["Users", "Orders"]}
B{"Tables": ["Users", "Orders"]}
C{"TableList": ["Users", "Orders"]}
D}]"sredrO" ,"sresU"[ :"semaNelbaT"{
Attempts:
2 left
💡 Hint
Look for the exact key name that AWS CLI uses to list tables.
Configuration
intermediate
2:00remaining
Which AWS CLI command creates a DynamoDB table with a primary key named 'Id' of type string?
You want to create a DynamoDB table named Products with a simple primary key called Id of type string. Which command will do this correctly?
Aaws dynamodb create-table --table-name Products --attribute-definitions AttributeName=Id,AttributeType=S --key-schema AttributeName=Id,KeyType=RANGE --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5
Baws dynamodb create-table --table-name Products --attribute-definitions AttributeName=Id,AttributeType=N --key-schema AttributeName=Id,KeyType=HASH --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5
Caws dynamodb create-table --table-name Products --attribute-definitions AttributeName=Id,AttributeType=S --key-schema AttributeName=Id,KeyType=HASH --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5
Daws dynamodb create-table --table-name Products --attribute-definitions AttributeName=Id,AttributeType=S --key-schema AttributeName=Id,KeyType=HASH
Attempts:
2 left
💡 Hint
The primary key must be of type HASH and attribute type S for string.
security
advanced
2:00remaining
What error occurs if you try to delete a DynamoDB table that does not exist using AWS CLI?
You run this command:

aws dynamodb delete-table --table-name NonExistentTable

What error message will AWS CLI return?
AAn error with code ValidationException indicating invalid table name
BAn error with code AccessDeniedException indicating you lack permissions
CNo error; the command succeeds silently
DAn error with code ResourceNotFoundException indicating the table does not exist
Attempts:
2 left
💡 Hint
Deleting a non-existing resource usually returns a 'not found' error.
Architecture
advanced
2:00remaining
Which AWS CLI command correctly updates the provisioned throughput of a DynamoDB table named 'Orders' to 10 read and 5 write units?
You want to increase the read capacity units to 10 and write capacity units to 5 for the 'Orders' table. Which command is correct?
Aaws dynamodb update-table --table-name Orders --provisioned-throughput ReadCapacityUnits=10,WriteCapacityUnits=5
Baws dynamodb update-table --table-name Orders --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=10
Caws dynamodb update-table --table-name Orders --read-capacity 10 --write-capacity 5
Daws dynamodb update-table --table-name Orders --capacity Read=10,Write=5
Attempts:
2 left
💡 Hint
Provisioned throughput requires both read and write capacity units specified in a single option.
🧠 Conceptual
expert
2:00remaining
What is the output of this AWS CLI command querying a DynamoDB table?
You run this command to query the 'Users' table for items where 'UserId' equals '123':

aws dynamodb query --table-name Users --key-condition-expression "UserId = :v1" --expression-attribute-values '{":v1":{"S":"123"}}'

Assuming the table has one item with UserId '123' and attribute 'Name' with value 'Alice', what will the output JSON contain?
DynamoDB
aws dynamodb query --table-name Users --key-condition-expression "UserId = :v1" --expression-attribute-values '{":v1":{"S":"123"}}'
A{"Items": [{"UserId": "123", "Name": "Alice"}], "Count": 1}
B{"Items": [{"UserId": {"S": "123"}, "Name": {"S": "Alice"}}], "Count": 1, "ScannedCount": 1}
C{"Results": [{"UserId": {"S": "123"}, "Name": {"S": "Alice"}}], "Count": 1}
D{"Items": [{"UserId": {"N": "123"}, "Name": {"S": "Alice"}}], "Count": 1, "ScannedCount": 1}
Attempts:
2 left
💡 Hint
DynamoDB returns attribute values with their types in the output.