Normalising a databaseCreate a relational database; with a primary key; and show relationships
Relational databases use the concept of normalisation orNormal forms to define well-formed tables.1. Normal Forms (NF)ü Rules aimed at eliminating redundancy within the database;ü Each table is given a primary key;ü Usually results in more tables than would have otherwise beenü included;ü Results in independent tables that can be edited withoutü affecting other tables;ü There should be nothing common between any of the tables.
ü sets out to establish common ground between the tables so they can be related;ü A field is established that is common to each set of two tables;ü The common field is used to link the two tables.
The use of normalisation ensures that there are no problemsWhen modifying the database: ü Each table can be edited and manipulated separately; ü Relationships can be established between each table when ü data is needed from more than one table. Example ~ the school database INF • all fields related to students would become one table: Students • all fields related to teachers would become the second table: Teachers The link between Teachers and Students is Class ü A ClassCode filed will be established to allow one table to read the data in the other table; ü ClassID may be the primary key of the Students table; ü ClassID, containing the exact same data, may be the foreign key of the Teachers table; ü The list of students in the teacher s class can then be accessed through the relationship ü Established between the two tables.
When normalising a database you should achieve four goals:ü Arranging data into logical groups such that each group describes a small part of the wholeü Minimizing the amount of duplicated data stored in a databaseü Building a database in which you can access and manipulate the data quickly and efficiently without compromising the integrity of the data storageü Organising the data such that, when you modify it, you make the changes in only one place
Normalization is a complex process with many specific rules anddifferent intensity levels. In its full definition, normalization is the processof discarding repeating groups, minimizing redundancy,eliminating composite keys for partial dependency and separatingnon-key attributes.A properly normalised design allows you to:• Use storage space efficiently• Eliminate redundant data• Reduce or eliminate inconsistent data• Ease the database maintenance burdenA bad database design usually include:• Repetition of information• Inability to represent certain information• Loss of information• Difficulty to maintain information
The Process of NormalisationWhile many people find the process ofnormalisation quite confusing, this is generallybecause the formal definitions tend to be quitejargon-heavy and the basic concepts becomehidden beneath a murky surface of functionaldependencies, determinants and key attributes.
A very good way of understanding normalisationis to use an analogy of paragraphs and goodwriting.• Any basic language course teaches the fact thatall good writing uses single-theme paragraphs.That is, each paragraph should deal solely with asingle theme; a paragraph with more than onetheme should be split into separate paragraphs –one for each theme
Normalisation uses the same idea: each tableshould only contain information related to asingle concept.HINT:If it contains more than the table should be splitinto a number of smaller, related tables