Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 48

Relational

Database
Design
Group 4
Ebarle, Edorot, Ermita, Felicitas,
Gaccion, Gaguan, Sandigan
Group 4

Hannah Gaguan Sydney Sandigan Graciela Ermita

Joshua Felicitas

Tirso Gaccion Lessa Ebarle Aren Edorot


Objectives
Intended learning outcome/s :
1. Describe the physical database design process
2. Choose storage formats for attributes
3. Select appropriate file organizations
4. Describe three types of file organization
5. Describe indexes and their appropriate use
6. Translate database model into efficient structures, and
7. Know when and how to use denormalization
PHYSICAL DATABASE
DESIGN PROCESS
Physical Database Design

Physical database design is the process of


transforming logical data models into
physical data models. An experienced
database designer will make a physical
database design in parallel with conceptual
data modeling if they know the type of
database technology that will be used.
Physical Database Design
Purpose: translate the logical description of
data into the technical specifications for
storing and retrieving data.

Goal: create a design for storing data that will


provide adequate performance and ensure
database integrity, security, and
recoverability.
ATTRIBUTES
What is Attributes?
In relational databases, attributes are the describing characteristics or
properties that define all items pertaining to a certain category applied to
all cells of a column.

The rows, instead, are called tuples, and represent data sets applied to a
single entity to uniquely identify each item. Attributes are, therefore, the
characteristics of every individual tuple that help describe its unique
properties.

It stores only one piece of data about the object represented by the table
in which the attribute belongs.
Types of Attributes

1. Composite attribute
2. Multivalued attribute
3. Key attribute or primary attribute
4. Derived attribute
Types of Attributes

1. Composite attribute
is an attribute composed of several other simple attributes.
Types of Attributes
Types of Attributes

2. Multivalued attribute
is an attribute where more than one description can be
provided.
Types of Attributes
Types of Attributes

3. Key attribute or primary attribute


is an ID, key, letter or number that uniquely identifies
that item. A table that contains a single key attribute is
considered a strong entity. However, a table might
contain more than one key attribute if it’s derived from
other tables.
Types of Attributes
Types of Attributes
4. Derived attribute
as the name implies, these are derived from other
attributes, either directly or through specific formula
results. In other instances, a formula might calculate the
VAT of a certain payment, so that whenever the cell with
the attribute Payment is filled, the cell with the derived
attribute VAT automatically calculates its value.
Types of Attributes
FILE ORGANIZATION
A database consists of a huge amount of data. The
data is grouped within a table in RDBMS, and each
table have related records. A user can see that the
data is stored in form of tables, but in actual, this huge
amount of data is stored in physical memory in form of
files.
File organization
File Organization refers to the
logical relationships among
various records that constitute
the file, particularly with respect to
the means of identification and
access to any specific record. In
simple terms, storing the files in
certain order is called file
organization.
Objective of file organization

● Optimal Selection of Records


● Easy Transaction
● No duplicate records
● Efficient Storing
Types of File Organizations

There are various methods in file organization.


These methods have their pros and cons
accordingly. These methods may be efficient for
certain types of selection. Meanwhile, they will be
inefficient for other selection. So, the developer or
the programmer decides the best-suited file
organization method depending on his requirement
according to the situation.
Types of File Organization

1. Sequential File Organization


2. Heap File Organization
3. Hash File Organization
4. B+ Tree File Organization
5. Clustered File Organization
Types of File Organization

1. Sequential File Organization

● Storing and sorting in contiguous block within files on tape or disk is called as sequential access file organization.

Advantages
1. It is simple to program and easy to design.
2. Sequential file is best use if storage space.

Disadvantages
3. Sequential file is time consuming process.
4. It has high data redundancy.
Types of File Organization
Types of File Organization

2. Heap File Organization

● Simplest type of file organization.


● Also called as, unordered file organization.
● No order is required in storing the records.

Advantages:

1. Insertion becomes easy.


2. Best method for bulk loading data into a relation.

Disadvantages:

3. Frequent deletions of records would need periodical file reorganization.


4. Inefficient for larger database tables.
Types of File Organization
Types of File Organization

3. Hash File Organization

● Hash File Organization uses the computation of hash function on some fields of the records. The hash function's
output determines the location of disk block where the records are to be placed. When a record has to be received
using the hash key columns, then the address is generated, and the whole record is retrieved using that address.

Advantages of Hash File Organization

1. This method doesn’t require sorting explicitly as the records are automatically sorted in the memory based on
hash keys.
2. Records are not dependant on each other and are not stored in consecutive memory locations so that prevents
the database from read, write, update, delete anomalies.

Disadvantages of Hash File Organization


3. Can cause accidental deletion of data, if columns are not selected properly for hash function.
4. Memory is not efficiently used in hash file organization as records are not stored in consecutive memory
locations.
Types of File Organization
Types of File Organization
4. B+ Tree File Organization

● B+ tree file organization is the advanced method of an indexed sequential access method. It
uses a tree-like structure to store records in File. Uses the same concept of key-index where
the primary key is used to sort the records. For each primary key, the value of the index is
generated and mapped with the record.

