Recall & Review
beginner
What are Expression Attribute Names in DynamoDB?
Expression Attribute Names are placeholders used in DynamoDB queries to substitute attribute names that are reserved words or contain special characters.
Click to reveal answer
beginner
Why do we use Expression Attribute Names in DynamoDB queries?
We use Expression Attribute Names to avoid conflicts with reserved keywords and to safely reference attribute names that contain special characters or spaces.
Click to reveal answer
intermediate
How do you define an Expression Attribute Name in a DynamoDB query?
You define Expression Attribute Names by using a map with keys starting with '#' and values as the actual attribute names, for example: {"#yr": "year"}.
Click to reveal answer
intermediate
Example: How to use Expression Attribute Names to query an attribute named 'and' which is a reserved word?
Use a placeholder like '#and' in your expression and map it to 'and' in ExpressionAttributeNames. For example: ExpressionAttributeNames: {"#and": "and"}, KeyConditionExpression: "#and = :value".
Click to reveal answer
intermediate
Can Expression Attribute Names be used with Update Expressions in DynamoDB?
Yes, Expression Attribute Names can be used in Update Expressions to safely reference attribute names that might conflict with reserved words or contain special characters.
Click to reveal answer
What symbol must Expression Attribute Names start with in DynamoDB?
✗ Incorrect
Expression Attribute Names always start with '#' to distinguish them from other placeholders.
Why might you need to use Expression Attribute Names in a DynamoDB query?
✗ Incorrect
Expression Attribute Names help avoid conflicts with reserved words or special characters in attribute names.
Which of the following is a correct way to define an Expression Attribute Name for the attribute 'status'?
✗ Incorrect
The key must start with '#' and the value is the actual attribute name.
Can Expression Attribute Names be used in Filter Expressions?
✗ Incorrect
Expression Attribute Names can be used in any expression including FilterExpression to avoid reserved word conflicts.
If an attribute name contains a space, how should you reference it in a DynamoDB expression?
✗ Incorrect
Attribute names with spaces must be replaced with Expression Attribute Names starting with '#' to be valid.
Explain what Expression Attribute Names are and why they are important in DynamoDB queries.
Think about how DynamoDB handles reserved words and special characters.
You got /3 concepts.
Describe how to use Expression Attribute Names in a DynamoDB Update Expression with an example.
Use '#' placeholders and show how to update an attribute safely.
You got /3 concepts.