> ## Documentation Index
> Fetch the complete documentation index at: https://cloud-architect.ipoint-labs.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a DynamoDB table and perform various table operations using NoSQL Workbench

> Hands-on lab · 45m

Launch this lab in the IP Lab Portal, then follow the steps below in the AWS console.

<a className="ip-lab-portal-btn" href="https://labs.intellectualpoint.com/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben" target="_blank" rel="noreferrer">
  Open IP Lab Portal
</a>

## Overview

### Lab details

1. This lab walks you through DynamoDB Console and NoSQL Workbench. You will be creating a DynamoDB table and performing CRUD methods using NoSQL Workbench and visualizing the changes in the DynamoDB console. And also, you will be creating a DynamoDB table in the console and insert items and visualize the reflections in the NoSQL Workbench.
2. Duration: **60 minutes**
3. AWS Region: **US East (N. Virginia) us-east-1**

### Introduction

#### What is AWS DynamoDB?

###### Definition

* DynamoDB is a fast and flexible NoSQL database designed for applications that need consistent, single-digit millisecond latency at any scale.it is a fully managed database and it supports both document and key value data models.
* It has a very flexible data model. This means that you don't need to define your database schema upfront. It also has reliable performance.
* DynamoDB is a good fit for mobile gaming, ad-tech, IoT and many other applications.

###### DynamoDB Tables

DynamoDB tables consist of:

* Items (Think of a row of data in a table).
* Attributes ((Think of a column of data in a table).
* Supports key-value and document data structures.
* Key= the name of the data.  Value= the data itself.
* Document can be written in JSON, HTML or XML.

###### DynamoDB - Primary Keys

* DynamoDB stores and retrieves data based on a Primary key
* DynamoDB also uses Partition keys to determine the physical location data is stored.
* If you are using a partition key as your Primary key, then no items will have the same Partition key.
* Composite Keys (Partition Key + Sort Key) can be used in Combination.
* Two items may have the same partition key, but must have a different sort key.
* All items with the same partition key are stored together and then sorted according to the sort key value.
* DynamoDB allows you to store multiple items with the same partition keys.

###### NoSQL Workbench

* NoSQL is basically a Non-Relational Database, with a lot of other advantages too.
* NoSQL Workbench is a virtual development as well as a testing environment for developers across the globe.
* It allows the users to test their data models over a large number of aspects of functionality and also allows them to develop their software, right from the scratch with ease.
* In simple terms, the NoSQL Workbench is an IDE platform that includes data modeling, data visualization, and operation building.
* **Data Modeling:** Workbench enables users with a facility to build new data models right from scratch or by using existing data models.
* **Data Visualization:** As the name suggests, it provides the graphical representation of information and data..
* **Operation Building:** Workbench is a strong and reliable platform for building applications and also has a great graphical user interface which eventually makes the communication between the database and the user easier.

### Architecture diagram

### <img src="https://mintcdn.com/ip-cloud-architect-pathway/2u36x6URmH9hJ3QL/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/001.png?fit=max&auto=format&n=2u36x6URmH9hJ3QL&q=85&s=2ebf3d6c44d23456c21cda7b17150ee0" alt="" width="2844" height="1774" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/001.png" />

### Task details

1. Sign in to AWS Management Console.
2. Create a DynamoDB table through the AWS Console.
3. Connect to DynamoDB using NoSQL Workbench.
4. Creating items using the console.
5. Adding new items to the table using NoSQL Workbench.
6. Deleting an item using NoSQL Workbench.
7. Updating an item using NoSQL Workbench.
8. Creating a new table using NoSQL Workbench.
9. Adding items into the new table.
10. Commiting the table and its data to Amazon DynamoDB.
11. Deleting AWS Resources.

### Prerequisites

1. To work with this lab, it is necessary to download the NoSQL Workbench. To download it, go to the [Download NoSQL Workbench Page](https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/workbench.settingup.html). Based on your OS, select the respective option under **Download link**. Once downloaded, open the file and install.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/2u36x6URmH9hJ3QL/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/002.png?fit=max&auto=format&n=2u36x6URmH9hJ3QL&q=85&s=99fb061e5fe9b4b3132607d196f975a1" alt="" width="1330" height="709" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/002.png" />

### Launching the lab environment

1. To launch the lab environment, Click on the **Launch lab** button.
2. Please wait until the cloud environment is provisioned. It will take less than a minute to provision.
3. Once the Lab is started, you will be provided with **IAM user name**, **Password**, **Access** **Key**, and **Secret** **Access** **Key**.

<Note>
  You can only start one lab at any given time
</Note>

## Lab guide

### Lab steps

#### Task 1: Sign in to AWS Management Console

1. Click on the **Open console** button, and you will get redirected to AWS Console in a new browser tab and it will be Logged in Successfully.
2. On the AWS Console, in the search bar search for **IAM** and click on it.
3. Then Click on **IAM Users** and select **TerraformUser-XXXXX**

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/2u36x6URmH9hJ3QL/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/003.png?fit=max&auto=format&n=2u36x6URmH9hJ3QL&q=85&s=007f5a435a5795e5365375fb002aec6f" alt="" width="1472" height="774" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/003.png" />
4. Click on **Create Access Key**.

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/2u36x6URmH9hJ3QL/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/004.png?fit=max&auto=format&n=2u36x6URmH9hJ3QL&q=85&s=e05aa2d11fad84f743775439bd4bea14" alt="" width="2892" height="718" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/004.png" />
5. Choose **Other**, Click on **Next** and click on **Create Access Key.**

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/2u36x6URmH9hJ3QL/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/005.png?fit=max&auto=format&n=2u36x6URmH9hJ3QL&q=85&s=22f8caaf32b0aed3cbd2ea3427b4fdf8" alt="" width="2390" height="1378" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/005.png" />
6. Your **Access and Secret key** will get Created. Make a note of it for later use.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/2u36x6URmH9hJ3QL/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/006.png?fit=max&auto=format&n=2u36x6URmH9hJ3QL&q=85&s=0019d5e89ddd4f646133a12272872f6c" alt="" width="1858" height="1004" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/006.png" />

#### Task 2: Create a DynamoDB table through the AWS Console

In this task, you will create a DynamoDB table that is used to add items and visualize the data in the NoSQL Workbench.

1. Make sure you are in the **N.Virginia** Region.
2. Navigate to **DynamoDB** by clicking on the **Services** menu at the top and selecting **DynamoDB** under the **Database** section.
3. Click on **Create Table**  on the right side.
4. Table details:

   * Table name : Enter ***Student\_Info***
   * Partition key : Enter ***StudentId***
   * Sort Key : Enter ***StudentName***
5. Leave everything as default and click on **Create table** button.

#### Task 3: Connect to DynamoDB using NoSQL Workbench

In this task, you will configure files and pass access credentials to connect to DynamoDB using NoSQL Workbench and view the DynamoDB table after successful connection. And the credentials you are going to use for making a connection are the **Access Key ID** and **Secret Access Key** present on the left side of the lab interface under **IAM username** and **Password**.

1. Open the NoSQL Workbench you have downloaded and installed during the prerequisites step.
2. Click on the **Launch** button next to Amazon DynamoDB.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/2u36x6URmH9hJ3QL/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/007.png?fit=max&auto=format&n=2u36x6URmH9hJ3QL&q=85&s=643ba3795f338f888670201ee23cfb84" alt="" width="1266" height="632" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/007.png" />

3. In the left side panel, click on **Operation builder** and click on **Add connection** on the right side.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/2u36x6URmH9hJ3QL/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/008.png?fit=max&auto=format&n=2u36x6URmH9hJ3QL&q=85&s=6eef5346680915467fd5ecd8f148aa5b" alt="" width="1584" height="984" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/008.png" />

4. Now we need to configure two files in our local PC to successfully connect to our DynamoDB using NoSQL Workbench.

* For **Windows** Users:
* Go to the destination ***%USERPROFILE%\\\\.aws*** in your local Pc.
* You will be able to find **config** and **credentials** files, which we need to edit using notepad.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/2u36x6URmH9hJ3QL/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/009.png?fit=max&auto=format&n=2u36x6URmH9hJ3QL&q=85&s=0cfac56fe15b4a86389d3d96e10b4916" alt="" width="768" height="384" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/009.png" />

5. Open the **config** file using notepad and replace the existing content with the one given below.

```
[default]
region=us-east-1
output=json
AWS_SDK_LOAD_CONFIG=1
```

6. Save the file using **Ctrl+S**.

7. Now open the **credentials** file using notepad and replace the default **aws\_access\_key\_id** and **aws\_secret\_access\_key** with the **Access Key ID** and **Secret Access Key** created earlier.

8. The file after replacing your credentials looks something like this. (**I have masked my secret access key as a security protocol**)

<img src="https://mintcdn.com/ip-cloud-architect-pathway/2u36x6URmH9hJ3QL/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/010.png?fit=max&auto=format&n=2u36x6URmH9hJ3QL&q=85&s=3f88355c1383cd3d64485863dca1ce48" alt="" width="556" height="154" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/010.png" />

9. Save the file using **Ctrl+S**.

* For **Mac** and **Linux** Users:

```
[default]
aws_access_key_id = <Access Key ID>
aws_secret_access_key = <Secret Access Key>
```

<img src="https://mintcdn.com/ip-cloud-architect-pathway/2u36x6URmH9hJ3QL/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/011.png?fit=max&auto=format&n=2u36x6URmH9hJ3QL&q=85&s=9e41cbab62071d1f3a0f353626797158" alt="" width="515" height="133" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/011.png" />

1. Copy and paste your scret key and access key from the lab document
2. Save the file by pressing **Esc** button, and type ***:wq*** \[If you are using Vi editor]
3. Open your Mac Terminal or Linux Command Line.
4. You can either use Vi editor or nano to edit the config and credentials files mentioned in the above steps.

* Enter in your mac terminal.

nano \~/.aws/config

<img src="https://mintcdn.com/ip-cloud-architect-pathway/2u36x6URmH9hJ3QL/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/012.png?fit=max&auto=format&n=2u36x6URmH9hJ3QL&q=85&s=7c975dbaff5ee69b47f6c05c8bd9df60" alt="" width="862" height="108" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/012.png" />

5. Now paste the content which is tabulated in the Step-7 inside this **\~/.aws/config** file.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/2u36x6URmH9hJ3QL/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/013.png?fit=max&auto=format&n=2u36x6URmH9hJ3QL&q=85&s=75d947e902dfffb664fcae9f0e06ab7e" alt="" width="215" height="171" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/013.png" />

* Press **Ctrl+X** and Press **Enter** to save the file.
* Now enter

nano \~/.aws/credentials

<img src="https://mintcdn.com/ip-cloud-architect-pathway/2u36x6URmH9hJ3QL/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/014.png?fit=max&auto=format&n=2u36x6URmH9hJ3QL&q=85&s=d0f40ecc836d028e1afa6dc16afa616b" alt="" width="846" height="126" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/014.png" />

6. Now **replace** the default **aws\_access\_key\_id** and **aws\_secret\_access\_key** with the **Access Key ID** and **Secret Access Key** present on the right side of the lab interface under **IAM username** and **Password**. \[Refer Step 9&10 to understand]

* Press **Ctrl+X** and Press **Enter** to save the file.

7. Now get back to the NoSQL Workbench and fill the following details:

* Connection name : Enter ***Connection 3*** ( You can give any name of your choice)
* Default AWS Region : Select **us-east-1**
* Access Key ID : Paste your **Access Key ID** of the lab. (The same way you did in the Step 9)
* Secret access key : Paste your **Secret Access Key** of the lab. (The same way you did in the Step 9)
* Persist connection : **Check** the box
* Click on the **Connect** button.

  <img src="https://mintcdn.com/ip-cloud-architect-pathway/2u36x6URmH9hJ3QL/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/015.png?fit=max&auto=format&n=2u36x6URmH9hJ3QL&q=85&s=f902794efa22f98bacea863fd16961a8" alt="" width="646" height="611" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/015.png" />

8. In the next screen, click on **Open** under your respective connection.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/2u36x6URmH9hJ3QL/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/016.png?fit=max&auto=format&n=2u36x6URmH9hJ3QL&q=85&s=18111db9ae54cc82e68686c444cc4dc6" alt="" width="1051" height="485" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/016.png" />

9. Now you will be able to see the table(**Student\_Info)** we have created using AWS Console here in NoSQL Workbench.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/2u36x6URmH9hJ3QL/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/017.png?fit=max&auto=format&n=2u36x6URmH9hJ3QL&q=85&s=a8c75bbdf031ab3ea2939319ae02e632" alt="" width="1329" height="452" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/017.png" />

#### Task 4: Creating items using the console

In this task, you will create a few items in the DynamoDB table through the console and try to see these items in the NoSQL Workbench.

1. Make sure you are in the **N.Virginia** Region.
2. Navigate to **DynamoDB** by clicking on the **Services** menu at the top and selecting **DynamoDB** under the **Database** section.
3. On the left side panel, click on **Explore Items** and select your table i.e **Student\_Info**
4. Click on the **Create item** button on the right side.
5. Attributes:

   * StudentId : Enter ***1***
   * StudentName : Enter ***Jay***
   * Click on **Add new attribute** and select **String**
   * Give Attribute name as ***FavoriteSport*** and Value as ***Cricket***
   * Click on **Create item** button.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/2u36x6URmH9hJ3QL/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/018.png?fit=max&auto=format&n=2u36x6URmH9hJ3QL&q=85&s=c4415c8eb64940ee6f5034db0a622255" alt="" width="1259" height="431" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/018.png" />

6. Similarly create the following items shown below with their respective Attribute names and Values by following the above steps.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/2u36x6URmH9hJ3QL/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/019.png?fit=max&auto=format&n=2u36x6URmH9hJ3QL&q=85&s=1f2d5aea7b2020381501b76e4e4a2d5c" alt="" width="1261" height="555" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/019.png" />

7. Now you will be able to see three items returned in the **Student\_Info** table in the console.

8. Now open the NoSQL Workbench window from your taskbar to see if these newly created items in the console are present in the NoSQL Workbench.

9. Go to **Operation builder > Tables > Student\_Info** and click on the **Scan** button on the right side.

10. Now you will be able to see three items in the **Student\_info** table in the Workbench.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/2u36x6URmH9hJ3QL/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/020.png?fit=max&auto=format&n=2u36x6URmH9hJ3QL&q=85&s=832f0baeaa9a91797567dc06562a7a69" alt="" width="1343" height="569" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/020.png" />

#### Task 5: Adding new items to the table using NoSQL Workbench

In this task, you will add two new items to the existing table from NoSQL Workbench and see the reflections in the DynamoDB console.

1. Now on the top right corner click on **Action operation** and click on **Create** **Item**.

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/2u36x6URmH9hJ3QL/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/021.png?fit=max&auto=format&n=2u36x6URmH9hJ3QL&q=85&s=50365329f405e02e577f2b728710965d" alt="" width="1874" height="656" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/021.png" />
2. Build Operations:

   * Table : Select **Student\_Info**
   * Partition key : Enter ***4***
   * Sort key : Enter ***Harsh***
   * Click on **+** sign next to **Other attributes**
   * Attribute name : Enter ***FavoriteSport***
   * Attribute type : Select **String** from the drop down menu
   * Attribute value : Enter ***Volleyball***
3. Now click on the **Save operation** button.

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/2u36x6URmH9hJ3QL/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/022.png?fit=max&auto=format&n=2u36x6URmH9hJ3QL&q=85&s=5ebee9b810a7b2ce0a98d209f4a3021c" alt="" width="1874" height="822" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/022.png" />
4. Scroll down a little and give the **Name** under Save operation as ***test1*** and click on the **Save** button.
5. You can give a name of your choice for Save operation as well, it does not matter.

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/2u36x6URmH9hJ3QL/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/023.png?fit=max&auto=format&n=2u36x6URmH9hJ3QL&q=85&s=8d644e1ed25b8f2130bc0ca6f76a3d1b" alt="" width="1910" height="320" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/023.png" />
6. Now click on the **Run** button which is next to Save operation.
7. Expand the table by clicking on it to see the result.

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/2u36x6URmH9hJ3QL/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/024.png?fit=max&auto=format&n=2u36x6URmH9hJ3QL&q=85&s=1e55a47181afc55e666f0a4db6d2d938" alt="" width="1324" height="307" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/024.png" />
8. Click on the **Scan** button on the right side if you do not see any item.
9. Similarly add one more item from the NoSQL Workbench using **Create Item** operation:

   * StudentId as ***5***
   * StudentName as ***Virat***
   * FavoriteSport as ***Rugby***
10. The table looks something like this in the Workbench. Click on the **Scan** button on the right side if you do not see any items.

    <img src="https://mintcdn.com/ip-cloud-architect-pathway/2u36x6URmH9hJ3QL/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/025.png?fit=max&auto=format&n=2u36x6URmH9hJ3QL&q=85&s=49e175784266e543940d034de614b3c4" alt="" width="2132" height="700" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/025.png" />
11. Now head back to the **DynamoDB console** and refresh the page to see these newly added items there.

    <img src="https://mintcdn.com/ip-cloud-architect-pathway/2u36x6URmH9hJ3QL/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/026.png?fit=max&auto=format&n=2u36x6URmH9hJ3QL&q=85&s=a3e2ca138993e0bc70bba1b1060ee5f2" alt="" width="1248" height="405" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/026.png" />

#### Task 6: Deleting an item using NoSQL Workbench

In this task, you will delete an item from the Workbench and see the reflections in the DynamoDB console.

1. Now get back to the NoSQL Workbench.
2. Scroll to the top and click on **Expand Action operation** and choose **Delete item**.
3. Build Operations:

   * Data plane operations : Select **DeleteItem** from the drop down menu
   * Table : Select **Student\_Info**
   * Partition key : Enter ***1***
   * Sort key : Enter ***Jay***
4. Now click on the **Save operation** button.

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/027.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=f07f2619a45bf49db1a8c8ac4bfe458b" alt="" width="1874" height="644" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/027.png" />
5. One pop-up will appear to confirm to deletion.
6. Click on the table on the left side to expand it and see the result. Click on the **Scan** button on the right side if you do not see the result.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/028.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=a0239fe5f61c46d39a1dfd148c30bcea" alt="" width="2080" height="590" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/028.png" />

7. Now head back to the **DynamoDB console** and refresh the page to see if the item has been deleted here as well or not.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/029.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=8a210547f76cbed0b43673d52b334cd7" alt="" width="1243" height="482" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/029.png" />

#### Task 7: Updating an item using NoSQL Workbench

In this task, you will update an existing item through NoSQL Workbench and see if it is reflected in the DynamoDB console as well.

1. Now get back to the NoSQL Workbench.
2. Click on the StudentId where it is **2**
3. Build Operations:

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/030.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=da8aa5d329f9f11664d63f8bcaef44d9" alt="" width="1868" height="530" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/030.png" />

   * Update expression : Select **Set** from the drop down menu.
   * Click on **+** sign next to it.

     <img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/031.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=68ac9898e5a5531904adb169c277e152" alt="" width="686" height="75" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/031.png" />
   * Set:

     * Attribute name : Enter ***FavoriteSport***
     * Operators : Select **=** sign from the drop down menu.
     * Attribute type : Select **String** from the drop down menu.
     * Value : Enter ***Football*** in the \<empty> box.
4. Now click on the **Save operation** button.
5. Scroll down a little and give the **name** under Save operation as ***test3*** and click on **Save** button.

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/032.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=c3e23d34c768ee3d6e4a07a31356fa63" alt="" width="1868" height="732" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/032.png" />
6. Now click on the **Run** button which is next to Clear form.
7. Click on the table on the left side to expand it and see the result. Click on the **Scan** button on the right side if you do not see the update

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/033.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=fa4bd98ce6f96b5a0338d2164fb889c4" alt="" width="1093" height="453" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/033.png" />

8. Now head back to the **DynamoDB console** and refresh the page to see if the item has been updated here as well or not.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/034.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=dd27d32501154a751d0bc0bf0e06afbf" alt="" width="1642" height="582" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/034.png" />

#### Task 8: Creating a new table using NoSQL Workbench

In this task, you will create a new table with **Movies** as its name using NoSQL Workbench to add a few items and see if it has been updated in the dynamoDB console as well.

1. Now get back to the NoSQL Workbench.
2. In the NoSQL workbench, click on the **Data modeler** below the Amazon DynamoDB section.
3. Click on **+** sign below Data model to create a new data model.
4. Create data model for Amazon DynamoDB select Make Model from scratch:

   * Name : Enter ***Movies Name***
   * Author : Enter **\<Your Name>**
5. Click on the **Create** button.

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/035.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=680990e5a78fc72e3b6a610200e0caf1" alt="" width="663" height="370" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/035.png" />
6. Click on **+** sign next to **Tables** which is below Data model to create a new table (or) click on **+ Create new table** option present on the right side.
7. Add DynamoDB table:

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/036.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=98a0a6eb93708839f94d3aacf81b30b3" alt="" width="1874" height="1362" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/036.png" />

   * Table name : Enter ***Movies***
   * Partition key : Enter ***Id*** and select **Number** from the drop down menu.
   * Add sort key : **Check**
   * Sort key : Enter ***Name*** and select **String** from the drop down menu.
   * Other attributes : Click on **+ Add other attribute**

* Attribute name : Enter ***FavoriteMovie*** and select **String** from the drop down menu.

8. Leave the other settings as default and click on **Add table definition** button.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/037.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=e67ec25ee34fe04644e48122c8f4f25b" alt="" width="1087" height="272" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/037.png" />

9. The next screen you see will be something like this.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/038.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=29f70fae9e1e001e14850319594a7326" alt="" width="1075" height="563" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/038.png" />

#### Task 9: Adding items into the new table

In this task, you will add a few new items into the newly created Movies table through NoSQL Workbench.

1. Click on the **Visualizer** option on the left side panel .
2. Click on the **Update** button next to the **Movies** table and click on **Actions** from the drop down choose **Edit data.**

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/039.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=2c80b3e23cebc38c8e59b32301ed3179" alt="" width="2416" height="1010" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/039.png" />

3. Adding data:

* Under **Id** : Enter ***1***
* Under **Name** : Enter ***Sherley***
* Under **FavoriteMovie** : Enter ***Harry Potter***

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/040.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=0f373b8801a2fbb3c0050bde28c1c6a2" alt="" width="1337" height="285" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/040.png" />

4. Click on **+ Add new row** to add two other items as shown below. And once done, click on **Save Changes** button.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/041.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=5e9e9d952fffee5b2d1c05d9de4658f1" alt="" width="1938" height="668" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/041.png" />

5. Now click on **Aggregate view** to see data stored in the table in aggregated form.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/042.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=c5a825ebe1d3a3f322f29492a9924cf7" alt="" width="1344" height="437" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/042.png" />

#### Task 10: Commiting the table and its data to Amazon DynamoDB

In this task, you will commit the table and its items to the DynamoDB database in the console from NoSQL Workbench and see if it has been added to the DynamoDB console.

1. Click on **Commit to Amazon DynamoDB** button under Aggregate view.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/043.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=1fcaf1a8550d2fd65c93d0ad4b9a1725" alt="" width="1344" height="437" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/043.png" />

2. In the next screen, select your **connection name** from the **Saved connections** drop down menu. \[ In my case - Connection 3 ]

3. Now click on the **Commit** button. It will take a few seconds to process.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/044.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=6547a5606e523fb47e70de10135e8ccd" alt="" width="672" height="480" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/044.png" />

4. Now in the next screen, under **Active connections**, click on **Open** under your connection name. \[ In my case - Connection 3 ]

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/045.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=fb861bb32f1040b4bf82b00dd5005765" alt="" width="794" height="324" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/045.png" />

5. Now you will be able to find the **Movies** table under **Tables** section just above your **Student\_Info** table.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/046.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=3312c203f5e218a123f8e604e6bd42dc" alt="" width="1339" height="566" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/046.png" />

6. Now click on the **Movies** table to expand it and see the items you have created earlier inside this table.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/047.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=444d6e1ee84841d2477ba2a3c2fdb856" alt="" width="1323" height="416" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/047.png" />

7. Now head back to the **DynamoDB console**, refresh the page and click on **Tables** on the left side panel.

8. You will see the **Movies** table present here in the DynamoDB console.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/048.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=164825df273909f9764845be306fe24f" alt="" width="1292" height="296" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/048.png" />

9. Click on the **Items** section beneath the **Tables** on the left side panel and select **Movies** table.

10. You will be able to find the three items you have created through NoSQL Workbench, here in the console.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/049.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=4ada944cac64ddc70084e9c49a8a039d" alt="" width="1276" height="495" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/049.png" />

11. You can play around by updating and deleting items in the new table i.e **Movies**.

> #### Do you know?
>
> NoSQL Workbench allows multiple team members to collaborate on the data modeling process. You can share your data models with others, making it easier to work together and gather feedback. It is user for *Collaboration and sharing.*

#### Task 11: Validation Test

1. Once the lab steps are completed, please click on the **Validate** button on the left side panel.
2. This will validate the resources in the AWS account and displays whether you have completed this lab successfully or not.
3. Sample output :

   <img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/050.gif?s=805c481bfac02ca2b2d2c3fba0c07f1c" alt="" width="999" height="475" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/050.gif" />

#### Task 11: Delete AWS Resources

**Deleting DyanamoDB Tables**

1. Navigate to **DynamoDB** by clicking on the **Services** menu at the top and selecting **DynamoDB** under the **Database** section.
2. Click on **Tables** on the left side panel.
3. Select the tables you have created and click on the **Delete** button on the right side.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/051.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=58f49dcaf7e29b503339e6203c3a23ac" alt="" width="955" height="239" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/051.png" />

4. In the next screen,

* Delete all CloudWatch alarms for the tables shown : **Check**
* Create backups of all tables shown before deleting them : **Uncheck**
* Enter ***delete*** in the confirmation box.

5. Click on the **Delete tables** button to delete the tables.

<img src="https://mintcdn.com/ip-cloud-architect-pathway/TSQ7Mvha7YyTZ0k2/images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/052.png?fit=max&auto=format&n=TSQ7Mvha7YyTZ0k2&q=85&s=409272eb3dc33379c3aef26115fb075f" alt="" width="583" height="417" data-path="images/labs/create-a-dynamodb-table-and-perform-various-table-operations-using-nosql-workben/052.png" />

### Completion and conclusion

1. You have successfully created a DynamoDB table through the DynamoDB console.
2. You have successfully connected to DynamoDB using NoSQL Workbench.
3. You have successfully performed CRUD methods through NoSQL Workbench and seen the reflections in the DynamoDB console.
4. You have successfully created a table through NoSQL Workbench and committed to Amazon DynamoDB.

### End lab

1. Sign out of the AWS Account.
2. You have successfully completed the lab.
3. Once you have completed the steps, click on **End lab** button in the IP Lab Portal.

## What gets checked

When you press **Check my work**, the platform verifies each of these:

* **Create Amazon DynamoDB Table** — Check whether a DynamoDB Table is created or not.
* **Create Items in DynamoDB Table** — Check whether items in the DynamoDB table are created or not.

## Related help

* [FAQs and Troubleshooting](/aws-cp/support/faqs-and-troubleshooting)
