logo

Introduction to Databases

A database is an organized collection of structured information, or data, typically stored electronically. They are critical for applications handling user accounts, product inventories, and dynamic content.

Why Learn This?

Permanent Persistence

Without databases, any data written on a website resets when the server restarts. Databases allow you to save and retain information securely.

Relational (SQL)

Systems like PostgreSQL and MySQL organize data into strict tables that relate mathematically (e.g. A User has many Posts).

Document (NoSQL)

Systems like MongoDB store data in flexible, JSON-like document shapes that don’t require a rigid schema, ideal for rapid iterations.

How to Access Databases

Databases run on standalone server ports. You write queries generated by your backend application to push and pull data from them continuously.

A Standard SQL Query Example:
schema.sql
1-- Find all users who subscribed this month 2 SELECT id, username, email 3 FROM users 4 WHERE status = 'active' 5 ORDER BY created_at DESC;

Official Learning Resources