CRUD Operations In SQL Database

Başak Tüysüz
Towards Dev
Published in
2 min readAug 23, 2023

--

Hello everyone, today I will provide you with clear examples to help you understand the fundamental CRUD operations and how they are utilized within SQL.

What is CRUD?

CRUD is an acronym for operations used when working with databases. Create, Read, Update, and Delete operations are simple operations we use when using a database.

How To Apply CRUD Operations

As I mentioned, These operations are Create, Read, Update, and Delete. Firstly, we must use the create functions to add an item to a database. Then we use read operations to access all the items we created. We can also use update and delete to change the value of the item we want or to delete the item.

First, let’s assume we have a database table named “Users”. This table contains the users’ name, e-mail address, and age.

Create (INSERT INTO)

To add a new user:

INSERT INTO Users (name, email, age) VALUES ('Başak Tüysüz', 'basaktuysuz1@gmail.com', 20);

Read (SELECT)

To list users over a certain age:

SELECT * FROM Users WHERE age > 18;

Update (SET)

To update a user’s age

UPDATE Users SET age = 30 WHERE name = 'Başak Tüysüz';

Delete (DELETE )

To delete a specific user:

DELETE FROM Users WHERE email = 'basaktuysuz1@gmail.com';

These basic CRUD operations are commonly used in database management and software development. These processes are used specifically to meet the data management requirements of an application.

In conclusion, understanding CRUD operations (Create, Read, Update, Delete) is essential for managing data effectively in relational databases

Hope this helps!! See you in my next story.

Başak Tüysüz

--

--