100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CRUD Operations: Managing Data in Databases $4.79
Add to cart

Other

CRUD Operations: Managing Data in Databases

 0 purchase

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.

Preview 2 out of 5  pages

  • January 30, 2025
  • 5
  • 2024/2025
  • Other
  • Unknown
All documents for this subject (249)
avatar-seller
rileyclover179
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 } }
);

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller rileyclover179. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $4.79. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

66456 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 15 years now

Start selling
$4.79
  • (0)
Add to cart
Added