SQL Fundamentals
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 you can find what you need quickly and reliably. While a simple spreadsheet can hold a list of names or products, a database is built to handle much more complex and larger sets of data efficiently.
Imagine an online store. It needs to keep track of customers, products, and orders. All this information—customer names, product prices, order dates—lives in a database. When you search for a product or look up your order history, the website is quickly pulling that information from its database.
Databases bring structure to data, making it easy to store, manage, and retrieve information at scale.
Relational Databases
The most common type of database is the relational database. The name comes from its core concept: storing data in tables that are related to one another.
In our online store example, we might have one table for customer information and another table for all the orders they’ve placed. A relational database allows us to link these two tables together. We could, for instance, connect a specific customer in the Customers table to all of their orders in the Orders table. This organization prevents us from having to duplicate customer information for every single order, keeping the data clean and efficient.
The software that lets us create, update, and manage these databases is called a Relational Database Management System, or RDBMS.
The Building Blocks
Relational databases have a simple, consistent structure. All data is organized into tables, which are made up of columns and rows.
table
noun
A collection of related data held in a structured format within a database, consisting of columns and rows.
A table focuses on one specific type of item, like 'Customers' or 'Products'.
column
noun
A vertical set of data values of a particular type, one for each row of a table. Also known as a field or attribute.
Columns define the specific pieces of information you want to store in a table. For a Products table, you might have columns for ProductID, ProductName, and Price.
row
noun
A single entry or record in a table, consisting of a value for each column.
Each row is a complete record for a single item. One row in the Products table would hold the ID, name, and price for one specific product.
This structure is the foundation of all relational databases. The most popular RDBMS software you'll encounter includes MySQL, PostgreSQL, Microsoft SQL Server, and Oracle Database. While they have their differences, they all use this same fundamental table-based structure.
Now that you understand the basic structure, you're ready to learn how to interact with the data inside these tables.