Docsity

Database Organization and Data Warehousing: Functions, Record Sizes, and Data Security, Study notes of Database Management Systems (DBMS)

Toggle sidebar
bg1
KABARAK UNIVERSITY
UNIVERSITY EXAMINATIONS
MAIN CAMPUS
COMP 324: DBMS 11 compliled assignment:
Sep-Dec2023Class:
Brian kibet
Barton kibet
David karanja
Victor mbii
Faith Omuliebi
Kipleting Dan
Timson Rogers
Ian omondi
Victor kipyegon
Kevin kiprotich
Collins Kirui
Mitchell gitito
Sandra Akinyi
Dr. Laura Cheptegei
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Database Organization and Data Warehousing: Functions, Record Sizes, and Data Security and more Study notes Database Management Systems (DBMS) in PDF only on Docsity!

KABARAK UNIVERSITY

UNIVERSITY EXAMINATIONS

MAIN CAMPUS

COMP 324: DBMS 11 compliled assignment:

Sep-Dec2023Class:

Brian kibet

Barton kibet

David karanja

Victor mbii

Faith Omuliebi

Kipleting Dan

Timson Rogers

Ian omondi

Victor kipyegon

Kevin kiprotich

Collins Kirui

Mitchell gitito

Sandra Akinyi

Dr. Laura Cheptegei

