Create and Query a DynamoDB Table
Create a DynamoDB table, add items, and query data using partition keys, sort keys, and scans

Lab overview
Amazon DynamoDB is a fully managed NoSQL database service that delivers single-digit millisecond performance at any scale. Unlike traditional relational databases that organize data in rows and columns with rigid schemas, DynamoDB uses a flexible key-value and document data model that adapts to your application's access patterns. It automatically handles capacity provisioning, data replication across multiple Availability Zones, and on-demand scaling — making it a foundational service for serverless architectures, gaming leaderboards, IoT telemetry, e-commerce carts, and virtually any workload that demands consistent, low-latency reads and writes.
Every DynamoDB table is built around a primary key that uniquely identifies each item. A partition key distributes data across storage nodes, while an optional sort key enables range-based queries within a partition. Understanding how to design these keys — and when to use Query versus Scan operations — is the single most important skill for working effectively with DynamoDB. In this lab, you will create a DynamoDB table with a composite primary key, populate it with sample data, run targeted queries using partition and sort keys, compare Query and Scan operations to see the performance difference firsthand, and add a Global Secondary Index to enable queries on an alternate attribute.
Objectives
Upon completion of this Beginner level lab, you will be able to:
- Create a DynamoDB table with a composite primary key (partition key and sort key)
- Add and manage items in a DynamoDB table using the AWS Console
- Query a table using partition key and sort key conditions
- Compare Query and Scan operations and understand their performance implications
- Create a Global Secondary Index (GSI) to enable queries on non-key attributes
Who is this lab for?
This lab is designed for:
- Cloud beginners who want to learn AWS's core NoSQL database service
- Developers and solutions architects preparing for AWS certification exams that cover DynamoDB fundamentals
Verified against your live environment
An automated validation engine inspects your actual resources and configurations as you work. Completion means the task was performed, not multiple choice, real-world proficiency.
More labs like this
Terraform Custom Validation and Check Blocks on AWS
Write variable validation rules, add preconditions and postconditions to resources, attach output preconditions, and create check blocks on AWS.
Configure Terraform Remote State with S3 and DynamoDB Backend
Configure an S3 backend with DynamoDB locking for Terraform remote state, migrate local state, and verify encryption and locking behavior.
Terraform Complex Types and Dynamic Expressions on AWS
Define complex variable types, use for_each and count for resource iteration, apply splat expressions and dynamic blocks on AWS with Terraform.
Related reading
Environment
Every lab includes
- Real environment, pre-credentialed
- Automated checks on every step
- Isolated sandbox, auto cleanup
- AI-recommended next steps
Lab curriculum
- 01
Signing into AWS Console
- 02
Creating a DynamoDB Table with a Composite Primary Key
1 automated check
- 03
Adding and Managing Items in a DynamoDB Table
1 automated check
- 04
Querying and Scanning DynamoDB Table Data
1 automated check
- 05
Creating a Global Secondary Index for Alternate Queries
1 automated check
Skills validated
Not the lab you were looking for?
Browse 200+ hands-on labs across AWS, Azure, Kubernetes, Docker, and cloud security.