CAT - DBMS - UoE
CAT - DBMS - UoE
✓ Database Storage:
At the core of database storage lies the concept of a "page." A page is a fixed-size
block of data that serves as the basic unit of I/O (Input/Output) and data storage in
most databases. Pages are primarily used to store data tuples (rows) along with
some metadata about the page itself, such as the page number and transaction
information. It's important to note that other database structures like indexes and
logs are typically managed separately and may not reside within the same pages as
data tuples.
✓ Storage Manager:
The storage manager is a critical component of the DBMS responsible for handling
read and write operations on the database files. It also manages the allocation and
deallocation of storage space within the database, ensuring efficient utilization of
resources.
1
File Organization Techniques:
Heap file organization is a simple and unordered method of storing data pages. In a
heap, new records are inserted wherever there is available space, without
maintaining any specific order. Heap storage does not provide any ordering based on
indexes or values; instead, it focuses on efficiently utilizing storage space. To locate
specific pages in a heap, the DBMS relies on metadata at the file and page levels,
such as page numbers and free space information.
Tree file organization is well-suited for efficient range queries. When you need to
retrieve records based on a range of values. These tree-based indexes allow for
quick traversal and locating of relevant pages, making range queries highly efficient.
Hashing file organization is optimized for fast equality searches. When you need to
quickly find records based on an exact match, hashing techniques come into play.
By applying a hash function to the search key, the DBMS can directly locate the page
containing the desired record, providing excellent performance for equality queries.
The page directory is a data structure used by the DBMS to map logical page
numbers to their corresponding physical locations on disk. It helps in efficiently
locating and accessing specific pages. In addition to the page directory, databases
often employ separate structures like free space maps or free lists to manage the
allocation and deallocation of storage space within the database files. These
structures keep track of available space and help optimize storage utilization.
2
ensure data redundancy, high availability, and fault tolerance. The storage manager
focuses on the low-level management of data files and pages, while replication
mechanisms operate at a higher level to keep data synchronized across multiple
instances.
Database storage is a vital aspect of DBMS that directly impacts the performance,
scalability, and reliability of database systems. By understanding the concepts of file
systems, pages, and file organization techniques, you can make informed decisions
when designing and optimizing your databases. While the specific implementations
may vary between different database systems, the fundamental principles remain
largely consistent. As you continue to explore the world of databases, keep an open
mind, experiment with different techniques, and strive to find the right balance
between performance, storage efficiency, and data integrity. Happy data storing.
Normalization in DBMS is a bit like organizing your closet. Imagine you have got
clothes, shoes, and accessories all mixed up. If you wanted to find your favourite
shirt, you would have a tough time sifting through everything. Just like that,
databases can get mixed-up if data isn’t organized properly.
First, you need to identify what items (or entities) you have. Just like figuring out you
have shirts, shorts, and shoes, in a database, you would figure out what items you
are dealing with, like customers, orders, and products.
✓ The objective for 1NF is to eliminate duplicate columns from the same table and
create separate tables for each group of related data and the cardinal rule for
this form is that each column must contain atomic (indivisible) values, and each
record must be unique.
This is where you make sure everything is tidy. In your closet, this means
ensuring no clothes are folded together. Each item should have its own space. In
database terms, you would make sure that each piece of information is clear and
3
distinct. So instead of cramming multiple phone numbers into one space, you
would have each phone number listed separately.
✓ The objective for 2NF is to remove partial dependencies; ensure that all non-key
attributes are fully dependent on the primary key and the rule is that the table
must be in 1NF, and all non-key columns must be dependent on the entire
primary key, not just part of it (applicable for composite keys).
Now that everything is neatly arranged, you want to make sure that each item is
associated with all the information it needs. Imagine if you had a shelf for shoes,
but you also kept a receipt there. That receipt belongs with the order details, not
the shoes. In DBMS, you would make sure every piece of information relates
directly to the main entry, so it doesn’t mix things up.
✓ The objective for 3NF is to eliminate transitive dependencies while the rule is
that the table must be in 2NF, and all attributes must be directly dependent on
the primary key, meaning there should be no transitive functional dependencies.
This step ensures that everything stays connected without overlaps. If you had a
box for accessories that included your favourite earrings and a jewellery cleaner
that only applies to earrings, it’s better to keep the cleaner with other cleaning
supplies instead. In database terms, you separate information that doesn’t
directly connect to each other to keep things streamlined.
Sometimes, you might need to get even more specific, like having separate
sections for casual and formal shoes. In databases, this means creating even
more focused tables to ensure every piece of data is in its perfect place, and
everything aligns perfectly.
✓ The objective for 4NF is to remove multi-valued dependencies while the rule is
that the table must be in BCNF, and it should not have any non-trivial multi-
valued dependencies.
4
6. Fifth Normal Form (5NF).
✓ The objective is to address all constraints on a table while the cardinal rule
states that, a table is in DKNF if every constraint on the table is a consequence of
the definition of keys and domains of the attributes.
✓ Data Integrity - Just like a neatly organized closet, a normalized database has
less redundant data, making it easier to find what you need.
✓ Data consistency - If you clean out your closet, it’s easier to see what you have.
Similarly, normalization helps keep your data accurate and reliable.
✓ Better relationship between tables - No large tables, small tables with a proper
relationship.
✓ More scalable design for tables - If you ever need to update something, you know
exactly where to go—no more searching through piles.
✓ Removing dependencies, like Partial Dependency, Transitive Dependency, Join
Dependency.