← Back to MySQL Course | Chapter 1: Introduction & Basics | Lesson 1 of 8

MySQL RDBMS

A relational database organizes data into structured tables of rows and columns, and an RDBMS is the software, like MySQL, that creates and manages those tables and the relationships between them.

What is a Relational Database?

A relational database organizes data into structured tables made up of rows and columns, and a relational database management system, or RDBMS, is the software that creates, stores, and lets you query those tables using SQL.

Example: What is a Relational Database?

sql
CREATE TABLE users (id INT PRIMARY KEY, name VARCHAR(50));
SELECT * FROM users;

Tables, Rows, and Columns

Every table in a relational database is made up of columns, which define what kind of data can be stored (like a name or an email address), and rows, where each row represents one complete record made up of a value for every column.

Example: Tables, Rows, and Columns

sql
CREATE TABLE contacts (
  name VARCHAR(50),
  email VARCHAR(100)
);
INSERT INTO contacts VALUES ('Priya', '[email protected]');

Primary Keys and Relationships

A primary key uniquely identifies each row in a table, and a foreign key in one table can reference a primary key in another, which is how a relational database models relationships between different kinds of data, like customers and their orders.

Example: Primary Keys and Relationships

sql
CREATE TABLE authors (id INT PRIMARY KEY, name VARCHAR(50));
CREATE TABLE books (
  id INT PRIMARY KEY,
  title VARCHAR(100),
  author_id INT,
  FOREIGN KEY (author_id) REFERENCES authors(id)
);

RDBMS vs Other Database Types

An RDBMS enforces a fixed table structure and strict relationships between tables, which differs from non-relational (NoSQL) databases that often store flexible, schema-less documents without predefined columns or formal relationships.

Example: RDBMS vs Other Database Types

sql
CREATE TABLE orders (
  id INT PRIMARY KEY,
  customer_id INT NOT NULL,
  total DECIMAL(10,2) NOT NULL
);

Popular RDBMS Systems

MySQL is one of several popular RDBMS products alongside PostgreSQL, Microsoft SQL Server, and Oracle Database, and while each implements the same core relational concepts, their exact SQL syntax and available features can differ.

Example: Popular RDBMS Systems

sql
-- MySQL, PostgreSQL, SQL Server, and Oracle all implement core relational concepts
SELECT VERSION();

⚠️ This is MySQL-specific syntax. It cannot run in the browser editor. Practice this on your local MySQL installation.

🔒

Chapter Quiz — Complete all 8 topics to unlock

0/8 topics done

Complete these topics first:

Login to run this code

C/C++/Java/PHP execution requires a free account. Your code is saved — you'll land right back in the editor after logging in.