![]() ![]() First Normal Form (1NF)įor a table to be in the First Normal Form, it should follow the following 4 rules: Let's cover all the Database Normal forms one by one with some basic examples to help you understand the DBMS normal forms. Normalization rules are divided into the following normal forms: Primary Key and Non-key attributesīefore we move on to learn different Normal Forms in DBMS, let's first understand what is a primary key and what are non-key attributes.Īs you can see in the table above, the student_id column is a primary key because using the student_id value we can uniquely identify each row of data, hence the remaining columns then become the non-key attributes. And use the branch_id in the student table to reference the branch. The solution for all the three anomalies described above is to keep the student information and the branch information in two different tables. So never in DBMS, we should keep two different entities together, which in the above example is Student and branch, So if only a single student is enrolled in a branch, and that student leaves the college, or for some reason, the entry for the student is deleted, we will lose the branch information too. In our Student table, two different pieces of information are kept together, the Student information and the Branch information. This is an Updation anomaly because you need to update all the records in your table just because one piece of information got changed. X is no longer the HOD of the computer science department? In that case, all the student records will have to be updated, and if by mistake we miss any record, it will lead to data inconsistency. So in the above table, we can keep the branch information separately, and just use the branch_id in the student table, where branch_id can be used to get the branch information. If you have to repeat the same data in every row of data, it's better to keep the data separately and reference that data in each row. These scenarios are nothing but Insertion anomalies. Suppose for a new admission, until and unless a student opts for a branch, data of the student cannot be inserted, or else we will have to set the branch information as NULL.Īlso, if we have to insert data for 100 students of the same branch, then the branch information will be repeated for all those 100 students. students.Īs we can see, data for the fields branch, hod(Head of Department), and office_tel are repeated for the students who are in the same branch in the college, this is Data Redundancy. In the table above, we have data for four Computer Sci. To understand these anomalies let us take an example of a Student table. Insertion, Updation, and Deletion Anomalies are very frequent if the database is not normalized. If a table is not properly normalized and has data redundancy(repetition) then it will not only eat up extra memory space but will also make it difficult for you to handle and update the data in the database, without losing data. If you want you can skip the video, as the concept is covered in this tutorial as well - Normalization in DBMS (YouTube Video). ![]() This video will give you a good overview of Database Normalization. Storage optimization although that is not an issue these days because Database storage is cheap.īreaking down large tables into smaller tables with relationships, so it makes the database structure more scalable and adaptable.Įnsuring data dependencies make sense i.e. Normalization helps in keeping data consistent by storing the data in one table and referencing it everywhere else. Why we need Normalization in DBMS?Įliminating redundant(useless) data, therefore handling data integrity, because if data is repeated it increases the chances of inconsistent data. It is a multi-step process that puts data into tabular form, removes duplicate data, and set up the relationship between tables. Normalization in DBMS is a technique using which you can organize the data in the database tables so that:Ī large set of data is structured into a bunch of smaller tables,Īnd the tables have a proper relationship between them.ĭBMS Normalization is a systematic approach to decompose (break down) tables to eliminate data redundancy(repetition) and undesirable characteristics like Insertion anomaly in DBMS, Update anomaly in DBMS, and Delete anomaly in DBMS. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |