B. The map (M) type cannot contain nested attributes
C. The age attribute should use type N, not S
D. Binary (B) type is missing for profile
Solution
Step 1: Analyze the attribute types inside the map
The map contains "age" with type S and value 30, and "name" with type S and value "Alice".
Step 2: Check if types match values
Age is a number (30), so it should use type N, not S (string). Name is correctly a string.
Final Answer:
Age attribute should use type N, not S -> Option C
Quick Check:
Numbers use N type, not S [OK]
Hint: Numbers inside maps must use N type, not S [OK]
Common Mistakes:
Using S for numbers
Thinking maps can't nest attributes
Confusing name type as number
5.
You want to store a user's profile with a list of phone numbers and a map of address details in DynamoDB. Which attribute types should you use for phoneNumbers and address respectively?
hard
A. phoneNumbers: L, address: M
B. phoneNumbers: M, address: L
C. phoneNumbers: S, address: B
D. phoneNumbers: BOOL, address: N
Solution
Step 1: Identify the type for a list of phone numbers
A list of phone numbers is a collection, so it should use the List (L) type.
Step 2: Identify the type for address details as key-value pairs
Address details are structured data with keys and values, so Map (M) type is appropriate.
Final Answer:
phoneNumbers: L, address: M -> Option A
Quick Check:
Lists = L, Maps = M [OK]
Hint: Use L for lists, M for maps (objects) in DynamoDB [OK]