{"id":337,"date":"2019-08-13T18:51:39","date_gmt":"2019-08-13T18:51:39","guid":{"rendered":"https:\/\/old.staging-teachcomputerscienceuk.kinsta.cloud\/?p=337"},"modified":"2024-07-24T10:07:52","modified_gmt":"2024-07-24T10:07:52","slug":"data-validation","status":"publish","type":"post","link":"https:\/\/teachcomputerscience.com\/data-validation\/","title":{"rendered":"Data Validation"},"content":{"rendered":"<div class=\"gb-container gb-container-3ce04b00 upsell-block\"><div class=\"gb-inside-container\">\n<div class=\"gb-grid-wrapper gb-grid-wrapper-a1f3e574\">\n<div class=\"gb-grid-column gb-grid-column-c476173d\"><div class=\"gb-container gb-container-c476173d\"><div class=\"gb-inside-container\">\n\n<h2 class=\"gb-headline gb-headline-1edd4de3 gb-headline-text\">KS3 Data Representation (14-16 years)<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>An editable PowerPoint lesson presentation<\/li><li>Editable revision handouts<\/li><li>A glossary which covers the key terminologies of the module<\/li><li>Topic mindmaps for visualising the key concepts<\/li><li>Printable flashcards to help students engage active recall and confidence-based repetition<\/li><li>A quiz with accompanying answer key to test knowledge and understanding of the module<\/li><\/ul>\n\n\n<div class=\"gb-button-wrapper gb-button-wrapper-9e04f02a\">\n\n<a class=\"gb-button gb-button-f0d279e7 gb-button-text\" href=\"https:\/\/teachcomputerscience.com\/ks3\/data-representation\/\">View KS3 Data Representation Resources<\/a>\n\n<\/div>\n<\/div><\/div><\/div>\n\n<div class=\"gb-grid-column gb-grid-column-6723f4e4\"><div class=\"gb-container gb-container-6723f4e4\"><div class=\"gb-inside-container\">\n\n<h2 class=\"gb-headline gb-headline-29e7ad57 gb-headline-text\">A-Level Data types, data structures and algorithms (16-18 years)<\/h2>\n\n\n\n<ul class=\"wp-block-list\"><li>An editable PowerPoint lesson presentation<\/li><li>Editable revision handouts<\/li><li>A glossary which covers the key terminologies of the module<\/li><li>Topic mindmaps for visualising the key concepts<\/li><li>Printable flashcards to help students engage active recall and confidence-based repetition<\/li><li>A quiz with accompanying answer key to test knowledge and understanding of the module<\/li><\/ul>\n\n\n<div class=\"gb-button-wrapper gb-button-wrapper-8f9824bf\">\n\n<a class=\"gb-button gb-button-e231ea52 gb-button-text\" href=\"https:\/\/teachcomputerscience.com\/a-level\/data-types-data-structures-and-algorithms\/\">View A-Level Data types, data structures and algorithms Resources<\/a>\n\n<\/div>\n<\/div><\/div><\/div>\n<\/div>\n<\/div><\/div>\n\n\n\n\n<div class=\"wp-block-image\"><figure class=\"aligncenter size-full is-resized\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/teachcomputerscience.com\/wp-content\/uploads\/2019\/08\/072-web-interface.png\" alt=\"Data validation is an automated check performed to guarantee that the data input is rational and acceptable.\" class=\"wp-image-5752\" width=\"267\" height=\"267\" title=\"\" srcset=\"https:\/\/teachcomputerscience.com\/wp-content\/uploads\/2019\/08\/072-web-interface.png 512w, https:\/\/teachcomputerscience.com\/wp-content\/uploads\/2019\/08\/072-web-interface-150x150.png 150w, https:\/\/teachcomputerscience.com\/wp-content\/uploads\/2019\/08\/072-web-interface-300x300.png 300w\" sizes=\"auto, (max-width: 267px) 100vw, 267px\" \/><\/figure><\/div>\n\n\n<p><strong>Data Validation<\/strong> is an automated check performed to guarantee that the data input is rational and acceptable.\u00a0 It does not check the correctness of the data itself.<\/p>\n<p>As an example, let\u2019s assume a coffee shop is hiring baristas aged 18 to 25.\u00a0 The system can be programmed to only accept <a href=\"http:\/\/teachcomputerscience.com\/numbers\/\">numbers<\/a> between 18 and 25 for the age field.\u00a0 This is called a range check.<\/p>\n<p>However, this does not guarantee that the number entered is correct.\u00a0 An applicant\u2019s age might be 20, but if 18 is entered it will still be valid, just incorrect.<\/p>\n<p>Validation is a way of trying to lessen the number of <a href=\"http:\/\/teachcomputerscience.com\/error-detection\/\">errors<\/a> in the data input.<\/p>\n<p>The validation is carried out by the computer when you input data.\u00a0 It is a way of checking the input data against a given set of validation rules.<\/p>\n<p>The purpose of validation is to make sure any given set of data is logical, rational, complete, and within acceptable limits.<\/p>\n<h3>Data Validation Methods<\/h3>\n<p>There are several validation methods that can be used to check the input data.<\/p>\n<p><strong>Range Check<\/strong> \u2013 this is generally used when working with data which contains numbers, currency, or date and time values.<\/p>\n<ul>\n<li>A range check lets you set appropriate limits:<\/li>\n<\/ul>\n<table class=\"rcp-table\">\n<tbody>\n<tr>\n<th><b>Boundary<\/b><\/th>\n<th><b>Description<\/b><\/th>\n<th><b>Validation<\/b><\/th>\n<\/tr>\n<tr>\n<td>Upper limit<\/td>\n<td>The maximum price of any item in a shop is $10.<\/td>\n<td>&lt;=10<\/td>\n<\/tr>\n<tr>\n<td>Lower limit<\/td>\n<td>In a shop all items have a corresponding cost.<\/td>\n<td>&gt;=0<\/td>\n<\/tr>\n<tr>\n<td>A range<\/td>\n<td>Number of hours worked must be less than or equal to 8 but more than 0.<\/td>\n<td>&gt;0 and &lt;=8<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>Type Check<\/strong> \u2013 this is a way to confirm that the correct data type is inputted.<\/p>\n<ul>\n<li>For example, in an application form age may range from 0 to 100.\u00a0 A number data type would be an appropriate choice for this data.\u00a0 By defining the data type as number, only numbers are allowed in the field (e.g. 18, 20, 25) and it would prevent people from inputting verbal data, like \u2018eighteen\u2019.<\/li>\n<li>Some <a href=\"http:\/\/teachcomputerscience.com\/database-data-types\/\">data types<\/a> are capable of doing an extra type check.\u00a0 For example, a date data type will ensure that a date inputted existed at some point in the past, or will exist in the future.\u00a0 It would not, for example, accept the date 30\/02\/2018.<\/li>\n<\/ul>\n<p><strong>Check Digit<\/strong> \u2013 this is used to find out if a series of numbers has been keyed correctly. There are many ways to produce check digits.<\/p>\n<ul>\n<li>For example, the ISBN-10 numbering system for books uses \u2018Modulo-11\u2019 division, where it outputs the remainder of the division as the result of the operation.<\/li>\n<\/ul>\n<p><strong>Length Check<\/strong> \u2013 this is used to make sure that the correct number of <a href=\"http:\/\/teachcomputerscience.com\/characters\/\">characters<\/a> are entered into the field. It confirms that the character string entered is neither too short nor too long.<\/p>\n<ul>\n<li>For example, consider a password that needs to be 8 characters long.\u00a0 The length check will ensure that exactly 8 characters are entered into the field.<\/li>\n<\/ul>\n<p>L<strong>ookup<\/strong> \u2013 this helps to lessen errors in a field with a limited list of values.<\/p>\n<ul>\n<li>For example, the fact that there are only 12 possible months in a year ensures that the list of possible values is limited.<\/li>\n<li>Advantages of a lookup list are as follows:<\/li>\n<\/ul>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>Faster data entry\u2014because it is typically much faster to select from a list than to type each individual entry.<\/li>\n<li>Enhanced accuracy\u2014because it lessens the risk of spelling mistakes.<\/li>\n<li>Greater ease of use\u2014because it limits the options to choose from by only displaying the essential choices.<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><strong>Format Check<\/strong> \u2013 this checks that the input data is in the right format.<\/p>\n<ul>\n<li>For example, a National Insurance number is in the form XX 99 99 99 XX where X is any letter and 9 is any number.<\/li>\n<\/ul>\n<p><strong>Presence Check<\/strong> \u2013 this kind of check makes sure that an essential or required field cannot be left blank: it must be filled in. If someone attempts to leave the field blank, then an error message will be displayed, and they won\u2019t be able to proceed to the next step, nor will they be able to save any other data which they have entered.<\/p>\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/teachcomputerscience.com\/database-management-systems-dbms\/\">Read more about Database Management Systems (DBMS)<\/a><\/p>\n\n\n\n<h3 class=\"gb-headline gb-headline-14ff478a gb-headline-text\"><strong>Further Reading<\/strong><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/en.wikipedia.org\/wiki\/Data_validation\" target=\"_blank\" rel=\"noopener\">Data validation<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Data Validation is an automated check performed to guarantee that the data input is rational and acceptable.\u00a0 It does not check the correctness of the data itself. As an example, let\u2019s assume a coffee shop is hiring baristas aged 18 to 25.\u00a0 The system can be programmed to only accept numbers between 18 and 25 &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Data Validation\" class=\"read-more button\" href=\"https:\/\/teachcomputerscience.com\/data-validation\/\" aria-label=\"Read more about Data Validation\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_monsterinsights_skip_tracking":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[14],"tags":[204,47],"class_list":["post-337","post","type-post","status-publish","format-standard","hentry","category-programming","tag-article","tag-hide-old-upsell","generate-columns","tablet-grid-50","mobile-grid-100","grid-parent","grid-50"],"acf":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/posts\/337","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/comments?post=337"}],"version-history":[{"count":5,"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/posts\/337\/revisions"}],"predecessor-version":[{"id":683933,"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/posts\/337\/revisions\/683933"}],"wp:attachment":[{"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/media?parent=337"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/categories?post=337"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/tags?post=337"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}