AWS DynamoDB – PartiQL Delete Statements For DynamoDB
PartiQL is a SQL-compatible query language that supports querying, modifying, and inserting data. It makes it easier to interact with DynamoDB and run queries in AWS Management Console.
Delete data in DynamoDB Table using PartiQL:
DELETE FROM table-name WHERE condition;
- Table name: Required – Name of the table in which you want to insert data.
- Condition: Required – The criteria for the item that needs to be deleted.
DELETE FROM Books WHERE “BookName” = ‘ABC’ AND “Author” = ‘EFG’ ;
Note: Updates and Deletes cannot be processed in bulk, You can only delete one record in one operation.
Using PartiQL in AWS Management Console:
Pre – Requisites:
- AWS Account
- DynamoDB table
Step 1: Login into your AWS account. Search for “DynamoDB” which will be present under “Services”, select it.
Step 2: Once you are directed to the DynamoDB Management Console, on the left side there is PartiQL editor, select it.
Step 3: After you are directed to the PartiQL editor, Select the table that you want to delete data from.
Step 4: Type the Query in the editor and click on run, it should be executed successfully.
Step 5: The record gets deleted from the table, and the delete operation is completed.