Relational database, flat file, primary key, foreign key, secondary key, entity relationship modelling, normalisation and indexing.


FLAT FILE DATABASE:

A flat file database stores everything in one single table


Problems

  • data is repeated

  • can become inconsistent

  • hard to update


Advantages:

  • simple to design

  • easy to use

  • good for small datasets


Disadvantages:


  • data redundancy

  • data inconsistency

  • not scalable

  • hard to maintain


— RELATIONAL DATABASE:

A relational database splits data into multiple tables and links them together.


Advantages:

  • reduces duplication

  • more consistent data

  • easier to update

  • more scalable


Disadvantages:

  • more complex

  • requires design/planning

  • slower for simple tasks


— KEYS:


🔵 Primary Key:

a field that uniquely identifies each records


🔴 Foreign Key

a field that links to a primary key in another table


🟢 Secondary Key

a field used for searching but is not unique


— ENTITY RELATIONSHIP MODELLING

A way of designing databases visually


Example idea

Entities:

  • Student

  • Subject

Relationship:

  • “Student studies Subject”


ERM helps plan:

  • tables

  • relationships

  • keys


— NORMALISATION

normalisation is the process of organising data to reduce duplication


Why?

to:

  • remove repeated data

  • improve consistency

  • avoid update errors


Advantages

  • Reduces redundancy

  • Improves data integrity

  • Makes updates easier


Disadvantages

  • more complex structure

  • requires joins→ slower queries


— INDEXING

indexing creates a quick lookup system for data


Advantages:

  • faster searching

  • improves performance


Disadvantages

  • uses extra storage

  • slows down updates