Presentation is loading. Please wait.

Presentation is loading. Please wait.

Normalisation FORM RULES 1NF 2NF 3NF. What is normalisation of data? The process of Normalisation organises your database to: Reduce or minimise redundant.

Similar presentations


Presentation on theme: "Normalisation FORM RULES 1NF 2NF 3NF. What is normalisation of data? The process of Normalisation organises your database to: Reduce or minimise redundant."— Presentation transcript:

1 Normalisation FORM RULES 1NF 2NF 3NF

2 What is normalisation of data? The process of Normalisation organises your database to: Reduce or minimise redundant data. Promote Data Integrity. Ensure that related data are stored in a given table.

3 Rules called ‘Normal Forms’ have been developed to allow a database to be designed with different levels of efficiency. They are : Unnormalised Form0NF First Normal Form1NF Second Normal Form2NF Third Normal Form3NF Fourth Normal Form4NF Fifth Normal Form5NF

4 1NF – First Normal Form Break each field down to the smallest meaningful value

5 2NF – Second Normal Form 2NF attempts to reduce the amount of redundant data in a table by extracting it, placing it in new table(s) and creating relationships between those tables.

6 3NF – Third Normal Form Remove fields that do not relate to, or provide a fact about, the primary key

7 Student #First NameSurnameTelephone 1Telephone 2 1456987PeterAdam03 945978940401569784 Student #First NameSurnameFull Name 1456987PeterAdamPeter Adam 1NF (First Normal Form) 1)No column with repeated of similar data. Examples of repeated or similar data:

8 2) Each data item cannot be broken down any further or must be ‘atomic’ data, without losing its meaning. Example of data that cannot be broken down further or ‘atomic’ data: An ID number (student id number, licence number) Stock Code Number PN10081 A telephone number A First Name or Surname A Description (This computer is broken)

9 Examples of data that can still be broken down or is NOT ‘atomic’: A full name: “Christopher Jones” Can be broken down to: A complete address: 62 Southern Rd, West Heidelberg, VIC, 3081 Can be broken down to… ?: Student #First NameSurname 1456987ChristopherJones Student #Full Name 1456987Christopher Jones Student #First NameSurnameAddress 1456987ChristopherJones62 Southern Rd, West Heidelberg, VIC, 3081

10 1)Each row is unique (no duplicate records). 2) Each Field has a unique name.

11  Repeated or Redundant Fields?  Data Atomic?  Primary Key?  Each Field Name Unique?  Each row (record) Unique? 1NF?

12 2NF (Second Normal Form) 1) Must be in 1NF already 2) Non-key attributes must depend on the (so no redundant data is being stored) TIP: Attribute = Field of data Attribute = Field of data

13 Example: This is not in 2NF: What data is redundant? Or repeated? What data is not dependant on Course (key- attribute)? Course #Semester Amount of Student Places Available Course Name IT0012012 -150Multimedia IT0012012 -250Multimedia IT0022012 -1100Programming IT0022012 -2100Programming IT0032012 -180Databases IT0032012 -280Databases IT0042012 -1100OO Programming

14 If we create a new Table called Course #, such as below: We have now eliminated the redundancy of data. Course #Course Name IT001Multimedia IT002Programming IT003Databases IT004OO Programming

15 Example: Here we have a lot of repetitive data. And City and State rely on Post Code, not necessarily the key-attribute (Customer #). Customer #First NameSurnameCityState Post Code 789LucyJonesMelbourneVIC3081 790EmmaMooreMelbourneVIC3081 791PeterSmithGeelongVIC3052 792KurtDavisGeelongVIC3052 CityState Post Code MelbourneVIC3081 MelbourneVIC3122 GeelongVIC3052 GeelongVIC3052

16 Post CodeCityState 3081MelbourneVIC If we create a new table called Post Codes Post CodeCityState 3081MelbourneVIC 3052GeelongVIC Customer #First NameSurnamePost Code 789LucyJones3081 +

17  1NF?  Dependant on Key-attributes?  No repeated data? 2NF?

18 3NF (Third Normal Form) 1) Must be in 2NF 2) There are no non-key attributes that depend on another non-key attribute. In other words: Data in your table must depend on the primary key only.

19 Remove fields that do not relate to, or provide a fact about, the primary key In this case Supplier Phone does not relate to the Primary Key (Product #) but relates to Supplier. Product #DescriptionCostSupplier Name Supplier Phone 00221Ring$5RingsRUs0482987623

20 So in creating a new Table, Supplier: We are eliminating redundancy of information in our Product table, which will now look like this: And have a relationship with: Supplier #Supplier Name Supplier Phone 1RingsRUs0482987623 Product #DescriptionCostSupplier # 00221Ring$51 Supplier #Supplier Phone 10482987623

21  2NF?  All fields rely on only the Primary key? 3NF?

22


Download ppt "Normalisation FORM RULES 1NF 2NF 3NF. What is normalisation of data? The process of Normalisation organises your database to: Reduce or minimise redundant."

Similar presentations


Ads by Google