Exam DVA-C02 All QuestionsBrowse all questions from this exam
Question 363

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?

    Correct Answer: C

    To retrieve the student_id for the top scorer for each school subject efficiently, a global secondary index (GSI) with subject_name as the partition key and top_score as the sort key should be created. This index allows efficient querying by subject_name and will sort the results by top_score, enabling quick retrieval of the top score for each subject.

Discussion
rdiazOption: C

GSI - diff part key and sort key | LSI - same part key and diff sort key