Serksa
All Concepts
API & Backend

Database Basics

1

What is it?

A <strong>database</strong> is an organized collection of data that can be easily accessed, managed, and updated. It's where applications store information permanently.

2

Think of it like...

The Filing Cabinet

Like a filing cabinet with organized folders, a database stores data in structured tables.

🗄️

Database

Organized storage

📁

Tables

Folders for different types

📄

Records

Individual documents

3

Visual Flow

💾Database

Data storage

📊Tables

Organized structure

🔍Queries

Find data

4

Where you see it

1

Create Tables

Define structure: users table, posts table, etc.

2

Insert Data

Add new records (new user, new post)

3

Query Data

Search and retrieve specific information

4

Update Data

Modify existing records

5

Delete Data

Remove records when needed

5

Common Mistake

Wrong

Databases are only for big companies with lots of data

Correct

Every app needs a database, even small ones. Your todo app, blog, or game all need to store data somewhere. Without a database, data disappears when you close the app.

💡 Real-World Example

A simple blog database:

1

Users table: id, name, email, password

2

Posts table: id, title, content, author_id, created_at

3

Comments table: id, post_id, user_id, text

4

Query: 'Get all posts by user John' → Returns John's posts

5

Update: 'Change post title' → Modifies the record