Hi, my name is Rodney Harris and in this lesson we will explore the concept of database normalization and demonstrate how it helps in organizing and optimizing your database. So let's get started. In relational database design, our goal is not only to store data but also to minimize errors. Database normalization is a method used to make a database organized and reliable. It aims to eliminate data redundancy and minimize anomalies. Which in turn enhances data integrity of the information stored. This process involves dividing a big table into a smaller ones that are easy to handle. And these smaller tables are connected in a logical way. The three stages of normalization that we will discuss are first normal form, second normal form, and third normal form. In first normal form, the goal is to eliminate repeating groups and identify primary keys. The end result is a functional dependency. In second normal form, the objective is to eliminate partial dependency. For third normal form, the goal is to eliminate transitive dependencies. To put it into context, let's take a look at each form and their differences. In first normal form, each table in a database should have a primary key and store only indivisible values. A database is considered in first normal form if it satisfies the following conditions. It contains only atomic values, there are no repeating groups, and columns should contain individual values without any repeating sets of data. An atomic value is a value that cannot be divided. A repeating group describes a table that contains two or more columns that are closely related. To further illustrate, let's review our first normal form example. Consider the following example. Looking at the table product table shown here, the values in the color column in the first row can be divided into red and green. Thus, table product table is not in first normal form, because the color column contains multiple values. Consider the following example. Looking at the table product table shown here, the values in the color column in the first row can be divided into red and green. Thus, the table product is not in first normal form, because the color column contains multiple values. To bring this table to the first normal form, we must split the tables into two tables, table product price, and table product color. Now our database satisfies the first normal form requirement, as the columns on each table all hold just one value. Building upon that, let's take a look at second normal form. Second normal form requires eliminating partial dependencies, where non-key attributes depend on only a part of the primary key. Table should be split to remove partial dependencies, ensuring each table represents a distinct entity. Second normal form preserves functional dependencies and improves data integrity by eliminating partial dependencies and reducing update anomalies. A database is considered in second normal form if it satisfies the following conditions. It is in first normal form, and also, all non-key attributes are fully functional and dependent on the primary key. If attribute B relies solely on attribute A and not on any part of A, we say that B is fully dependent on A, and in table that follows the second normal form, non-key attributes should not be dependent on only a portion of the primary key. If the primary key consists of a single attribute, then all non-key attributes are automatically fully dependent on the primary key. Additionally, a table that meets the requirement of first normal form and has a single primary key is automatically in second normal form. To further illustrate, we can take a look at our next example. This table has a composite primary key, customer ID and store ID. The non-key attribute is purchase location. In this case, purchase location only depends on store ID, which is only part of the primary key. Therefore, this table does not satisfy second normal form. To bring this table to second normal form, we break the tables into two tables, and now we have the following, table purchase and table store. To bring our database to second normal form, we remove the partial functional dependency that we initially had. Now, in the table, table store, the column purchase location is fully dependent on the primary key of that table, which is store ID. To further explore this concept, let's take a look at the following example. In this table, book ID determines genre ID, and genre ID determines genre type. Therefore, book ID determines genre type by way of genre ID. This shows transitive functional dependency, and this table does not satisfy third normal form. To bring this table to third normal form, we need to split the table into two as follows. Table book and table genre. Now, all non-key attributes are fully functionally dependent, only on the primary key. To bring this table to third normal form, we need to split the table into two tables as follows. Table book and table genre. Now, all non-key attributes are fully functionally dependent, only on the primary key. In table book, both genre ID and price are only dependent on book ID. And in table genre, genre type is only dependent on genre ID. As a result, this database achieves third normal form. Database normalization offers several benefits. It eliminates data redundancy, which reduces storage space and improves data consistency. It simplifies database management by breaking down complex tables into smaller and more manageable tables. In turn, it improves data integrity and reduces the likelihood of anomaly. Thank you for watching.