{"id":3247,"date":"2023-10-04T13:19:23","date_gmt":"2023-10-04T13:19:23","guid":{"rendered":"http:\/\/localhost\/ecole9ja\/?p=3247"},"modified":"2023-10-04T13:25:59","modified_gmt":"2023-10-04T13:25:59","slug":"week-6-and-7-ss2-second-term-data-processing-notes","status":"publish","type":"post","link":"https:\/\/ecolebooks.com\/nigeria\/posts\/week-6-and-7-ss2-second-term-data-processing-notes\/","title":{"rendered":"Week 6 and 7 &#8211; SS2 Second Term Data Processing Notes"},"content":{"rendered":"<p><strong>WEEK : 6-7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0<br \/>\n<\/strong><strong>TOPIC: File Organization<br \/>\n<\/strong><strong>CONTENT<br \/>\n\t\t<\/strong><strong>FILE<br \/>\n<\/strong>A collection of\u00a0data\u00a0or information that has a\u00a0name, called the<em>filename<\/em>. Almost all information\u00a0stored\u00a0in a\u00a0computer\u00a0must be in a file. There are many different types of files:\u00a0<em>data<\/em>\u00a0<em>files,\u00a0text files\u00a0,program\u00a0files,\u00a0directory\u00a0files,<\/em>\u00a0and so on. Different types of files store different types of information. For example, program files store programs, whereas text files store\u00a0text.<br \/>\n<strong>Computer File<\/strong><br \/>\n\t\t\tA\u00a0<strong>computer file<\/strong>\u00a0is a resource for storing information, which is available to a\u00a0computer program\u00a0and is usually based on some kind of durable\u00a0storage. A file is &#8220;durable&#8221; in the sense that it remains available for other programs to use after the program that created it has finished\u00a0executing. Computer files can be considered as the modern counterpart of paper\u00a0documents\u00a0which traditionally are kept in office and library\u00a0files, and this is the source of the term.<\/p>\n<p>\u00a0<strong>File organization<\/strong><br \/>\n\t\t<strong>File organization<\/strong>&#8221; refers to the logical relationships among the various records that constitute the\u00a0<strong>file<\/strong>, particularly with respect to the means of identification and access to any specific record. &#8220;<strong>File<\/strong>\u00a0structure&#8221; refers to the format of the label and data blocks and of any logical record control information<br \/>\nIt is used to determine an efficient file organization for each base relation. For example, if we want to retrieve student records in alphabetical order of name, sorting the file by student name is a good file organization. However, if we want to retrieve all students whose marks is in a certain range, a file ordered by student name would not be a good file organization. Some file organizations are efficient for bulk loading data into the database but inefficient for retrieve and other activities.<br \/>\nThe objective of this selection is to choose an optimal file organization for each relation.<br \/>\n<strong>Types of File Organization<br \/>\n<\/strong>In order to make effective selection of file organizations and indexes, here we present the details different types of file Organization. These are:<br \/>\n\u00a0<br \/>\n\u00a0\u2022 Heap File Organization<br \/>\n\u2022 Hash File Organization<br \/>\n\u2022 Indexed Sequential Access Methods (ISAM) File Organization<br \/>\n<strong>Heap (unordered) File Organization<br \/>\n<\/strong>An unordered file, sometimes called a heap file, is the simplest type of file organization.<br \/>\nRecords are placed in file in the same order as they are inserted. A new record is inserted in the last page of the file; if there is insufficient space in the last page, a new page is added to the file. This makes insertion very efficient. However, as a heap file has no particular ordering with respect to field values, a linear search must be performed to access a record. A linear search involves reading pages from the file until the required is found. This makes retrievals from heap files that have more than a few pages relatively slow, unless the retrieval involves a large proportion of the records in the file.<\/p>\n<p>\u00a0<strong>Pros of Heap storage<br \/>\n<\/strong>Heap is a good storage structure in the following situations:<br \/>\nWhen data is being bulk-loaded into the relation.<br \/>\nThe relation is only a few pages long. In this case, the time to locate any tuple is Short, even if the entire relation has been searched serially.<br \/>\nWhen every tuple in the relation has to be retrieved (in any order) every time the relation is accessed. For example, retrieve the name of all the students.<br \/>\n<strong>Cons of Heap storage<br \/>\n<\/strong>Heap files are inappropriate when only selected tuples of a relation are to be accessed.<\/p>\n<p>\u00a0<br \/>\n\u00a0<br \/>\n\u00a0<strong>Hash File Organization<br \/>\n<\/strong>In a hash file, records are not stored sequentially in a file instead a hash function is used to calculate the address of the page in which the record is to be stored.<br \/>\nThe field on which hash function is calculated is called as Hash field and if that field acts as the key of the relation then it is called as Hash key. Records are randomly distributed in the file so it is also called as <strong>Random or Direct files<\/strong>. Commonly some arithmetic function is applied to the hash field so that records will be evenly distributed throughout the file.<br \/>\n<strong><br \/>\n\t\t\t<\/strong>\u00a0<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WEEK : 6-7\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 TOPIC: File Organization CONTENT FILE A collection of\u00a0data\u00a0or information that has a\u00a0name,&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1,259],"tags":[],"class_list":["post-3247","post","type-post","status-publish","format-standard","hentry","category-posts","category-second-term-ss2-data-processing"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/ecolebooks.com\/nigeria\/wp-json\/wp\/v2\/posts\/3247","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ecolebooks.com\/nigeria\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ecolebooks.com\/nigeria\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ecolebooks.com\/nigeria\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/ecolebooks.com\/nigeria\/wp-json\/wp\/v2\/comments?post=3247"}],"version-history":[{"count":1,"href":"https:\/\/ecolebooks.com\/nigeria\/wp-json\/wp\/v2\/posts\/3247\/revisions"}],"predecessor-version":[{"id":3248,"href":"https:\/\/ecolebooks.com\/nigeria\/wp-json\/wp\/v2\/posts\/3247\/revisions\/3248"}],"wp:attachment":[{"href":"https:\/\/ecolebooks.com\/nigeria\/wp-json\/wp\/v2\/media?parent=3247"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ecolebooks.com\/nigeria\/wp-json\/wp\/v2\/categories?post=3247"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ecolebooks.com\/nigeria\/wp-json\/wp\/v2\/tags?post=3247"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}