100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.6 TrustPilot
logo-home
Other

CRUD Operations: Managing Data in Databases

Rating
-
Sold
-
Pages
5
Uploaded on
30-01-2025
Written in
2024/2025

This document explains CRUD operations—Create, Read, Update, and Delete—which are the fundamental actions for managing data in databases. It covers how these operations work in both SQL and NoSQL databases with examples of SQL queries and NoSQL commands.

Show more Read less

Content preview

CRUD Operations
1. Introduction to CRUD
CRUD operations are the fundamental functions for working with persistent data
in any database system, including relational (SQL) and non-relational (NoSQL)
databases. These operations correspond to the basic actions that allow users to
create, read, update, and delete data.



2. CRUD Operations Breakdown
a. CREATE (C)

 Purpose: The CREATE operation is used to insert new records into a
database.
 In SQL, the INSERT statement is used for this operation.
 In NoSQL, it varies depending on the type of database (e.g., insert() in
MongoDB).

SQL Example:

INSERT INTO Employees (ID, Name, Age, Department)
VALUES (1, 'Alice', 30, 'HR');

NoSQL Example (MongoDB):

db.employees.insertOne({
ID: 1,
Name: "Alice",
Age: 30,
Department: "HR"
});

, b. READ (R)

 Purpose: The READ operation is used to retrieve data from a database.
 In SQL, the SELECT statement is used to retrieve data.
 In NoSQL, it varies based on the database type (e.g., find() in MongoDB).

SQL Example:

SELECT Name, Age, Department
FROM Employees
WHERE Department = 'HR';

NoSQL Example (MongoDB):

db.employees.find({ Department: "HR" });


c. UPDATE (U)

 Purpose: The UPDATE operation is used to modify existing records in a
database.
 In SQL, the UPDATE statement is used for this operation.
 In NoSQL, it varies based on the database (e.g., updateOne() in MongoDB).

SQL Example:

UPDATE Employees
SET Age = 31
WHERE ID = 1;

NoSQL Example (MongoDB):

db.employees.updateOne(
{ ID: 1 },
{ $set: { Age: 31 } }
);

Document information

Uploaded on
January 30, 2025
Number of pages
5
Written in
2024/2025
Type
Other
Person
Unknown
$5.29
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
rileyclover179

Also available in package deal

Thumbnail
Package deal
Databases Complete Exam Study Pack and Q&A for Exam (23 Documents)
-
23 2025
$ 128.07 More info

Get to know the seller

Seller avatar
rileyclover179 US
View profile
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
1 year
Number of followers
0
Documents
252
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions