# Database Overview

## Database (DB)

A database is a **structured collection of data** that is organized and stored in a way that allows for efficient retrieval, management, and manipulation of the data.

## Database Management System (DBMS)

A Database Management System (DBMS) is a software that provides an interface for managing databases, either with direct user actions via its CLI/GUI, or with standardized interface used by other parts of the application.

Core functionalities of DBMS include ensuring **data integrity, security, and concurrency control**.

## Relational Database

A relational database is a type of database that organizes data into **tables**, consisting of rows and columns. Structured Query Language (SQL) is used for querying and manipulating data.

It follows the relational model, which defines relationships between tables using **keys**.

| ![Image 1](https://2807223923-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTUqAJOgHs57S8lmqdxRV%2Fuploads%2Fgit-blob-6c3d0ee5f268b386e49a42bacf21bbd993f4d1a6%2Fpostgresql.png?alt=media) | ![Image 2](https://2807223923-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTUqAJOgHs57S8lmqdxRV%2Fuploads%2Fgit-blob-d831fa4c9c5a4faea675d7f6c16cd6409f8b0f5f%2Fmysql.png?alt=media) | ![Image 3](https://2807223923-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTUqAJOgHs57S8lmqdxRV%2Fuploads%2Fgit-blob-7f4a12e0cce9563b662df96e04b5e22497feddb1%2Fsqlite.png?alt=media) |
| ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |

## Non-Relational Database

A non-relational database, also known as NoSQL (Not Only SQL) provides flexible schema.

Data is arranged in various formats, such as **key-value pairs, documents, graphs, or wide-column stores**. Non-relational databases are designed to handle large amounts of unstructured or semi-structured data efficiently.

| ![Image 1](https://2807223923-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTUqAJOgHs57S8lmqdxRV%2Fuploads%2Fgit-blob-ec5fd53b46616ec1334deab8e75a663db868b661%2Fcassandra.png?alt=media) | ![Image 2](https://2807223923-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTUqAJOgHs57S8lmqdxRV%2Fuploads%2Fgit-blob-176562ca62b93fe41682989d32ba17782c188594%2Fmongodb.png?alt=media) | ![Image 3](https://2807223923-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FTUqAJOgHs57S8lmqdxRV%2Fuploads%2Fgit-blob-5eecf35c88760580636463a4a7564e52e8ac3465%2Fredis.png?alt=media) |
| --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |

## In Case You Are Wondering...

Each RDBMS speaks a different SQL.

They are just dialects of SQL with slightly different syntax and extensions. They all adhere to the *ANSI SQL standard* (commonly referred but not accurate) so that under most cases, same SQL statements can be used across all RDBMS without too much modification.

Non-relational DBMS are typically very different in the way they are store data, as you see from the above examples. Hence, there isn’t a standard for NoSQL.
