In our last tutorial, we learned about the second normal form and even normalized our Score table into the 2nd Normal Form.

So let's use the same example, where we have 3 tables, StudentSubject and Score.

Student Table

Subject Table

Score Table

In the Score table, we need to store some more information, which is the exam name and total marks, so let's add 2 more columns to the Score table.

Requirements for Third Normal Form


For a table to be in the third normal form,

  1. It should be in the Second Normal form.
  2. And it should not have Transitive Dependency.

What is Transitive Dependency?

With exam_name and total_marks added to our Score table, it saves more data now. Primary key for our Score table is a composite key, which means it's made up of two attributes or columns → student_id + subject_id.

Our new column exam_name depends on both student and subject. For example, a mechanical engineering student will have Workshop exam but a computer science student won't. And for some subjects you have Prctical exams and for some you don't. So we can say that exam_name is dependent on both student_id and subject_id.

And what about our second new column total_marks? Does it depend on our Score table's primary key?

Well, the column total_marks depends on exam_name as with exam type the total score changes. For example, practicals are of less marks while theory exams are of more marks.

But, exam_name is just another column in the score table. It is not a primary key or even a part of the primary key, and total_marks depends on it.

This is Transitive Dependency. When a non-prime attribute depends on other non-prime attributes rather than depending upon the prime attributes or primary key.


How to remove Transitive Dependency?

Again the solution is very simple. Take out the columns exam_name and total_marks from Score table and put them in an Exam table and use the exam_id wherever required.

Score Table: In 3rd Normal Form

The new Exam table


Advantage of removing Transtive Dependency


The advantage of removing transtive dependency is,

  • Amount of data duplication is reduced.
  • Data integrity achieved.

最新文章

  1. C#在高性能计算领域为什么性能却如此不尽人意
  2. css中图片等比例缩放
  3. SQLite手工注入方法小结
  4. IOS AFNetworking配置进IOS
  5. Bootstrap的学习以及简单运用
  6. 如何让dapper支持oracle游标呢?
  7. nginx中的try_files指令解释
  8. hadoop_集群安装_1
  9. Show All Running Processes in Linux
  10. NSDate和NSString的转换及判定是昨天,今天,明天
  11. Django内置template标签
  12. 【html5】html学习笔记1
  13. Java学习网站大全
  14. 吴恩达《机器学习》编程作业——machine-learning-ex1:线性回归
  15. iBATIS 传MAP处理方式(value是list的方式)
  16. Codeforces Round #527 (Div. 3) . F Tree with Maximum Cost
  17. Python CNN卷积神经网络代码实现
  18. [转]Python中yield的解释
  19. 07: jquery.cookie操作cookie
  20. 利用vbs设置Java环境变量

热门文章

  1. xss的高级利用
  2. OSG 中文解决方案 【转】
  3. tomcat 部署 RESTful 服务实例
  4. 第二章:ES索引说明
  5. 【Linux】debian jessie版本安装1.9 svn
  6. [Angular] Improve Server Communication in Ngrx Effects with NX Data Persistence in Angular
  7. 文本域光标操作(选、添、删、取)的jQuery扩展
  8. Out of office 模板
  9. 云计算之路-试用Azure-飞流直下三千尺:实测虚拟机磁盘IO
  10. 在单进程单线程或单进程多线程下实现log4cplus写日志并按大小切割