Slides badge

Data dictionaries and Validation

Searching and sorting a database

Produce an SQL query to display everything about anyone with Intelligence >= 90 and Charisma of >= 90 from BondCharacters

Fields
Table
Criteria
Sort Order
  • Understand what a data dictionary is and how to implement one

  • Understand and implement database validation

  • I am able to explain and produce data dictionaries
  • I am able to use validation on my database

What is a data dictionary?

  • Data dictionaries are simply ways of describing the structure of a database before it is created.

  • A data dictionary contains:

    • The fields in a database table
    • If it's a key
    • What each field stores
    • The data type of each field
    • Any validation (e.g. size, range)

What is a data dictionary?

  • A data dictionary:
    • Helps plan the structure of a database
    • Reduces errors
    • Ensures correct data types are used
    • Makes the database easier to understand
    • Helps when working in a team

Validation

  • Validation on a database ensures that the user inserts the correct information into the database. 
  • Validation is applied to attributes in an entity. 
  • There are four forms of validation required for National 5 Computing Science. 
Validation Description Example
Presence check The field is required and data must be provided Email address is required.
Restricted choice The data must be selected from a list of valid entries (normally a dropdown box) Class could be 2L1, 2L2, 2G1, 2G2, 2T1 or 2T2
Length check The data must be of a specified length Phone numbers require exactly 11 digits, a validation rule could be added to ensure that phone numbers are exactly 11 digits
Range check The data must be within the range A score must be between 0 and 55 marks for a prelim

Database setup - Setting up validation - restricted choice

  • Select the Lookup Wizard as the field type.

Data dictionaries

Attribute Key Type Size Required Validation
BookISBN PK Text 13 Yes Length = 13
BookTitle Text
AuthorID* FK Number 11 Yes
BookPublishYear Number 4 Between 1900 and 2025
Author
Attribute Key Type Size Required Validation
AuthorID PK Number 11 Yes
AuthorName Text 30 Yes
AuthorDateOfBirth Date
Book

Data dictionaries tasks

  • Create data dictionaries for each of the following:
    • A database table is needed to store employee information. It will store a unique employee ID (8 characters long), the employee’s forename (required), surname (required), job title, department, annual salary (in pounds, required), and whether they work full time (required).
    • A database table is required to store information about video games in a shop. It will store a unique game ID (6 characters long), the game title (required), platform (required), age rating, price (in pounds, required), stock quantity (required), and release date.

Database Setup - Setting up validation

Length check

Presence check

Range check

Note - Number data types cannot have a field size - they are determined based on their data type (e.g. Integer or Double)

aDD VALIDATION

  • Edit your class database. If you haven't already got them, add eye colour, hair colour, year group (you are all S3, but you'll want your database to accept S1 to S6)
  • Add validation to your database to ensure that the user can only enter certain colours and year groups

Create a data dictionary

  • Open the Customer database. Create a data dictionary for that database.
  • Open the Database Practical notes on Google Classroom. Turn to page 10 and complete the tasks there.
Presentation Overview
Close
JB
Data Dictionaries and Validation
© 2020 - 2026 J Balfour
23:55 | 22-04-2026
Join Live Session
Go Live
Start Remote
Save Progress
Slideshow Outline
Presenter Mode
Bullet Only Mode
Generate Quiz
Generate Lesson Plan
Widget Screen
Canvas Controls
Fullscreen
Random Selector
Timer
Volume Meter
Binary Converter
Python Editor
Show Knox 90
Provide Feedback
Help
!
Keywords
    DragonDocs Management
    Random selector
    Set a timer for how long?
    10:00
    5:00
    3:00
    2:30
    2:00
    1:00
    ...
    Sections
      Binary conversion
      Denary to binary conversion
      Binary to denary conversion
      Feedback 👍
      Accessibility

      Apply a filter:

      Apply theme

      Blue theme
      White theme

      More effects:

      ×
      Loading
      All slideshow files