WJ9 Z MMM 5 Tqs 9 ZHVB
WJ9 Z MMM 5 Tqs 9 ZHVB
Page 1 of 8
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources
Text files
A text file is useful when working with small amounts of data, text files are stored on secondary storage
and 'read' into a program when being used
They are used to store information when the application is closed
Each entry is stored on a new line or separated with a special identifier, for example, a comma (',')
It can be difficult in text files to know where a record begins and ends
Page 2 of 8
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources
Your notes
Validation
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 validation checks that are used are the same as those that appear in section 7: Algorithm
Design & Problem-Solving
Type Description
Length This type of validation checks the number of characters that have been entered into a field.
Check For example, you might make phone numbers entered have to be eleven characters long
Format This type of validation checks data entered meets an exact format. For example, a product
Check code might have to be two letters followed by five numbers
Page 3 of 8
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources
Range A range check will check the number entered is within a specific range. For example, the
Check age of a dog would be between 0 - 40. Any other number would be disallowed
Your notes
Presence A presence check can be added to fields which cannot be left blank
Check
Type A type check will allow data with a specific data type to be entered into a field. For
Check 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 Check digit validation is a process used to verify the accuracy of numbers such as credit
Digits 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
Page 4 of 8
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources
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
Examples of common datatypes are:
Integer - whole number
Real - decimal number
Text/alphanumeric - text data
Character - single
Date/Time
Boolean - true or false values
In the table cars below, the following datatypes would be used:
car_id: integer
make: text/alphanumeric
model: text/alphanumeric
colour: text/alphanumeric
Page 5 of 8
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources
price: real
cars
Your notes
car_id make model colour price
Page 6 of 8
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources
Primary Keys
Your notes
Primary Keys
What is a primary key?
A primary key is a unique field that can be used to identify a record in a table
customer_id is the primary key for the customers table below
Other examples of primary keys in database tables would include:
Student_ID in a school database
Car_Registration in a car database
Product_ID in a shop database
Page 7 of 8
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers
Head to www.savemyexams.com for more awesome resources
Worked Example
A database has been developed for a dance club to store information about their members.
The database contains one table: Members
Figure A shows some data from the table.
Members
State the name of the field from the Members table that is the most suitable to use as the primary
key [1]
Answer
(a) MemberID
Page 8 of 8
© 2015-2024 Save My Exams, Ltd. · Revision Notes, Topic Questions, Past Papers