Data Types & Validation (Edexcel IGCSE ICT)

Revision Note

Robert Hampton

Written by: Robert Hampton

Reviewed by: James Woodhouse

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

Last updated:

You've read 0 of your 5 free revision notes this week

Sign up now. It’s free!

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

Expertise: Computer Science Content Creator

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.

James Woodhouse

Author: James Woodhouse

Expertise: Computer Science

James graduated from the University of Sunderland with a degree in ICT and Computing education. He has over 14 years of experience both teaching and leading in Computer Science, specialising in teaching GCSE and A-level. James has held various leadership roles, including Head of Computer Science and coordinator positions for Key Stage 3 and Key Stage 4. James has a keen interest in networking security and technologies aimed at preventing security breaches.