Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 6

Mod 4.

1 – Database design and concepts

 Databases are limited by the media they’re recorded on


o Paper, cards
 They can have space restrictions that limit the amount of data that
can be recorded
o Data is recorded in a set order, with indexes and a table of
contents
 With the arrival of computers
o Mass amount of data can be stored
o Data can be retrieved and manipulated in complex ways
 Relational database design involves using many tables linked in
relationships

Relational database overview

 When we select and record the things (entities) we want to record


data about, and the important data (fields) of the entity

 Basic rules and structures


o A database contains one or more tables
o A table represents a single concept or entity
o Data is stored in tables
o A record is an instance of the entity. Made from multiple
fields
o A field contains one or more attributes of the entity
o Primary keys uniquely identify a record
o A primary key can be composite (more than one field)
o A foreign key can link tables in a database
o A field cannot appear more than once in a table
o No single data field can appear in more than one table unless
it is a foreign key to link the tables
 Select the data you want to work with
o This is the data you will record and manipulate
o Any data irrelevant to your task is ignored
 Structure the data
o Sort the tables you are going to use and the relationships
between the tables

 Normalisation
o Structuring your database in a way that there is no redundant
information or anomaly
o It is a set of rules that ensure that databases are designed in
an optimal state
o No normalisation has taken place when no entities attribute or
relationships have been identified
 Data Maintenance
o Adding, deleting and updating data to keep it current
o Much easier when a database is well-designed

Basic database design

 It initially begins when a problem has been identified


o And if the solution involves having an electronic database

Step 1: Select the data


 Determine the type of data you will record
 Sources to obtain data
o Existing documents – Issuing forms to be filled in can help
identify the input and output of data. Data entered is then
analysed. The headings can be used as fields
o Existing workflows – The order in which things get completed.
This helps understand the process of how data can be
obtained managed
o Business plan – It indicates the strategies to be implemented
for the business to be a success. Data can be obtained to
track the progress of the business plan

Step 2: Structuring data


 You will need to determine how to organise your data
 A few guidelines when using normalisation
o Each field should have one value
o The same data must not be repeated across different fields
of a record
 Anomalies that can occur if the database is not well structured
o Insert anomaly – When a user cannot insert data to a field.
Usually occurs when there are two different entities in the
same table and data is only entered in one of them, whilst the
other is required
o Delete anomaly – When deleting a part of data causes other
unrelated data to be deleted too. This is also caused when
there are two different entities in the same table
o Update anomaly – When editing data in one record requires
you to edit data in multiple records of the table. This is
caused by repeating data across more than one record
(redundancy)
 A solution for these anomalies is to separate the entities across
different tables and link them with a foreign key

Concepts to improve design

 Data integrity
o Maintaining the accuracy and consistency of data in a
database
o Split into Physical and Logical integrity
 Physical integrity
o Overcoming practical issues such as natural disasters,
mechanical and power failure
o Physical storage and retrieval of data
o UPS and RAID
 Logical integrity
o How correct data is in its context
o Enforced by ensuring unique primary keys (entity integrity)
and foreign keys (referential integrity)
 A record can’t be deleted from the one side of a
one:many relationships without the other being entered
 A record can’t be added on the many side of a one:many
relationship without the other being entered

 Transaction
o An activity that involves creating, loading, editing saving or
deleting data managed by a DBMS
 Transactional processing system
o Software system that captures and processes data
o Transactions that depend on each other are grouped
 In terms of transactional processing DBMS
o The operation will only be completed if all of the individual
transactions are successful
o If errors occur in any one of the transactions, the transaction
processing DBMS will ‘reverse’ or ‘roll back’ all transactions of
the group, including the ones that were successful. i.e. It is
set to its previous state
o Partial completions of actions are prevented if any hardware
or software errors occur
o E.g. on Transferring Money from your savings account to your
credit account
o Data integrity is maintained
 Transactional processing terms
o Record Lock – When a record is in use by a user, no other user
may access the record until changes are made or discarded
o Edit – When a record is locked and its data is loaded into
memory for editing. Changes ae only made when the edit is
posted
o Delete – When a record is removed from the database. It is
flagged as ‘deleted’
o Insert – When a new record is made in memory and saved
either manually or when a user moves to the next record.
Records flagged as ‘deleted’ are overwritten
o Commit/Post – When changes to a record are saved to storage
after being edited or inserted
o Refresh – When information is reloaded from storage to
memory. Usually done when viewing changes made by another
user to see the updated data
o Purge /Consolidate – Remove deleted records to compact the
file
o Navigation (Previous/Next) – Moving to another record after
an editor insert will Post the record
o Rollback – When the DBMS reverses a transaction, restoring
the data to its previous state

Data redundancy

 Two concepts
o Unnecessary repetition of data across multiple fields, that
can cause update anomalies
o Mirroring the database across multiple storage media to
ensure data will always be available even if one storage
medium fails

Data independence
 The separation between software that uses database applications
and data structures by DBMS servers
o Not possible with Access style databases
 Advantages
o The user application will not change the structure of the
database
o Multiple applications can interface to the same data. Physical
structure is not a factor
o Database management is left to the DBMS software
 Physical independence – It doesn’t matter what storage medium the
database is on. The application does not need different code for
the different media
 Logical independence – When adding a table to the database or
making extra fields in an existing table will not affect the existing
applications

Data security

 Protecting data from theft and loss


 Use physical measures
o Control access to the machines and data
o E.g. biometrics, passwords, encryption

You might also like