Knowledge (XXG)

Third normal form

Source đź“ť

112:
doctors.) The negative outcome of such a design is that a doctor's number will be duplicated in the database if they have multiple patients, thus increasing both the chance of input error and the cost and risk of updating that number should it change (compared to a third normal form-compliant data model that only stores a doctor's number once on a doctor table).
694:
via query, reporting, and dashboards were often facilitated by a different type of data model that provided pre-calculated analysis such as trend lines, period-to-date calculations (month-to-date, quarter-to-date, year-to-date), cumulative calculations, basic statistics (average, standard deviation,
383:
attributes are dependent on keys. Prime attributes (which are keys or parts of keys) must not be functionally dependent at all; they each represent a fact about the key in the sense of providing part or all of the key itself. (This rule applies only to functionally dependent attributes, as applying
478:
The breach of 3NF occurs because the non-prime attribute (Winner's date of birth) is transitively dependent on the candidate key {Tournament, Year} through the non-prime attribute Winner. The fact that Winner's date of birth is functionally dependent on Winner makes the table vulnerable to logical
111:
A hypothetical example of a failure to meet third normal form would be a hospital database having a table of patients which included a column for the telephone number of their doctor. (The phone number is dependent on the doctor, rather than the patient, thus would be better stored in a table of
744:
Codd, E. F. "Further Normalization of the Data Base Relational Model". (Presented at Courant Computer Science Symposia Series 6, "Data Base Systems", New York City, May 24–25, 1971.) IBM Research Report RJ909 (August 31, 1971). Republished in Randall J. Rustin (ed.),
661:(i.e. one where X does not contain A) and let A be a non-prime attribute. Also let Y be a candidate key of R. Then Y → X. Therefore, A is not transitively dependent on Y if there is a functional dependency X → Y iff X is a superkey of R. 345:
to give true evidence in a court of law, was given by Bill Kent: " non-key must provide a fact about the key, the whole key, and nothing but the key". A common variation supplements this definition with the oath "so help me
379:: "Each attribute must represent a fact about the key, the whole key, and nothing but the key." The 3NF version of the definition is weaker than Date's BCNF variation, as the former is concerned only with ensuring that 224:
A 3NF definition that is equivalent to Codd's, but expressed differently, was given by Carlo Zaniolo in 1982. This definition states that a table is in 3NF if and only if for each of its functional dependencies
669:
Most 3NF tables are free of update, insertion, and deletion anomalies. Certain types of 3NF tables, rarely met with in practice, are affected by such anomalies; these are tables which either fall short of
361:; further requiring that non-key attributes be dependent on "nothing but the key" ensures 3NF. While this phrase is a useful mnemonic, the fact that it only mentions a single key means it defines some 602:
Update anomalies cannot occur in these tables, because unlike before, Winner is now a candidate key in the second table, thus allowing only one value for Date of birth for each Winner.
96:, except the case of functional dependency whose right hand side is a prime attribute (an attribute which is strictly included into some key) . Codd defined this as a relation in 657:
The definition of 3NF offered by Carlo Zaniolo in 1982, and given above, can be shown to be equivalent to the Codd definition in the following way: Let X → A be a nontrivial
375:
refers to Kent's summary as "an intuitively attractive characterization" of 3NF and notes that with slight adaptation it may serve as a definition of the slightly stronger
1095: 649:
functional dependencies, then create a relation for every candidate key of the original relation which was not already a subset of a relation in the decomposition.
305:
To rephrase Zaniolo's definition more simply, the relation is in 3NF if and only if for every non-trivial functional dependency X → Y, X is a superkey or
475:{Tournament, Year} is a minimal set of attributes guaranteed to uniquely identify a row. That is, {Tournament, Year} is a candidate key for the table. 1006: 890: 115:
Codd later realized that 3NF did not eliminate all undesirable data anomalies and developed a stronger version to address this in 1974, known as
828:
The author of a 1989 book on database management credits one of his students with coming up with the "so help me Codd" addendum. Diehr, George.
384:
it to all attributes would implicitly prohibit composite candidate keys, since each part of any such key would violate the "whole key" clause.)
690:
While 3NF was ideal for machine processing, the segmented nature of the data model can be difficult to intuitively consume by a human user.
1088: 1181: 1015: 630:, in the sense that every functional dependency on R can be derived from the functional dependencies that hold on the projections R 479:
inconsistencies, as there is nothing to stop the same person from being shown with different dates of birth on different records.
1236: 1081: 869: 313:
consists of prime attributes. Zaniolo's definition gives a clear sense of the difference between 3NF and the more stringent
933: 1201: 1145: 671: 376: 314: 116: 1139: 362: 1067: 1049: 627: 282: 1191: 1163: 1104: 716: 132: 128: 46: 471:
Because each row in the table needs to tell us who won a particular Tournament in a particular Year, the
1186: 883: 707:. Hadley Wickham's "tidy data" framework is 3NF, with "the constraints framed in statistical language". 658: 611: 178: 174: 105: 89: 54: 482:
In order to express the same facts without violating 3NF, it is necessary to split the table into two:
1043: 789: 696: 372: 151: 77: 42: 610:
A relation can always be decomposed in third normal form, that is, the relation R is rewritten to
1151: 1127: 675: 358: 155: 97: 27:
Normalizing a database design to reduce the duplication of data and ensure referential integrity
1206: 1169: 1157: 1121: 1115: 1011: 982: 865: 679: 354: 85: 972: 81: 66: 1217: 1196: 854: 646: 639: 342: 58: 38: 793: 143: 1038: 695:
moving averages) and previous period comparisons (year ago, month ago, week ago) e.g.
1230: 472: 365:
to satisfy the 2nd and 3rd normal forms. Both 2NF and 3NF are concerned equally with
347: 298: 170: 101: 93: 62: 776:
Zaniolo, Carlo. "A New Normal Form for the Design of Relational Database Schemata".
858: 704: 623: 50: 626:
is equal to the original relation. Further, this decomposition does not lose any
136: 986: 735:
Codd, E. F. "Further Normalization of the Data Base Relational Model", p. 34.
691: 357:; requiring that non-key attributes be dependent on "the whole key" ensures 977: 341:
An approximation of Codd's definition of 3NF, paralleling the traditional
84:) is said to meet third normal form standards if all the attributes (e.g. 1073: 1061: 267: 161:
No non-prime attribute of R is transitively dependent on the primary key.
70: 960: 317:(BCNF). BCNF simply eliminates the third alternative ("Every element of 1023: 908:"Comparisons between Data Warehouse modelling techniques – Roelant Vos" 812: 700: 387:
An example of a table that fails to meet the requirements of 3NF is:
1055: 907: 674:(BCNF) or, if they meet BCNF, fall short of the higher normal forms 645:
To decompose a relation into 3NF from 2NF, break the table into the
813:"A Simple Guide to Five Normal Forms in Relational Database Theory" 17: 1024:
A Simple Guide to Five Normal Forms in Relational Database Theory
862: 1077: 353:
Requiring existence of "the key" ensures that the table is in
747:
Data Base Systems: Courant Computer Science Symposia Series 6
798: 699:
and beyond dimensional modeling, flattening of stars via
638:. What is more, such a decomposition can be computed in 1027:, Communications of the ACM, vol. 26, pp. 120–126 653:
Equivalence of the Codd and Zaniolo definitions of 3NF
369:
candidate keys of a table and not just any one key.
49:
principles to reduce the duplication of data, avoid
861:: Foundations of Databases. Addison-Wesley, 1995. 233:, at least one of the following conditions holds: 100:where all non-prime attributes depend only on the 169:of R is an attribute that does not belong to any 65:, an English computer scientist who invented the 1062:Description of the database normalization basics 686:Considerations for use in reporting environments 142:Codd's definition states that a table is in 3NF 1089: 8: 1096: 1082: 1074: 1050:An Introduction to Database Normalization 976: 845:(7th ed.) (Addison Wesley, 2000), p. 379. 556: 488: 389: 728: 363:necessary but not sufficient conditions 146:both of the following conditions hold: 1068:Third Normal Form with Simple Examples 1056:A tutorial on the first 3 normal forms 7: 934:"Hadoop Data Modeling Lessons | EMC" 778:ACM Transactions on Database Systems 260:is a trivial functional dependency), 1010:(8th ed.). Addison-Wesley Longman. 1007:An Introduction to Database Systems 843:An Introduction to Database Systems 25: 127:The third normal form (3NF) is a 938:InFocus Blog | Dell EMC Services 896:from the original on 2023-03-15. 832:(Scott, Foresman, 1989), p. 331. 135:. 3NF was originally defined by 965:Journal of Statistical Software 819:26 (2), Feb. 1983, pp. 120–125. 213:(where it is not the case that 123:Definition of third normal form 959:Wickham, Hadley (2014-09-12). 1: 1044:Database Normalization Basics 863:http://webdam.inria.fr/Alice/ 325:, the set difference between 61:. It was defined in 1971 by 1202:Lossless join decomposition 1046:by Mike Chapple (About.com) 333:, is a prime attribute."). 197:) indirectly, by virtue of 1253: 1140:Elementary key normal form 1039:Litt's Tips: Normalization 884:"Decomposition, 3NF, BCNF" 802:(5th edition), p. 276–277. 555: 487: 1215: 1179: 1111: 817:Communications of the ACM 289:(i.e., each attribute in 799:Database System Concepts 665:Normalization beyond 3NF 558:Winner's dates of birth 409:Winner's date of birth 1237:Database normalization 1192:Multivalued dependency 1164:Domain-key normal form 1146:Boyce–Codd normal form 1105:Database normalization 749:. Prentice-Hall, 1972. 717:Attribute-value system 672:Boyce–Codd normal form 377:Boyce–Codd normal form 315:Boyce–Codd normal form 285:between Y and X, is a 133:database normalization 117:Boyce–Codd normal form 90:functionally dependent 1187:Functional dependency 978:10.18637/jss.v059.i10 780:7(3), September 1982. 628:functional dependency 337:"Nothing but the key" 297:is contained in some 179:functional dependency 175:transitive dependency 106:transitive dependency 55:referential integrity 1004:Date, C. J. (1999), 790:Abraham Silberschatz 767:Codd, p. 45–46. 697:dimensional modeling 543:Indiana Invitational 510:Indiana Invitational 456:Indiana Invitational 414:Indiana Invitational 43:relational databases 41:design approach for 940:. 23 September 2014 857:, Richard B. Hull, 830:Database Management 559: 491: 490:Tournament winners 392: 391:Tournament winners 167:non-prime attribute 1152:Fourth normal form 1128:Second normal form 1070:by exploreDatabase 914:. 12 February 2013 872:. Theorem 11.2.14. 592:28 September 1968 557: 532:Des Moines Masters 489: 442:Des Moines Masters 437:28 September 1968 390: 156:second normal form 104:and do not have a 98:second normal form 1224: 1223: 1207:Temporal database 1170:Sixth normal form 1158:Fifth normal form 1134:Third normal form 1122:First normal form 1116:Unnormalized form 841:Date, C. J. 758:Codd, p. 43. 600: 599: 596: 595: 553: 552: 469: 468: 273:every element of 108:on another key. 78:database relation 31:Third normal form 16:(Redirected from 1244: 1098: 1091: 1084: 1075: 1052:by Mike Hillyer. 1021:Kent, W. (1983) 991: 990: 980: 956: 950: 949: 947: 945: 930: 924: 923: 921: 919: 904: 898: 897: 895: 888: 879: 873: 852: 846: 839: 833: 826: 820: 809: 803: 796:, S. Sudarshan, 787: 781: 774: 768: 765: 759: 756: 750: 742: 736: 733: 560: 492: 485: 484: 393: 154:R (table) is in 86:database columns 67:relational model 21: 1252: 1251: 1247: 1246: 1245: 1243: 1242: 1241: 1227: 1226: 1225: 1220: 1218:Denormalization 1211: 1197:Join dependency 1175: 1107: 1102: 1058:by Fred Coulson 1035: 1030: 1000: 998:Further reading 995: 994: 958: 957: 953: 943: 941: 932: 931: 927: 917: 915: 906: 905: 901: 893: 886: 882:Hammo, Bassam. 881: 880: 876: 855:Serge Abiteboul 853: 849: 840: 836: 827: 823: 811:Kent, William. 810: 806: 788: 784: 775: 771: 766: 762: 757: 753: 743: 739: 734: 730: 725: 713: 688: 667: 655: 647:canonical cover 640:polynomial time 637: 633: 621: 617: 608: 549:Chip Masterson 538:Al Fredrickson 516:Al Fredrickson 339: 287:prime attribute 248:is a subset of 137:E. F. Codd 125: 59:data management 57:, and simplify 39:database schema 28: 23: 22: 15: 12: 11: 5: 1250: 1248: 1240: 1239: 1229: 1228: 1222: 1221: 1216: 1213: 1212: 1210: 1209: 1204: 1199: 1194: 1189: 1180: 1177: 1176: 1174: 1173: 1167: 1161: 1155: 1149: 1148:(3.5NF / BCNF) 1143: 1137: 1131: 1125: 1119: 1112: 1109: 1108: 1103: 1101: 1100: 1093: 1086: 1078: 1072: 1071: 1065: 1059: 1053: 1047: 1041: 1034: 1033:External links 1031: 1029: 1028: 1019: 1001: 999: 996: 993: 992: 951: 925: 899: 874: 847: 834: 821: 804: 794:Henry F. Korth 782: 769: 760: 751: 737: 727: 726: 724: 721: 720: 719: 712: 709: 687: 684: 666: 663: 654: 651: 635: 631: 619: 615: 607: 604: 598: 597: 594: 593: 590: 586: 585: 582: 581:Al Fredrickson 578: 577: 576:14 March 1977 574: 573:Chip Masterson 570: 569: 568:Date of birth 566: 554: 551: 550: 547: 544: 540: 539: 536: 533: 529: 528: 527:Bob Albertson 525: 522: 521:Cleveland Open 518: 517: 514: 511: 507: 506: 503: 498: 467: 466: 465:14 March 1977 463: 462:Chip Masterson 460: 457: 453: 452: 449: 448:Al Fredrickson 446: 443: 439: 438: 435: 432: 429: 428:Cleveland Open 425: 424: 421: 420:Al Fredrickson 418: 415: 411: 410: 407: 404: 399: 338: 335: 303: 302: 283:set difference 271: 261: 163: 162: 159: 144:if and only if 124: 121: 102:candidate keys 82:database table 51:data anomalies 26: 24: 14: 13: 10: 9: 6: 4: 3: 2: 1249: 1238: 1235: 1234: 1232: 1219: 1214: 1208: 1205: 1203: 1200: 1198: 1195: 1193: 1190: 1188: 1185: 1184: 1183: 1178: 1171: 1168: 1165: 1162: 1159: 1156: 1153: 1150: 1147: 1144: 1141: 1138: 1135: 1132: 1129: 1126: 1123: 1120: 1117: 1114: 1113: 1110: 1106: 1099: 1094: 1092: 1087: 1085: 1080: 1079: 1076: 1069: 1066: 1063: 1060: 1057: 1054: 1051: 1048: 1045: 1042: 1040: 1037: 1036: 1032: 1026: 1025: 1020: 1017: 1016:0-321-19784-4 1013: 1009: 1008: 1003: 1002: 997: 988: 984: 979: 974: 970: 966: 962: 955: 952: 939: 935: 929: 926: 913: 909: 903: 900: 892: 885: 878: 875: 871: 867: 864: 860: 856: 851: 848: 844: 838: 835: 831: 825: 822: 818: 814: 808: 805: 801: 800: 795: 791: 786: 783: 779: 773: 770: 764: 761: 755: 752: 748: 741: 738: 732: 729: 722: 718: 715: 714: 710: 708: 706: 702: 698: 693: 685: 683: 681: 677: 673: 664: 662: 660: 652: 650: 648: 643: 641: 629: 625: 613: 605: 603: 591: 589:Bob Albertson 588: 587: 584:21 July 1975 583: 580: 579: 575: 572: 571: 567: 565: 562: 561: 548: 545: 542: 541: 537: 534: 531: 530: 526: 523: 520: 519: 515: 512: 509: 508: 504: 502: 499: 497: 494: 493: 486: 483: 480: 476: 474: 473:composite key 464: 461: 458: 455: 454: 451:21 July 1975 450: 447: 444: 441: 440: 436: 434:Bob Albertson 433: 430: 427: 426: 423:21 July 1975 422: 419: 416: 413: 412: 408: 405: 403: 400: 398: 395: 394: 388: 385: 382: 378: 374: 370: 368: 364: 360: 356: 351: 349: 344: 336: 334: 332: 328: 324: 321: \  320: 316: 312: 309: \  308: 300: 299:candidate key 296: 293: \  292: 288: 284: 280: 277: \  276: 272: 269: 265: 262: 259: 255: 251: 247: 243: 239: 236: 235: 234: 232: 228: 222: 220: 216: 212: 208: 204: 200: 196: 192: 188: 184: 180: 176: 172: 171:candidate key 168: 160: 157: 153: 149: 148: 147: 145: 140: 138: 134: 130: 122: 120: 118: 113: 109: 107: 103: 99: 95: 91: 87: 83: 79: 74: 72: 68: 64: 63:Edgar F. Codd 60: 56: 52: 48: 44: 40: 36: 32: 19: 1182:Dependencies 1160:(5NF / PJNF) 1133: 1064:by Microsoft 1022: 1005: 968: 964: 954: 942:. Retrieved 937: 928: 916:. Retrieved 911: 902: 877: 859:Victor Vianu 850: 842: 837: 829: 824: 816: 807: 797: 785: 777: 772: 763: 754: 746: 740: 731: 705:data science 689: 668: 656: 644: 609: 601: 563: 500: 495: 481: 477: 470: 401: 396: 386: 380: 371: 366: 352: 340: 330: 326: 322: 318: 310: 306: 304: 294: 290: 286: 278: 274: 263: 257: 253: 249: 245: 241: 237: 230: 226: 223: 218: 214: 210: 206: 202: 198: 194: 190: 186: 182: 166: 164: 141: 126: 114: 110: 92:on solely a 75: 73:management. 34: 30: 29: 961:"Tidy Data" 912:Roelant Vos 612:projections 606:Computation 193:determines 129:normal form 47:normalizing 45:which uses 870:0201537710 723:References 496:Tournament 397:Tournament 373:Chris Date 252:, meaning 244:(that is, 139:in 1971. 987:1548-7660 692:Analytics 240:contains 181:in which 53:, ensure 1231:Category 971:: 1–23. 891:Archived 711:See also 634:, ..., R 618:, ..., R 268:superkey 173:of R. A 152:relation 131:used in 80:(e.g. a 71:database 944:5 March 918:5 March 505:Winner 381:non-key 37:) is a 1166:(DKNF) 1142:(EKNF) 1014:  985:  868:  701:Hadoop 622:whose 564:Winner 406:Winner 281:, the 158:(2NF). 88:) are 1172:(6NF) 1154:(4NF) 1136:(3NF) 1130:(2NF) 1124:(1NF) 1118:(UNF) 894:(PDF) 887:(PDF) 266:is a 177:is a 1012:ISBN 983:ISSN 946:2018 920:2018 866:ISBN 703:and 624:join 546:1999 535:1999 524:1999 513:1998 501:Year 459:1999 445:1999 431:1999 417:1998 402:Year 348:Codd 343:oath 329:and 205:and 150:The 69:for 973:doi 680:5NF 678:or 676:4NF 367:all 359:2NF 355:1NF 350:". 221:). 94:key 35:3NF 18:3NF 1233:: 981:. 969:59 967:. 963:. 936:. 910:. 889:. 815:, 792:, 682:. 659:FD 642:. 301:). 256:→ 229:→ 217:→ 209:→ 201:→ 185:→ 165:A 119:. 76:A 1097:e 1090:t 1083:v 1018:. 989:. 975:: 948:. 922:. 636:n 632:1 620:n 616:1 614:R 331:X 327:Y 323:X 319:Y 311:X 307:Y 295:X 291:Y 279:X 275:Y 270:, 264:X 258:Y 254:X 250:X 246:Y 242:Y 238:X 231:Y 227:X 219:X 215:Y 211:Z 207:Y 203:Y 199:X 195:Z 191:X 189:( 187:Z 183:X 33:( 20:)

Index

3NF
database schema
relational databases
normalizing
data anomalies
referential integrity
data management
Edgar F. Codd
relational model
database
database relation
database table
database columns
functionally dependent
key
second normal form
candidate keys
transitive dependency
Boyce–Codd normal form
normal form
database normalization
E. F. Codd
if and only if
relation
second normal form
candidate key
transitive dependency
functional dependency
superkey
set difference

Text is available under the Creative Commons Attribution-ShareAlike License. Additional terms may apply.

↑