No history yet

Introduction to Databases

The Digital Filing Cabinet

Think about all the information you interact with daily. Your contacts list, your favorite songs on a music app, your shopping history on an e-commerce site. Where does all that data live? It's stored in a database.

A database is essentially a highly organized digital filing cabinet. It's a system for collecting and storing data in a way that makes it easy to manage, update, and retrieve. Without databases, finding a specific piece of information would be like searching for a single piece of paper in a massive, messy warehouse.

The core purpose of a database is to bring structure to data, turning a chaotic pile of information into an orderly, searchable resource.

From banking systems that track your transactions to social media platforms that remember your friends and posts, databases are the invisible backbone of modern technology. They allow applications to handle huge amounts of information quickly and reliably.

Organizing with Relationships

There are different ways to organize a database, but the most common by far is the relational model. A relational database stores data in a simple, intuitive format: tables.

The "relational" part means the tables can be linked, or related, to each other. Imagine you have a table for Customers and another for Orders. A relational database lets you connect a specific customer to all the orders they've placed. This creates a powerful web of connected information.

Lesson image

This structure is similar to a collection of spreadsheets, where each sheet is dedicated to a specific category of information, but with the added ability to create links between them. Let's break down the core components.

Tables, Rows, and Columns

Every relational database is built from three fundamental parts.

Table

noun

A collection of related data held in a structured format within a database. It consists of columns and rows.

A table, sometimes called a relation, is where you store information about a single subject. For example, you might have a table for Employees, one for Products, and another for Sales.

Each table is made up of columns and rows.

Columns define the attributes or pieces of information you want to store about your subject. For an Employees table, your columns might be EmployeeID, FirstName, LastName, and HireDate.

Rows are the actual records. Each row represents a single item, like one specific employee with their own unique ID, name, and hire date.

Here’s what a simple Employees table might look like:

EmployeeIDFirstNameLastNameHireDate
101AnaRossi2022-03-15
102BenCarter2021-07-22
103ClaraJones2023-01-10

In this example, EmployeeID, FirstName, LastName, and HireDate are the columns. Each line of data, like the one for Ana Rossi, is a row.

The Database Manager

So, we have this organized structure of tables, rows, and columns. But how do we actually interact with it? How do we add new data, search for something, or make an update?

That's the job of a Relational Database Management System, or RDBMS. An RDBMS is the software that acts as an intermediary between you and the database. It handles all the complex work of storing, managing, and retrieving data.

You've likely heard of popular RDBMS software like MySQL, PostgreSQL, Microsoft SQL Server, and Oracle. These systems all use a standard language to communicate: SQL, or Structured Query Language. In the next sections, you'll learn how to use SQL to talk to these systems and work with the data inside them.

Before moving on, let's review these foundational concepts.

Quiz Questions 1/5

What is the primary function of a database?

Quiz Questions 2/5

In a relational database, data is organized into a collection of what?