once you switch to a different task. It is also used to load and run applications, like your spreadsheet program, answers commands, like all edits you made within the spreadsheet, or toggle between multiple programs, like once you left the spreadsheet to see the email. Memory is nearly always actively employed by your computer. It ranges from 1GB – 32GB/64GB depending upon the specifications. There are different types of RAM, and although they all serve the same purpose, the most common ones are :

  1. SRAM: It stands for Static Random Access Memory. It consists of circuits that retain stored information as long as the power supply is on. It is also known as volatile memory. It is used to build Cache memory. The access time of SRAM is lower and it is much faster as compared to DRAM but in terms of cost, it is costly as compared to DRAM.
  2. DRAM: It stands for Dynamic Random Access Memory. It is used to store binary bits in the form of electrical charges that are applied to capacitors. The access time of DRAM is slower as compared to SRAM but it is cheaper than SRAM and has a high packaging density.
  3. SDRAM: It stands for Synchronous Dynamic Random Access Memory. It is faster than DRAM. It is widely used in computers and others. After SDRAM was introduced, the upgraded version of double data rate RAM, i.e., DDR1, DDR2, DDR3, and DDR4 was entered into the market and widely used in home/office desktops and laptops.  ROM: It stands for Read-Only Memory. The data written or stored in these devices are non- volatile, i.e, once the data is stored in the memory cannot be modified or deleted. The memory from which will only read but cannot write it. This type of memory is non-volatile. The information is stored permanently during manufacture only once. ROM stores instructions that are used to start a computer. This operation is referred to as bootstrap. It is also used in other electronic items like washers and microwaves. ROM chips can only store a few megabytes (MB) of data, which ranges between 4 and 8 MB per ROM chip. There are two types of ROM:
  4. PROM: PROM is Programmable Read-Only Memory. These are ROMs that can be programmed. A special PROM programmer is employed to enter the program on the PROM. Once the chip has been programmed, information on the PROM can’t be altered. PROM is non-volatile, that is data is not lost when power is switched off.
  5. EPROM: Another sort of memory is the Erasable Programmable Read-Only Memory. It is possible to erase the info which has been previously stored on an EPROM and write new data onto the chip.
  6. EEPROM: EEPROM is Electrically erasable programmable read-only memory. Here, data can be erased without using ultraviolet light, with the use of just applying the electric field.
  1. Magnetic Storage Devices  Floppy Disk: Floppy Disk is also known as a floppy diskette. It is generally used on a personal computer to store data externally. A Floppy disk is made up of a plastic cartridge and secured with a protective case. Nowadays floppy disk is replaced by new and effective storage devices like USB, etc.  Hard Disk: Hard Disk is a storage device (HDD) that stores and retrieves data using magnetic storage. It is a non-volatile storage device that can be modified or deleted n number of times without any problem. Most computers and laptops have HDDs as their secondary storage device. It is actually a set of stacked disks, just like phonograph records. In every hard disk, the data is recorded electromagnetically in concentric circles or we can say track present on the hard disk, and with the help of a head just like a phonograph arm(but fixed in a position) to read the information present on the track. The read-write speed of HDDs is not so fast but decent. It ranges from a few GBs to a few and more TB.  Magnetic Card: It is a card in which data is stored by modifying or rearranging the magnetism of tiny iron-based magnetic particles present on the band of the card. It is also known as a swipe card. It is used like a passcode(to enter the house or hotel room), credit card, identity card, etc.  Tape Cassette: It is also known as a music cassette. It is a rectangular flat container in which the data is stored in an analog magnetic tape. It is generally used to store audio recordings.  SuperDisk: It is also called LS-240 and LS-120. It is introduced by Imation Corporation and it is popular with OEM computers. It can store data up to 240 MB.
  1. Optical Storage Devices Optical Storage Devices is also secondary storage device. It is a removable storage device. Following are some optical storage devices:  CD: It is known as Compact Disc. It contains tracks and sectors on its surface to store data. It is made up of polycarbonate plastic and is circular in shape. CD can store data up to 700MB. It is of two types:
    1. CD-R: It stands for Compact Disc read-only. In this type of CD, once the data is written can not be erased. It is read-only.
    2. CD-RW: It stands for Compact Disc Read Write. In this type of CD, you can easily write or erase data multiple times.  DVD: It is known as Digital Versatile Disc. DVDs are circular flat optical discs used to store data. It comes in two different sizes one is 4.7GB single-layer discs and another one is 8.5GB double- layer discs. DVDs look like CDs but the storage capacity of DVDs is more than as compared to CDs. It is of two types:
    3. DVD-R: It stands for Digital Versatile Disc read-only. In this type of DVD, once the data is written can not be erased. It is read-only. It is generally used to write movies, etc.
    4. DVD-RW: It stands for Digital Versatile Disc Read Write. In this type of DVD, you can easily write or erase data multiple times.  Blu-ray Disc: It is just like CD and DVD but the storage capacity of blu ray is up to 25GB. To run a Blu-ray disc you need a separate Blu-ray reader. This Blu-ray technology is used to read a disc from a blue-violet laser due to which the information is stored in greater density with a longer wavelength.
  1. Cloud and Virtual Storage Nowadays, secondary memory has been upgraded to virtual or cloud storage devices. We can store our files and other stuff in the cloud and the data is stored for as long as we pay for the cloud storage. There are many companies that provide cloud services largely Google, Amazon, Microsoft, etc. We can pay the rent for the amount of space we need and we get multiple benefits out of it. Though it is actually being stored in a physical device located in the data centers of the service provider, the user doesn’t interact with the physical device and its maintenance. For example, Amazon Web Services offers AWS S3 as a type of storage where users can store data virtually instead of being stored in physical hard drive devices. These sorts of innovations represent the frontier of where storage media goes. Characteristics of Computer Storage Devices
    1. Data stored in the Memory can be changed or replaced in case of a requirement, because of the mobility of the storage devices.

Hard Disk Drives (HDDs): Speed: HDDs are relatively slower compared to other storage types, as they rely on spinning disks and mechanical arms to read and write data. Capacity: HDDs offer high-capacity options, often ranging from several hundred gigabytes (GB) to multiple terabytes (TB). Cost: HDDs are cost-effective and provide a lower cost per gigabyte compared to other storage types. Solid State Drives (SSDs): Speed: SSDs are much faster than HDDs because they use flash memory for data storage, which has no moving parts. Capacity: SSDs come in a range of capacities, from smaller drives of a few hundred GBs to multiple terabytes. Cost: SSDs are more expensive than HDDs on a per-gigabyte basis but have become more affordable over time. NVMe SSDs (Non-Volatile Memory Express): Speed: NVMe SSDs are the fastest consumer storage option available, offering significantly higher read and write speeds compared to traditional SSDs. Capacity: They are available in various capacities, similar to standard SSDs. Cost: NVMe SSDs tend to be more expensive than standard SSDs but are known for their excellent performance. Optical Discs (CD/DVD/Blu-ray): Speed: Optical discs are slower for data access compared to HDDs and SSDs.

