3.2.2

Managing Databases

Test yourself

Entity Relationship Modelling

When you are working with a relational database and forming relationships, you are linking entities together. This is known as entity relationship modelling.

Illustrative background for Entity relationship modellingIllustrative background for Entity relationship modelling ?? "content

Entity relationship modelling

  • There are 3 main types of relationships that exist:
    • One to one.
    • One to many.
    • Many to many.
  • We can show these relationships in entity relationship diagrams.
Illustrative background for One to oneIllustrative background for One to one ?? "content

One to one

  • A one to one relationship is when one entity is linked to one other entity.
Illustrative background for One to manyIllustrative background for One to many ?? "content

One to many

  • A one to many relationship is when one entity is linked to several entitities.
Illustrative background for Many to manyIllustrative background for Many to many ?? "content

Many to many

  • A many to many relationship is when several entities are linked to several other entitities.

Managing Data

When populating a database with data, we need to consider the methods of data capture, management and exchange.

Illustrative background for Capturing dataIllustrative background for Capturing data ?? "content

Capturing data

  • Capturing data is a careful consideration that should be made and selecting what will suit your purpose best.
  • This could be a data collection form that the user fills out and then is entered by a data operator.
  • Alternatively, the data operator could enter the data with the user present.
Illustrative background for Selecting dataIllustrative background for Selecting data ?? "content

Selecting data

  • It is important to select what data needs to be stored.
  • This is determined by how important or useful the context of the data would be.
  • A CCTV video recording of people who are NOT committing crimes is not suitable to store.
Illustrative background for Database managementIllustrative background for Database management ?? "content

Database management

  • The management of the database is handled by the database management system.
  • There are lots of different database management systems (DBMS), including:
    • MySQL.
    • Oracle.
    • Bigtable.
Illustrative background for Exchanging dataIllustrative background for Exchanging data ?? "content

Exchanging data

  • The data in a database can be exchanged in different ways.
  • Traditionally this data is exchanged as a comma separated value file (.csv).
  • Other formats used are XML and JSON.
  • These formats contain markup that make the data easier to read and manipulate.
Illustrative background for Exchanging data cont.Illustrative background for Exchanging data cont. ?? "content

Exchanging data cont.

  • Schools, colleges and universities make use of EDI (Electronic Data interchange).
  • Each organisation's system can be configured to read and write to each another's database.
Illustrative background for Referential integrityIllustrative background for Referential integrity ?? "content

Referential integrity

  • Referential integrity is a key principle for relational databases.
  • Referential integrity helps to ensure no data redundancy and inaccuracies between linked tables.
  • Referential integrity prevents a record containing a foreign key from using a value that doesn’t exist in the linked table where it is a primary key.

Normalisation to 3NF

Normalising data is a process which makes a database more efficient to run and store.

Illustrative background for Stages of normalisationIllustrative background for Stages of normalisation ?? "content

Stages of normalisation

  • To ensure the most efficient database structure possible, we use a process called normalisation.
  • There are 3 stages of normalisation:
    • First normal form (1NF).
    • Second normal form (2NF).
    • Third normal form (3NF).
  • Normalisation can turn a flat-file database into a relational database.
Illustrative background for Unnormalised dataIllustrative background for Unnormalised data ?? "content

Unnormalised data

  • Before going to 1NF, a flat-file table structure is put together.
  • We refer to this stage as unnormalised data or 0NF.
Illustrative background for First normal form Illustrative background for First normal form  ?? "content

First normal form

  • For a database to be in 1NF it has to obey the following:
    • No columns with repeated or similar data.
    • Each row is unique with a primary key.
    • Each field must have a unique name.
Illustrative background for Second normal formIllustrative background for Second normal form ?? "content

Second normal form

  • For a database to be in 2NF, it has to be in 1NF.
  • Each of the fields must rely on the primary key to be unique.
Illustrative background for Third normal formIllustrative background for Third normal form ?? "content

Third normal form

  • For a database to be in 3NF, it has to be in 2NF.
  • No field should rely on another non-key field.
  • For example, a database should not store someone's age and date of birth.
  • It should store the date of birth only and the surrounding software should be used to calculate the age.

Jump to other topics

1Components of a Computer

2Software & Software Development

3Exchanging Data

4Data Types, Data Structures & Algorithms

5Legal, Moral, Cultural & Ethical Issues

6Elements of Computational Thinking

6.1Thinking Abstractly

6.2Thinking Procedurally

6.3Thinking Logically

7Problem Solving & Programming

8Algorithms

Go student ad image

Unlock your full potential with GoStudent tutoring

  • Affordable 1:1 tutoring from the comfort of your home

  • Tutors are matched to your specific learning needs

  • 30+ school subjects covered

Book a free trial lesson