Bird
0
0

Which AWS CLI command correctly creates a DynamoDB table with OrderId as the partition key and OrderDate as the sort key?

easy📝 Configuration Q3 of 15
AWS - DynamoDB

Which AWS CLI command correctly creates a DynamoDB table with OrderId as the partition key and OrderDate as the sort key?

Aaws dynamodb create-table --table-name Orders --attribute-definitions AttributeName=OrderId,AttributeType=S --key-schema AttributeName=OrderId,KeyType=HASH --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5
Baws dynamodb create-table --table-name Orders --attribute-definitions AttributeName=OrderId,AttributeType=N AttributeName=OrderDate,AttributeType=S --key-schema AttributeName=OrderDate,KeyType=HASH AttributeName=OrderId,KeyType=RANGE --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5
Caws dynamodb create-table --table-name Orders --attribute-definitions AttributeName=OrderId,AttributeType=S AttributeName=OrderDate,AttributeType=S --key-schema AttributeName=OrderId,KeyType=HASH AttributeName=OrderDate,KeyType=RANGE --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5
Daws dynamodb create-table --table-name Orders --attribute-definitions AttributeName=OrderDate,AttributeType=S AttributeName=OrderId,AttributeType=S --key-schema AttributeName=OrderDate,KeyType=HASH AttributeName=OrderId,KeyType=RANGE --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5
Step-by-Step Solution
Solution:
  1. Step 1: Identify partition and sort key

    Partition key is HASH, sort key is RANGE in DynamoDB key schema.
  2. Step 2: Check attribute definitions

    Both keys must be defined with correct attribute names and types.
  3. Step 3: Validate AWS CLI syntax

    aws dynamodb create-table --table-name Orders --attribute-definitions AttributeName=OrderId,AttributeType=S AttributeName=OrderDate,AttributeType=S --key-schema AttributeName=OrderId,KeyType=HASH AttributeName=OrderDate,KeyType=RANGE --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 correctly defines OrderId as HASH and OrderDate as RANGE with proper attribute types.
  4. Final Answer:

    aws dynamodb create-table --table-name Orders --attribute-definitions AttributeName=OrderId,AttributeType=S AttributeName=OrderDate,AttributeType=S --key-schema AttributeName=OrderId,KeyType=HASH AttributeName=OrderDate,KeyType=RANGE --provisioned-throughput ReadCapacityUnits=5,WriteCapacityUnits=5 is the correct AWS CLI command.
  5. Quick Check:

    Partition key = HASH, sort key = RANGE [OK]
Quick Trick: Partition key is HASH, sort key is RANGE [OK]
Common Mistakes:
MISTAKES
  • Swapping HASH and RANGE key types
  • Missing attribute definitions for keys
  • Incorrect attribute types for keys

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes