You are on page 1of 8

1

UNIT 18

Assignment 1: Features of a Relational Database

Etinosa Enomayo
3

Features of a relational Database..........................................................................................................1


Entities:..............................................................................................................................................1
Field attributes and their properties..................................................................................................1
The purpose of key fields...................................................................................................................1
Primary key....................................................................................................................................1
Foreign key....................................................................................................................................1
Auto Incremented key.......................................................................................................................1
Different types of relationships with supporting diagrams................................................................1
The Process of Normalisation............................................................................................................1
Benefits of a relational database including data redundancy............................................................1
Referential Integrity..............................................................................................................................1
Avoiding errors in Relational Databases................................................................................................1
References:............................................................................................................................................1

Features of a relational Database

Entities:
An entity is a single thing person, place or thing that is independent from another. The information
stored about the real world are entities.

Field attributes and their properties


The information in the fields that fall beneath a column in a table makes up a database Field
attributes. The properties of it are:

 Field data: The kind of information kept in this attribute field.


 Field Label: A word or phrase assigned to the field.
 Field Length: Maximum length for the field's data.
 Field sequence number: the order in which this field appears in the attribute.

 Name: The attribute field's name. It must be a lowercase value.


 Virtual: Makes clear whether this attribute is virtual. Virtualized attributes are used in data
derivation but are not saved in the database. This attribute cannot be shown or utilised in
task and member search functionality when it is set to "Yes." Additionally, the database does
not remember the attributes' history
4

The purpose of key fields


Primary key
To be considered a relational table, a table should include a primary key. It consists of one or more
columns in which information uniquely identifies each table row.

The primary key may be used, for instance, to identify the streets where the houses were located if
the data in the rows included house numbers.

To be recognised as a primary key, it is the data in each column that must be different, and not the
column name themselves. On top of that there can be no blank value or Null in the columns

Foreign key
The accuracy and reliability of data and the consistency as well as updating the data are all made
possible through the foreign key. While the primary key ensures that such data is distinct in a single
column, the foreign key restrictions guaranteed referential integrity. This is done by forbidding the
entry of values which are not matching with the primary key of the associated table.

Auto Incremented key


Creates a distinct number for each new record that is added. Since it is simple for the developers to
automatically produce a unique integer for each new entry, this is typically utilised for the primary
key column. It works by looking at what the current increment value for the table is and
automatically stores that value with plus 1 for the next row that comes in.

Different types of relationships with supporting diagrams


A one-to-one relationship: The least common relationship and only one record for either side of the
connection exists in this relationship. And the table's rows are all linked to only a single row in
another table. However, there is little in the way of data analysis within this type of relationship, it
does provide various users varying degrees of access to the data in the linked table.

A one-to-many relationship: This relationship has one record on one side and zero, one, or many
records on the other. The most frequently utilised kind of relationship is this one. The one-to-many
relationship can become a many-one relationship due to the linked table. For instance, a mother can
bear multiple children, however a mother can also only be the mother of only one child.

A many-to-many relationship: Such relationship of this sort exists when every single record in the
first table can be associated to one or more records in the second table, as well as when a single
record in the second table can be associated with one or more records in the first table. Two one-to-
many relationships can be connected via something called a linking table and they can then be
considered as a many-to-many relationship. The primary keys of the other two tables are found in
the connecting table, this is what links the two tables.
5

The Process of Normalisation


Database normalisation is a process in which data can be organised. In this process the breaking
down of tables is done to get rid of redundant data and undesired traits. The data is converted into a
tabular form with help of multi-step procedure that will also get rid of redundant data from
relational tables. Normalisation is used when eliminating redundant data or making sure the data is
kept logically. There are normalisation rules which are divided into 3 forms:

First Normal form (1NF)

The following 4 guidelines must be followed by a table for it to be in the First Normal Form:

 It needs to include a single valued attributes/ column.


 Values kept in a column must be in the same domain.
 A table's columns should each have a name that is distinct.
 Furthermore, it does not matter in what order the data is kept in.

Second Normal form (2NF)

To be considered in the Second Normal Form, a table must:

 It needs to be in the First Normal Form.


 And it cannot include Partial Dependency

Third Normal form (3NF)

When a table exhibits the Third Normal Form:

 The second normal form is used.


 Additionally, it lacks transitive dependence.

Benefits of a relational database including data redundancy


The relational database model's key advantage is that it offers a simple method of representing data
and makes connected data points accessible with ease. Because of this, relational databases have
been most frequently employed by businesses that need to manage significant volumes of
structured data, such as those that need to track inventories, process transactional data, or log
application activity. There are many more benefits that come with relational database such as:

 Reduced data redundancy: Due to Database Normalisation involving efficiently arranging


