DEV Community

Cover image for CRUD Operations
Nafisa Muntaha
Nafisa Muntaha

Posted on

CRUD Operations

CRUD Operations

CRUD stands for Create, Read, Update and Delete. They are the four basic operations that are necessary for storage application.

The capacity to create, read, update and delete items in a web application is important for the development of a website and making it interactive. For example: if we are making a blog page and someone wants to post blogs, without CRUD operations it would be a real problem.

Create

The create allows adding items or data to the database. It will add a new row on the database table for adding that data. To create data, the HTTP Post method is used, it is used to create new data for the database.

Read

The read allows reading from the database. It would never change the data. To read a resource HTTP Get method is used. No matter how many times you call the Get method, you’ll get the same data stored in there.

Update

The update is used to update any data from the database. If you store the price of stocks and after a few days it has gone up, you would want to change the previous price to the current price. It means you would update the price from the previous one. The PUT method is used for updating data from the database. After updating it, the data will be changed from the database, also the updated data will be displayed on the website.

Delete

The delete is used to delete data from the database or remove any resource from the system. For example, you stored your favorite dishes on the database. You want to remove pizza from the list(Don't think anyone would do that!), then you’ll use the delete operation. For that HTTP Delete method will be used.

Top comments (0)