Relational Databases – Further Study I think we’ve covered all you need to know for GCSE about relational databases I’m not aware of any practical coursework that requires you to make a relational database… …they are, however, used quite a lot by applications and web-pages to store data. The next step would be to learn about normalisation to make your database designs more efficient.
Normalisation The process of refining the structure of a database to minimise redundancy and improve integrity is called normalisation. When a database has been normalised, it is said to be in normal form. There are three normal forms: –1 st Normal Form (1NF) –2 nd Normal Form (2NF) –3 rd Normal Form (3NF)
First Normal Form A database is in first normal form if there are no repeated fields. This means that there must only be one field for each item of data you want to store. For example, a library database is not in first normal form if it has the fields book1, book2, book3, book4, book5, and book6, which all store the same information, i.e. the name of a book. First normal form makes searching easier, and is also more efficient as there wouldn't be 5 empty fields if borrowers only had one book.
Second Normal Form A database is said to be in second normal form if it: –is already in first normal form –has no fields that aren't dependent on the whole of the key i.e. all fields in the table must relate to the whole of the key field For example, if, in a library loan table, the key is a combination of book ID, borrower ID and date, then you can’t include the borrower name because that is not related to the book ID or the date.
Third Normal Form A database is in third normal form if it: –is already in second normal form –it has no non-key dependencies By non-key dependencies, we mean that there are no fields that are dependent on other fields that are not part of the key. taxi (registration, make, model, driver, licence number) The taxi table is not in 3NF because the licence number is an attribute of the driver, not of the taxi itself (you would need a separate driver table).
Normalisation Oath Here's a little tip to remember the three stages - we call it the Normalisation Oath: Each attribute is dependent on the key, the whole key, and nothing but the key! So, to get to third normal form, your non- repeating fields (first normal form) need to be dependent on the whole of the key (second normal form), and nothing other than the key (third normal form). It works for me!
Real Life / Your Project Lots of students doing projects try to contrive various versions of their databases in different normal forms – don’t bother! Don't try to start at first normal form, and then go to second normal form, and then to third. Once you understand relational databases, you will put them into third normal form straight away. The key thing is to think about what your entities (or tables) are going to be - if you pick the right ones it'll normalise itself.