Databases (CIE IGCSE Computer Science)

Revision Note

Test Yourself
Amy Fellows

Expertise

Computer Science

Single Table Databases

  • A database is a structured collection of data so it can be searched, sorted, filtered and analysed quickly
    • Data in a database can be any type of data including text, images, videos, sound
  • Databases use tables to store data
  • Tables have records of data represented by one row
    • In the example below, each row represents the data stored about a single customer (the customer’s record)
    • In the customer table there are 3 records
    • Each record is divided into fields (CustomerID, FirstName, LastName, DOB and Phone Number)

A Database Table Containing Customer Details


CustomerID


FirstName


LastName


DOB

PhoneNumber

1

Andrea

Bycroft

05031976

0746762883

2

Melissa

Langler

22012001

0756372892

3

Amy

George

22111988

0746372821

  • Fields are represented by the columns in a table
    • There are 5 fields in the customer table
    • The first row in a table contains the field names which is the heading for the data stored in that field
    • Each field in a table has a data type which defines what data can be entered into that field

Worked example

A Database Table Containing Pet Details


DogID


Name


Breed


Age


Gender

DG12

Smokey

Poodle

12

M

DG34

Harvey

Springer Spaniel

10

M

DG48

Maisie

Labradoodle

3

F

DG49

Maggie

Labradoodle

3

F

DG88

Winston

Bulldog

7

M

DG95

Shona

Golden Retriever

6

F



How many fields are there in the Dogs table shown above?

[1]

5 [1]

How many records are there in the Dogs table?

[1]

6 [1]

Exam Tip

  • It is very likely you will be presented with an example database table and identify either how many fields there are or how many records there are so make sure you remember a record is row and a field is a column

Validation and Verification

  • Verification checks check whether the data that has been entered is the correct data and is accurate
    • This is often completed by getting data entered by one person is then checked by another person
  • When a table is created, validation rules can be assigned to the different fields
    • A validation rule controls what data can be entered into that field
    • There are different types of validation checks used to limit what data can be entered into each field 

The different types of validation check


Type


Description

Length Check

This type of validation checks the number of characters that have been entered into a field. For example, you might make phone numbers entered have to be eleven characters long

Format Check

This type of validation checks data entered meets an exact format. For example, a product code might have to be two letters followed by five numbers

Range Check

A range check will check the number entered is within a specific range. For example, the age of a dog would be between 0 - 40. Any other number would be disallowed

Presence Check

A presence check can be added to fields which cannot be left blank

Type Check

A type check will allow data with a specific data type to be entered into a field. For example, if text was entered into a field which is supposed to contain the date of birth of a person it would not be allowed

Check Digits

Check digit validation is a process used to verify the accuracy of numbers such as credit card numbers. A check digit is a single digit added to the end of the number, which is calculated based on a specific algorithm applied to the other digits in the number. When the data is re-entered the same algorithm can be applied and if it produces a different result the code is incorrect

Worked example

A Database Table Containing Student Grades


StudentID


FirstName


LastName


MarkSubmitted


Percentage

1483792

Shanay

Giles

Y

55

1498378

Poppy

Petit

N

20

1500121

Diya

Dinesh

Y

74

1382972

Joe

Swaile

Y

68

1598264

Anton

Smith

Y

34

1548282

Felicity

Hall

N

47



Describe two validation checks that could be used to check data being inputted into the table above

[4]

StudentID could have a length check to ensure 7 characters are entered [2]

FirstName and LastName could have a presence check to make a record cannot be entered without entering the name of the student [2]

A type check of boolean could be applied to the Mark Submitted field so that only Y or N are entered [2]

A range check could be assigned to the Mark column to ensure only numbers between 0 and 100 are entered [2]

Data Types

  • Table fields are represented by columns in a table
  • There are 5 fields in the customer table below
    • These include CustomerID, FirstName, LastName, DOB and PhoneNumber

A Database Table Containing Customer Details


CustomerID


FirstName


LastName


DOB


PhoneNumber

1

Andrea

Bycroft

05031976

0746762883

2

Melissa

Langler

22012001

0756372892

3

Amy

George

22111988

0746372821

  • Each field in a table, has a data type
    • Common data types include text/alphanumeric, character, boolean, integer, real and date/time
    • Phone numbers have to be assigned the text/alphanumeric data type because they begin with a 0
      • If you assigned the data type Integer to a phone number it would remove the initial 0

Database Data Types


Data Type


Explanation


Example

Text/Alphanumeric

This data type allows letters, special characters like spaces and punctuation and numbers to be entered into a field

NG321AE

Character

This allows single characters to be entered into a field. Characters can be any alphanumeric value and can be lowercase or uppercase

A

Boolean

This data type can be used in fields where there are only two possible options. Data is stored as a 1 or 0 in the database but can be used to represent True/False or Yes/No

True/False

Integer

Only whole numbers can be entered

15

Real

Numbers including decimal numbers can be stored

30.99

Date/Time

Only dates or times can be entered into a field with this type. A format for the date/time can also be assigned to the field

180855

Worked example

A Database Table Containing Dog Details


DogID


Name


Breed


Age


Gender

DG12

Smokey

Poodle

12

M

DG34

Harvey

Springer Spaniel

10

M

DG48

Maisie

Labradoodle

3

F

DG49

Maggie

Labradoodle

3

F

DG88

Winston

Bulldog

7

M

DG95

Shona

Golden Retriever

6

F



What data type should Age be?

[1]

Integer [1]

What data type should DogID be?

[1]

Text/Alphanumeric  [1]

You've read 0 of your 0 free revision notes

Get unlimited access

to absolutely everything:

  • Downloadable PDFs
  • Unlimited Revision Notes
  • Topic Questions
  • Past Papers
  • Model Answers
  • Videos (Maths and Science)

Join the 100,000+ Students that ❤️ Save My Exams

the (exam) results speak for themselves:

Did this page help you?

Amy Fellows

Author: Amy Fellows

Amy has been a passionate Computing teacher for over 9 years, teaching Computer Science across the East Midlands, at all levels. Amy has also been a GCSE examiner for seven years.