No history yet

Introduction to Databases

What Is a Database?

Think of a database as a highly organized digital filing cabinet. It’s a system for storing and managing information so that it can be easily accessed, updated, and retrieved. Instead of paper files, it holds digital data, and instead of alphabetical dividers, it uses a logical structure to keep everything in order.

Nearly every app and website you use relies on a database. Your social media feed, the inventory of an online store, your bank account balance, and even the contacts on your phone are all powered by databases working behind the scenes. They are essential for handling large amounts of information efficiently and reliably.

Lesson image

Without databases, finding a specific piece of information would be like searching for a single book in a library with no catalog and all the books piled on the floor. Databases provide the structure and tools needed to query, sort, and filter data in an instant, making them a cornerstone of modern technology.

The Relational Model

The most common type of database is the relational database. The “relational” part simply means the data is organized into tables, and these tables can be linked, or related, to one another based on shared data. The software used to create, manage, and interact with these databases is called a Relational Database Management System, or RDBMS. Examples include MySQL, PostgreSQL, and SQL Server.

The structure of a relational database is intuitive because it mirrors how we often organize information in the real world: in tables with rows and columns.

A relational database is essentially a collection of interconnected tables.

Tables, Rows, and Columns

The three fundamental building blocks of a relational database are tables, columns, and rows. Understanding these concepts is the first step to understanding how data is managed.

Table

noun

A collection of related data organized in a grid-like format of rows and columns. Each table in a database typically stores information about one type of thing, like 'Customers' or 'Products'.

Column

noun

A vertical field in a table that contains all the information of a specific type. Each column has a name and a specific data type, like 'FirstName' (text) or 'OrderDate' (date).

Row

noun

A single record in a table, representing one complete item. It is a horizontal entry containing the data for each column.

Let’s visualize this with a simple Customers table from an online store.

In this example:

  • The entire grid is the Customers table.
  • CustomerID, FirstName, LastName, and Email are the columns.
  • The line with David Smith's information is a single row.

By organizing data this way, we can quickly find all customers with the last name "Smith" or get the email address for customer 103. This simple, powerful structure is why relational databases are used to manage the vast majority of the world's structured data.

Quiz Questions 1/5

Based on the filing cabinet analogy, what is the primary purpose of a database?

Quiz Questions 2/5

True or False: The data in a relational database is organized into tables, and these tables can be linked to one another.

This foundational knowledge of databases, tables, rows, and columns is the first step. Next, you'll learn how to communicate with a database to perform tasks like retrieving and manipulating this data.