Professional Documents
Culture Documents
Principles of Computer
Science
Data
Contents
Binary ................................................................................................................................................................. 3
Understand that computers use binary to represent data and instructions ....................................... 3
Understand how computers represent and manipulate numbers....................................................... 3
Be able to convert between binary and denary whole numbers ....................................................... 3
Be able to perform binary arithmetic ....................................................................................................... 5
Understand why hexadecimal notation is used and be able to convert between hexadecimal
and binary and vice versa ......................................................................................................................... 8
Data Representation..................................................................................................................................... 10
Understand how computers encode characters ................................................................................. 10
Understand how bitmap images are represented in binary ............................................................... 13
Understand how analogue data is represented in binary .................................................................. 16
Understand the limitations of binary representation of data and how bit length constrains the
range of values that can represented ................................................................................................... 18
Data Storage and Compression ................................................................................................................. 19
Understand and be able to convert between the terms bit, nibble, byte, kilobyte, megabyte,
gigabyte, terabyte ................................................................................................................................... 19
Understand the need for data compression and methods of compressing data and that JPEG
and MP3 are examples of lossy algorithms ............................................................................................ 19
Understand how a lossless, run-length encoding algorithm works ..................................................... 21
Understand that file storage is measured in bytes and that data transmission is measured in bits
per second, and be able to calculate the time to transmit a file and storage requirements for
files ............................................................................................................................................................... 27
Understand the need for data encryption ............................................................................................ 28
Understand how a Caesar cipher algorithm works .............................................................................. 29
Understand the characteristics of structured and unstructured data ............................................... 29
Understand that data can be decomposed and organised in a structured database ................ 30
Understand the need for and be able to use SQL statements ........................................................... 31
Homework ...................................................................................................................................................... 40
Homework 3.1............................................................................................................................................. 40
Homework 3.2............................................................................................................................................. 41
Homework 3.3............................................................................................................................................. 41
Homework 3.4............................................................................................................................................. 41
Homework 3.5............................................................................................................................................. 42
Homework 3.6............................................................................................................................................. 43
Homework 3.7............................................................................................................................................. 44
Homework 3.8............................................................................................................................................. 44
Homework 3.9............................................................................................................................................. 45
Homework 3.10........................................................................................................................................... 46
Homework 3.11........................................................................................................................................... 47
Homework 3.12........................................................................................................................................... 48
Glossary ........................................................................................................................................................... 49
SQL Commands ............................................................................................................................................. 52
Teacher Target Codes .................................................................................................................................. 52
Binary
Understand that computers use binary to represent data and instructions
1 What is binary?
2.2 What are transistors and how are they used in digital circuits?
9
5
11
15
2
WWW:
SA
EBI:
PA
TA
ReAct:
Denary
Denary
10110101
00110011
00111111
11110011
10101010
3.5 Convert the following denary numbers to binary:
Denary
Binary
66
154
89
231
78
WWW:
SA
EBI:
PA
TA
ReAct:
4.2 Add up these binary numbers, check your answers by converting them to denary.
0111
0101
1111
0100 +
0110 +
0111 +
0011
1011
0111
0011 +
1111 +
0010 +
1110
01111
01110
0111 +
10101 +
10111 +
WWW:
EBI:
SA
PA
TA
ReAct:
10101010
10101100
00110010 +
00010010 +
4.4 Subtract these binary numbers, check your answers by converting them to denary.
11
1111
100
10 -
0110 -
010 -
100
1000
0111
011 -
0101 -
0010 -
1110
10010
01110
0111 -
01010 -
00011 -
10101010
10101100
00110010 -
00010010 -
WWW:
SA
EBI:
PA
TA
ReAct:
4.6 Convert these sign and magnitude numbers into denary. The first one is done for you.
Denary
1100 1101
-(64+8+4+1) = -77
0001 1111
1000 1010
0101 1100
1000 0000
1111 1111
0111 1111
4.7 Explain how to convert twos complement numbers into denary.
WWW:
SA
EBI:
PA
TA
ReAct:
4.8 Convert these twos complement numbers into denary. The first one is done for you.
Twos complement
binary number
Denary
1100 1101
-128+64+8+4+1 = -51
0001 1111
1000 1010
0101 1100
1000 0000
1111 1111
0111 1111
Hint: The most significant bit is -128.
4.9 How are floating point numbers represented in binary?
WWW:
SA
EBI:
PA
TA
ReAct:
1101
1111
1001
0001
0011
1010
1110
1100
1011
0101
0111
1111
WWW:
SA
EBI:
PA
TA
ReAct:
Data Representation
Understand how computers encode characters
Binary
Symbol
Binary
Symbol
Binary
Symbol
Binary
Symbol
Binary
0100 0001
0110 0001
0010 0001
0100 0000
Space
0010 0000
0100 0010
0110 0010
"
0010 0010
0101 1011
0100 0011
0110 0011
0010 0011
0101 1100
0100 0100
0110 0100
0010 0100
0101 1101
0100 0101
0110 0101
0010 0101
0101 1110
0100 0110
0110 0110
&
0010 0110
0101 1111
0100 0111
0110 0111
'
0010 0111
0110 0000
0100 1000
0110 1000
0010 1000
0111 1011
0100 1001
0110 1001
0010 1001
0111 1100
0100 1010
0110 1010
0010 1010
0111 1101
0100 1011
0110 1011
0010 1011
0111 1110
0100 1100
0110 1100
0010 1100
0011 0000
0100 1101
0110 1101
0010 1101
0011 0001
0100 1110
0110 1110
0010 1110
0011 0010
0100 1111
0110 1111
0010 1111
0011 0011
0101 0000
0111 0000
0011 1010
0011 0100
0101 0001
0111 0001
0011 1011
0011 0101
0101 0010
0111 0010
<
0011 1100
0011 0110
0101 0011
0111 0011
0011 1101
0011 0111
0101 0100
0111 0100
>
0011 1110
0011 1000
0101 0101
0111 0101
0011 1111
0011 1001
0101 0110
0111 0110
0101 0111
0111 0111
0101 1000
0111 1000
01011001
0111 1001
01011010
0111 1010
WWW:
SA
EBI:
PA
TA
ReAct:
10
Character
0110 1000
0110 0101
0110 1100
0110 1100
0110 1111
6.2 Use the table of ASCII binary codes to decode this:
Character
S
a
n
T
a
C
l
a
u
s
Hint: Dont forget the space.
6.3 The ASCII code for a blank space is:
WWW:
SA
EBI:
PA
TA
ReAct:
11
WWW:
SA
EBI:
PA
TA
ReAct:
12
How big can you make the image before it gets blurry?
Reload the original image and change its colour depth. Summarise what happens as the colour
depth decreases.
WWW:
SA
EBI:
PA
TA
ReAct:
13
Number of colours
Range
1 bit
01
2 bits
3 bits
4 bits
8 bits
16 bits
24 bits
32 bits
7.4 Fill in the grid to reveal what character this code produces (0 = black and 1 = white)
Binary code
0000
0111
0111
0001
0111
0111
0000
WWW:
SA
EBI:
PA
TA
ReAct:
14
7.5 Produce the binary code to produce the letter G in the grid below (0 = black and 1 = white)
Binary code
7.6 Calculate the file size of an image with dimensions of 3 inches x 4 inches, a pixel density of 300
pixels per inch and a colour depth of 8 bits. Give your answer in bytes.
Hint: The formula for calculating the file size of a bitmap image is (height x pixel density) x (depth x
pixel density) x colour depth and there are 8 bits in a byte.
7.7 Calculate the file size of an image with dimensions of 5 inches x 7 inches, a pixel density of 400
pixels per inch and a colour depth of 3 bits. Give your answer in bytes.
WWW:
SA
EBI:
PA
TA
ReAct:
15
amplitude
time
analogue signal
sampling period
8.2 Describe the process of converting analogue sound waves into digital data.
WWW:
SA
EBI:
PA
TA
ReAct:
16
8.6 What is the sampling rate for CD audio? Give your answer in kHz.
8.7 In the context of digital sound, what is meant by the term bit depth?
8.8 How many bits per sample are used for CD audio?
8.11 What is the highest frequency the human ear can detect?
8.13 Calculate the file size of a CD quality, stereo sound track that is 2.5 minutes long.
Give your answer in megabytes to 1 decimal place.
WWW:
SA
EBI:
PA
TA
ReAct:
17
8.14 Calculate the bit depth of a 10.3 MB, 3 minute, stereo sound track, with a sampling rate of
30 kHz.
8.15 An analogue-to-digital converter samples the temperature of a furnace every two hours.
Each sample is stored as a 32-bit number. How many bytes of data are stored in a week?
Understand the limitations of binary representation of data and how bit length constrains
the range of values that can represented
9.1 What range of values can be represented in 8 bits?
9.2 Explain what the number of bits used for the exponent and mantissa determine.
WWW:
SA
EBI:
PA
TA
ReAct:
18
Number of bytes
1 kilobyte (KB)
= 1024 bytes
1 megabyte (MB)
= 1024 kilobytes
1 gigabyte (GB)
= 1024 megabytes
1 terabyte(TB)
= 1024 gigabytes
Understand the need for data compression and methods of compressing data and that
JPEG and MP3 are examples of lossy algorithms
11.1 Describe the three strategies for compressing data:
Lossless
Lossy
Superchannel
WWW:
SA
EBI:
PA
TA
ReAct:
19
11.2 Discuss the pros and cons of each method of compressing data
Pros
Cons
Lossless
Lossy
Superchannel
WWW:
SA
EBI:
PA
TA
ReAct:
20
11.4 Fill in this table to help you see what a difference compression makes to file size.
File A
File B
File C
WWW:
SA
EBI:
PA
TA
ReAct:
21
12.2 In the table below, the image is encoded in binary. The first binary pair represents a colour (00
= blue, 01 = white, 10 = yellow, 11 = green) and the second binary number represents the run
length of the colour. So, for example, 00, 1101 represents blue, 13 pixels. Shade the squares
(pixels) in the table to recreate the image.
Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9
Line 10
Line 11
Line 12
Line 13
Line 14
Line 15
Line 16
10 10000
WWW:
SA
EBI:
PA
TA
ReAct:
22
12.3 Answer these questions based on the image on the previous page.
How many bytes are required to
represent the uncompressed file?
Remember: number of squares in grid x 2
/8
How many bytes are required to
represent the RLE encoded file?
Remember: number of codes x number
of bits in each code / 8
How much storage space have you
saved?
12.4 Use the Run Length Encoding Calculator to encode these text strings.
Text string
Answer
AAAABBBBBBBBBCADDDDEEFFFFFFFF
ABCABCABCABCABCABCABCABCABCS
BBGGYYAACCFFEEBBGGYYAACCFFEE
WWW:
SA
EBI:
PA
TA
ReAct:
23
WWW:
SA
EBI:
PA
TA
ReAct:
24
12.8 Complete this lookup table of all the words used more than once in the song.
Lookup table
0.
The
1.
wheels
2.
on
3.
the
4.
5.
6.
7.
12.9 Use the lookup table you have completed to encode the song, replacing repeated words
with the number representing their positing in the table.
WWW:
SA
EBI:
PA
TA
ReAct:
25
WWW:
SA
EBI:
PA
TA
ReAct:
26
Understand that file storage is measured in bytes and that data transmission is measured
in bits per second, and be able to calculate the time to transmit a file and storage
requirements for files
13.1 Answer these questions (giving all answers to 2 decimal places):
Question
Answer
13.2 How much storage space is required for 50 images, each with dimensions of 3 inches x 4
inches, a bit-map density of 300 pixels per inch and a colour depth of 8 bits.
Give your answer in megabytes to 1 decimal place.
WWW:
SA
EBI:
PA
TA
ReAct:
27
Encryption
Understand the need for data encryption
14.1 Crack this code!
14.2 Who uses encryption and what do they use it for what?
Users of encryption
Businesses
Individuals
Governments
E-traders
The military
WWW:
SA
EBI:
PA
TA
ReAct:
28
Shift
+3
+4
Encrypted text
+5
-3
Databases
Understand the characteristics of structured and unstructured data
16.1 Give some examples of unstructured data.
WWW:
SA
EBI:
PA
TA
ReAct:
29
Name
Terry
Maria
Sam
Toni
Bob
Charlie
Breed
Lion
Chimpanzee
Gibbon
Tiger
Red deer
Chimpanzee
Gender
Male
Female
Female
Female
Female
Male
Date_Of_Birth
30/6/1982
12/3/2012
10/6/2002
18/6/2009
6/7/2007
19/7/2011
Enclosure
Big Cats
Ape House
Ape House
Big Cats
Deer Park
Ape House
Capacity
12
50
50
12
200
50
Headkeeper
J Milner
S Larkin
S Larkin
J Milner
A Hunt
S Larkin
Record
Field
WWW:
SA
EBI:
PA
TA
ReAct:
30
17.5 Re-organise the data from the Zoo table into two linked tables called Animal and Enclosure.
Animal
Enclosure
Symbol
Equal to
Less than
Greater than
Less than or equal to
Greater than or equal to
Not equal to
WWW:
SA
EBI:
PA
TA
ReAct:
31
The table below is called Marksheet and it contains details of the marks students have achieved in
three different school assignments as well as their average mark.
Marksheet Table
Name
Aisha
Katharine
Fiona
Gareth
Jo
Manjit
Ian
Michael
Ubaid
Simon
Mark
Gemma
Shan
Alex
Philip
Assign1
51
75
100
86
38
66
13
43
55
40
0
52
30
56
90
WWW:
SA
Assign2
60
76
87
65
52
64
17
33
50
40
25
78
37
30
86
EBI:
PA
TA
Assign3
64
48
72
69
44
68
26
44
55
48
15
78
39
54
85
Average
58
70
86
73
45
66
19
40
53
43
13
69
35
47
87
ReAct:
32
18.2 Write down the outcome you would get if you ran each of these commands. The first one has
been done for you.
SELECT Name FROM Marksheet WHERE Assign1 > 50
Name
Aisha
Katharine
Fiona
Gareth
Manjit
Ubaid
Gemma
Alex
Philip
SELECT Name FROM Marksheet WHERE Assign1 = 0
WWW:
SA
EBI:
PA
TA
ReAct:
33
18.3 Write down the outcome you would get if you ran each of these commands:
SELECT Name, Average FROM Marksheet WHERE Average > 0 AND Average < 65
SELECT Name, Assign1, Assign2, Assign3 FROM Marksheet WHERE Assign1 <= 40 AND Assign2 <=
40 AND Assign3 <= 40
SELECT Name FROM Marksheet WHERE Assign1 < 50 OR Assign2 < 50 OR Assign3 < 50
Song Table
Song_Title
Hello Igglepiggle!
Time
0:38
Track_No
3
7:32
12
1:09
16
Hokey Cokey
Ten Green Bottles
Old MacDonald Had a farm
This Little Pig
Six Little Ducks
My Name is
Everythings Rosie Theme Tune
Summer Song
The Birdie Song
2:28
2:33
2:03
1:13
1:02
1:21
0:43
1:54
2:23
1
12
1
3
12
5
12
21
12
Album Table
Album_Title
In The Night Garden A
Musical Journey
Heads, Shoulders, Knees &
Toes
50 Nursery Rhyme Songs
CBeebies the Album
Childrens Party Time
WWW:
SA
Artist
Andrew Davenport
Released
2007
Genre
Childrens music
2004
Childrens music
Countdown Kids
Various Artists
Kids Players
2009
2012
1995
Childrens music
Childrens music
Childrens music
EBI:
PA
TA
Album_Title
In The Night Garden A Musical
Journey
In The Night Garden A Musical
Journey
In The Night Garden A Musical
Journey
Heads, Shoulders, Knees & Toes
Heads, Shoulders, Knees & Toes
50 Nursery Rhyme Songs
50 Nursery Rhyme Songs
50 Nursery Rhyme Songs
CBeebies the Album
CBeebies the Album
CBeebies the Album
Childrens Party Time
ReAct:
34
18.4 Based on the Song and Album tables write the SQL commands to:
a) display the title, track number, time and artist of all the songs in the Song table:
b) display the song and album titles for all the songs recorded by Countdown Kids:
Food_Item Table
Product_Code
1239T
1237T
1309T
4550F
3444F
2121G
5544C
Product_Name
Baked beans
Tomato soup
Spaghetti hoops
Oven chips
Fish fingers
Frankfurters
Sausage rolls
Price
0.34
0.56
0.80
1.24
1.45
1.02
2.45
Supplier_Code
S121/A
S121/A
S121/A
S234/F
S234/F
S009/C
S100/C
Quantity_In_Stock
154
450
99
550
756
52
150
18.5 The table above contains details of food items stocked by a supermarket.
a) Write the SQL command to insert a new record into this table, for a product with the
following details:
Product_Code: 5500C
Product_Name: Pork Pie
Price: 2.45
Supplier_Code: S100/C
Stock: 150
b) Write the SQL command to update the record for Tomato soup in the Food_Item table
above: the Quantity_In_Stock is now 415.
WWW:
SA
EBI:
PA
TA
ReAct:
35
18.6 For the Supplier table below, write the SQL command to update the record for Smiths Pork
Products whose email address is now BHSwinefoot@Smith.com.
Supplier Table
Supplier_Code
S121/A
S234/F
S009/C
S100/C
Supplier_Name
Williamsons Ltd
Artic Foods
A Taste of Germany
Smiths Pork Products
Email
orders@williamson.com
orders@aff.co.uk
weissrock@dtv.de
OAAdam@Smith.com
b) delete one more record of your choice from the Song table:
c) Write the SQL command to create a table called ExamTimetable. The table should include
the following fields:
Examination
Date
Time
Duration
Taken_Place
Dont forget that you need to specify a suitable data type for each field.
WWW:
SA
EBI:
PA
TA
ReAct:
36
TestScores Table
StudentID
English
JMD1
76
MH1
51
JHM1
70
CJC1
59
GMM2
42
BD3
78
SRM2
96
LMRM1
49
ABL1
17
GML2
35
AK3
93
CJM1
36
AK4
49
CJD1
78
LTD2
39
Choices Table
StudentID First_Name
JMD1
Julie
MH1
Mandeep
JHM1
Jo
CJC1
Chris
GMM2
Geraldine
BD3
Ben
SRM2
Steven
LMRM1
Lewis
ABL1
Adam
GML2
Grace
AK3
CJM1
AK4
CJD1
LTD2
Aquil
Charlotte
Amelie
Cala
Lola
WWW:
SA
Maths
55
67
96
54
70
77
64
24
49
83
3
67
66
83
40
Science
55
87
79
22
90
75
7
79
65
72
80
11
25
82
52
Surname
Davies
Heer
Morris
Charter
McGuiness
Dodd
Mitchell
Mitchell
Lewis
Langham
Subject1
English
English
Maths
English
Maths
English
Maths
Computer Science
English
English
Khan
Mansell
Khalil
Dickenson
Dukes
Biology
English
Maths
English
Maths
EBI:
PA
TA
ComputerScience
40
34
62
41
67
82
21
55
67
67
24
47
33
90
42
German
46
58
14
21
47
17
92
44
78
23
91
5
55
70
55
Subject2
Maths
History
Biology
History
Physics
German
Biology
History
Maths
Computer
Science
Chemistry
German
Biology
Maths
Chemistry
History
68
48
42
80
27
47
33
83
49
56
29
42
90
76
43
Music
24
93
72
53
15
22
18
67
65
79
81
2
15
51
30
Subject3
Computer Science
Music
Chemistry
Music
Computer Science
Music
Chemistry
Music
Physics
History
Physics
History
Music
Music
History
ReAct:
37
18.8 The two related tables, TestScores and Choices, contain information about students results in
their latest GCSE mocks and their A level choices. Write down the outcome you would get if you
ran each of these commands:
a) SELECT First_Name, Surname FROM Choices WHERE Subject1 = English AND Subject2 =
Maths
d) SELECT Subject1, Subject2, Subject3 FROM Choices WHERE Student_ID IN (CJC1, GML2,
AK3, CJD1)
WWW:
SA
EBI:
PA
TA
ReAct:
38
c) delete records from both tables for the student with the StudentID AK3:
d) display the first name, surname and English score of all students:
WWW:
SA
EBI:
PA
TA
ReAct:
39
Homework
Homework 3.1
Convert the following binary numbers to denary:
Binary
Denary
10111101
10110011
10111111
11010011
10101011
Convert the following denary numbers to binary:
Denary
Binary
254
68
70
83
212
Add up these binary numbers, check your answers by converting them to denary.
1111
0001
1101
0101 +
1110 +
1111 +
WWW:
EBI:
SA
PA
TA
ReAct:
40
Homework 3.2
Add the following key terms and their definitions to Quizlet.
ASCII
Bitmap
Colour Depth
Homework 3.3
Add the following key terms and their definitions to Quizlet.
Analogue Data
Sampling Rate
Bit Depth
Sample
Memorise the definitions for the key terms above.
Homework 3.4
Add the following key terms and their definitions to Quizlet.
Lossless
Lossy
Super channel
Run Length Encoding
Memorise the definitions for the key terms above.
WWW:
SA
EBI:
PA
TA
ReAct:
41
Homework 3.5
Use four different colours to draw an image in the grid below.
Now encode the image using a 2-bit binary number to represent the colour depth and a 4-bit
binary number to specify the run length of the pixels to be filled with that colour.
Line 1
Line 2
Line 3
Line 4
Line 5
Line 6
Line 7
Line 8
Line 9
Line 10
Line 11
Line 12
Line 13
WWW:
SA
EBI:
PA
TA
ReAct:
42
Homework 3.6
A lookup table has been used to encode this text:
Encoded text
0.
Lossy
1.
data
2.
compression
3.
is
4.
lossless
5.
the
6.
of
7.
files
8.
original
9.
to
10.
be
11.
lossy
12.
used
13.
and
14.
by
WWW:
SA
EBI:
PA
TA
ReAct:
43
Homework 3.7
Create your own cipher and then use it to encrypt a secret message. Make sure you keep a
note of the key to cracking your cipher, so that you (or someone else) can decode the
message later!
Homework 3.8
Produce a step-by-step guide to using a Caesar cipher to produce an encoded message.
WWW:
SA
EBI:
PA
TA
ReAct:
44
Homework 3.9
The table below is called PlayList and it lists some of the songs on five albums of childrens songs.
PlayList Table
Album_Title
In The Night Garden
A Musical Journey
In The Night Garden
A Musical Journey
In The Night Garden
A Musical Journey
Heads, Shoulders,
Knees & Toes
Heads, Shoulders,
Knees & Toes
50 Nursery Rhyme
Songs
50 Nursery Rhyme
Songs
50 Nursery Rhyme
Songs
CBeebies the Album
Artist
Andrew
Davenport
Andrew
Davenport
Andrew
Davenport
The C.R.S.
Players
The C.R.S.
Players
Countdown Kids
Released
2007
Countdown Kids
2009
Countdown Kids
2009
Various Artists
2012
Various Artists
2012
Various Artists
2012
Kids Players
1995
2007
2007
2004
2004
2009
Genre
Childrens
music
Childrens
music
Childrens
music
Childrens
music
Childrens
music
Childrens
music
Childrens
music
Childrens
music
Childrens
music
Childrens
music
Childrens
music
Childrens
music
Track_No
3
Song_Title
Hello Igglepiggle!
Time
0:38
12
7:32
16
Hokey Cokey
2:28
12
2:33
2:03
12
1:02
My Name is
1:21
12
0:43
21
Everythings Rosie
Theme Tune
Summer Song
12
2:23
1:09
1:13
1:54
The data in the table above could be split into two tables (Album and Song) list the fields that
would be placed in each table.
Album Table
Song Table
WWW:
SA
EBI:
PA
TA
ReAct:
45
Homework 3.10
Use the Playlist table to help you answer these questions:
Write down the outcome you would get if you ran each of these commands.
SELECT Track_No, Song_Title FROM PlayList WHERE Album_Title IN (50 Nursery Rhyme Songs,
CBeebies the Album)
SELECT Album_Title, Track_No, Song_Title FROM PlayList WHERE Time > 2.30
Now write three SQL queries of your own, giving the outcome for each one.
Write a query using SELECT FROM WHERE and either a comparison operator (=, <, >, <=, >=,
<>) or a Boolean operator (AND, OR):
WWW:
SA
EBI:
PA
TA
ReAct:
46
Homework 3.11
Here are two related tables: Animal and Enclosure.
Animal
ID
C009
A002
A019
C015
B033
A007
Name
Terry
Maria
Sam
Toni
Bob
Charlie
Enclosure
Enclosure
Big Cats
Ape House
Deer Park
Breed
Lion
Chimpanzee
Gibbon
Tiger
Red deer
Chimpanzee
Capacity
12
50
200
Gender
Male
Female
Female
Female
Female
Male
Date_Of_Birth
30/6/1982
12/3/2012
10/6/2002
18/6/2009
6/7/2007
19/7/2011
Enclosure
Big Cats
Ape House
Ape House
Big Cats
Deer Park
Ape House
Headkeeper
J Milner
S Larkin
A Hunt
display the name, breed and headkeeper of all the animals in the Animal table:
display Tonis ID, date of birth and the capacity of her enclosure:
Now write an SQL command to extract information from both tables, and give the outcome of it.
WWW:
SA
EBI:
PA
TA
ReAct:
47
Homework 3.12
The questions below relate to the related tables Animal and Enclosure.
Write the SQL command to:
delete the record for the red deer from the Animal table.
delete the record for the Deer Park from the Enclosure table.
WWW:
SA
EBI:
PA
TA
ReAct:
48
Glossary
Analogue Data
An analogue signal is one which has a value that varies smoothly.
ASCII
The American Standard Code for Information Interchange is used to represent each character,
number and symbol. It has space for 128 symbols, this is enough for standard English.
Binary
A base-2 number system that is used in digital circuits, it uses two digits, 0 and 1. 1 represents the
on state of a digital circuit and 0 represents the off state.
Bit Depth
This refers to the number of bits in each sample, combined with the sample rate it determines the
quality of the sound.
Bitmap
Consists of a grid of squares called pixels. Each pixel can be uniquely identified by its position in
the grid (x/y coordinates) and each pixel is a single colour.
Caesar Cipher
One of the simplest encryption methods, it is a substitution cipher that involves replacing each
letter with the letter that is three places further down the alphabet.
Colour Depth
This is number of bits used to store each pixels colour is in an image. The greater it is, the more
colours can be represented.
Database
Denary
A base 10 number system consisting of the digits (0, 1, 2, 3, 4, 5, 6, 7, 8, 9) also known as decimal.
Encryption
Allows data to be kept secret and secure so no one else can make use of it. A key is used to
encrypt plain text into meaningless cipher text, the same key is used to decrypt the data back
into its original form.
Exponent
Determines the position of the binary point in a floating point number.
Field
One piece of data or information about a person or thing.
Foreign Key
Used to link tables together and create a relationship. It is a field in one table that is linked to the
primary key in another table.
49
Hexadecimal
A base 16 number system that is widely used in computing because it is a much shorter way of
representing a byte of data compared to binary.
Integers
Lossless Compression
Reduces the size of a file while retaining all the original data.
Lossy Compression
Mantissa
Primary Key
Record
A record is all of the data or information about one person or one thing.
A simple form of data compression in which sequences consisting of the same value are stored as
a single value and a number.
Samples
Taken at evenly spaced time intervals and represented as numerical values when digitising sound.
Sampling Rate
The number of samples taken per second and is measured in hertz (Hz).
Represents negative and positive numbers by placing an extra bit at the front of the number. 1
represents a negative number and 0 represents a positive number.
Signed Integers
Used to encode negative numbers in binary, the two main methods are sign and magnitude and
twos complement.
Structured Data
Generally refers to data that has been organised and stored using a database.
Superchannel
A form of compression where special data are selected for a special reason. These data are
separated from the rest, and the rest are thrown out.
Table
Stores all the records for a particular category.
50
Transistors
Switches that are used in digital circuits, in their off state they represent a 0 and in their on state
they represent a 1. Computers use combinations of millions or even billions of transistors to carry
out instructions.
Two's Complement
The method most computers use to represent integers. To represent a negative integer you invert
the digits and add one to the result.
Unstructured Data
Generally refers to data that has not been organised and stored using a database.
51
SQL Commands
Command
SELECT (FieldName, )
FROM TableName
WHERE condition
ORDER BY (FieldName, ..)
SELECT (FieldName, )
FROM Table1Name, Table2Name,
WHERE join criteria
ORDER BY (FieldName, ..)
UPDATE TableName
SET (FieldName=Value, )
WHERE condition
DELETE FROM TableName
WHERE condtion
CREATE TABLE TableName
(FieldName data type, )
INSERT INTO TableName
VALUES (Value, )
SELECT FieldName
FROM TableName
WHERE FieldName LIKE pattern
Description
Retrieves data from a table. (The asterisk * can be
used if all columns are required in the output.
Retrieves data from two related tables.
T2
T3
T4
T5
T6
T7
Use the glossary to help you to identify key points you have missed out.
T8
T9
T10
T11
T12
T13
T14
Take responsibility: complete all work in full and on time to the best of your ability.
52