Overview of Databases
Learn about databases and their types.
Imagine our online store is doing well and we're receiving many orders from our customers. To manage all these orders efficiently, we need to keep track of product availability, customer details, suppliers, and sales records. Handling all this information manually would be chaotic. This is where databases come in—they allow us to store, organize, and retrieve data efficiently.
Let's explore databases, their types, and how relational databases differ from non-relational databases. Understanding these concepts will provide a solid foundation for using SQL to manage and retrieve data effectively. We'll aim to:
Understand what a database is and why it is essential.
Identify different types of databases.
Differentiate between relational and non-relational databases.
What is a database?
A database is an organized collection of data that allows users to store, retrieve, and manage information efficiently. It acts as a structured storage system where data is categorized and indexed for easy access.
Why are databases important?
Let's look at some key reasons why databases are essential:
Databases allow structured storage of data, making retrieval faster and easier.
They help maintain accurate and consistent data.
Multiple users can access and modify data simultaneously.
Databases provide user authentication and role-based access to protect sensitive information.
Types of databases
Databases come in various forms, each suited for different use cases. The two primary types are:
Relational database
Non-relational database
Let's explore each of them one by one.
Relational databases (SQL-based)
Relational databases store data in structured tables with predefined relationships between them. SQL (Structured Query Language) manages and queries data in relational databases. Common relational databases include MySQL, PostgreSQL, Oracle Database, and Microsoft SQL Server.
Let’s look at some characteristics of the relational databases:
Data is organized in tables with rows and columns.
Tables can be linked using primary keys and foreign keys.
Data consistency and integrity are enforced through constraints.
An example of a relational database can be the OnlineStore
database that we’ll use in this course. It has multiple tables like Products
, Customers
, Orders
, and Suppliers
. These tables relate to each other, ensuring organized and structured data storage. The Customers
table has the following tabular structure:
Get hands-on with 1400+ tech skills courses.