exam questions

Exam AWS Certified Developer - Associate DVA-C02 All Questions

View all questions & answers for the AWS Certified Developer - Associate DVA-C02 exam

Exam AWS Certified Developer - Associate DVA-C02 topic 1 question 363 discussion

A developer is creating a web application for a school that stores data in Amazon DynamoDB. The ExamScores table has the following attributes: student_id, subject_name, and top_score.

Each item in the ExamScores table is identified with student_id as the partition key and subject_name as the sort key. The web application needs to display the student _id for the top scores for each school subject. The developer needs to increase the speed of the queries to retrieve the student_id for the top scorer for each school subject.

Which solution will meet these requirements?

  • A. Create a local secondary index (LSI) with subject_name as the partition key and top_score as the sort key.
  • B. Create a local secondary index (LSI) with top_score as the partition key and student_id as the sort key.
  • C. Create a global secondary index (GSI) with subject_name as the partition key and top_score as the sort key.
  • D. Create a global secondary index (GSI) with subject_name as the partition key and student_id as the sort key.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
examuserss
4 months, 1 week ago
Selected Answer: C
The best solution is C. Create a global secondary index (GSI) with subject_name as the partition key and top_score as the sort key. Here's why: The goal is to efficiently retrieve the student ID of the top scorer for each subject. A GSI allows querying on a key combination different from the table's primary key. By using subject_name as the partition key, you can easily query all scores for a given subject. Then, sorting by top_score in descending order will allow you to quickly identify the top scorer using a single query. An LSI (options A and B) is tied to the table's primary key, making efficient retrieval of this data impossible. Option D would allow retrieval of student IDs given a subject, but not directly sorted by top score to find the top scorer for each subject efficiently. A GSI offers the flexibility to achieve the desired retrieval speeds without requiring multiple queries.
upvoted 2 times
...
rdiaz
9 months, 3 weeks ago
Selected Answer: C
GSI - diff part key and sort key | LSI - same part key and diff sort key
upvoted 3 times
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago