Cambridge Lower Secondary CheckpointStage 8

Managing Data

Computing Stage 8 Chapter Notes

What this chapter covers

Managing Data
ShareWhatsAppPost
Managing Data notes

Unable to load PDF

The notes viewer could not load. Please refresh the page.

Read online free. Download a watermarked copy with a free account.

Read the notes

The full Managing Data notes as text: skim, search, and jump between subtopics.

~10 min read

1. Introduction to Databases and Data Models

A database is a structured collection of data, organised for easy access, management, and updating. Think of it as a highly organised electronic filing cabinet. To create a useful database, we first build a data model. A data model is a digital representation of a real-life scenario, breaking it down into individual attributes (data items) that a computer can understand and process. For example, to model a 'student', we would identify attributes like 'student ID', 'name', and 'date of birth'. This process helps us decide what data we need to store and how to structure it.

Key term

Data Model: A digital representation of a real-life scenario, breaking it down into individual attributes which are represented as data items.

Examiner insight

Examiners look for a clear understanding that a data model is an abstract representation used to design the final database structure.

Fun fact

The concept of databases dates back to the 1960s, but one of the earliest large-scale computerised databases was the SABRE airline reservation system, which went live in 1964 and is still used in a modern form today.

Worked example 14 marks

A local sports club wants to create a digital system to manage its members. Explain why using a database would be more suitable than a simple text document.

  1. 1
    1. A database provides structure. It would allow the club to store each piece of member information (e.g., name, age, membership type) in separate fields, making the data organised.
  2. 2
    1. It allows for efficient searching and sorting. The club could quickly find all members over 18 or sort members by their last name.
  3. 3
    1. It supports data validation to ensure information is accurate. For example, it could ensure a 'membership start date' is a valid date.
  4. 4
    1. A database can handle relationships between data, such as linking members to the teams they play for, which is difficult in a simple text file.

Recap

  • A database is an organised collection of data.
  • A data model is a plan or blueprint for a database based on a real-world situation.
  • Data modelling involves identifying the essential data items needed to represent a scenario.
  • Databases are powerful tools for storing, organising, and retrieving information efficiently.

Quick check

  1. What is the main purpose of creating a data model before building a database?2 marks

2. Database Structure: Entities, Fields and Keys

Databases are organised into tables. Each table represents an 'entity', which is a person, place, thing, or concept we want to store data about (e.g., 'Student', 'Book', 'Order'). Each table is made up of columns called 'fields' and rows called 'records'. A field represents a single piece of information about the entity (e.g., 'FirstName'). A record contains all the data for one instance of the entity (e.g., all the information for a single student). To uniquely identify each record, we use a 'primary key'. A primary key is a field containing a value that is unique for every record in the table, like a Student ID number.

Key term

Primary Key: A field in a database table that uniquely identifies each record in that table.

Examiner insight

Marks are often awarded for justifying the choice of a primary key by explaining why other fields are unsuitable (e.g., they might contain duplicate values).

Common pitfall

Mistaking a record for a field. A field is a single column (like 'Email'), while a record is an entire row of data for one person or thing.

Worked example 13 marks

A table in a library database is designed to store information about books. The fields are BookID, Title, Author, Genre, and PublicationYear. Identify the entity, an example record, and a suitable primary key.

  1. 1
    1. Entity: The entity is 'Book', as the table is storing information about books.
  2. 2
    1. Example Record: A record would be a single row, for example: {BookID: 1023, Title: 'The Hobbit', Author: 'J.R.R. Tolkien', Genre: 'Fantasy', PublicationYear: 1937}.
  3. 3
    1. Primary Key: The most suitable primary key is 'BookID'. The title is not suitable as two books could have the same title, but the BookID will be unique for every book.

Recap

  • A database table represents a single entity.
  • A field is a column in a table representing an attribute of the entity.
  • A record is a row in a table containing all the data for one instance of the entity.
  • A primary key is a field with a unique value for each record.
  • Choosing a good primary key is crucial for database integrity.

Quick check

  1. In a table of cars, which field would be a better primary key: 'Colour' or 'VehicleIdentificationNumber'?1 mark

3. Using Data Dictionaries

A data dictionary is a central source of information about the data in a database. It's like a detailed blueprint that defines the structure of the database tables. For each field, the data dictionary specifies its name, the type of data it will hold (e.g., Text, Number, Date/Time), its size or length (e.g., max 50 characters), any validation rules, and whether it's a primary key. Creating a data dictionary is a key step in database design as it ensures consistency and helps developers understand the data they are working with.

Key term

Data Dictionary: A table that outlines the field names, data types, field lengths, and other key features of each field in a database.

Examiner insight

Examiners expect you to be able to create a data dictionary table for a given scenario, correctly identifying appropriate data types and validation rules for different fields.

Worked example 13 marks

Create a data dictionary entry for a field designed to store the price of a product in a shop's database. Include the field name, data type, and a suitable validation rule.

  1. 1
    1. Field Name: 'ProductPrice'. The name is clear and descriptive.
  2. 2
    1. Data Type: 'Currency' or 'Decimal Number'. This data type is appropriate for storing monetary values with decimal places.
  3. 3
    1. Validation Rule: '>= 0'. This is a range check to ensure the price cannot be a negative number, which would be invalid.

Worked example 24 marks

A database for a vet clinic needs a field to store the species of an animal (e.g., 'Dog', 'Cat', 'Rabbit'). Describe two key entries for this field in the data dictionary.

  1. 1
    1. Field Name: 'Species'. Data Type: 'Text'.
  2. 2
    1. Validation Rule: A lookup list or presence check. A lookup list containing 'Dog', 'Cat', 'Rabbit', 'Hamster', 'Fish' would be ideal to restrict entries to a predefined set and prevent spelling errors. A presence check would ensure the field is not left blank.

Recap

  • A data dictionary defines the structure and properties of every field in a database.
  • It includes field name, data type, size, and validation rules.
  • Data dictionaries ensure consistency and are essential for database development and maintenance.
  • Choosing the correct data type (e.g., Number for calculations, Text for names) is vital.

Quick check

  1. What data type would be most appropriate for a 'DateOfBirth' field?1 mark
  2. Why is defining a field length in a data dictionary useful?2 marks

4. Data Validation Techniques

Data validation is the process of using automatic checks to ensure that the data entered into a database is sensible, reasonable, and complete. It helps to improve data quality by catching errors at the point of entry. It does not check if the data is correct (this is verification), but only if it is plausible. Common validation checks include: Presence check (ensures a field is not left empty), Type check (ensures the data is of the right type, e.g., a number in a 'Quantity' field), Range check (ensures a number is within a specific range, e.g., age between 0 and 120), Format check (ensures data matches a specific pattern, e.g., a postcode like 'SW1A 0AA'), and Length check (ensures data is a certain number of characters long).

Key term

Data Validation: The process of automatically checking data entered into a system to ensure it is sensible, reasonable, and within expected boundaries.

Examiner insight

Be specific. Instead of just saying 'a check', name the specific type of validation check (e.g., range check, format check) and explain how it applies to the given data.

Common pitfall

Confusing validation with verification. Validation is an automatic check for sensibility (e.g., is the email in a valid format?). Verification is confirming data is correct, often by double-entry or checking with the user (e.g., 'Please re-type your email address').

Worked example 12 marks

A website asks users to create a new password. The password must be at least 8 characters long. What type of validation check should be used?

  1. 1
    1. The validation check required is a 'Length Check'.
  2. 2
    1. It would be configured to check that the number of characters entered in the password field is greater than or equal to 8.

Worked example 23 marks

A school database has a field for 'ExamPercentage'. Suggest a suitable validation rule and state the type of check it is.

  1. 1
    1. A suitable validation rule would be to check if the number is between 0 and 100 inclusive.
  2. 2
    1. This can be written as '>= 0 AND <= 100'.
  3. 3
    1. This is an example of a 'Range Check'.

Recap

  • Data validation improves the quality of data by checking it upon entry.
  • A presence check ensures a field is not left blank.
  • A range check ensures a value falls within an allowed minimum and maximum.
  • A format check ensures data conforms to a specific pattern, like an email address.
  • Validation checks if data is reasonable, not if it is factually correct.

Quick check

  1. What type of validation check prevents a user from typing 'abc' into a field for their age?1 mark
  2. Give an example of a field that would require a presence check.1 mark

5. Data Capture Forms

While you can enter data directly into a database table, it's not very user-friendly and can lead to errors. A data capture form is a screen or window with an organised layout designed for easy and accurate data entry. It presents the fields from a table in a clear, logical order, often with helpful labels and instructions. Forms can use features like drop-down lists (from lookup validation), tick boxes, and calendars to make data entry faster and more accurate. When a user fills in the form and clicks 'Save' or 'Submit', the data is automatically placed into the correct fields in the underlying database table.

Key term

Data-Capture Form: A user-friendly interface designed for entering, viewing, or editing data for a single record in a database table.

Examiner insight

Students who can link the features of a data capture form (like drop-down lists) back to the underlying database concepts (like validation rules and data types) demonstrate a deeper understanding and tend to score higher.

Fun fact

Every time you sign up for a new website, fill out a contact form, or buy something online, you are using a data capture form that feeds information into a company's database.

Worked example 14 marks

Explain two advantages of using a data capture form to enter new customer details instead of typing directly into the database table.

  1. 1
    1. User-Friendliness: A form can be designed to be more intuitive and less intimidating than a raw table grid. It can guide the user through the entry process with clear labels and instructions.
  2. 2
    1. Improved Accuracy: Forms can incorporate user interface controls like drop-down menus for 'Country' or calendars for 'Date of Birth'. This prevents spelling mistakes and ensures data is in a consistent format, improving data quality.

Recap

  • Data capture forms provide a user-friendly interface for data entry.
  • They improve accuracy by using controls like drop-down lists and date pickers.
  • Forms can be designed to show data for only one record at a time, reducing confusion.
  • Data entered into a form is saved to the linked database table.
  • Good form design is an important part of creating a usable database application.

Quick check

  1. Name one type of form control that can help prevent spelling errors during data entry.1 mark

End-of-chapter exercise

Test yourself on the whole chapter. Work through these before moving on.

  1. Define the terms 'field', 'record', and 'entity' in the context of a database.3 marks
  2. A database table stores details about cars for sale. Suggest a suitable primary key for the table and justify your choice.2 marks
  3. Explain the difference between data validation and data verification, giving an example of each.4 marks
  4. A school is creating a database to store student information. For the 'YearGroup' field, which must be a number from 7 to 13, name and describe the validation check that should be used.2 marks
  5. Describe two ways a data capture form can help to reduce data entry errors.4 marks
  6. A new social media app requires users to provide their date of birth. Create a data dictionary entry for this field, including field name, data type, and a suitable validation rule.3 marks
  7. A company stores employee data. The 'EmployeeID' field has a format of 'EMP' followed by four digits (e.g., 'EMP1234'). Name and describe the validation check needed to ensure data is entered in this format.2 marks
  8. A database is being created for a movie rental store. One table will store customer details. Decompose the 'Customer' entity into five appropriate fields and suggest a suitable data type for each.5 marks
  9. Why is a data dictionary an important tool for a team of developers working on the same database application?3 marks
  10. Design a data dictionary for a database table that will store details of products sold on an e-commerce website. The table must store a unique product code, product name, description, price, and stock level. Justify your choice of data types and validation rules for the 'Price' and 'StockLevel' fields.8 marks

Go deeper

Practise and revise with member-only material for this chapter.

Free notes are just the start.

Unlock every Workbook and Chapter at a Glance, and generate your own worksheets and predicted papers.

Explore plans

Related chapters