LearnContact
Lesson 122 min read

Introduction to MySQL

Learn what MySQL is, what a relational database is, and how SQL lets you interact with structured data.

Introduction

Nearly every application — a to-do app, a social network, an online store — needs somewhere to permanently store its data. Databases are built specifically for this job, and MySQL is one of the most widely used database systems in the world.

This lesson introduces what a database actually is, what MySQL specifically provides, and the basics of SQL — the language you will use throughout this entire course to talk to it.

What You Will Learn
  • What a database is and why applications need one.
  • What MySQL is and what makes it a relational database.
  • What SQL is and how it lets you ask questions about your data.
  • How data is organized into tables of rows and columns.
  • Where MySQL is used in real-world applications.

What is a Database?

A database is an organized collection of data, stored so it can be efficiently accessed, managed, and updated. Instead of scattering data across text files, a database keeps everything structured, searchable, and safe from accidental corruption.

Organized Storage

Data is structured, not just dumped into random files.

Fast Retrieval

Databases are built to find exactly the data you need, quickly.

Data Integrity

Rules can prevent invalid or inconsistent data from ever being stored.

Multi-User Access

Many users or applications can safely read and write at the same time.

What is MySQL?

MySQL is a relational database management system (RDBMS) — software that lets you create, manage, and query relational databases. It is free, open-source, and was first released in 1995.

"Relational" means data is organized into related tables, rather than one giant unstructured blob. For example, a "students" table and a "grades" table can be linked together through a shared ID.

Simple Definition
  • MySQL stores data in structured tables made of rows and columns.
  • It uses SQL to create, read, update, and delete that data.
  • It is free, open-source, and runs on every major operating system.

What is SQL?

SQL (Structured Query Language) is the language used to communicate with a relational database — to create tables, insert data, and ask questions about that data.

SELECT name, marks
FROM students
WHERE marks >= 60;
Result
+-------+-------+
| name  | marks |
+-------+-------+
| Alex  | 78    |
| Sam   | 65    |
+-------+-------+
Note

SQL syntax is very similar across most relational databases (PostgreSQL, SQLite, SQL Server), so what you learn here transfers broadly — even though this course focuses on MySQL specifically.

Tables: Rows and Columns

Think of a table like a spreadsheet. Each column represents one piece of information (like a name or an age), and each row represents one complete record.

idnameagegrade
1Alex16A
2Sam17B
3Priya16A

This example table is named "students." Each row is one student, and each column stores one attribute about that student.

What Can MySQL Do?

Store Data Permanently

Data survives even after an application restarts or a server reboots.

Query & Filter Data

Ask precise questions like "find every order placed this month."

Link Related Data

Connect tables together, like customers to their orders.

Enforce Rules

Constraints can prevent invalid data — like a negative price — from ever being saved.

Summarize Data

Calculate totals, averages, and counts directly inside the database.

Control Access

Grant different users different levels of access to the data.

Where MySQL Is Used

WordPress

WordPress, powering a huge share of the web, stores all its content in MySQL.

Facebook

Facebook has historically used MySQL (heavily customized) at massive scale.

YouTube & Netflix

Large streaming platforms have relied on MySQL for core data storage.

E-commerce & Startups

Countless online stores and startups use MySQL as their primary database.

Example: A First Look at SQL

You do not need to understand every keyword yet — this is just a preview. Notice how SQL reads almost like a sentence.

first_query.sql
CREATE TABLE students (
    id INT PRIMARY KEY,
    name VARCHAR(50),
    marks INT
);

INSERT INTO students VALUES (1, 'Alex', 78);

SELECT * FROM students;
Result
+----+------+-------+
| id | name | marks |
+----+------+-------+
| 1  | Alex | 78    |
+----+------+-------+

Common Mistakes

Avoid These Mistakes
  • Confusing MySQL (the database software) with SQL (the language used to talk to it).
  • Assuming every database is relational — some (like MongoDB) store data very differently.
  • Skipping table design and jumping straight into complex queries.
  • Forgetting that SQL keywords are not case-sensitive, but data inside strings is.

Best Practices

  • Install MySQL and a GUI tool (covered in the next lessons) before writing real queries.
  • Practice writing SQL by hand rather than only reading examples.
  • Think in terms of tables, rows, and columns from the very start.
  • Keep the official MySQL documentation bookmarked as your reference.

Frequently Asked Questions

Is MySQL free to use?

Yes. MySQL Community Edition is free and open-source, and it is what this course uses.

Do I need to know a programming language before learning MySQL?

No. SQL is its own language, and MySQL can be learned without prior programming experience, though it pairs naturally with languages like PHP, Java, or Node.js.

Is MySQL the same as SQL?

No. SQL is the query language; MySQL is one specific database system that implements and understands SQL.

What is the difference between MySQL and a spreadsheet?

A spreadsheet is fine for small, simple data. MySQL is built for large amounts of structured data, multiple simultaneous users, enforced data rules, and fast searching.

What should I learn after this course?

After mastering MySQL fundamentals, connecting it to a backend language (PHP, Node.js, or Java, all covered later in this course) is the natural next step.

Key Takeaways

  • A database is an organized, searchable collection of data.
  • MySQL is a free, open-source relational database management system (RDBMS).
  • A relational database organizes data into tables made of rows and columns.
  • SQL is the language used to create, read, update, and delete data in MySQL.
  • MySQL powers a huge share of real-world applications, from WordPress to large-scale platforms.

Summary

MySQL is a free, open-source relational database system that stores data in structured tables and is controlled using SQL. It has been a foundational piece of web development for decades.

In this lesson, you learned what a database is, what MySQL specifically provides, how tables organize data into rows and columns, and where MySQL is used today. Next, you will explore the history behind MySQL.

Lesson 1 Completed
  • You understand what a database and an RDBMS are.
  • You know what SQL is used for.
  • You can picture how data is organized into tables.
  • You are ready to explore the history of MySQL.
Next Lesson →

History of MySQL