What is normalization in MySQL?
Normalization means organising data in tables so that the same data is not stored in many places. It saves space and avoids mistakes when data changes.
| Form | Rule |
|---|---|
| 1NF | Every cell has one value (no lists in a cell). Every row is unique |
| 2NF | 1NF, and every column depends on the whole primary key |
| 3NF | 2NF, and columns do not depend on other non-key columns |
Example: instead of writing the course name in every student row, we keep a courses table and store only a course_id in students. If the name changes, you change it in one place. See MySQL JOINs.
Learn more about the similar topics:
| Tutorials |
|---|
| MySQL Data Types |
| MySQL CREATE DATABASE |
| MySQL USE and SHOW DATABASES |
| MySQL DROP DATABASE |
| MySQL CREATE TABLE |
| MySQL Constraints |
| MySQL DROP TABLE |
| Exercises & Assignments |
|---|
| Write a query to get all column names of a database table |
| Write a query to create a new table with the data and structure of another table |