Data Types & Validation (Edexcel IGCSE ICT)

Revision Note

Robert Hampton

Expertise

Computer Science Content Creator

Data types

What is a data type?

  • A data type is the type of data that can be held in a field and is defined when designing a table in a database

  • Examples of common datatypes are:

    • Numerical/number - whole/decimal numbers

    • Alphanumerical - contains letters & numbers

    • Date/Time 

    • Boolean - true or false values

    • Currency

  • In the car table below, the following datatypes would be used:

    • car_id: numerical

    • make: alphanumerical

    • model: alphanumerical

    • colour: alphanumerical

    • price: currency

cars

car_id

make

model

colour

price

1

Peugeot

2008

Red

24950

2

Mazda

MX5

Blue

17995

3

Citroen

DS4

Black

21450

4

Ford

Puma

White

19500

Validation

What is validation?

  • Validation is used to check that an input from a user is acceptable and that it matches the requirements of the database

  • There are 5 main categories of validation which can be carried out on fields and data types, these are:

    • Length check

    • Type check

    • Range check

    • Presence check

  • There can be occasions where more than one type of validation will be used on a field

  • An example of this could be a password field which could have a length, presence and type check on it

input-validation

Length check

  • Checks the length of an input

  • An example is ensuring that a password is 8 or more characters in length

Type check

  • Check the data type of a field

  • An example is checking a user's age has been entered as an integer

Range check

  • Ensures the data entered as a number falls within a particular range

  • An example is checking a user's age has been entered and falls between the digits of 0-100

Presence check

  • Looks to see if any data has been entered in a field

  • An example is checking that a user has entered a name when registering for a website

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?

Robert Hampton

Author: Robert Hampton

Rob has over 16 years' experience teaching Computer Science and ICT at KS3 & GCSE levels. Rob has demonstrated strong leadership as Head of Department since 2012 and previously supported teacher development as a Specialist Leader of Education, empowering departments to excel in Computer Science. Beyond his tech expertise, Robert embraces the virtual world as an avid gamer, conquering digital battlefields when he's not coding.