FastAPI - Beginner to Pro / Setting Up the Database

SQL Database Introduction

🗄️ What Is a Database?

A database is an organized collection of structured data stored in a computer system.

Databases are designed to store, manage, and retrieve data efficiently, making them a critical part of modern applications.

Databases allow data to be:

  • Easily accessed

  • Modified when needed

  • Controlled and organized efficiently

Many databases use Structured Query Language (SQL) to read, write, and modify data.


📦 Understanding Data

Data represents information about real-world objects.

For example, a user in an application may have the following structured data:

  • Name

  • Age

  • Email

  • Password

This structured information is stored and managed inside a database.


🏗️ Database Management Systems (DBMS)

Databases are managed using Database Management Systems (DBMS).

Common DBMS include:

  • SQLite – Lightweight, file-based, ideal for development

  • MySQL – Popular, widely adopted, reliable for production

  • PostgreSQL – Powerful, enterprise-ready, scalable

Each DBMS provides tools to create, manage, and interact with databases efficiently.


🧠 What Is SQL?

SQL (Structured Query Language)—pronounced “See-Quel”—is the standard language for interacting with relational databases.

You can think of a database like an Excel spreadsheet:

  • Tables are like sheets

  • Columns are like fields

  • Rows are individual records

SQL allows us to manipulate and query database records.


🔄 What Can SQL Do?

SQL is primarily used to perform four key operations, known as CRUD:

  • Create data

  • Read data

  • Update data

  • Delete data

These CRUD operations closely correspond to HTTP methods in APIs, making SQL a natural fit for backend development.