Advantages of B+ Trees

1. Using B+, we can retrieve range retrieval or partial retrieval. Traversing through the tree structure makes
this easier and quicker.
2. Since it is a balance tree structure, any insert/ delete/ update does not affect the performance.

Disadvantages of B+ Trees

3. This method is less efficient for static tables


Types of File Organization
Types of File Organization

5. Clustered File Organization

● When the two or more records are stored in the same file, it is known as clusters. These files will have two or more
tables in the same data block, and key attributes which are used to map these tables together are stored only once.
● This method reduces the cost of searching for various records in different files.

Advantages of Clustered File Organization

1. This method is best suited when there is frequent request for joining the tables with same joining condition.
2. When there is a 1:M mapping between the tables, it results efficiently

Disadvantages of Clustered File Organization

3. This method is not suitable for very large databases since the performance of this method on them is low.
4. This method is not suitable for less frequently joined tables or tables with 1:1 conditions.
Types of File Organization
RELATIONA
L
DATABASE
INDEX
DATA INTEGRITY
What is Data Integrity

Data integrity is the overall completeness, accuracy and


consistency of data over its entire lifecycle.

When data has integrity, mechanisms have been put in place to


ensure that data-in-use, data-in-transit and data-at-rest cannot be
changed by an unauthorized person or program. An important goal
of maintaining data integrity is to make sure that when data is
recovered after a disruption, it can be trusted.
Field Data Integrity
• Default value: Assumes value if there is no explicit value.

• Range control: Allows value limitations, i.e constraints or value rules.

• Null value control: Allows or prohibits empty fields.

• Referential integrity: Acts as range control and null value allowance for foreign-key
to primary-key matchups.

▶▶Sarbanes-Oxley Act or SQX legislatss


importance of financial data integrity.
Handling Missing Data
• Substitute an estimate of a missing data by using a formula.
• Construct a report listing missing values.
• Ignore missing data unless the value is significant (i.e. sensitivity testing).

▶▶Triggers can be performed to perform the


operations listed above.
HOW TO USE
DENORMALIZATION
WHAT IS
DENORMALIZATION?
- Denormalization is a strategy used on a
previously-normalized database to increase
performance. The idea behind it is to add
redundant data where we think it will help us
the most. We can use extra attributes in an
existing table, add new tables, or even create
instances of existing tables.
Benefits of Denormalization
Denormalization can improve performance by:

- Minimizing the need for joins


- Precomputing aggregate values, that is,
computing them at data modification time,
rather than at select time
- Reducing the number of tables, in some cases
WHY DO WE NEED TO APPLY
DENORMALIZATION
1. Maintaining History
2. Improving Query Performance
3. Speeding up Report
4. Computing commonly-needed values up front
ADVANTAGES DISADVANTAGES
● It reduces the number of ● Increase the size of tables
foreign keys and indexes
● Waste storage spaces
● It minimizes the number of
necessary join queries ● Can make update and insert
code difficult to write
● In some cases, it reduces
number of tables in ● Does not maintain data integrity
database

● Improves performance of
the database by increasing
speed
Gracias
References
1. Code studio. (n.d.). Retrieved October 6, 2022, from https://www.codingninjas.com/codestudio/library/introduction-
to-file-organization
2. File organization in DBMS: Set 1. GeeksforGeeks. (2022, July 20). Retrieved October 6, 2022, from
https://www.geeksforgeeks.org/file-organization-in-dbms-set-1/
3. Farmer, K. (2021, July 10). Relational database indexes and when to use them. Medium. Retrieved October 6,
2022, from https://levelup.gitconnected.com/relational-database-indexes-and-when-to-use-them-fb2104cf7af4
4. Admin. (2022, September 19). File organization in DBMS: Gate notes. BYJUS. Retrieved October 6, 2022, from
https://byjus.com/gate/file-organization-in-dbms-notes/
5. OpenALG. (n.d.). Retrieved October 6, 2022, from https://alg.manifoldapp.org/read/introduction-to-database-
systems/section/c5a934d1-5720-401e-b90b-e6b01fb0aaa7#:~:text=Physical%20database%20design%20is
%20the,technology%20that%20will%20be%20used.
6. https://youtu.be/WmJuhKLQMA4
7. Drkušić, E. (2019, February 13). Denormalization: When, why, and how. Vertabelo Data Modeler. Retrieved October
6, 2022, from
https://vertabelo.com/blog/denormalization-when-why-and-how/?fbclid=IwAR3hwRnfVBnOHd2pR7_Aq_SJyBwYplr
R_fXWe8Io_9PUNcVvdQXkre5c3k4#:~:text=Denormalization%20is%20a%20strategy%20used,create%20instance
s%20of%20existing%20tables
8. Viva. (2020, December 14). 9 difference between normalization and Denormalization in SQL. Viva Differences.
Retrieved October 6, 2022, from https://vivadifferences.com/9-difference-between-normalization-and-
denormalization-in-sql-with-examples/?fbclid=IwAR382J8xq62_2sFQP_a-nsNY4jtnbCrCGKpxxtr_r-

You might also like