{"id":3742,"date":"2023-10-05T18:38:27","date_gmt":"2023-10-05T18:38:27","guid":{"rendered":"http:\/\/localhost\/ecole9ja\/?p=3742"},"modified":"2023-10-05T18:43:26","modified_gmt":"2023-10-05T18:43:26","slug":"week-3-ss3-first-term-data-processing-notes","status":"publish","type":"post","link":"https:\/\/ecolebooks.com\/nigeria\/posts\/week-3-ss3-first-term-data-processing-notes\/","title":{"rendered":"Week 3 &#8211; SS3 First Term Data  Processing Notes"},"content":{"rendered":"<p>\u00a0<strong>WEEK THREE<br \/>\n<\/strong><strong>INDEXES<br \/>\n<\/strong><strong>DENSE VERSUS SPARSE INDEXES<br \/>\n<\/strong>DENSE INDEX<br \/>\nThis is said to be dense if it contains (at least) one data entry for every search key value that appears in a record in the indexed file.<\/p>\n<p>\u00a0In a <strong>dense<\/strong> index, index record appears for every search key value in the file or table. That is every search key in the index column has a particular record it will point to in the table or file. <\/p>\n<p>\u00a0For example,<\/p>\n<div>\n<table>\n<tbody>\n<tr>\n<td><strong>10101<\/strong><\/td>\n<td>\u00a0<\/td>\n<\/tr>\n<tr>\n<td><strong>12121<\/strong><\/td>\n<td>\u00a0<\/td>\n<\/tr>\n<tr>\n<td><strong>15151<\/strong><\/td>\n<td>\u00a0<\/td>\n<\/tr>\n<tr>\n<td><strong>22222<\/strong><\/td>\n<td>\u00a0<\/td>\n<\/tr>\n<tr>\n<td><strong>32343<\/strong><\/td>\n<td>\u00a0<\/td>\n<\/tr>\n<tr>\n<td><strong>10101<\/strong><\/td>\n<td><strong>OJO<\/strong><\/td>\n<td><strong>Maths<\/strong><\/td>\n<td><strong>90000<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>12121<\/strong><\/td>\n<td><strong>ANYAOGU<\/strong><\/td>\n<td><strong>DP<\/strong><\/td>\n<td><strong>75000<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>15151<\/strong><\/td>\n<td><strong>ROBERT<\/strong><\/td>\n<td><strong>ICT<\/strong><\/td>\n<td><strong>65000<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>22222<\/strong><\/td>\n<td><strong>ADEREMU<\/strong><\/td>\n<td><strong>Computer<\/strong><\/td>\n<td><strong>60000<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>32343<\/strong><\/td>\n<td><strong>TUNDE<\/strong><\/td>\n<td><strong>Music<\/strong><\/td>\n<td><strong>50000<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u00a0<img decoding=\"async\" align=\"left\" src=\"https:\/\/ecolebooks.com\/nigeria\/wp-content\/uploads\/9jalessonsimages\/100523_1838_Week3SS3Fi1.png\" alt=\"\"\/><br \/>\n\t\t<img decoding=\"async\" align=\"left\" src=\"https:\/\/ecolebooks.com\/nigeria\/wp-content\/uploads\/9jalessonsimages\/100523_1838_Week3SS3Fi2.png\" alt=\"\"\/><br \/>\n\t\t<img decoding=\"async\" align=\"left\" src=\"https:\/\/ecolebooks.com\/nigeria\/wp-content\/uploads\/9jalessonsimages\/100523_1838_Week3SS3Fi3.png\" alt=\"\"\/><br \/>\n\t\t<img decoding=\"async\" align=\"left\" src=\"https:\/\/ecolebooks.com\/nigeria\/wp-content\/uploads\/9jalessonsimages\/100523_1838_Week3SS3Fi4.png\" alt=\"\"\/><br \/>\n\t\t<img decoding=\"async\" align=\"left\" src=\"https:\/\/ecolebooks.com\/nigeria\/wp-content\/uploads\/9jalessonsimages\/100523_1838_Week3SS3Fi5.png\" alt=\"\"\/><br \/>\n\t\tFrom the figure above, we can see that each search key in the index has a particular record that it point to in the base table<\/p>\n<p>\u00a0SPARSE INDEX<br \/>\nIn a sparse index, each search key does not have a corresponding record it point to but may point to a group of records in the base table. For example:<\/p>\n<div>\n<table>\n<tbody>\n<tr>\n<td><strong>10101<\/strong><\/td>\n<td><img decoding=\"async\" align=\"left\" src=\"https:\/\/ecolebooks.com\/nigeria\/wp-content\/uploads\/9jalessonsimages\/100523_1838_Week3SS3Fi6.png\" alt=\"\"\/><\/td>\n<\/tr>\n<tr>\n<td><strong>22222<\/strong><\/td>\n<td><img decoding=\"async\" align=\"left\" src=\"https:\/\/ecolebooks.com\/nigeria\/wp-content\/uploads\/9jalessonsimages\/100523_1838_Week3SS3Fi7.png\" alt=\"\"\/><\/td>\n<\/tr>\n<tr>\n<td><strong>32343<\/strong><\/td>\n<td>\u00a0<\/td>\n<\/tr>\n<tr>\n<td><strong>10101<\/strong><\/td>\n<td><strong>OJO<\/strong><\/td>\n<td><strong>Maths<\/strong><\/td>\n<td><strong>90000<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>12121<\/strong><\/td>\n<td><strong>ANYAOGU<\/strong><\/td>\n<td><strong>DP<\/strong><\/td>\n<td><strong>75000<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>15151<\/strong><\/td>\n<td><strong>ROBERT<\/strong><\/td>\n<td><strong>ICT<\/strong><\/td>\n<td><strong>65000<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>22222<\/strong><\/td>\n<td><strong>ADEREMU<\/strong><\/td>\n<td><strong>Computer<\/strong><\/td>\n<td><strong>60000<\/strong><\/td>\n<\/tr>\n<tr>\n<td><strong>32343<\/strong><\/td>\n<td><strong>TUNDE<\/strong><\/td>\n<td><strong>Music<\/strong><\/td>\n<td><strong>50000<\/strong><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<p>\u00a0<br \/>\n\u00a0<br \/>\n\u00a0<br \/>\n\u00a0<img decoding=\"async\" align=\"left\" src=\"https:\/\/ecolebooks.com\/nigeria\/wp-content\/uploads\/9jalessonsimages\/100523_1838_Week3SS3Fi8.png\" alt=\"\"\/><strong><br \/>\n\t\t\t<\/strong><br \/>\n\u00a0From the figure above, search keys such as 12121, 15151 do not have corresponding records in the index but you can search for them through 10101 key to retrieve their records in the base table.<\/p>\n<p>\u00a0A Sparse Index contains one entry for each page of records in the data file. The index record contains the search key and a pointer to the first data record with that search key value. A Sparse index must be clustered and it is smaller than a dense index.<\/p>\n<p>\u00a0PRIMARY AND SECONDARY INDEX<br \/>\nPRIMARY INDEX<br \/>\nPrimary index is an index defined on a primary key column(s) of a relation with unique constraint which guarantee that the field will not contain duplicate values and determine the order of how the records are physically stored on the disk. Note that this is also called <strong>clustered index<\/strong>.<\/p>\n<p>\u00a0This is an index on a set of fields that includes the primary key. Primary index contains records that are usually clustered. A primary index is created for the primary key of a table.<\/p>\n<p>\u00a0SECONDARY INDEX<br \/>\nSecondary index is an index defined on a non-key field which may contain duplicate values and as such does not determine the order of how the records are physically stored on a disk. It is also called <strong>non-clustered index<\/strong>.<br \/>\nFor example, in student database, student ID is used to look up for a student as the key, however, one might want to look up for a student using LastName by creating secondary index on that column.<\/p>\n<p>\u00a0Secondary index is an index that is not a primary index i.e. it does not include primary key. Secondary index can be created on non- key attribute. It contains duplicate data entries.<\/p>\n<p>\u00a0A Unique index is an index in which the search key contains some candidate key.<\/p>\n<p>\u00a0<strong>EVALUATION<br \/>\n<\/strong><\/p>\n<ol>\n<li>\n<div>Distinguish between dense index and sparse index\n<\/div>\n<\/li>\n<li>\n<div>Explain primary and secondary index\n<\/div>\n<\/li>\n<\/ol>\n<p>\u00a0INDEXES USING COMPOSITE SEARCH KEYS<br \/>\nComposite search keys or concatenated keys are when the search key for an index contain several fields. For example, considering a collection of employee records with field name, age and salary stored in sorted order by name. if the search key is composite, an equality query is one in which each field in the search key is bound to a constant. For example, we can ask to retrieve all data entries with age = 20 and sal = 10, the hashed file organization supports only equality queries since a hash function identifies the bucket containing desired records only if a value is specified for each field in the search key.<\/p>\n<p>\u00a0The search key for an index can contain several fields, such keys are called <strong>Composite Search Keys<\/strong>or <strong>Concatenated Keys<\/strong>.<\/p>\n<p>\u00a0<strong>Range Query<\/strong>is the one in which not all fields in the search key are bound to constants. For example, we can ask to retrieve all data entries with age = 20; this query implies that any value is acceptable for the sal _eld. Another example of a range query is when ask to retrieve all data entries with age &lt; 30 and sal&gt; 40   <\/p>\n<p>\u00a0<strong>GENERAL EVALUATION<br \/>\n<\/strong><\/p>\n<ol>\n<li> Differentiate between a unique index and a range query.\n<\/li>\n<li>What is the difference between primary and secondary indexes?.\n<\/li>\n<\/ol>\n<p>\u00a0<strong>READING ASSIGNMENT<\/strong><br \/>\n\t\tUnderstanding Data Processing for Senior Secondary Schools by Dinehin Victoria, Page 254.<\/p>\n<p>\u00a0<strong>WEEKEND ASSIGNMENT<br \/>\n<\/strong><\/p>\n<ol>\n<li>\u2026\u2026\u2026. is an index in which  the search key contains some candidate key. a) Unique index  b) An index  c) composite  d) sparse index\n<\/li>\n<li>\u2026\u2026  can be created on a non- key attribute.  a) primary index b) dense index   c) secondary index  d) sparse index\n<\/li>\n<li>\n<div>A sparse index contains one entry for each  \u2026\u2026of records in the data file. a) page b) table c) row  d) column\n<\/div>\n<p>4.  \u2026\u2026\u2026is the one in which not all fields in the Search key are bound to constant.  a) dense index b) composite search key c) secondary index d) range query<br \/>\n5.  \u2026\u2026. is when the search key for an index contain several fields. a) primary index b) composite search key c) secondary index  d) unique index\n<\/li>\n<\/ol>\n<p>\u00a0<strong>THEORY<br \/>\n<\/strong>1.\u00a0\u00a0\u00a0\u00a0Create a student table with the following fields: name, age, and scores of 5 records. Create an index using a composite keys name and age. (show the table and SQL statements)<br \/>\n2.\u00a0\u00a0\u00a0\u00a0Discuss the different types of indexing.<br \/>\n3.\u00a0\u00a0\u00a0\u00a0Differentiate between a unique index and a range query.<br \/>\n4.\u00a0\u00a0\u00a0\u00a0What is composite search key?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0WEEK THREE INDEXES DENSE VERSUS SPARSE INDEXES DENSE INDEX This is said to be dense&#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,291],"tags":[],"class_list":["post-3742","post","type-post","status-publish","format-standard","hentry","category-posts","category-first-term-ss3-data-processing"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/ecolebooks.com\/nigeria\/wp-json\/wp\/v2\/posts\/3742","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=3742"}],"version-history":[{"count":1,"href":"https:\/\/ecolebooks.com\/nigeria\/wp-json\/wp\/v2\/posts\/3742\/revisions"}],"predecessor-version":[{"id":3743,"href":"https:\/\/ecolebooks.com\/nigeria\/wp-json\/wp\/v2\/posts\/3742\/revisions\/3743"}],"wp:attachment":[{"href":"https:\/\/ecolebooks.com\/nigeria\/wp-json\/wp\/v2\/media?parent=3742"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ecolebooks.com\/nigeria\/wp-json\/wp\/v2\/categories?post=3742"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ecolebooks.com\/nigeria\/wp-json\/wp\/v2\/tags?post=3742"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}