The Wayback Machine - https://web.archive.org/web/20240204231440/https://www.geeksforgeeks.org/aws-dynamodb-query-data-in-a-table/
Open In App
Related Articles

AWS DynamoDB – Query Data in a Table

Improve
Improve
Improve
Like Article
Like
Save Article
Save
Report issue
Report

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:

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:

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.

Lost in the complex landscape of DevOps? It's time to find your way! Enroll in our DevOps Engineering Planning to Production Live Course and set out on an exhilarating expedition to conquer DevOps methodologies with precision and timeliness.
What We Offer:

  • Comprehensive DevOps Curriculum
  • Expert Guidance for Streamlined Learning
  • Hands-on Experience with Real-world Scenarios
  • Proven Track Record with 100,000+ Successful DevOps Enthusiasts

Last Updated : 28 Mar, 2023
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads
Complete Tutorials