Bird
0
0

Which of the following is the correct JSON syntax to represent an item with attributes "Name" as "Alice" and "Age" as 30 in DynamoDB?

easy📝 Syntax Q3 of 15
AWS - DynamoDB
Which of the following is the correct JSON syntax to represent an item with attributes "Name" as "Alice" and "Age" as 30 in DynamoDB?
A{"Name": {"S": "Alice"}, "Age": {"N": "30"}}
B{"Name": "Alice", "Age": 30}
C{"Name": "Alice", "Age": "30"}
D{"Name": {"N": "Alice"}, "Age": {"S": "30"}}
Step-by-Step Solution
Solution:
  1. Step 1: Understand DynamoDB JSON attribute format

    DynamoDB expects attributes to be typed: "S" for string, "N" for number, etc.
  2. Step 2: Match attribute types with values

    Name is a string, so use "S"; Age is a number, so use "N" with string number value.
  3. Final Answer:

    {"Name": {"S": "Alice"}, "Age": {"N": "30"}} -> Option A
  4. Quick Check:

    Typed JSON attributes = {"Name": {"S": "Alice"}, "Age": {"N": "30"}} [OK]
Quick Trick: Use typed JSON for DynamoDB attributes [OK]
Common Mistakes:
  • Omitting type keys like "S" or "N"
  • Using wrong types for values
  • Using untyped JSON

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes