Recall & Review
beginner
What is a partition key in DynamoDB?
A partition key is the primary key attribute that DynamoDB uses to distribute data across partitions. It uniquely identifies items within a table's partition.
Click to reveal answer
beginner
How do you query items by partition key in DynamoDB?
You use the Query operation specifying the partition key value. This returns all items with that partition key efficiently.
Click to reveal answer
intermediate
Why is Query by partition key faster than Scan in DynamoDB?
Query uses the partition key to directly find items, so it reads only relevant data. Scan reads the entire table, which is slower and more costly.
Click to reveal answer
beginner
Can you query DynamoDB without specifying a partition key?
No, Query requires a partition key value. Without it, you must use Scan, which reads the whole table.
Click to reveal answer
intermediate
What is the syntax to query a DynamoDB table by partition key using AWS CLI?
aws dynamodb query --table-name YourTableName --key-condition-expression "PartitionKeyName = :pkval" --expression-attribute-values '{":pkval":{"S":"YourKeyValue"}}'
Click to reveal answer
What must you always provide when using the Query operation in DynamoDB?
✗ Incorrect
Query requires the partition key value to find matching items.
Which operation reads the entire DynamoDB table?
✗ Incorrect
Scan reads every item in the table, unlike Query which uses the partition key.
What does the Query operation return when multiple items share the same partition key?
✗ Incorrect
Query returns all items that have the specified partition key.
Which of these is NOT required for a Query by partition key?
✗ Incorrect
Query does not perform a full table scan; it uses the partition key to find items.
What is the main benefit of querying by partition key?
✗ Incorrect
Querying by partition key is efficient and cost-effective because it targets specific data.
Explain how querying by partition key works in DynamoDB and why it is efficient.
Think about how DynamoDB organizes data and how Query uses that.
You got /4 concepts.
Describe the difference between Query and Scan operations in DynamoDB.
Focus on how much data each operation reads.
You got /4 concepts.