ISDD Database Structure N5

15

Transcript of ISDD Database Structure N5

Page 1: ISDD Database Structure N5
Page 2: ISDD Database Structure N5

Database Structure A database is a system for organising and storing data Databases are made up of one or more files Files are a collection of records, and records are made up of fields.

Page 3: ISDD Database Structure N5

Database Structure A database is a system for organising and storing data Databases are made up of one or more files Files are a collection of records, and records are made up of fields.

Page 4: ISDD Database Structure N5

Database Structure Each column represents a field

Each row represents a record

Page 5: ISDD Database Structure N5

Flat File Database A flat-file database is a database structure which consists of only a

single table.

While this is a simple way to store files, a flat-file system becomes increasingly inefficient as more data is added.

Page 6: ISDD Database Structure N5

Database AnomaliesWhilst the flat-file database might seem to be a good solution to begin with, there are actually a number of problems which are linked with this approach.

These are known as anomalies.

Page 7: ISDD Database Structure N5

Database AnomaliesAnomaly 1:Mr O'Hara is a teacher in the English department and he teaches in English Room 4. Add Mr O'Hara's details to the database.

Page 8: ISDD Database Structure N5

Database AnomaliesAnomaly 1:Mr O'Hara is a teacher in the English department and he teaches in English Room 4. Add Mr O'Hara's details to the database.

This is known as an insertion anomaly.

Page 9: ISDD Database Structure N5

Database AnomaliesAnomaly 2:The art department is reorganising rooms and Miss Dewar is moving from Art Room 3 to Art Room 1. Update the database to show this.

Page 10: ISDD Database Structure N5

Database AnomaliesAnomaly 2:The art department is reorganising rooms and Miss Dewar is moving from Art Room 3 to Art Room 1. Update the database to show this.

This is known as an update anomaly.

Page 11: ISDD Database Structure N5

Database AnomaliesAnomaly 3:John McGinn has left school. His record should be deleted from the database.

Page 12: ISDD Database Structure N5

Database AnomaliesAnomaly 3:John McGinn has left school. His record should be deleted from the database.

This is known as a deletion anomaly.

Page 13: ISDD Database Structure N5

Relational DatabasesA better approach to database design is known as the Relational Database Model. In the relational model, the data is stored in multiple tables or relations.

However, in this example we have lost the link between pupil and their tutor teacher.

Page 14: ISDD Database Structure N5

Relational DatabasesWe create linked tables by introducing keys.

Page 15: ISDD Database Structure N5

Relational DatabasesWe create linked tables by introducing keys.