• Wrong document? Swap it for free
  • Written by students who passed
  • Immediately available after payment
  • Read online or as PDF
Sell
Where do you study
Your language
Document preview thumbnail
Preview 2 out of 7 pages
Other

Common Database Operations: CRUD and Beyond

Document preview thumbnail
Preview 2 out of 7 pages

This document explains common database operations, including CRUD (Create, Read, Update, Delete), and other essential tasks like indexing and joins. It covers how these operations are used to manage and manipulate data in both relational and NoSQL databases.

Content preview

Common Database Operations
Database operations can be broadly categorized into two main groups: Data
Definition Operations and Data Manipulation Operations. Let’s break them
down:



1. Data Definition Operations
These operations define and modify the structure of the database. They include:

a. CREATE

 The CREATE operation is used to define a new database object, such as a
table, view, index, or database itself.
 SQL Example:

CREATE TABLE Employees (
ID INT PRIMARY KEY,
Name VARCHAR(100),
Age INT,
Department VARCHAR(50)
);

b. ALTER

 The ALTER command modifies an existing database object, such as adding,
deleting, or modifying columns in a table.
 SQL Example:

ALTER TABLE Employees ADD COLUMN Salary DECIMAL(10, 2);

c. DROP

 The DROP operation removes a database object, such as a table, index, or
view, and permanently deletes its data.
 SQL Example:

, DROP TABLE Employees;

d. TRUNCATE

 The TRUNCATE operation removes all rows from a table but does not
remove the table structure itself. It is faster than DELETE as it does not log
individual row deletions.
 SQL Example:

TRUNCATE TABLE Employees;


2. Data Manipulation Operations
These operations deal with the actual data inside the database and include:

a. SELECT

 The SELECT statement is used to retrieve data from one or more tables.
 SQL Example:

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

b. INSERT

 The INSERT operation adds new records (rows) into a table.
 SQL Example:

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

c. UPDATE

 The UPDATE operation modifies existing records in a table.
 SQL Example:

UPDATE Employees
SET Age = 31
WHERE ID = 1;

Document information

Uploaded on
January 29, 2025
Number of pages
7
Written in
2024/2025
Type
Other
Person
Unknown
$5.49

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Sold
0
Followers
0
Items
252
Last sold
-




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

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions