Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
3 views14 pages

Chapter 2.3

Uploaded by

principal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views14 pages

Chapter 2.3

Uploaded by

principal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 14

2.

3 Creating a database

3 Creating a
We are
going to:
database
design a single table database
a single table
create
database
for information in a
database
"search

using aphrase.

attribute filter
database phrase searching
FA
data type record F10
field
o

3 5LO 6
8 9

W R

H K

Getting started
What do you already know?
Youcan find data that matches a single keyword.
olt a
Data can be edited and updated.
0ptic Changingdata input into a spreadsheet impacts the calculated outputs. optio
The difference between physical (paper-based) and digital databases.
question.
How to use a database to answer a single
including what a record
The different parts of a database table,
isand what afield is.
in a statistical investigation
Adatabase is onetool that can be used

135 )
2 Manaqing data

Continued
Now try this!
about some cars.
LOOk at this database t showsa range of information

Chare
)Comments
Home thsen Page tayout Formulas Data Holo
Reiew View

A B D E F
1 ID Car_Model Car_Make Year Colour Country
2 1Range Rover Land Rover 2012 Turquoise Sweden
3 2 B-Series Mazda 2008 Goldenrod Sweden
4 3 Vision Eagle 1993 Green Slovenia
5 4 600 BMW 1959 Yellow China
6 5E-Class Mercedes-Benz 2007 Blue Russia
7 6 Tacoma 2009 Teal Canada
Toyota
7 Passat Volkswagen 2000 Maroon China
8X5 M BMW 2010 Puce Indonesia
10 9 Phantom Rolls-Royce 2012 Maroon China
11 10 Regal Buick 2001 Green Georgia
12 11 Rabbit Volkswagen 2006 Teal Philippines
13 12 SRX Cadillac 2004 Pink Canada
Sheett

Reac S ÁCCEsSiDAty Good to go


Qosplay Settings 27

With a partner, discuss how you could use the database to answer
the following questions:
1 HoW many cars are green?
2 What steps would you take to find a specific car?

What is a database?
A database is an organised set of data.
Databases are realy useful
because data is much easier to use when it is
organised.
A database is made up of records and fields.
2.3 Creatinga database
Arecord provides all the data about one thing. For example, the record
all the data
provides

about the car that


below
Marcus's mum drives:
Colour:red

Car make: Toyota

Fuel type: petrol

5
Age (in years):
Eoch record in a database is made up of
different fields. Afield is a category of
data within a record. For example,
in the record above, the fields are:
Colour

Car make

. Fueltype
Age (in years)
record is complete when all fields
A
are filled with data.
In a database, records are usually organised as rows, and fields are
usually organised ascolumns. But this is not always the case!
An attribute is the data found in
one field of arecord in adatabase.
Look again at the record above If my teacher had
adatabase with all the
for the car that Marcus's
mum drives.
learners in our class, Iwould be
arecord in it. The felds the teacher
Ihe attributes in this record might have could include
are red, Toyota, petrol and 5. my name, my address and
my birthday.

137 )
2 Managng dato

Questions
Look ot this record obout acountty.

Country: Oman
Size (in km): 309 500
Population: 4 576 298
Language: Arabic
Currency: Omani rial

1 What are the fields inthe record?


2 What are the attributes of the record?

Did you know?


AlIMusic.com is an online database that contains
information for over 30 million music tracks and
3 million albums. You can search for music based
on the type, artist or other individuals that were
involved in any of the tracks.

Data types
of
We can store the data in adatabase in the form
different data types. A data type tells us the way
that data is presented, for example as text
or numbers. M

Youmay have previously learnt about


two types of data: number and text.
In Unit1 of this book, you learnt
about integer, character and
string data types.

138)
23 Creating odatabase
ook atthis table for some information about database duta types.

Description
patatype |Example
Whole numbers onlu
h t e g e r

500
Text
Words only rnustard

C h a r a c t e r
Asingle letter, number or symbol
More than one character joined rmarcus 42*
String
(can include anscharacter) together

Question

aJdentify the data types


used in the attributes of
the following record:
a Country: Oman
b Size (in km²): 309 500
c Population: 4 576 298
d Language: Arabic
e Currency: Omanirial
f Have youvisited
this country?

Formatting data
tools to make sure the
Ina digital database, we can use formatting data type
For example, if the
dota appears in the way we want it to.
need to make sure the data will be
s dn integer (a whole number), we
displayed without a decimal point.

139)
2 Managing data

time,
teyt. number, currency, date,
Vve can format our datogs categories
percentage or fraction,
There greglso lots of other
we can use!
as the
categorised
is
For example, if you type '21' into a cell that changes the
spregdsheet automatically
CUrency US dollars, the
data to $21.
ways we categorIse d t
Look at the table. It shows the common
spregdsheet formats this data.
In aspreadsheet and how the
format the data?
Data category Howdoes the spreadsheet
entered. We can specify if
Number Only a number can be
the number has any decimal places.
example $3,
Currency Data is automatically formatted as money, jor
£3 or ¬3.
Date This puts the data into the format of a date,
for example 12/03/23.
Time This puts the data into the format ofa time,
for example 07:36:00.
Text Any text can be entered. A qood example of this
is headings or labels.
Percentage This puts the data into a percentage format, for example
0.75 shows as 75%.

Fraction This puts the data into a fraction format, for example
0.5 shows as 1/2.

When entering data into aspreadsheet database, the data is


qutomatically categorised as 'General, which means you can enter
anything. The software will automatically decide how to treat
the data unless youformat the data yourself. For example,
if vouentered $5, the spreadsheet would treat it as currency.
Sometimes spreadsheets can get confused if we use multiple
kinds of numbers in the same column or row, like a number
and a date, so it is useful to know how to change the
formatting yourself.

140 >
2.3 Creating a database
Practicaltask 1

You will need: a desktop


source
file 2.4 computer, laptop
formatting_data or tablet and
You arre practise formatting data
going to
is displayed correctly. so that a data
type
source file
1 Opern
Select the data you wish to 2.4_formatting_data.
2 format.
3 Open the menu as shown in the
image below.
AutoSave 24 Form. Saved
None Insert Page Layout Formulas Data
Review View
X Cahbn 11 Help
Comments Share
8 I U A A Conditional Formatting
Paste
General sle
123 No specific format Cells Editing
Clipbosrd Font Analyze
Alignment Data
Number
p2 12 Analysls

O Curency
A B
Accountina D
1 Item Revenue Short Date Price per item
2 T-shirt Long Date

3 Shorts 24 Time

4 Jacket 66.98 % Percentage

5Coat 275 Fraction


25
6 Socks 129 10 Scientific

7 Watch 72. ab Text

8 Scarf 30.3 More Number Formats...

9Shoes 40 1
10 Gloves 105 21
11 Hat 97.86 14
12
Sheet1
Ready ACCessibity Good to go LQ Displsy Settings 2609%

4 Choose the formatting option you Want to use.


Tne spreadsheet will format the cell as requested.

141
2 Managing data

Designing adatabase
design adatabase, first
we
When we want to
about the data that we
need to think carefully records,
us to identify the
Wantto collect. This helps database.
will make up the
fields and attributes that
we need to think
When designing a database,
about these questions:
attributes do we need?
What records, fields and
How many
How many records will there be?
fields willthere be?
columns?
records and fields be arranged into rows and
How willthe
What willthe titles of the columns be?
What data types will be used in each
of the fields?
Willthe database be digital or on paper?
sketches to
Youcan design a database by making notes and
collect your ideas.

Unplugged activity1
You will need: coloured pens and a large piece of paper
I Work in agroup to designa
Idatabase that provides data about
I different holiday destinations.
I Your database should include
I five records.

142 )
2.3 Creating a database

Continued

questions on the previous


Usethe
to help you.
Nge
Ithink two
White and sketch your ideas of the fields should be
piece of paper.
on a big Currency and lanquage because
this is important data to
know ýyou are visiting
a country!

Creating a database
Once you have designed a database. you can create it.
Dotabases can be created on paper or digitally.

Creating paper databases


Paper databases can be created very simply by making paper records.
paper record contains data for a number of different fields. Look at
A
Splashy.
the paper record below. It shows data for a character called

This particular record


SPLASIY is used in a card qame where
you have to try and beat your
opponent by picking the field with
the best score. Have you ever played
one of these games, like
Pokémon, or Top Trumps?
HEALTH: 400
ENERGY: 475
ELEMENT: WATER
HAIR BLOND
EYES: BROWN

143 )
2 Mangqmg dot0

Activity 2
Youwill need: adesktop computer, laptop or tablet with aCCess
to the internet, a
a pen and paper, Worksheet 2.6 and your
dotabase design ideas from Unplugged activity 1
You are going to Create a
simple
datobase to organise data aboutpaper
holiday destinations. different
Country name: Oma
Create a paper record for each holiday
Use your ideas from Unplugged activitydestination.
Area: 309 500 on?

record card template to help 1 and the Population: +576 292


you.
Use the internet to help youfind Language: Arabic
information to add to
your paper database. Flag:
Your record cards might look Currency: Omani rial
something like this:

Creatingdigital databases
You can createadigital database
using specific software.
For example, you can use:
spreadsheet software, such as
Excel or Google Sheets
database software, such as
Microsoft Access or Oracle.
These programs are designed
specifically for creating databases.
You only need to know howto
create databases using
spreadsheet software.

144 )
2.3 Creating a database
Practicaltask2

need: a desktop
You will computer, laptop or tablet,
software
such as Excel or
Google Sheets, your ideas spreadsheet
from
paper database from
Activity 2 or source Unplugged
your
octivity 1,
file 2.5 countries
now aoing to create a digital
in Activity 2, or you can database. You can use the data
You are
recorded

