WorksheetsData Validation Quiz
Total questions: 40
Worksheet time: 20mins
What is the primary purpose of data validation in a database?
To ensure only correct and meaningful data is entered
To make data entry faster
To prevent users from making any changes to the database
To automatically fix errors in the data
Why is an error message displayed when a validation rule is violated?
To prevent users from entering data again
To allow users to correct mistakes
To delete the incorrect record
To notify the database administrator
Which validation rule ensures that no field is left empty?
Type check
Presence check
Format check
Length check
A length check ensures that:
Data fits within a specified range of values
Data is entered in a correct pattern
Data contains the required number of characters
Data is unique
Which validation rule ensures that a field contains data within a set limit, such as numbers between 1 and 100?
Length check
Presence check
Range check
Type check
A format check ensures that:
A number is not less than zero
Data follows a specific structure or pattern
The field is not left blank
Only numbers are entered
A type check is useful when:
Verifying that only numbers are entered in a price field
Checking if a password includes special characters
Ensuring that a phone number is in a valid format
Ensuring a name field contains at least five letters
What happens when a validation rule is broken during data entry?
The data is stored but marked as incorrect
An error message is displayed
The incorrect data is deleted automatically
The data is corrected automatically
Which validation rule would be used to prevent a student from entering an age of 200?
Presence check
Range check
Format check
Length check
If a field is required to contain only numbers, which validation rule should be used?
Presence check
Type check
Format check
Range check
A student ID must always be entered when registering a new student. What validation should be applied?
Presence check
Range check
Length check
Format check
What is the purpose of a length check in a database?
To ensure the field is not left empty
To ensure the data has a specified number of characters
To check if a value is within a certain range
To compare two values
A phone number field requires exactly 10 digits. Which validation rule should be applied?
Presence check
Length check
Type check
Range check
What kind of validation would ensure that a student’s name only contains letters?
Presence check
Range check
Format check
Type check
A type check ensures that:
A field is not left blank
A field contains only letters or numbers based on the required data type
A field has a fixed number of characters
A field follows a specific pattern
If a database field for a student's grade only allows numbers from 1 to 12, which validation rule is applied?
Range check
Format check
Presence check
Type check
A student's email address must contain "@" and end with ".com". Which validation rule should be used?
Presence check
Format check
Length check
Type check
If an entry in a currency field must be in decimal format (e.g., 10.50), which validation rule should be applied?
Type check
Range check
Presence check
Length check
What would happen if a student tries to enter a booking for a date in the past?
An error message would appear due to a range check
The booking would be saved
The system would delete the incorrect entry
The system would change the date to today’s date automatically
If an Online/In-Person field should only accept "Online" or "InPerson", what validation rule should be applied?
Type check
Format check
Presence check
Range check
What does a presence check prevent?
Data from being entered twice
Data from exceeding a specific length
Leaving a required field empty
Entering incorrect types of data
A range check is used to:
Ensure values fall within an upper and lower limit
Ensure the field is not empty
Check that text follows a pattern
Ensure all characters are lowercase
What validation would be best for a student’s exam score, which must be between 0 and 100?
Presence check
Length check
Range check
Type check
If a booking date must always be today or in the future, what rule should be used?
Format check
Range check
Presence check
Length check
If an input field should only contain numbers, what rule should be applied?
Presence check
Type check
Length check
Format check
A student enters "ABC" instead of a number in an age field. Which validation rule detects this error?
Presence check
Type check
Format check
Range check
Which validation rule would ensure that a password contains at least one uppercase letter, one number, and one special character?
Presence check
Format check
Type check
Range check
A library system requires a book ID to be exactly 6 digits. Which validation rule is best suited?
Length check
Range check
Presence check
Type check
A customer ID field must be unique for every record. What should be applied?
Presence check
Uniqueness check
Format check
Type check
If a system requires a date of birth to be before today’s date, which validation rule should be used?
Presence check
Length check
Range check
Type check
A validation rule ensures a username is between 5 and 15 characters. What type of check is this?
Length check
Range check
Presence check
Type check
A school system requires student grades to be entered as A, B, C, D, or F. Which validation rule is best?
Type check
Format check
Range check
Presence check
What is the main difference between a format check and a type check?
Format check ensures the correct data type, type check ensures a specific pattern
Format check ensures a specific pattern, type check ensures the correct data type
There is no difference
Type check is only used for numerical values
A university ensures that student IDs start with "STU" followed by 4 digits (e.g., STU1234). Which validation rule is applied?
Length check
Format check
Range check
Presence check
A person’s monthly salary must be greater than zero. Which validation rule is appropriate?
Presence check
Length check
Range check
Format check
A user enters "ABCD123" instead of a valid email address. Which validation rule would detect this error?
Length check
Format check
Type check
Presence check
A system rejects a passport number because it must contain exactly 9 digits. What validation rule caused this?
Type check
Length check
Format check
Range check
A student leaves their phone number field blank, and an error appears. What rule is responsible?
Presence check
Format check
Type check
Length check
A user tries to enter "Blue" in a gender selection field that only allows "Male" or "Female." Which validation rule prevents this?
Type check
Format check
Length check
Presence check
A discount percentage must be between 0 and 50. What validation rule ensures this?
Presence check
Type check
Range check
Length check
