VOOZH about

URL: https://www.geeksforgeeks.org/dynamo-db/aws-dynamodb-query-data-in-a-table/

⇱ AWS DynamoDB - Query Data in a Table - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

AWS DynamoDB - Query Data in a Table

Last Updated : 23 Jul, 2025

Amazon DynamoDB is a NoSQL managed database that stores semi-structured data i.e. key-value pair and document data. A table in DynamoDB stores data in form of an item and each item has a primary key. 

Example:
{
 "Color": true,
 "Director": "Christopher Nolan",
 "MovieID": 1,
 "Name": "Inception",
 "Rating": 8.7,
 "Year": 2010
}

The Query operation in Amazon DynamoDB finds items based on primary key values. You must provide the name of the partition key attribute and a single value for that attribute. The query returns all items with that partition key value. 

Create a table and add items: 

To query on data, create a table say, Movies with partition key as MovieID. No two items can have the same primary key. Add few items to query upon. A table has already been created with data in it. See the below image:

👁 Image

Query on the table :

 To query upon data in the table, navigate to the Items tab of the table and select Query from the dropdown. By default, a query has a partition key as one of the search filters. We can add more attributes to refine the search. See the below images:

👁 Image

In the above image we see that when we enter 200 for primary key MovieID, we obtain 1 record which is shown above in the image.

Comment
Article Tags: