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.
![Illustrative background for Entity relationship modelling](https://image-v2.cdn.app.senecalearning.com/2020-08/f48d9430-5a4c-4ad8-8ad9-64c4900b7b1d/cabinet-drawer,h_400,q_80,w_640.jpg)
![Illustrative background for Entity relationship modelling ?? "content](https://image-v2.cdn.app.senecalearning.com/2020-08/f48d9430-5a4c-4ad8-8ad9-64c4900b7b1d/cabinet-drawer,h_400,q_80,w_640.jpg)
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.
![Illustrative background for One to one](https://image-v2.cdn.app.senecalearning.com/2020-08/c6ff76aa-bc97-455d-b6ad-b6ab8bb39bf0/Screenshot%202020-08-21%20at%2015.39.14-min,h_400,q_80,w_640.png)
![Illustrative background for One to one ?? "content](https://image-v2.cdn.app.senecalearning.com/2020-08/c6ff76aa-bc97-455d-b6ad-b6ab8bb39bf0/Screenshot%202020-08-21%20at%2015.39.14-min,h_400,q_80,w_640.png)
One to one
One to one
- A one to one relationship is when one entity is linked to one other entity.
![Illustrative background for One to many](https://image-v2.cdn.app.senecalearning.com/2020-08/15687ab0-e63c-4f84-917e-cc79239abe55/Screenshot%202020-08-21%20at%2015.22.28-min,h_400,q_80,w_640.png)
![Illustrative background for One to many ?? "content](https://image-v2.cdn.app.senecalearning.com/2020-08/15687ab0-e63c-4f84-917e-cc79239abe55/Screenshot%202020-08-21%20at%2015.22.28-min,h_400,q_80,w_640.png)
One to many
One to many
- A one to many relationship is when one entity is linked to several entitities.
![Illustrative background for Many to many](https://image-v2.cdn.app.senecalearning.com/2020-08/7b51faf7-29b7-468d-b04c-225d25177868/Screenshot%202020-08-21%20at%2015.22.30-min,h_400,q_80,w_640.png)
![Illustrative background for Many to many ?? "content](https://image-v2.cdn.app.senecalearning.com/2020-08/7b51faf7-29b7-468d-b04c-225d25177868/Screenshot%202020-08-21%20at%2015.22.30-min,h_400,q_80,w_640.png)
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.
![Illustrative background for Capturing data](https://image-v2.cdn.app.senecalearning.com/2020-08/d09cb18c-985a-4ec0-9b79-23a0f118cc61/form-3723115_1920,h_400,q_80,w_640.jpg)
![Illustrative background for Capturing data ?? "content](https://image-v2.cdn.app.senecalearning.com/2020-08/d09cb18c-985a-4ec0-9b79-23a0f118cc61/form-3723115_1920,h_400,q_80,w_640.jpg)
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.
![Illustrative background for Selecting data](https://image-v2.cdn.app.senecalearning.com/courseImages/biology/5.2.1 - The nervous system/cctv-watching,h_400,q_80,w_640.jpg)
![Illustrative background for Selecting data ?? "content](https://image-v2.cdn.app.senecalearning.com/courseImages/biology/5.2.1 - The nervous system/cctv-watching,h_400,q_80,w_640.jpg)
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.
![Illustrative background for Database management](https://image-v2.cdn.app.senecalearning.com/2018-08/c3ff06e1-dc31-4e18-9b55-fad2424fa82f/ethics-committee-cctv-guard,h_400,q_80,w_640.jpg)
![Illustrative background for Database management ?? "content](https://image-v2.cdn.app.senecalearning.com/2018-08/c3ff06e1-dc31-4e18-9b55-fad2424fa82f/ethics-committee-cctv-guard,h_400,q_80,w_640.jpg)
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.
![Illustrative background for Exchanging data](https://image-v2.cdn.app.senecalearning.com/2018-03/4aed5c8e-7015-4aff-baff-345e7dd5f6fa/shutterstock_527842111,h_400,q_80,w_640.jpg)
![Illustrative background for Exchanging data ?? "content](https://image-v2.cdn.app.senecalearning.com/2018-03/4aed5c8e-7015-4aff-baff-345e7dd5f6fa/shutterstock_527842111,h_400,q_80,w_640.jpg)
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.
![Illustrative background for Exchanging data cont.](https://image-v2.cdn.app.senecalearning.com/2018-04/3b6b6f94-9c0a-4941-b3ac-3e0065693718/shutterstock_571293919,h_400,q_80,w_640.jpg)
![Illustrative background for Exchanging data cont. ?? "content](https://image-v2.cdn.app.senecalearning.com/2018-04/3b6b6f94-9c0a-4941-b3ac-3e0065693718/shutterstock_571293919,h_400,q_80,w_640.jpg)
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.
![Illustrative background for Referential integrity](https://image-v2.cdn.app.senecalearning.com/2018-09/bfb8edfa-a8ed-4a04-90d7-fd208c45f0b0/vinyl-records-collection-music,h_400,q_80,w_640.jpg)
![Illustrative background for Referential integrity ?? "content](https://image-v2.cdn.app.senecalearning.com/2018-09/bfb8edfa-a8ed-4a04-90d7-fd208c45f0b0/vinyl-records-collection-music,h_400,q_80,w_640.jpg)
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.
![Illustrative background for Stages of normalisation](https://image-v2.cdn.app.senecalearning.com/2020-08/809cec4a-2783-41c0-b77e-cf8ae9972959/files-paper,h_400,q_80,w_640.jpg)
![Illustrative background for Stages of normalisation ?? "content](https://image-v2.cdn.app.senecalearning.com/2020-08/809cec4a-2783-41c0-b77e-cf8ae9972959/files-paper,h_400,q_80,w_640.jpg)
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.
![Illustrative background for Unnormalised data](https://image-v2.cdn.app.senecalearning.com/2019-04/8b72c1b3-25f1-47ad-b70d-c4c111b01084/zero-0,h_400,q_80,w_640.jpg)
![Illustrative background for Unnormalised data ?? "content](https://image-v2.cdn.app.senecalearning.com/2019-04/8b72c1b3-25f1-47ad-b70d-c4c111b01084/zero-0,h_400,q_80,w_640.jpg)
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.
![Illustrative background for First normal form](https://image-v2.cdn.app.senecalearning.com/2019-06/c1d1c9a1-ce98-4906-9b4a-763357951d14/step1-1,h_400,q_80,w_640.jpg)
![Illustrative background for First normal form ?? "content](https://image-v2.cdn.app.senecalearning.com/2019-06/c1d1c9a1-ce98-4906-9b4a-763357951d14/step1-1,h_400,q_80,w_640.jpg)
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.
![Illustrative background for Second normal form](https://image-v2.cdn.app.senecalearning.com/2019-06/2852a728-a8f9-4d18-8531-8ade4688f9ba/2-step-2,h_400,q_80,w_640.jpg)
![Illustrative background for Second normal form ?? "content](https://image-v2.cdn.app.senecalearning.com/2019-06/2852a728-a8f9-4d18-8531-8ade4688f9ba/2-step-2,h_400,q_80,w_640.jpg)
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.
![Illustrative background for Third normal form](https://image-v2.cdn.app.senecalearning.com/2020-05/a8f6cbf0-081c-420d-8b32-fd3ea8686e98/3,h_400,q_80,w_640.png)
![Illustrative background for Third normal form ?? "content](https://image-v2.cdn.app.senecalearning.com/2020-05/a8f6cbf0-081c-420d-8b32-fd3ea8686e98/3,h_400,q_80,w_640.png)
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
![Go student ad image](/en-GB/revision-notes/_next/image?url=%2Fen-GB%2Frevision-notes%2Fimages%2Fgo-student-uk-ad.jpg&w=640&q=100)
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