Chapter 2.3
Chapter 2.3
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
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
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
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
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
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.
140 >
2.3 Creating a database
Practicaltask 1
O Curency
A B
Accountina D
1 Item Revenue Short Date Price per item
2 T-shirt Long Date
3 Shorts 24 Time
9Shoes 40 1
10 Gloves 105 21
11 Hat 97.86 14
12
Sheet1
Ready ACCessibity Good to go LQ Displsy Settings 2609%
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
Creating a database
Once you have designed a database. you can create it.
Dotabases can be created on paper or digitally.
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?
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
A B F
D E
1 Country Currency Language Population Area (km) National animal
2
Shestl
Pead T Atcersbity Geod to go Qrplay Stings
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
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
147 )
2 Mangging dato
Continued
Question
4 How do you search a database for a
specific phrase?
148 )