大象传媒

Databases

A is a persistent and organised store of data. Imagine a database storing information about customers for Vicki's Vinyl record store:

Customer IDFirst nameLast nameGenderAddressTown/City
C0AliceAndersonF13 Monk WayLisburn
C1BobBuchannonM14b Iris StreetBelfast
C2ConorCrawleyM17 Eblana StreetArmagh
C3DavinaDevlinF53 Fitzwilliam StNewry
C4EdwardEllisonM42 Park ViewEnniskillen
Customer IDC0
First nameAlice
Last nameAnderson
GenderF
Address13 Monk Way
Town/CityLisburn
Customer IDC1
First nameBob
Last nameBuchannon
GenderM
Address14b Iris Street
Town/CityBelfast
Customer IDC2
First nameConor
Last nameCrawley
GenderM
Address17 Eblana Street
Town/CityArmagh
Customer IDC3
First nameDavina
Last nameDevlin
GenderF
Address53 Fitzwilliam St
Town/CityNewry
Customer IDC4
First nameEdward
Last nameEllison
GenderM
Address42 Park View
Town/CityEnniskillen

The data has been organised into a table structure with appropriate data types. It is persistent, which means the data will be stored if the computer is turned off or there is power failure.

Flat file and relational databases

The simplest store data in a single file, where each record is identified as a new line and each row can be separated by a comma. These are known as flat file databases.

However, flat file databases have several undesirable features:

  1. Data redundancy is created within a database when the same piece of data is held in several places. This leads to records with duplicated data. And data .
  2. Data consistency means that a has only one value at a particular time/throughout the database. In a database, a change to a data value is implemented throughout the database because it is held in only one table.
  3. Data lacks , i.e. the quality by which information from the system can be trusted. Redundancy and inconsistency show that information can be out of date, can have different values in different parts of the system and can be inaccurate thus reducing data integrity.

Relational databases can be implemented to help reduce (but not remove) data redundancy, which improves data consistency and integrity.

Relational database design attempts to achieve this by modelling data into appropriate entities and creating relations (links) between the entities.