You are on page 1of 14

Databases

Databases are (in my opinion) the single most widely used and important pieces of application software You will (possibly unwittingly) encounter them continually throughout your life (unless you become a hermit) They are now fundamental to the way in which any organisation operates today

Dukhan English School

Structure
Suppose a school stores information about its students on record cards. Each student has their own card; this is their record.
Denton High School
Pupil Record Card
Student Number Forename Surname Date-of-Birth Form 0125 Lisa Knapper 12-Jan-1985 T3

Record

Field

The individual pieces of information recorded on each card, such as name and date of birth, are called fields.
Dukhan English School

Definitions and Vocabulary


We can define a database as: A collection of information that is organised so that it is easy to use Each thing in a database is called a Record
In our database, one record is represented by one card or person

Each piece of data in a record is called a Field


In our database, examples of fields are Date of Birth and Form

When we search a database for information it is called a Query


In our database and example of a query would be to find all the students where the Date of Birth is before 1st Jan 1997

Dukhan English School

Records and Fields


These are the fields there are four fields in each record of this file.

ISBN is the key field . This is the field that has a different value in every record. It is used to distinguish one record from another. Some books could have the same title, author or publisher. The ISBN is the only way a particular book can be picked out.
A key field uniquely identifies an individual record.

This is one complete record - there are five records in this file.

Dukhan English School

Computerised Databases
A database is a structured collection of data. It can be a single file that contains a large number of records or a collection of files. Practically all modern databases are described as being relational databases. A relational database stores data in tables that are linked together using common fields.

Dukhan English School

Relational vs. Flat File Databases


Flat File
Video Shop
Member Number

Relational
Members Loans
Member number Video number Date loaned Length of loan Date due Total cost Member number Forename Surname Address line 1 Address line 2 Telephone number

Forename
Surname Address Line 1 Address Line 2 Telephone Number Video Number Title Certificate Category

Videos
Video number Title Certificate Category Cost per day

Cost Per Day


Date Loaned Length of Loan Data Due Total Cost

Dukhan English School

Database Operations (1)


Database operations are the different things that can be done to a database file. The main types of operation are searching, sorting, updating. Searching
Searching, or interrogating a database, involves looking for an individual record or group of records that match a certain criterion Searches are called queries To search a database the user must enter a query The query tells the software which fields to look at in each record and what to look for This is the most important operation for which a database is used
Dukhan English School

Database Operations (2)


Sorting
Sorting involves putting the records in a file into a particular order, such as alphabetical order.

Updating
The information stored in computer files must be kept up-to-date or it will cause problems for the business or organisation thats using it. When a new record needs to be added to a file, it is inserted. Records are deleted when they are no longer needed. Records are updated when the data in one or more of the fields needs to be altered for some reason.

Dukhan English School

Data Types
When Tables are created and fields are entered, the data type for the field must be selected This informs the computer system what type of data is allowed in a given field The most common data types are

Dukhan English School

Text / alphanumeric
These are used for storing strings of characters, such as a persons name or address They can have a fixed length, or variable length Any character from the keyboard can be entered, although each will always be stored as its ASCII equivalent (even if a number is typed) Operations are performed in an alphanumeric way
Dukhan English School

Numeric
Real numbers
Have a decimal fraction, and a floating point

Integers
Are whole numbers

You can perform useful calculations on a Numeric field

Dukhan English School

Date
The date data type is used to store dates It really means that it is a number that the computer displays a certain way
In windows the range is: 1 January 100 to 31 December 9999 1st October 2006 is actually stored as:
38991

Dates can be added and subtracted like other numbers.

Dukhan English School

Boolean
This is one bit of data Used to store logical information Value can only be 1 or 0, but this can be interpreted as:
On / off Yes / no True / false Male / female etc

Dukhan English School

Task
Describe what is meant by the term Database Record using an example Describe what is meant by the term Database Field using an example ISFY Page 71 ISFY Page 335
Q1, 3, 5, 6 (Skip 3(b)(i) and (ii))

Dukhan English School

You might also like