Capacity: Their capacity is limited, ranging from a few hundred megabytes to a few gigabytes. Cost: Optical discs are relatively inexpensive, and the cost per disc is low. Tape Drives: Speed: Tape drives are slower for random access but are used for long-term archival storage. Capacity: They offer extremely high capacities, often in the terabytes or petabytes. Cost: Tape drives are cost-effective for long-term storage on a per-gigabyte basis but have higher upfront hardware costs. Cloud Storage: Speed: Cloud storage speed can vary depending on the service and internet connection, but it generally offers good accessibility. Capacity: Cloud storage providers offer scalable capacity, allowing users to store and access data as needed. Cost: Cloud storage costs depend on usage, with pricing models based on storage volume and data transfer.

2. What are the functions of database organization 1. Data Storage : One of the fundamental functions of database organization is to efficiently store data. Databases organize data into tables, rows, and columns, ensuring that data is stored in a structured and easily retrievable format. 2. Data Retrieval : Databases are designed to allow users and applications to retrieve data quickly and efficiently. The organization of data through indexing and storage mechanisms like B-trees helps expedite data retrieval operations. 3. Data Sorting : Databases often need to sort data based on specific criteria. Efficient sorting algorithms and data structures are employed to facilitate this process, ensuring that data can be ordered in various ways without significant performance overhead. 4. Data Filtering : Filtering is essential for querying databases. Database organization supports the ability to filter data based on conditions and criteria, allowing users to extract only the relevant information they need. 5. Data Indexing : Indexes are data structures that improve data retrieval performance. They provide a quick way to locate specific data records based on indexed columns, reducing the need for scanning the entire dataset. 6. Data Integrity : Ensuring data integrity is a key function of database organization. This involves enforcing data constraints, such as primary keys, foreign keys, and unique constraints, to maintain data consistency and prevent data corruption. 7. Concurrency Control : In multi-user database systems, concurrent access to data is common. Database organization includes mechanisms like locks and transactions to manage and control concurrent access to maintain data consistency. 8. Backup and Recovery : Database organization should facilitate regular data backups and provide tools for data recovery in case of system failures or data corruption. This function ensures data availability and reliability. 9. Security : Security is a critical aspect of database organization. It involves setting access controls, authentication, and encryption to protect sensitive data from unauthorized access or breaches. 10. Data Compression and Storage Optimization : Efficient database organization may include techniques like data compression and storage optimization to reduce storage requirements while maintaining data accessibility and performance. 11. Partitioning : Large databases can benefit from partitioning, where data is divided into smaller subsets or partitions. This enhances data management, improves query performance, and supports data archiving and maintenance. 12. Data Archiving and Purging : Over time, data can accumulate in a database. Database organization should support archiving and purging mechanisms to manage older or less frequently used data, ensuring the database remains efficient. 13. Scalability: Database organization should be designed with scalability in mind, allowing for the expansion of storage capacity and accommodating increasing data volumes without significant performance degradation.

3. Define file organization A file is named a collection of related information that is recorded on secondary storage such as magnetic disks, magnetic tapes, and optical disks. File Structure refers to the format of the label and data blocks and of any logical control record. File organization refers to the way data is structured and stored within a file or a collection of files in a computer system. It encompasses the methods and techniques used to arrange and manage data in a file, making it easy to access, search, update, and manipulate as needed. The Objective of File Organization 1. It helps in the faster selection of records i.e. it makes the process faster. 2. Different Operations like inserting, deleting, and update on different records are faster and easier. 3. It prevents us from inserting duplicate records via various operations. 4. It helps in storing the records or the data very efficiently at a minimal cost

Types of File Organizations

 Sequential / Orderd

In this method, the file is stored one after another in a sequential manner. There are two ways to implement this method:

  1. Pile File Method This method is quite simple, in which we store the records in a sequence i.e. one after the other in the order in which they are inserted into the tables. Pile File Method

