CRUD Operations…
Published: 2021-12-23 15:16:27

**CRUD Operations…**

Everything that contains information or images on a website is stored in a database.The method by which we do this is called CRUD Operations. CRUD is an acronym.
Here,C stands for create , R stands for read , U stands for update , D stands for delete.These are the four most basic operations in database systems. CRUD operations are the backbone for interacting with any database.There are many databases where we can store data, some of which I will mention below:
Oracle 12c, MySQL, Microsoft SQLServer, PostgreSQL, MongoDB, MariaDB, DB2, SAP HANA. Today I will discuss MySQL and mongoDB.

MySQL : MySQL is an open-source relational database management system.
MySQL is one of the most popular databases for web-based applications. It's free for the user.Here SQL means Structured Query Language. SQL is a language programmers use to create, update ,read and delete from the relational database, and also control user access to the database. If a user wants to use a MySQL database  s/he has to set up XAMPP, without XAMPP any can not use a local server.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5lp0wb4uolv833jjanbw.png)

This is an inner look of MySQL. Here any one can create tables for storing data or information.
In SQL this process is used to Insert data.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/x4t5ecsfru8dbgiieo1l.PNG) 
Here * means get all data from the database.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/zmf2og6t7jvkuqj404n6.PNG)
This query use to update a data

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/87w152v6rz086olkhzu0.PNG)
And this one for delete data.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/idhen1650qt82ycf4vfo.PNG)

MongoDB: MongoDB is a document database.The main purpose of making MongoDB is designed to make scaling easier.MongoDB documents are similar to JSON objects. So it is easy to access the API . MongoDB has both local and cloud-hosted deployment. It is also free for all. MongoDB is a tool that can manage document-oriented information, store or retrieve information. MongoDB is a NoSQL database management program. Here NoSQL databases are  useful for working with large sets of distributed data. This is the inner look of MongoDb.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v5jswgkjgts6aqwuzc9a.PNG)
CRUD operation using MongoDB
InsertOne is used to add new data in the database.
.
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ykmhraue0t26zt06dnj2.PNG)
updateOne is used to update or change an existing data in the database.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/5fizc4195r55f27wjuog.PNG)
Find use to search a data from database 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/kq3fj3d7fj8hosp9cy5d.PNG)

DeleteOne is used to delete a specific data from a database realtion.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r1oszmgaw2kztqigkuj3.PNG)