23

Databases Foundation General

  • Upload
    mrcarty

  • View
    471

  • Download
    1

Embed Size (px)

DESCRIPTION

 

Citation preview

Page 1: Databases Foundation General
Page 2: Databases Foundation General

What is a database?

A database is a collection of information on a particular topic that is structured in some way.

For example you could have a database on football teams, CD collection or books.

Page 3: Databases Foundation General

Databases can either be stored manually (e.g. in a filing cabinet, as index cards or on paper)

Or they can be stored electronically (on the computer!)

A telephone book is an example of a manual database that keeps information on peoples names, addresses and telephone numbers.

Page 4: Databases Foundation General

Why do we use a database?

To access information quickly and easily.

To sort information in different ways e.g. alphabetical or ascending or descending.

We can also search the database for specific pieces of data e.g. a persons name or the author of a certain books etc.

Page 5: Databases Foundation General

How are databases made up?

Databases are organised in a particular way.

 They are set out in FILES, RECORDS and FIELDS.

 A FILE is a collection of structured information on a specific topic.

 A RECORD is a collection of structured information on a particular person or thing.

 A FIELD is a single piece of data which is contained in each record. Records are made up of, usually, 2 or more fields.

Page 6: Databases Foundation General

FileThird Year Pupils First Name:

Last Name:

D.O.B

Address:

Tel No:

Class:

Guidance:

First Name:

Last Name:

D.O.B

Address:

Tel No:

Class:

Guidance:

First Name:

Last Name:

D.O.B

Address:

Tel No:

Class:

Guidance:

Fields

Record

School Database

Page 7: Databases Foundation General

Types of Field

Text – only letters eg abc, ABC

Numeric – only numbers eg 123, 890

Date – a formatted date eg 12/12/00

Time – a formatted time eg 1340 hours

Page 8: Databases Foundation General

Descending means biggest to smallest i.e. z to a or 100 to 1.

Ascending means smallest to biggest i.e. a to z or 1 to 100.

Sorting

When you sort the database you are putting the information into some kind of order.

The most common way to sort text in a database is to put it into alphabetical order.

When we sort we are either putting data into ascending or descending order.

Page 9: Databases Foundation General

Searching

The main reason people create databases is so that they can search it for specific information.

When the computer searches the database it looks at the contents of particular fields.

There are 2 ways of searching:

Simple search – searching on one field

Complex search –searching on more than one field

Page 10: Databases Foundation General

Answering Database Questions

When answering a database question, go through the following points:

•Is it a simple search or complex search?

•What is the first field you want to search on?

•In a complex search, what is the second field you want to search on?

•Does the info have to be in a certain order?

•Does the info have to be printed?

Page 11: Databases Foundation General

Database questions:

Look at the following database extract:

First Name Lauren

Surname Duffy

Class 4E

Date of Birth 24th Feb

Questions:

1. Teacher wants a list of all the pupils in 4A, how would she do this?

2. Teacher wants a list of all pupils in 4C whose surname is QUINN,how would she do this?

3. Teacher wants an alphabetical list of pupils with surname Jones born on 30th July, how would she do this?.

Fields

Page 12: Databases Foundation General

1. Do a simple search on the field class for 4A.

2. Do a complex search first on the field class for 4C then on the field surname for Quinn.

3. Do a complex search first on the field surname for Jones then on the field date of birth for 30th July then SORT into alphabetical order.

Answers:Field Names: Sample Data:

First Name Lauren

Surname Duffy

Class 4E

Date of Birth 24th Feb

Page 13: Databases Foundation General

Searching A Database (Example)

Member NO. 3234

Name Lila Lonely

Sex F

Area Glasgow

Occupation Lawyer

Height (m) 1.65

Hair Fair

Age 35

Interests Skiing

1

2

Page 14: Databases Foundation General

Search 1

• Find an accountant from Glasgow:

Complex Search

• On Occupation = Accountant

• AND

• On Area = Glasgow

Page 15: Databases Foundation General

Search 2

Find Male who likes to ski and is taller than 1.65m:

Complex Search

On Interests =Skiing

AND

On Height > 1.65

AND

Sex = Male

Page 16: Databases Foundation General

More Database Questions:Look at the following database extract:

Field Names Sample Data

Make Vauxhall

Model Astra

Colour Silver

Year 1998

Questions

1. How would you get a list of all the cars made by MAZDA?

2. How would you get a list of all the cars made by FORD in 1999?

3. How would you get an alphabetical list of all the cars that are BLACK and made by ROVER.

Page 17: Databases Foundation General

Answers:Field Names Sample Data

Make Vauxhall

Model Astra

Colour Silver

Year 1998

1. Do a simple search on the field make for Mazda.

2. Do a complex search first on the field make for Ford then on the field year for 1999.

3. Do a complex search first on the field colour for black then on the field make for Rover then SORT the MAKE field into alphabetical order.

Page 18: Databases Foundation General

Searching for Information on CD-ROM or the Internet

Databases are now readily available on both CD-ROM/ DVD-ROM and on the Internet.

There are quite a few databases available now on CD. e.g.encyclopaedia’s CD-ROM

(Encarta) (Encarta)

Page 19: Databases Foundation General

Searching a CD-ROM Database The way in which we search these databases

is different to the way we would search a computer database.

Simple search on a CD-ROM. Enter a single word into the search box and it

would then display matching results.

Page 20: Databases Foundation General

Searching an online database Online databases have become more common over

the past few years.

Page 21: Databases Foundation General

Searching an online databaseInternet search engines such as Yahoo or Google allow us to carry out simple and advanced searches online.

SimpleSearchType in word

Advancedsearch

Page 22: Databases Foundation General

Why use a Computerised system?

There are many disadvantages to using a manual system:

records easily get lost,

only one person can use a record at one time

it takes up a lot space.

it can be slow to find things

records can only be in one order

Page 23: Databases Foundation General

Computerised records solve these problems because computer databases:

Take up little space

Records don’t get lost

Fast to search

Can be sorted into any order

On a network many users can view a record at once.