databases main lesson 1

15
Surname: Brown Forename: James Form: 7B Date of Birth: 23.4.84 Telephone: 020 1234 5678

Upload: high300

Post on 14-Dec-2014

282 views

Category:

Education


0 download

DESCRIPTION

This powerpoint will guide you through the first lesson.

TRANSCRIPT

Page 1: Databases Main Lesson 1

Surname: Brown

Forename: James

Form: 7B

Date of Birth: 23.4.84

Telephone: 020 1234 5678

Page 2: Databases Main Lesson 1

A database is a collection of information.

You can have a very large one such as an encyclopaedia on a CD-ROM, or a much smaller one that you create yourself.

Page 3: Databases Main Lesson 1

Library catalogues Football player statistics Argos catalogue shopping School pupil records Address book What could you use a database for? Try to Try to

think of at least two ideas.think of at least two ideas.

Page 4: Databases Main Lesson 1

So that we can find information in a file, we need to have some kind of structure.

The diagram shows how the various parts of a file go together in a simple structure.

Surname: Brown

Forename: James

Form: 7B

Date of Birth: 23.4.84

Telephone: 020 1234 5678

One record for each Year 7 pupil

Five fields in the record

Page 5: Databases Main Lesson 1

The diagram shows how a file is made up of a collection of records.

Surname: Brown

Forename: James

Form: 7B

Date of Birth: 23.4.84

Telephone: 020 1234 5678

One record for each Year 7 pupil

Five fields in the record

• Each record is made up of a set of fields.

Page 6: Databases Main Lesson 1

Microsoft Access

Page 7: Databases Main Lesson 1

In the example, Surname, Forename, Form, and Date of Birth are four of the fields in each record. There would be one record holding this information for each pupil in Year 9.

Brown

James

7B

23.4.84

Telephone: 020 1234 5678

One record for each Year 7 pupil

Five fields in the record

Surname:

Forename:

Form:

Date of Birth:

Page 8: Databases Main Lesson 1

When you set up the fields you can say what type of data the field will hold. The field type is important when you sort the data into order. Here are some common field types:

TEXT

• NUMBER

• DATES

Page 9: Databases Main Lesson 1

A text field will hold any mixture of numbers

and letters.

Names are text and so are addresses, even

though the first line starts with a number.

Sorting a text field will be done using the

rules for alphabetical order.

Page 10: Databases Main Lesson 1

This field type only holds numbers, you need to think about this carefully in some cases.

For example, in the case of telephone numbers, although we refer to them as phone numbers we do not store them as numbers, or treat them as numbers. (If someone asks your phone number you say SIX, THREE, SEVEN, EIGHT, FIVE, not sixty-three thousand, seven hundred and eighty-five.) Telephone numbers, especially long ones with dial codes, should be stored as text.

Page 11: Databases Main Lesson 1

If you want to sort information by a date like date of birth, you need to store it as a date field. Dates need to be sorted in a special way. Think about how you would sort these dates into date order:

31/3/48, 1/4/97, 12/12/96, 11/12/96. Which part of the date did you look at first? If they were normal numbers, which part would

you look at first?

Page 12: Databases Main Lesson 1

Computers are very accurate and this is why we use them for storing information. Humans are not always accurate and this can lead to problems!

CHECK YOUR DATACHECK YOUR DATA

The computer when sorting or searching will always be accurate, but sometimes our mistakes will make things look wrong. An example of an error is as follows:

Page 13: Databases Main Lesson 1

These names look as if the computer has sorted them into the wrong order.Look carefully at them and you will see a space before the name ‘John’. The computer puts the space before the letter A in the alphabet. Because the name ‘John’ starts with a space, the computer’s rules put it before ‘Alfred’. It looks wrong to us, but it is our mistake not the computer’s.

Extra space John

AlfredBillJane

Page 14: Databases Main Lesson 1

1. Create a new database2. Give the database an appropriate name3. Look at the data you have to enter4. Decide what type of data is required for

each field.5. Decide how long each field needs to be to

fit the data (field size).

Page 15: Databases Main Lesson 1

> match items greater than

>= match items greater than or equal

< match items less than

<= match items less than or equal

& Items match both criteria

, Items match either criteria

<> Match items NOT the same as thecriteria