MySQL RDBMS
MySQL as an RDBMS (Relational Database Management System)
MySQL is a Relational Database Management System (RDBMS), which means it stores data in a structured format using tables, and allows relationships between those tables. It uses SQL (Structured Query Language) to manage and manipulate the database.
๐ What is an RDBMS?
An RDBMS (Relational Database Management System) is software used to create, manage, and operate relational databases. It organizes data in tables containing rows and columns, and relationships can be created using keys.
Example Table:
| ID | Name | Age | City |
|---|
Each row = a record
Each column = a field
๐ Why MySQL is an RDBMS?
MySQL qualifies as an RDBMS because it:
โ Stores data in multiple related tables
โ Uses SQL for data manipulation
โ Supports Primary Keys, Foreign Keys, and Constraints
โ Ensures data integrity and relationships
๐ Key Concepts in MySQL RDBMS
๐น 1. Database
A collection of tables and related data.
๐น 2. Table
A structured format to store data in rows and columns.
๐น 3. Row (Record)
A single data entry in a table.
๐น 4. Column (Field)
Defines the type of data stored (e.g., name, age).
๐ Keys in MySQL RDBMS
| Key Type | Purpose |
|---|---|
| Primary Key | Uniquely identifies each record in a table |
| Foreign Key | Creates a relationship between two tables |
| Unique Key | Prevents duplicate values |
| Composite Key | Combination of two or more columns to uniquely identify a record |
Example:
Students Table
| student_id (PK) | name |
|---|---|
| 1 | Neha |
| 2 | Rahul |
Courses Table
| course_id | student_id (FK) | course_name |
|---|---|---|
| 101 | 1 | PHP |
| 102 | 2 | MySQL |
Here, student_id connects both tables โ Relationship.
๐งช MySQL Supports ACID Properties
ACID ensures reliable and accurate transactions:
| Property | Meaning |
|---|---|
| A โ Atomicity | Complete transaction success or failure |
| C โ Consistency | Ensures valid and correct data |
| I โ Isolation | Prevents transaction conflicts |
| D โ Durability | Saves committed data permanently |
โ SQL Operations in RDBMS
| Category | Commands | Purpose |
|---|---|---|
| DDL (Data Definition Language) | CREATE, ALTER, DROP | Structure control |
| DML (Data Manipulation Language) | INSERT, UPDATE, DELETE | Modify data |
| DQL (Query Language) | SELECT | Retrieve data |
| DCL (Control Language) | GRANT, REVOKE | Permissions |
| TCL (Transaction Control) | COMMIT, ROLLBACK | Transaction management |
๐งฉ Advantages of MySQL RDBMS
-
๐ Fast and reliable
-
๐ Secure with user access control
-
๐ง Maintains data accuracy and integrity
-
๐ Supports large multi-user applications
-
๐พ Backup and recovery support
๐ Example Basic Commands
๐ Summary
MySQL is a powerful Relational Database Management System that stores data in a structured table format and allows relationships using keys. It ensures data integrity, supports transactions, and is widely used in web applications, software systems, and enterprise-level solutions.