Advantages of Sequential File Organization

  1. Fast and efficient method for huge amounts of data.
  2. Simple design.
  3. Files can be easily stored in magnetic tapes i.e. cheaper storage mechanism. Disadvantages of Sequential File Organization
  4. Time wastage as we cannot jump on a particular record that is required, but we have to move in a sequential manner which takes our time.
  5. The sorted file method is inefficient as it takes time and space for sorting records.

 Heap File Organization

Heap File Organization works with data blocks. In this method, records are inserted at the end of the file, into the data blocks. No Sorting or Ordering is required in this method. If a data block is full, the new record is stored in some other block, Here the other data block need not be the very next data block, but it can be any block in the memory. It is the responsibility of DBMS to store and manage the new records.

If we want to search, delete or update data in the heap file Organization we will traverse the data from the beginning of the file till we get the requested record. Thus if the database is very huge, searching, deleting, or updating the record will take a lot of time. Advantages of Heap File Organization  Fetching and retrieving records is faster than sequential records but only in the case of small databases.  When there is a huge number of data that needs to be loaded into the database at a time, then this method of file Organization is best suited. Disadvantages of Heap File Organization  The problem of unused memory blocks.  Inefficient for larger databases.

 Hashing

is an efficient technique to directly search the location of desired data on the disk without using an index structure. Data is stored at the data blocks whose address is generated by using a hash function. The memory location where these records are stored is called a data block or data bucket. Hash File Organization  Data bucket – Data buckets are the memory locations where the records are stored. These buckets are also considered Units of Storage.  Hash Function – The hash function is a mapping function that maps all the sets of search keys to the actual record address. Generally, the hash function uses the primary key to generate the hash index – the address of the data block. The hash function can be a simple mathematical function to any complex mathematical function.  Hash Index-The prefix of an entire hash value is taken as a hash index. Every hash index has a depth value to signify how many bits are used for computing a hash function. These bits can address 2n buckets. When all these bits are consumed? then the depth value is increased linearly and twice the buckets are allocated.

Static Hashing

In static hashing, when a search-key value is provided, the hash function always computes the same address. For example, if we want to generate an address for STUDENT_ID = 104 using a mod (5) hash function, it always results in the same bucket address 4. There will not be any changes to the bucket address here. Hence a number of data buckets in the memory for this static hashing remain constant throughout. Operations: 4

Quadratic probing : Quadratic probing is very much similar to open hashing or linear probing. Here, The only difference between old and new buckets is linear. The quadratic function is used to determine the new bucket address. Double Hashing : Double Hashing is another method similar to linear probing. Here the difference is fixed as in linear probing, but this fixed difference is calculated by using another hash function. That’s why the name is double hashing.

Dynamic Hashing

The drawback of static hashing is that it does not expand or shrink dynamically as the size of the database grows or shrinks. In Dynamic hashing, data buckets grow or shrink (added or removed dynamically) as the records increase or decrease. Dynamic hashing is also known as extended hashing. In dynamic hashing, the hash function is made to produce a large number of values. For Example, there are three data records D1, D2, and D3. The hash function generates three addresses 1001, 0101, and 1010 respectively. This method of storing considers only part of this address – especially only the first bit to store the data. So it tries to load three of them at addresses 0 and 1.

But the problem is that No bucket address is remaining for D3. The bucket has to grow dynamically to accommodate D3. So it changes the address to have 2 bits rather than 1 bit, and then it updates the existing data to have a 2-bit address. Then it tries to accommodate D3.

B+ Tree

as the name suggests, uses a tree-like structure to store records in a File. It uses the concept of Key indexing where the primary key is used to sort the records. For each primary key, an index value is generated and mapped with the record. An index of a record is the address of the record in the file. B+ Tree is very similar to a binary search tree, with the only difference being that instead of just two children, it can have more than two. All the information is stored in a leaf node and the intermediate nodes act as a pointer to the leaf nodes. The information in leaf nodes always remains a sorted sequential linked list.