Databases

=Relational Databases =

Definition
A database consisting of two or more separate tables, having explicitly defined relationships linked together via key fields, so that the data can be accessed in many different ways and by a range of different application programs. Advantages 1. Data integrity - Correctness of data 2. No data redundency - No data is stored several times in sepearate files 3. Data Consistency - No chance of holding e.g two addresses for the same customer as the customer will have a unique ID. 4. Data Availability - Database can be shared on a network and updated from many points. 5. Save Time inputting data. Disadvantages 1. Complex to construct

=Flatfile Databases =

Definition
A flat file database is database in which all records are stored in a single file.

 Advantages 1. Useful for simple lists such as a list of student grades. 2. A spreadsheet can be used as a flat file database.

Disadvantages 1. Data stored in one file cannot be easily linked to data stored in another file. 2. Data redundancy - Duplication / Repetition of the same data
 * Makes file larger than necessary
 * Wastes disk space
 * Makes it slow to retrieve information
 * Typing errors
 * Loss of data consistancy

3. Data Integrity (Data may be incorrect as may be changed in one place, but not another)

Exam Question:
Explain, using an example, why relational databases are more secure than flat file databases (3 marks) Relational databases are more secure than flat file databases because relational databases can have a hierarchy of passwords attached to the data whereas flat file databases can't this means that only certain people can view this data. This allows levels to be placed on the data e.g. admin only get to see certain bits of data whereas mangement have a greater access to that data. Good - 3/3 Luke

Explain the advantages and disadvantages of both flat file and relational databases (8 marks) The first advantage of relational databases over flat files is data integrity which is the correctness of the data. This means that once the data is changed in one table it is changed in all of them. Another advantage of relational databases is data consistency, which doesn't allow two sets of the same data to be stored on the database whereas a flatfile doesn't have data consistency so if the data is changed then the user would have to go into numerous files to change all of the data. The next advantage is data redundancy, which doesn't allow data to be stored several times in several files but kept in one files so that is manageable and it keeps the database efficient - a relational database prevents data redundancy which can occur in flat file databases. Data independence which keeps the data seperate from the programs that are accessing it. It is also possible to change the data without changing the application that is running it and processing it. The disadvantages of the realtional database is that they require expert users to set them up as they are much more complex than flat file databases in setting up and using them. The advantages of flat file databases are that they are easy to create and maintain and they don't need an expert user to set them up. So therefore they aare much simpler for users that do not have a great knowledge. Also, as this data is kept in only one file it is easy to find the data that you want. However the flat file suffers from data redundency which is the unneccessary duplication of the data. You have plenty of detail & the main advantages / disadvantages; well done. You could perhaps split it up so you look at advantages and disadvantages of a relational database and then those of a flat file, so the structure is really clear for the examiner, but you have all the points here. Luke

Data integrity Data independence Data Consistency Data redundancy

Files:
Presentation used in class

Exam Questions 