
No data redundancy – in a well-designed relational database there should be no duplicated data (other than the key field).What are the advantages of relational databases? The simplified diagram shows how the key fields in each table are used to link each entity. This loan table would not need to store details of the book, the author or the borrower, just the links to such data in the other tables.

A further table would hold details of the library members who could borrow books.Īnother further table would also be needed to store the details of the actual loans, such as the lending data and the return date. The book table would only have details about the book itself while details of the author would be stored in a separate table. Entities such as book, author and library members would all have separate but linked tables.Ī diagram of a simplified relational database showing the tables linked by the key fields The tables in a relational database are linked by the key field in one table being added as a foreign key in another table to form a relationship between the entities.Ĭonsider a library database. For example, an NHS number, a passport number, a vehicle registration, a booking reference, a flight number etc. The key field (sometimes called a primary key) is used to store an attribute that makes that particular entity entry in the database unique. What is a key field and how are they used to link database tables? In general, entities can have attributes but attributes have no smaller parts. In a database, each attribute corresponds to a separate field in the database. Attributes – Name, gender, address, DOB, qualifications, job title etc. Attributes – Flight No., aircraft type, departure/arrival date/time, destination etc. Attributes – ISBN number, author, category etc. What is an attribute and how are they related to database tables?Īttributes are the facts, aspects, properties, or details about an entity.

In a relational database, each entity corresponds to a separate table in the database. What is an entity and how are they related to database tables?Īn entity is a “real-world thing” about which data can be held in a database. The key difference between a relational database and a flat-file database is that in a relational database the data is grouped into entities and stored in multiple linked tables. Data inconsistency – errors in the values or format of data that should be identical.Data redundancy – the needless duplication of data.SUMMARY: The problems with flat-file database systems are that they can lead to:

By duplicating data across records in flat files we introduce a risk of data inconsistency. Such data inconsistency occurs when large amounts of duplicate data have to be entered into a database. The process of unnecessarily duplicating data is called data redundancy.ĭata inconsistency: Note the data entry errors highlighted in the above table. This makes the size of the database unnecessarily large and the process of data entry cumbersome and repetitive. The second row represents a different test but requires us to duplicate the information (forename, surname, age) about the patient. The first row represents the Pulse reading for patient “Kit Kline”. Duplicated data – highlights show typing errors made during data entryĭata redundancy: The limitations of trying to represent this information in a single file quickly become apparent.
