3.2.2
Managing Databases
Entity Relationship Modelling
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.
Entity relationship modelling
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.
One to one
One to one
- A one to one relationship is when one entity is linked to one other entity.
One to many
One to many
- A one to many relationship is when one entity is linked to several entitities.
Many to many
Many to many
- A many to many relationship is when several entities are linked to several other entitities.
Managing Data
Managing Data
When populating a database with data, we need to consider the methods of data capture, management and exchange.
Capturing data
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.
Selecting data
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.
Database management
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.
Exchanging data
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.
Exchanging data cont.
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.
Referential integrity
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
Normalisation to 3NF
Normalising data is a process which makes a database more efficient to run and store.
Stages of normalisation
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.
Unnormalised data
Unnormalised data
- Before going to 1NF, a flat-file table structure is put together.
- We refer to this stage as unnormalised data or 0NF.
First normal form
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.
Second normal form
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.
Third normal form
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.
1Components of a Computer
1.1Structure & Function of the Processor
1.2Types of Processors
2Software & Software Development
2.1Systems Software
2.2Applications Generation
2.3Software Development
3Exchanging Data
3.1Compression, Encryption & Hashing
3.3Networks
4Data Types, Data Structures & Algorithms
4.1Data Types
5Legal, Moral, Cultural & Ethical Issues
5.1Computing Related Legislation
6Elements of Computational Thinking
6.1Thinking Abstractly
6.2Thinking Procedurally
6.3Thinking Logically
7Problem Solving & Programming
7.1Programming Techniques
7.2Programming Construction
Jump to other topics
1Components of a Computer
1.1Structure & Function of the Processor
1.2Types of Processors
2Software & Software Development
2.1Systems Software
2.2Applications Generation
2.3Software Development
3Exchanging Data
3.1Compression, Encryption & Hashing
3.3Networks
4Data Types, Data Structures & Algorithms
4.1Data Types
5Legal, Moral, Cultural & Ethical Issues
5.1Computing Related Legislation
6Elements of Computational Thinking
6.1Thinking Abstractly
6.2Thinking Procedurally
6.3Thinking Logically
7Problem Solving & Programming
7.1Programming Techniques
7.2Programming Construction
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