Issuu on Google+

8 Topic Section

Database General Purpose Packages - (GPP)

2 of 4

Content - What you need to know field types (numeric, text, graphic, date, time) alter record format

G/C search on more than one field sort on more than one field

Features of a database package Field types Text Only letters and symbols are recognised by the database as text e.g. forename, surname. When information is searched or sorted as text it is possible to produce lists. Numeric Only numbers are recognised by the database e.g. ages, prices. This allows the records to be sorted into ascending or descending order. Databases can also carry out arithmetical tasks. Graphic Images can be stored in a database field. In an employee database, the photographs of staff could be held along with their personal details. Date/Time The Date type allows different formats for the date to be stored i.e. 19/5/04 or 19 May 2004. Similarly the time can be stored in different formats i.e. 3.14pm or 15:14.

Name Class Adm No. House DOB

School Record Craig Brown Picture 3C4 1198764 Castle 13/06/1990

This record from the SCHOOL DATABASE has three Text fields, one Numeric field , one Date field and one Graphic field.

Alter record format Some database packages allow you to alter the record format, that is you can add new fields or delete existing ones. You can also change the field type so that it can hold a different type of data or change the size of the fields. In the example on the right the size of the NAME field is set as 20 characters. This may need to be increased if the name is very long.

In the MUSIC DATABASE the field called POSITION (lw) is deleted.

Search on more than one field Sometimes we need to search on more than one field in order to narrow the search down. This is called a complex search. Linking conditions with an AND means that all of the conditions must be met. e.g. a database of pupils in a school could be searched for pupils who are under 13 years of age and are in Castle

NAME Young, Adam King, Mary Watson, Kim Hannay, Angela Smith, Rob

AGE 14 12 15 12 13

CLASS 3C1 1C4 4C2 2C1 2C5

HOUSE Victoria Castle Cromwell Castle Castle

Results of a omplex search for :To describe a complex search correctly you should write this :AGE < 13 AND HOUSE = Castle "Search the file SCHOOL DATABASE on the field AGE for records which match the condition <13 AND on the field HOUSE for records which match the condition Castle "

DGS S Grade Computing Studies

NAME King, Mary Hannay, Angela

AGE 12 12

CLASS 1C4 2C1

Page 1

HOUSE Castle Castle


Sort on more than one field This is when a file is sorted using two or more fields in a particular order. for example the entries in a telephone book are sorted into order according to surname first, then first name.

NAME Hannay, Angela King, Mary Smith, Rob Grant, Ray Watson, Kim Abbot, Fiona Brown, Jim Young, Adam

e.g. a database of pupils in a school could be sorted by HOUSE and then by NAME. The result is shown opposite. To describe a complex sort correctly you should write this :"Sort the file SCHOOL DATABASE on the field HOUSE in ASCENDING order and then on the field NAME in ASCENDING order"

1. 2.

AGE 12 12 13 13 15 16 15 14

CLASS 2C1 1C4 2C5 2C6 4C2 4C1 4C4 3C1

HOUSE Castle Castle Castle Cromwell Cromwell Victoria Victoria Victoria

Castle-Cromwell-Victoria sorted into A-Z order Names are sorted into A-Z order for each House

Questions 1

Name two types of field apart from Text and Numeric

2

Name two ways that you could alter the format of a record.

3

Fill in the data types for this CAR DATABASE. Field Name Make Model Registration Number Value Picture Road tax due

4

Write down the correct description for searching this MOBILE DATABASE for a camera phone costing less than £200.

5

Write down the correct description for sorting the SCHOOL DATABASE into this order :-

6

Write down the correct description for producing this output from the SCHOOL DATABASE :-

DGS S Grade Computing Studies

MODEL Samsung E700 Motorolla E398 Sony Ericsson T630 Nokia 3100

Data Type

PRICE £229 £199 £179 £79

FEATURES polyphonic, camera video, camera, MP3 polyphonic, camera colour, games

NAME Abbot, Fiona Brown, Jim Watson, Kim Young, Adam Grant, Ray Smith, Rob Hannay, Angela King, Mary

AGE 16 15 15 14 13 13 12 12

CLASS 4C1 4C4 4C2 3C1 2C6 2C5 2C1 1C4

HOUSE Victoria Victoria Cromwell Victoria Cromwell Castle Castle Castle

NAME Abbot, Fiona Brown, Jim

AGE 16 15

CLASS 4C1 4C4

HOUSE Victoria Victoria

Page 2


8 - Databases 2