أنشئ حسابًا أو سجّل الدخول للانضمام إلى مجتمعك المهني.
example:
Assume I have these field information should be have in the database for my employee system in place.
empCode empName mgrCode deptNo deptName deptLoc deptNatureOfWork empBrand empSalary
If i simply create one table with all those fields, I duplicate much data over there which is inefficient against normalization principle and cause redundancy.
if you split above fields into3 different tables called as Employee table, Department Table, Brand Table.
Now my Employee table contains only the below fields with empCode as Primary Key, and deptNo is foreign key referencing to Department table and empBrand is the foreign key referencing to Brand Table
empCode empName mgrCode deptNo empBrand
Now my Department table contains the below fields making my deptNo is the primary key
deptNo deptName deptLoc deptNatureOfWork, any other only related to department.
Now my Brand table contains the below fields making my brand is primary key here and the same is referring to the employee table empBrand which is a foreign key referrencing to this field.
brand SalaryForThisBrand DesgForThisBrand, etc like brand related only
now you can understand unnecessary unwanted repeat of the data is avoided there by no data redundancy. Hope I made it clear with the above example. Thanks.