Chapter 1 - Lesson 5 (Part 1)
Summary
TLDRThe video discusses various types of validation rules and verification in computer systems, explaining why validation is necessary. It covers different checks such as presence, range, type, length, format, and lookup checks. These rules ensure that data entered into a system is appropriate, though not necessarily correct. Examples include verifying if required fields are filled (presence check), ensuring data falls within certain limits (range check), or checking if data matches a specific format (format check). The video emphasizes the importance of validating input to maintain data integrity.
Takeaways
- ✅ Validation ensures that data input into a system is sensible and conforms to defined rules.
- 📅 An example of validation: A railway season ticket is valid until its expiry date, and this date is checked during validation.
- ❌ When data is invalid or doesn't conform to rules, it is rejected, and an error message is presented.
- 🔎 Presence check ensures that necessary data is entered; if not, an error message prompts the user to input the missing data.
- 📧 Example of a presence check: A contact form that requires an email address but doesn't check if it's formatted correctly.
- 🔢 Range check ensures that data falls between defined limits, like age being between 18 and 28 for a survey.
- 📏 Type check ensures that data is of the correct type, such as age being an integer or a grade being text.
- 🔐 Length check verifies that data is of a specific length, such as a password needing at least 8 characters.
- 🔤 Format check ensures data follows a required pattern, like an email address having an '@' symbol and proper structure.
- 📂 Lookup check tests whether data exists in a predefined list, like validating gender as 'male' or 'female'.
Q & A
What is the purpose of validation in a computer system?
-Validation ensures that data entered into a computer system is sensible and conforms to predefined rules, ensuring it is fit for use.
Can you give an example of a situation where validation is important?
-An example is a railway season ticket. The ticket has an expiry date, and the validation rule ensures that the ticket is used before it expires.
What happens when data is entered correctly or incorrectly in a validation check?
-If data conforms to the validation rules, it will be accepted. If it does not, the data will be rejected, and an error message will be displayed.
What is a presence check, and how does it work?
-A presence check ensures that data is entered into a required field. If data is missing, the user receives an error message prompting them to enter the required data.
Can you provide an example of a presence check?
-An example is a login form where you must enter both a username and a password. If the password is left blank, an error message will appear asking the user to input it.
What is a range check, and how does it differ from a limit check?
-A range check ensures that data falls within a specific range, with both a lower and upper boundary. A limit check has only one boundary, ensuring the data meets a single condition, such as being above or below a particular value.
Can you give an example of a range check?
-A range check could be used for the number of students in a class, where the acceptable range might be between 5 and 28.
What is a type check, and why is it important?
-A type check ensures that the data entered is of the correct data type. For example, an age must be an integer, and a price must be numerical. This prevents users from entering incorrect data formats.
What is a length check, and can you provide an example?
-A length check ensures that the data entered is of a specific length. For example, a password might be required to be at least 8 characters long.
What is a format check, and how does it function?
-A format check ensures that data follows a specific pattern or format. For example, an email address must include an '@' symbol followed by a domain. If the data doesn't match the required format, it will be rejected.
What is a lookup check, and when would it be used?
-A lookup check verifies whether the data entered exists in a predefined list or file. For example, when selecting a gender, the system might allow only 'Male' or 'Female' as valid options.
Outlines
🔍 Introduction to Validation and Verification in Data Entry
This paragraph introduces the topic of validation and verification rules in data entry. It explains the importance of validation when data is input into a system, ensuring that data follows specific rules to be considered sensible. An example is given using a railway season ticket where the expiry date serves as a validation criterion. The process ensures that data entered is valid before further processing, such as rejecting incorrect data with an error message.
✅ Presence Check in Data Validation
The paragraph discusses presence checks, a validation rule used to ensure that essential data is entered by the user. Examples include login forms where users must provide both a username and password. If a field like the password is left blank, an error message prompts the user to enter the missing data. However, presence checks only confirm that data is entered, not whether it is accurate, as demonstrated by accepting incorrect formats such as nonsensical email addresses.
📊 Range and Limit Checks Explained
This paragraph elaborates on range and limit checks. A range check ensures that data falls within a defined range with both upper and lower boundaries, such as the age of students in a class being between 5 and 28. A limit check, on the other hand, deals with one boundary condition. Examples include minimum age limits for surveys, where only the lower boundary (e.g., age 18) matters. Both types of checks ensure the data is within acceptable parameters before being accepted.
🔠 Type Check: Ensuring Correct Data Types
Here, the focus is on type checks, which verify that the data entered matches the expected data type. For instance, an age must be an integer, a grade must be a letter, and a date of birth must be in date format. This ensures that inputs adhere to predefined types, preventing errors in data processing.
🔢 Length Check: Controlling Data Input Length
This section describes length checks, a validation rule used to ensure that data is of a specified length or falls within a range of lengths. Common examples include setting minimum character limits for passwords (e.g., 8 characters or more) and requiring certain fields like product codes to be of a specific length. This rule ensures that inputs meet the necessary size criteria.
🔤 Format Check: Verifying Data Patterns
The paragraph explains format checks, which validate that the data follows a specific pattern or format. For example, email addresses must contain an '@' symbol, and student IDs must follow a predefined sequence of numbers and letters. If the data does not match the expected pattern, it is rejected, ensuring consistency in the format of inputs.
🔎 Lookup Check: Cross-Referencing Input with Accepted Data
This paragraph discusses lookup checks, a validation process that verifies whether the entered data exists within a predefined list of acceptable values. For instance, when entering gender, the system cross-references the input with a stored list of valid options like 'male' or 'female.' If the input doesn't match any of the acceptable values, the system prompts an error. Another example involves grading systems where only predefined grades such as 'P', 'M', or 'D' are accepted.
Mindmap
Keywords
💡Validation
💡Presence Check
💡Range Check
💡Limit Check
💡Type Check
💡Length Check
💡Format Check
💡Lookup Check
💡Error Message
💡Verification
Highlights
Validation ensures that data is sensible and conforms to defined rules, but it does not guarantee the data is correct.
An example of validation: a railway season ticket is valid until its expiry date; using it after expiration makes it invalid.
Presence check: Ensures that data is entered. For example, leaving the password field empty when logging in will prompt an error message.
Presence check only ensures that data is entered, not that the data is correct or in the proper format.
Range check: Ensures data is within a defined range. For example, a survey respondent must be at least 18 years old.
Limit check: A form of range check where there is only one boundary. For instance, grades must be less than or equal to 'E'.
Range check example: The number of students in a class should be between 5 and 28.
Type check: Ensures the data matches a defined data type. For example, an age must be an integer, and a price must be numerical.
Length check: Ensures data is of a defined length or within a range. Example: a password must be at least 8 characters long.
Format check: Ensures data matches a specific format, such as an email address including the '@' symbol followed by additional characters.
Format check example: A student ID must consist of four numbers followed by two letters.
Lookup check: Validates data by checking if it exists in a predefined list. Example: Gender must be either 'Male' or 'Female'.
Lookup check can also be used for qualification grades, ensuring values like 'Pass', 'Merit', or 'Distinction' are entered.
Validation rules help prevent incorrect data from being accepted by a computer system, maintaining data integrity.
Each validation rule, such as presence, range, type, length, format, and lookup checks, plays a crucial role in ensuring data quality and reliability.
Transcripts
alright so in this video we're just
gonna be looking at validation rules and
verification so some of these things you
would have seen an IG CC but let's go
through these slides and let me know if
you have any questions why do we need
validation and give an example of a
situation so validation takes place when
data is input into a computer system the
purpose is to ensure the data is
sensible and conforms to defined rules
so an example if you have a railway
season ticket okay that ticket will have
an expiry date on it the season ticket
is valid until it expires once it
expires it is invalid the rule here is
that the date the season ticket is used
must be before it's expiry date so that
is why we need validation and here is an
example that will be having a look at
specific validation rules when we look
through the next few slides
so what happens when correct or
incorrect data is entered
so when data is validated if it conforms
to the rules then it will be accepted if
it has not conformed to the rules then
will be rejected and an error message
will be presented validation does not
ensure that data is correct so what is a
presence check so now we're going to go
through the specific validation rules
that we can use in our software so
princess check is the first one we're
going to look at so a presence check is
used to ensure the data is entered if
data is entered then it is accepted if
data is not entered then the user will
be presented with an error message
asking them to enter data so just think
of likely form or like in Gmail or if
you login into Facebook or logging into
teams if you type in your user name that
you leave your password blank and just
hit enter it might show a message saying
like you have not entered your password
so that's an example of a presence check
it has to make sure that data that has
to be entered is entered by the user
so yes I'm examples so infinite in a
contact us form on a website
it is essential that an email address is
entered the following would be valid if
only a presence check is carried out so
you might not even put a proper e-mail
address in but the presence check will
accept whatever you enter because it
only takes a data is entered so you
might say a or a and B etc etc so it
doesn't actually make sure that the data
you typing in is of the correct form but
that at least you've typed something in
so notice that none of these are correct
but they pass the rule that data must be
present so what is a raincheck
give examples so raincheck ensures that
data is within a defined range so here's
some examples an opinion poll was taken
and asked for the respondents age the
respondents had to be at least 18 years
old so the lower boundaries are 18 there
is no upper boundary so limit so this is
a limit check this could be written as
the age of the person must be greater
than or equal to 18 so if there's only
one boundary involved in your criteria
then it's a limit check so the range
check is going to be we have two
conditions that your values must meet so
just have a look at another limit check
so letters represent grades for an exam
are entered and in the latest a te are
valid grades the grade must be less and
if the upper boundary is e there is no
lower boundary so this is a limit check
this could be written as the grade must
be less than if and here's an example of
the range check the number of students
in a class might be between five and
twenty eight the lower boundary is 5 the
upper boundary is 28 so this is the
range check so you can have two
conditions the others could be written
it as the number of students must be
greater equal to 5 and the number of
students must be less than or equal to
28 so
have one condition it's a limit check
where we have two conditions
it's a range check so what is the type
checking give the examples so type check
ensures the data must be event a find
data type so if an age is entered
it must be an integer if a grade is
entered
it must be text with no numbers if a
price is entered it must be numerical
and if a date of birth is entered it
must be a date so sis to make sure that
the data types that are being used are
of the correct forms age must be an
integer etc says making sure that what
you typed in is of the correct the data
type what is a length check give
examples a length check ensures data is
of a defined length or within a range of
links so for this example over here if
you've ever had to put in a password for
an account that you're using you know
sometimes it says that you all pass it
must be 8 characters or more there's an
example of a length check being used to
make sure you're giving a password that
satisfies that condition so just a
number of examples so a parser must be
at least 6 characters as long a grade
must be exactly one character long it's
like a b c d etc product code must be at
least 4 characters and no more than 6
characters so it's a length check and
some examples so what is a format check
and give examples so for my check
ensures data matches the defined format
it sometimes is known as a picture check
and the data has to follow a pattern so
some examples yes an email address must
include an @ symbol preceded by this one
character and followed by other
characters the following data would be
valid so John add B ldef dot C O so as
long as there is this @ symbol for the
character before it and
character after it then the format would
be satisfied in this case so student ID
is another example so you must say that
must be four numbers followed by two
letters the following data would be
valid so as long as the first four
characters are numbers three eight to
seven followed by two letters so BD then
that data will be accepted so as long as
the data that you are putting into the
system is of the form that is required
then the format check will allow their
data B to be accepted but if it's not of
that form if maybe the person here put
three eight to see BD
because the first four characters aren't
only numbers it would be rejected so
it's a format check and some examples so
what is a lookup check and give examples
so lookup check test to see if data
exists in a list so there is some file
that is stored on the system what has
valid information or data that is
accepted in the field that the user
might be typing in so a lookup check
tests and checks to see if the data that
the user enters in let's say for example
in the text box if that data actually
exists in the file that the system is
storing so let's have a look at some
examples so when asking a user they
gender they can respond with male or
female so lookup validation will check
to see if that if the values are within
this list so there would be some file it
have the information male female formal
agenda so someone doesn't type in male
or female so they type it something else
then whatever happen is a return an
error because that gender does not
appear in the gender file which would be
accepted students taking a qualification
could be issued grades of past merit and
distinction
so in inputting the data a validation
rule could check that only X p.m. or D
are entered
should be a fail so it have these
symbols in some file so if you typed in
for example let's say C you would notice
that C is not part of these symbols okay
and these symbols are stored in sound
file by the system so if C is not
amongst these symbols then the system
will give an error message back to the
user
浏览更多相关视频
Chapter 1 - Lesson 5 (Part 2)
Introduction to the concept of Data and Database Management System Part 2
BTEC Level 3 Database Exam - Part A - Walk through - Part2
Lec-8.0: Integrity Constraints in Database with Examples
printf and scanf functions in C
Ethernet frame format in data link layer | IEEE 802.3
5.0 / 5 (0 votes)