{"id":307,"date":"2018-01-12T16:04:15","date_gmt":"2018-01-12T16:04:15","guid":{"rendered":"https:\/\/old.staging-teachcomputerscienceuk.kinsta.cloud\/?p=307"},"modified":"2024-07-24T11:19:23","modified_gmt":"2024-07-24T11:19:23","slug":"database-validation","status":"publish","type":"post","link":"https:\/\/teachcomputerscience.com\/database-validation\/","title":{"rendered":"Database Validation"},"content":{"rendered":"<div class=\"gb-container gb-container-0a1c563b upsell-block\"><div class=\"gb-inside-container\">\n<div class=\"gb-grid-wrapper gb-grid-wrapper-a8a802f4\">\n<div class=\"gb-grid-column gb-grid-column-d2c4e2c1\"><div class=\"gb-container gb-container-d2c4e2c1\"><div class=\"gb-inside-container\">\n\n<h2 class=\"gb-headline gb-headline-d75a80d8 gb-headline-text\">GCSE Introduction to Databases (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-d8cecdbb\">\n\n<a class=\"gb-button gb-button-dd04c1b9 gb-button-text\" href=\"https:\/\/teachcomputerscience.com\/gcse\/databases\/introduction-to-databases\/\">View GCSE Introduction to Databases Resources<\/a>\n\n<\/div>\n<\/div><\/div><\/div>\n\n<div class=\"gb-grid-column gb-grid-column-50486815\"><div class=\"gb-container gb-container-50486815\"><div class=\"gb-inside-container\">\n\n<h2 class=\"gb-headline gb-headline-2d5e11fb gb-headline-text\">A-Level Relational Databases (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-7aed9499\">\n\n<a class=\"gb-button gb-button-517cee76 gb-button-text\" href=\"https:\/\/teachcomputerscience.com\/a-level\/exchanging-data\/relational-databases\/\">View A-Level Relational Databases Resources<\/a>\n\n<\/div>\n<\/div><\/div><\/div>\n<\/div>\n<\/div><\/div>\n\n\n\n\n<p class=\"wp-block-paragraph\">It is imperative that data is entered correctly in a <a href=\"http:\/\/teachcomputerscience.com\/what-is-a-database\/\">database<\/a>.&nbsp; An automated database has the benefit of including automatic checks in order to prevent incorrect data from being recorded into the database.&nbsp; This is a process which isn\u2019t available in a manual database.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Validation&nbsp;is a process whereby the data entered in the database is checked to make sure that it is sensible.&nbsp; For example, validation can be utilized to check that only Male or Female is entered in a sex field.&nbsp; It cannot check whether or not the data entered is correct. It can only check whether or not the data makes sense.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Validation is a way of trying to lessen the number of errors during the process of data input.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Validation is carried out by the computer when you input data.&nbsp; It is a way of checking the input data against the set of validation rules.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The purpose of validation is to make sure that data is a) logical, b) rational, and c) complete and within acceptable limits.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Database Validation Methods<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Type<\/strong> \u2013 If you make a specific field numeric then it won&#8217;t allow you to input any letters or other non-numeric <a href=\"http:\/\/teachcomputerscience.com\/characters\/\">characters<\/a>.&nbsp; Be wary when using the numeric data type. If you use it for fields like phone <a href=\"http:\/\/teachcomputerscience.com\/numbers\/\">numbers<\/a>, it won&#8217;t allow you to enter spaces, or other human-friendly forms of formatting.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Some data types can carry out an extra type check.&nbsp; For example, a date data type will ensure that a date inputted existed at some point, or could exist in the future.&nbsp; It would not accept the date 30\/02\/2018.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Presence<\/strong> \u2013 This is sometimes called Allow Blank or Mandatory.&nbsp; This type of validation compels the user to enter data in the required field.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, in an address book, you can make either the address or phone number optional, while you must make the name field required.&nbsp; Leaving a mandatory field blank will trigger an error message that will prevent you from proceeding to the next step.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Unique Identifier<\/strong> \u2013 It is essential that one record can be plainly recognised from another record. Generally speaking, each record has&nbsp;one field&nbsp;that functions as a&nbsp;unique identifier&nbsp;for a record.&nbsp; An easy validation check can be done to make sure that a value occurs only&nbsp;once in this field\u2014it doesn\u2019t matter if there are thousands of records in the database, the check can be carried out just the same.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Range Check<\/strong> \u2013 Range check is a validation check which can be applied to numeric fields. This is done to ensure that only numbers within a certain domain can be entered into a field.&nbsp; Remember that this does not necessarily mean that the data entered will be&nbsp;correct.&nbsp; But it will certainly lie within&nbsp;reasonable&nbsp;limits.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Format<\/strong> \u2013 This is used for a <a href=\"http:\/\/teachcomputerscience.com\/database-fields\/\">field<\/a> that requires an entry in a specific format.&nbsp; Examples include date format, postal codes, and driver\u2019s license numbers.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Restricted Choice<\/strong> \u2013 There are times that fields in a database have a definite amount of data that can be entered into them. For example, the amount of days in a week are limited to Sunday, Monday, Tuesday, etc.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Programming a database to accept only one of a series of valid choices can prevent errors, and can also serve to lessen the time it takes to input data.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">This has different forms like a list box, combo box, or radio button.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Benefits of Restricted Choice:<\/p>\n\n\n\n<ul class=\"wp-block-list\"><li>Faster data entry, because it is typically much quicker to select from a list than to type each individual entry.<\/li><li>Enhanced accuracy, because it lessens the risk of spelling mistakes.<\/li><li>Limits the options to choose from by only displaying the essential choices.<\/li><\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Referential Integrity<\/strong> \u2013 If you&#8217;re using a relational database, then you can impose referential integrity to validate inputs.&nbsp; You can check data inputs in certain fields against values in other tables.&nbsp; For example, in the&nbsp;job database, when a new hire is entered, you could check the supervisor name against the employee table, just like you could check the department name against the department table.<\/p>\n\n\n\n<h3 class=\"gb-headline gb-headline-c5664b7b gb-headline-text\">Further Readings:<\/h3>\n\n\n\n<ul class=\"wp-block-list\"><li><a href=\"https:\/\/en.wikipedia.org\/wiki\/Data_validation\" target=\"_blank\" rel=\"noopener\">Data validation<\/a><\/li><\/ul>\n\n\n","protected":false},"excerpt":{"rendered":"<p>It is imperative that data is entered correctly in a database.&nbsp; An automated database has the benefit of including automatic checks in order to prevent incorrect data from being recorded into the database.&nbsp; This is a process which isn\u2019t available in a manual database. Validation&nbsp;is a process whereby the data entered in the database is &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"Database Validation\" class=\"read-more button\" href=\"https:\/\/teachcomputerscience.com\/database-validation\/\" aria-label=\"Read more about Database 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":[12],"tags":[204,47],"class_list":["post-307","post","type-post","status-publish","format-standard","hentry","category-databases","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\/307","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=307"}],"version-history":[{"count":2,"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/posts\/307\/revisions"}],"predecessor-version":[{"id":607080,"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/posts\/307\/revisions\/607080"}],"wp:attachment":[{"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/media?parent=307"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/categories?post=307"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/teachcomputerscience.com\/wp-json\/wp\/v2\/tags?post=307"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}