data within the database it makes sure that redundancy is eliminated. This is a huge benefit
because data redundancy can lead to things such as data corruption and increased storage
cost.
 Reduced data storage: When data is stored redundantly there will be increased storage
which will leads to increased size as well as and more complexity however due to the
structure of relational database it ensures data integrity preventing this issue.
 Faster access: Due to relational database allowing reduced database size there will not be
longer load times allowing the database to be accessed a lot quicker.
6

 Efficient updating: The SQL used by relational databases makes it easier to update data this
is as users can write a single query that can update multiple fields in the database due to this
it is far easier and faster to update data.
 Searching: When searching for data within a relational database it is far easier this is
because of the data is organised into tables which make it easier to find specific pieces of
data.
 Sorting: Due to SQL sorting in data easy and efficient within relational databases, this is as
SQL allow users to write queries that sort data in a variety of ways. For example, SQL queries
can be written to sort data in ascending order or descending order and by a specific field or
by multiple fields.
 Reporting: Relational database allows for easy and quick reporting of data this is due to the
fact that users can custom queries and reports that can be used to either filter data,
aggregate data, and perform calculations on the data.

Referential Integrity
Referential integrity talks of how accurate and reliable the data within a relationship. In such
relationships the data is seen to be linked to two or more tables. This is done using a foreign key to
reference a primary key value and this means that it should be made sure that data on both sides of
the relationship is always kept functional.

Primary keys help ensure referential integrity by making sure that a link between two related tables
is established. It makes sure that there are no duplicate values and that each record in a table can be
identified. When building relationships in between tables, a foreign key is used to reference a
primary key in another table as this creates links that make sure the information is valid and
consistent. Foreign keys ensure that the data in one table corresponds to data in another.

Avoiding errors in Relational Databases


There are many errors that can occur during the design and construction of a relational database
which can impact how fictional, efficient, and reliable the database will be.

During the design of a relational database errors such as poor entity relationship modelling can
happen because of incorrectly representing relationships between entities. This error can lead to
significant issues such as data redundancy, inconsistency, and difficulties in querying. Another error
that can arise is incorrect data normalisation which happens when data is either over-normalised or
under-normalised. This can also lead to data fragmentation or data redundancy as well.

During the construction of a relational database error such as incorrect data entries can happen. For
example, due to human error during the entry of data inconsistency, inaccuracy of the data as well
as even missing data. Another error that could occur is data integration issues, incorrectly
integrating data from a variety of sources can cause data inconsistencies and/or data loss.

Although there are many errors that can occur during the construction and design of a relational
database there are also practices that can help prevent these errors from occurring. For instance,
utilising automated tools for data Intergration and data validation can help avoid the incorrect
integration of the data and will help prevent data inconsistencies as well as data losses. Another
thing that can be done is have regular checks to ensure that any errors can be identified and
corrected. Lastly adhering to the database design and principles can also prevent and such errors.
7

References:

1NF, 2NF, 3NF and BCNF in Database Normalization | Studytonight. (n.d.). Studytonight -
Best place to Learn Coding Online. https://www.studytonight.com/dbms/database-
normalization.php

Editor. (2022, April 11). 9 Common Pitfalls to Avoid During Database Design. AltexSoft.
https://www.altexsoft.com/blog/database-design-mistakes/

IBM Documentation. (n.d.). IBM - Deutschland | IBM.


https://www.ibm.com/docs/en/imdm/11.5?topic=properties-attribute-field

Ways to Reduce Data Redundancy. (n.d.). DBSync Blogs.


https://www.mydbsync.com/blogs/ways-to-reduce-data-redundancy/

What are the different types of relationships in DBMS? (n.d.). AfterAcademy | Platform
for learning coding & software development. https://afteracademy.com/blog/what-
are-the-different-types-of-relationships-in-dbms/

What is a relational database? | IBM. (n.d.). IBM - Deutschland | IBM.


https://www.ibm.com/topics/relational-databases

What is Primary and Foreign Keys in Database (Purpose and Use). (“Purpose of Foreign
Keys in Databases - eukhost Blog”) (n.d.). Web Hosting Blog from eUKhost.
https://www.eukhost.com/blog/webhosting/what-the-use-of-primary-foreign-keys-in-
database/

What is Referential Integrity? (n.d.). Database.Guide. https://database.guide/what-is-


referential-integrity/
8

You might also like