Presentation is loading. Please wait.

Presentation is loading. Please wait.

Database: Relational Vs Flat File. Databases - Structure Flat file database, contains only one table Relational database, contains more than one table.

Similar presentations


Presentation on theme: "Database: Relational Vs Flat File. Databases - Structure Flat file database, contains only one table Relational database, contains more than one table."— Presentation transcript:

1 Database: Relational Vs Flat File

2 Databases - Structure Flat file database, contains only one table Relational database, contains more than one table where relationships exist between the data in the table A flat file database often suffers from inefficient repetition of data. Normalisation is the process of removing this repetition by crafting relationships between tables.

3 Databases – Flat File Vs Relational Database NameDepartmentBossPhone SmithSalesBritney Lurgi9123 456 JonesSalesBritney Lurgi9123 456 LennonSalesBritney Lurgi9123 456 SadeTransportTom Brick9876 543 MasochTransportTom Brick9876 543 STAFF TABLE NameDepartment SmithSales JonesSales LennonSales SadeTransport MasochTransport DEPARTMENTS TABLE DepartmentBossPhone SalesBritney Lurgi9123 456 TransportTom Brick9876 543 + No unnecessary data repetition + Department info easily modified in one operation.

4 4 Types of Relationships, connection between data One-to-one relationship: Eg. Airline’s passenger details: passengersSeats 1 Each passenger has only one seat and each seat can be assigned to only one passenger. A record in one table is connected to only one record in a second table.

5 5 Types of Relationships, connection between data One-to-many relationship: Eg. customer details & job quotation: The one supplier can provide MANY products, but each product comes from ONE supplier. Also, eg. several workers share single telephone extensions; each extension record is related to several employee’s records.

6 6 Types of Relationships, connection between data many-to-many relationship: Eg. Student details and subjects tables: Each student studies many subjects and each subject has many students studentssubjects

7 Databases – Flat File Vs Relational School and Student Details If data was only in one table, with fields of surname, fname, school, address, phone no, fax no, etc. What would be the consequence of a school changing its phone number? A RDMS with two tables, one with student info and one with school information will avoid this duplication.

8 Databases – Flat File Vs Relational Advantages of a relational database: –reduced data redundancy – unnecessary duplication of data –improved data integrity or accuracy of data –able to access the data from separate but related tables or files very quickly and simply –allows easy querying, reporting, etc.


Download ppt "Database: Relational Vs Flat File. Databases - Structure Flat file database, contains only one table Relational database, contains more than one table."

Similar presentations


Ads by Google