Presentation is loading. Please wait.

Presentation is loading. Please wait.

Flat Files Relational Databases

Similar presentations


Presentation on theme: "Flat Files Relational Databases"— Presentation transcript:

1 Flat Files Relational Databases

2 Flat Files Databases which contain only 1 table of data. Advantages
Simple & easy to use, can be set up quickly (good for novice users) Fine if only want to use for storage & retrieval of data (e.g. student records) Problems Data redundancy (duplication) Data integrity (correctness of data) Inefficient (may have to enter data twice – wastes time)

3 Relational Databases “A large collection of data items stored in tables containing links between the tables so that the data can be accessed in many different ways and by a range of different applications programs”. Data held in 2 or more tables Links between tables Advantages Data can extracted to give meaningful information (reports) Avoids problems of flat files (data consistency, redundancy, integrity & independence). Improves security Disadvantages Greater knowledge needed to set up Must be set up carefully to avoid errors

4 4 Data Key terms Data Consistency Data Redundancy Data Integrity
Using relational database helps to ensure consistency across tables & files (e.g…) Data Redundancy Data which is repeated unnecessarily (far less in relational database) Data Integrity Correctness of the data. Steps should be taken to check data entry training, verification, validation, maintenance Data independence Data is independent of application used to process it. Can create new applications as necessary & still use data.

5 Primary & Foreign Keys Primary key
Field used to uniquely define a particular record or line / row in table (normally numeric) E.g. Membership number, product number, employee number etc. Foreign key Field of one table also primary key of another Establish relationships between tables

6 Normalisation Improves design of database
3 stage process (1st, 2nd & 3rd normal form) Why normalise? Minimises duplication Eliminates redundancy Ensures data integrity Allows flexible extraction

7 Distributed Databases
A single database under control of a DBMS (Database Management System) where storage devices are not attached to a common processor. Instead data is stored in storage devices attached to multiple computers located across network.

8 Distributed Databases
Advantages Improved performance (complex data mining in less time) If local server fails, data remains accessible Disadvantages Complex to install & maintain Increased security risk (files transferred across networks) Relies on data communication Could get inconsistencies due to number of users

9 Questions Explain, using an example, why normalisation is used when designing a relational database. (4 marks) A hospital uses a relational database management system for storing patient records. Staff and patients are allocated to wards. (i) Explain what is meant by a relational database. [2] (ii) One table in this database could be WARD (WardId, NumofBeds, StaffId ) with WardId being the primary key and StaffId the foreign key. Give two other suitable tables you could expect to see in this database, identifying any primary or foreign keys. [6] (iii) Explain why relational databases are more secure than a flat file approach for storing patient records. [2] (b) Hospitals use distributed medical databases. Describe the problems that could arise when using such distributed medical databases. [4]


Download ppt "Flat Files Relational Databases"

Similar presentations


Ads by Google