u use source file


Create
asimple database:
2.5_countries.
To
1 Open your spreadsheet or database software.
2 Create headings for each column of your database. The headings for
anch column should match your field titles from
Unplugged activity L,
Activity 2or source file 2.5_countries. For example:
AteSveo9
Countriesba Sved v a Search
Home tnsart PDoc Layout Formulas Data Review View Helo
DComments

A B F
D E
1 Country Currency Language Population Area (km) National animal
2

Shestl
Pead T Atcersbity Geod to go Qrplay Stings

3 Type the data for each record into the database.


4 Now format your cells according tothe datatype in them,
to ensure that allthe datais displayedcorrectly (see Practicaltask 1).

esc
F2

%
3 # 4 5
2@

I
G

145
2 Manogng doto

Searching acdatabase
We already knowthat databgses are made up of data
that is organised.
Searchig organised data in a database is much quicker and more
efticient than tryingto search for data by reading through lots of
separate record cards!
There are different ways of searching for specific data ina database.
One way is to apply a ilter, which allowS you to hide data that does
hot meet your criteria, so the database only shows data you want to
see. You may have learnt about filters in previous years.
Another way is to search for data that matches a single keyword,
which you might have done previously.
One other way to search data is to use phrase searching.
This means searching for data that matches a series of words.
For example,your school probably has a database about allthe
learners who attend the school. If a member of staff needs to contact
your parent or carer because you are unwell, they can do a phrase
search of the database, using your full name as the search criteria.
A single keyword search (your first name) would not work here, as
there might be more than one learner with the same first
name as you.
The phrase search will bring up all records that match the criteria
(your full name). That record will include a contact number for
your family.

146
2.3 Creating adatabase
Practicaltaska

You willI need: a desktop computer,


loptop
or tablet, spreadsheet
softwaree such as Excel or Google
source file
sheets and
26_countries database

Vauare now gong to use phrase


searching to find specific phrases
in a database.

source file
1 Open
26.countries_database.
) To search for a phrase,find the
search tool in your software.
InExcel, this is found in the
Home menu, under Find & Select.
26.countrie deabase o21o O Serch
hsert Dage Layot Formuas Data Renev Viea Autornate Help ACROBAT Camments shrn
- 11 - A A Wap Tat
Caibr General E Nomal Bud Good
Atom

B U - 6- A BMerge &Certer Condeianal Fermt Neutral Calculation Iset Deiete Format Sort & Fnd&
Formattng Ible FeSlet Dets
font G Aignment tumder Shles

s Country Reclace

Ge To Sgeca

Fenls
Nets
Condcal Fermez

G K N
A B D E Court

Country Currency Official language Population Area (km) Natlonal animal Data Vsidéan

United States of America US dollar English 333287557 9834000 American bald eagle
3Oman Omani rial Arabic 5270000 309501 Arabian oryx seecten Pane
4 Germany Euro German 84300000 357588 Federal eagle
5 United Kingdom 67508936 243610 Lion
Pound sterling English
6 Malaysia Malay 33000000 326847 Malayan tiger
Malaysian ringgit
7India Hindi 1417000000 3287000 Tiger
Indian rupee
8 Brazil 215313498 8500000 Jaguar
Brazilian real Portugese
S4027487 582646 Lion
9 Kenya Kenyan shilling Swahili
10 Australia 25978935 7688000 Kangaroo
Australian dollar English
11 South Korea S1440000 100210 Siberian tiger
South Korean won Korean
88499 Grey wolf
12 Seroia Serbian dinar Serbian 8636234
300000 VWater buffalo
13 Republic of the Philiopines Philippine Filipino and English 113779827
peso 390745 Sable antelope
14 Zimbabwe Shona 15485850
US dollar 25713 Macedonian lion
15 North Macedonia Macedonian denar Macedonian 2083129
462840 Dugong
16 Papua New Guinea 9435592
Kina English 2381741 Fennec fox
17 Algeria Arabic
46131386
Algerian dinar 165000 Lesser kiskadee
18 Suriname 612985
Surinamese dollar Dutch S6542 European pine marten
19 Croatia 4494749
Croatian kuna Croatian 244 Tortoise
20 Seychelles Seychellois Creole 119878
21 Saudi Arabia Seychelles rupees 2250000 Arabian camel
33000000
Saudiriyal Arabic
Sheetl Shee

tiger and press Enter.


liCk 'Find:. Type the phrase 'Malayan
will|be highlighted in the database.
4 The have searched for
phrase you

147 )
2 Mangging dato

Continued

Use phrase searching to find the answers to these questions:


Which country uses pound sterling as currency?
Which three countries have alion as their national animal?
Which country has a population of 51440000?
Which country has the federal eagle as their national animal?

Question
4 How do you search a database for a
specific phrase?

Look what I can do!


lcan design a single table database.
l can create a single table database.
Ican search for information in a
database using a specific phrase.

148 )

You might also like