0
0
DynamoDBquery~5 mins

Expression attribute names in DynamoDB - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
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?
A@
B:
C#
D$
Why might you need to use Expression Attribute Names in a DynamoDB query?
ATo encrypt data
BTo speed up queries
CTo change data types
DTo avoid reserved word conflicts
Which of the following is a correct way to define an Expression Attribute Name for the attribute 'status'?
A{"st": "#status"}
B{"#st": "status"}
C{"#status": ":st"}
D{"status": "#st"}
Can Expression Attribute Names be used in Filter Expressions?
AYes
BNo
COnly in KeyConditionExpression
DOnly in ProjectionExpression
If an attribute name contains a space, how should you reference it in a DynamoDB expression?
AUse an Expression Attribute Name placeholder starting with '#'
BUse the attribute name directly
CReplace spaces with underscores
DUse quotes around the attribute name
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.