Presentation is loading. Please wait.

Presentation is loading. Please wait.

DAT702 Normal Forms Normalization Rules. Normal Forms Normal Forms, also called Normalization rules, are basically processes or steps taken to allow for.

Similar presentations


Presentation on theme: "DAT702 Normal Forms Normalization Rules. Normal Forms Normal Forms, also called Normalization rules, are basically processes or steps taken to allow for."— Presentation transcript:

1 DAT702 Normal Forms Normalization Rules

2 Normal Forms Normal Forms, also called Normalization rules, are basically processes or steps taken to allow for the efficient creation of Relational databases. Following these rules lead an administrator towards a set of tables that: allow data to be organized in an efficient manner reduce disk space requirements for data storage minimize or eliminate redundant data greatly reduce the chance of data entry errors provide programmers with a stable data platform from which to create efficient applications

3 The Rules We will concentrate on the first three rules as they should be enough to create proper data tables for most circumstances. Rule 1:If a table contains repeating groups (fields) of data then these groups (fields) should be removed and placed into another table (child/foreign) as a single field. Rule 2:If a table contains records that have repeating data (redundant) then create a new table. Rule 3:All fields within a table must relate directly to and describe the Primary Key.

4 Form 0 (Flat File) Notice the repeating groups of data (Course1, Course2). Adding course data limited to number of current fields Violates all 3 Normal Form rules Table: Students Student# Name Course1 CourseDesc1 Course2 CourseDesc2 12345 Fred DAT702 Database Admin CDD301 DataComm 12346 Jane OPS400 AS/400 OPS440 Unix Admin

5 Correcting with Rule #1 Table: Students StudentNo Name Course1 CourseDesc1 Course2 CourseDesc2 12345 Fred DAT702 Database Admin DCN386 DataComm 12346 Jane OPS400 AS/400 OPS435 Unix Admin StudentNo Name CourseCode CourseDesc 12345 Fred DAT702 Database Admin 12345 Fred DCN386 DataComm 12456 Jane OPS400 AS/400 12456 Jane OPS435 Unix Admin Table: Students Converted to 1st Normal Form Better: But still violates Rules 2 & 3

6 Correcting with Rule #2 StudentNo(P) Name 12345 Fred 12456 Jane Table: Students Converted to 2 rd Normal Form Table: Courses Primary – Foreign Key Relationship StudentNo Name CourseCode CourseDesc 12345 Fred DAT702 Database Admin 12345 Fred DCN386 DataComm 12456 Jane OPS400 AS/400 12456 Jane OPS435 Unix Admin Rule 3 violation CourseCode(P) StudentNo(F) CourseDesc DAT702 12345 Database Admin DCN386 12345 DataComm OPS400 12456 AS/400 OPS435 12456 Unix Admin

7 Correcting with Rule #3 StudentNo(P) Name 12345 Fred 12456 Jane Table: Students Converted to 3 rd Normal Form Table: Stud_Courses Primary – Foreign Key Relationship StudentNo(P) Name 12345 Fred 12456 Jane CourseCode(F) StudentNo(F) DAT702 12345 DCN386 12345 OPS400 12456 OPS435 12456 Table: Students Table: Courses CourseCode(P) Description DAT702 Database Admin DCN386 DataComm OPS400 AS/400 Table: Courses CourseCode(P) StudentNo(F) CourseDesc DAT702 12345 Database Admin DCN386 12345 DataComm OPS400 12456 AS/400 OPS435 12456 Unix Admin


Download ppt "DAT702 Normal Forms Normalization Rules. Normal Forms Normal Forms, also called Normalization rules, are basically processes or steps taken to allow for."

Similar presentations


Ads by Google