2. What is a database?
It is a collection of related data.
It consists of records and fields; each
record contains the same set of fields.
One field contains one piece of
information.
What is the purpose of DBMS?
Back to
Contents
4. Database Management System
(DBMS)
This is a kind of software that is used to
manage database systems:
– Structure of individual data files
– Relationships between data items + between
data files
– How data is searched (interrogated)
– Properties of the database (queries, updating or
amendments)
Back to
Contents
5. Sequential Files
• Records are stored one after the other in the
order they were added to the storage medium.
• Storage Medium: Magnetic Tape
• Two ways in which records can be arranged:
1. Have the records in an order using a key field.
What is a key field?
Its is unique for every record. It is required to ensure
that you don’t have any duplicates.
This type of type of sequential is called
ordered sequential. Back to
Contents
6. Sequential Files
2. Another ways is to arrange the records in
no particular order
This is type of sequential is called
unordered sequential.
Another name for an unordered file is serial
file.
There is only one way of accessing the data:
by going through each record one by one.
Back to
Contents
7. Sequential Files
• Ordered file -- > data is put in order of a key
field (For example: customer ID)
• Unordered file -- > as the name suggests as
the data in no particular order.
Disadvantages of using sequential files
Back to
Contents
8. Disadvantages of a Sequential File
1. You can only add a new record at the end
of the file
2. If a record needs to be replaced it must be
the EXACT same length as the original
3. A record can only be updated if the data
item used to replace the existing data is
the same length as the original.
4. Processing of a sequential file is slower
compared to other files. How?
Back to
Contents
9. How do you process records?
• You need to read through each and every
record until you get the one you want.
• Only recommended for applications where
most/all the records are to be processed at
one time.
For example: British Gas sends out bills to all their customers.
You receive a bill after every three months. So a person who
joins in January will receive their bill in April along with all
the other people who also joined in January. Back to
Contents
10. Functions in a Sequential File
Adding records -- > easy
Amending + Deleting -- > not so easy.
If it is an unordered sequential file
amending and deleting are fairly difficult
If it is an ordered sequential file amending
and deleting are sort of easy. This is done with
the assistance of a transaction file.
What is a transaction file?
It contains the actions to be carried out on the
records.
Back to
Contents
11. Performing Functions in an Ordered
File D: Delete
C: Change
The key field is used. A: Add
Master File Transaction File
ID Name Gender ID Trans. Name Gender
1 Mr Ahmed Male 1 D Mr Ahmed Male
2 Mrs Russell Female 2 C Mr Russell Male
3 Mr Royale Male 3 D Mr Royale Male
4 Mr O’Neil Male 5 A Hafiz Male
New Master File
Computer reads the first record
from the transaction and the ID Name Gender
master file. If the ID doesn’t 2 Mr Russell Male
match (In this case it does), the 4 Mr O’Neil Male The next record is
computer writes it to the new then read and the
master file 5 Hafiz Male transaction is
carried out by the
Back to
computer
Contents
12. Indexed Sequential and Random
Access Files
• These are stored in order
• As opposed to the sequential files that were
stored on magnetic tape, index sequential are
stored on a disk, allowing them to have direct
access.
• Each record has a fixed field length.
• Having things ordered provides a greater
speed of access.
Back to
Contents
13. Indexed Sequential and Random
Access Files
• Indexed sequential -- > records are in an
order (for example: by surname)
• Index: pointer to where on the disk the record is stored. The table
may be from A-Z, the index can then point out where all the A’s are,
where all the B’s are, etc. it works like the index of a book.
• If you search for something starting with ‘S’. All the records from A to
R will be ignored. Then every record in the ‘S’ section is read one by
one until what you get what you need.
Back to
Contents
14. Indexed Sequential and Random
Access Files
• Banks use sequential access systems in order to process
cheques. This will be very useful especially in online
banking.
• Index sequential files are used with hybrid batch
processing systems- employee records.
• This allows for direct access when an individuals record
needs to be seen.
• Records held sequentially allowing serial access when
producing a payroll.
Back to
Contents
15. Indexed Sequential and Random
Access Files
• Random Access -- > quickest form of access.
• Despite the position of the desired record, it
will take the same amount of time to access it.
• Each record has a key; the computer looks up
the key -- > goes to the appropriate place on
the disk to access it.
Back to
Contents
16. Hierarchical Database Management
Systems (DMS)
• No longer used. Why?
One-way relationship problem!
• A hierarchical DMS -- > family tree like structure.
• One mother can have many children, but the
children can have only one mother.’
• Windows system several users each user
will have several documents
• Enabling fast access to data
Back to
Contents
17. Network Database Management
System (DMS)
• Overcome the faults of the hierarchical DMS
• Many organisations now use a distributed
database system.
• Data is stored on computers that are then
linked by a LAN/WAN.
• Data in the database is duplicated several
times, so it is unlikely to loose the data and it
also gives the users faster access times.
• To a user it seems to be a single system
Back to
Contents
18. Network Database Management
System (DMS)
• System caters for complex searches; search is
not necessarily done at the site where the
user is.
• For example: something that is done in
Dukhan on our computers could be then
processed in Doha.
Back to
Contents
19. Network Database Management
System (DMS)
• Another type of Network DB stored on one
device– accessed from a number of network
locations.
• Users access the database – but don’t slow
the system down.
• For example: PNC (Police National Computer)
and DVLA (Driver and Vehicle Licensing
Authority)
Back to
Contents
20. Relational Database Systems
What is a relational database?
It consists of separate tables that are all related
in some way. So this means that each table
needs to have a key field that is a field in
another table. So what?
The data from the initial table can then be
combined with data from another table when
you need to produce reports.
Back to
Contents
21. Relational Database Systems
Customer DVD
Customer ID DVD ID
Name: Name of DVD:
Date of Birth: Number of Copies:
Address: Main Actor:
Telephone Number: Customer ID
In this table the In this table the DVD ID is the
Customer ID is the Key primary key. The Customer ID is
Field the foreign key. These two tables
are linked by the Customer ID.
Back to
Contents
22. Relational Database Systems
• Standard Programming Language dealing
with relational tables is called Structured
Query Language (SQL). What is it used for?
It is used for queries and producing reports.
Advantages of relational databases
Back to
Contents
23. Advantages of Relational
Databases
1. Data not repeated – storage capacity not
wasted. Comparing this to a flat file
database, in which data is repeated.
2. Data retrieval is quicker. If the data is
repeated, hackers will have greater ease
in accessing the data. Relational
databases reduce this risk.
3. They also allow room for expansion
Back to
Contents