A Relational Database (RDB) is the most popular and widely used database structure. RDB is a collection of data items organized as a set of tables from which data can be accessed easily.
The core of RDB is the relationship between tables.
- One-to-One: rare case, recheck your design whenever you encounter one-to-one relationships
- One-to-Many: most common relationship, usually designed as a “Primary Key-Foreign Key” relationship
- Many-to-Many: Usually used to join tables
Normalization is a process that makes a data structure relational and has the following goals:
- Removes redundant data
- Protects the relational model
- Improves scalability and flexibility
There are 9 rules for Normalization. But the first three rules suffice for most cases.
3. First Normal Form (1NF)
Any column that occurs multiple times in a table should be removed and placed in a different table.
4. Second Normal Form (2NF)
1NF + all data not relying on a table key to uniquely identify it should be removed and placed in a different table.
5. Third Normal Form (3NF)
1NF + 2NF + eliminate all non-key data that is dependent on other non-key data in the same table should be placed in a different table.