A Note On Relational Databases
Tags: mysql, database, programming
Published: 2021-05-05 16:34:58

# A Note on Relational Database

Good day guys, in today's aricle i want to share with you some few things i have learned from using a relational database management system (RDBMS). Earlier on when i was moving from frontend to backend i had to make a choice of which database to learn, i was interested in php then so i went with relational databases. I have to say that relational databases are quite robust database solutions for your business, they are easy to setup, learn and use, most of the time it requires zero configurations to start using relational databases even on a server. Relational databases also have a powerful tool, the manner in which they are queried. Enter SQL (Structural Query Language) a language that reads like plain English and was designed for relational databases, it provides a simple yet powerful declarative language for accessing and managing data in relational databases. 

## RDBMS

A Relational database is database that operates with the relational model (RM). The RM is a way we store data by organizing and representing the data in such a way that such that we can relate one section, group or block of the data to another. The data is grouped into tables each table in turn has a row which represents an individual record in the data. Then there's columns, they describes an attribute of a particular record in the database. A row is also called a tuple. Each table usually have primary key. This primary key is an attribute of each record that will allow us to link to another record on another table. For us to link to another table, that table must specify on it it's column a field that will hold the equivalent value of the primary key of another table, once this is achieved we can link one or more tables together. we can also describe the type of relationship that exists among tuples. Examples of relational databases includes; MySQL, Microsoft SQL, Oracle DB amongst others. You can head [here](https://www.codecademy.com/articles/what-is-rdbms-sql) for more detailed explanation on relational databases 

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/mirxh7z7sox6z4b0ytbi.png)

## Advantages of Relational Model

#### SQL

This is arguably the best advantage of using RDBMS. For you to Manage and access the data stored in an RDBMS you use SQL which stands for structural query language. It is a computer language for storing, accessing and updating data stored in a relational database. SQL reads much like plain english, it is very easy to learn. It can be simple enough for a beginner and when you mature enough and want to perform more complex operations on your data. SQL allows you to write complex queries for accessing and updating your data, you can even write a query within another query, all other advantages of relational databases is made possible because of SQL.

### Relationships

Relational database are very good at expressing relationships, you can have a one to one relationship where one table shares a relationship with only a single relationship, or you can have a many to one relationship with one table and other tables, or a many to many relationship between other different table, two or more tables could be linked to 4 or more tables.

### Normalization

If you follow standard practice and you like sticking to the book, you will probably normalize your data at some point, normalization gives you the ability to properly define your data and abstract the relationship that exists between different groups of data, it will ensure that you devise the best possible schema for your data to avoid redundancy and inefficiency.

### Standardization

The SQL language is standardized language hence all database that says it is an SQL database must be SQL compliant, thus enabling you to write queries that you can run across multiple relational database and you don't need to have mad coding skills to learn SQL, so i would advice you to get familiar with it, you can visit this [page](https://www.tutorialspoint.com/sql/index.htm) to learn more about SQL.



## Why Pick a Relational Database

Here are some of the reasons why you should pick a relational database;

### Hosting Service

There are lot's of web hosting companies that provide relational database service already so you will find that your basic plan should come with a free relational database. MySQL is often the most used in this case, but we have others too. But often they come at a price so you should definitely look at your budget.

### ACID compliant

Relational databases are ACID compliant and by that we mean that they conform to the following principles;

* Atomicity - Each operation is treated as a single transaction, it either succeeds completely or fails completely.
* Consistency - Each transaction can only bring the database from one valid state to another, only data that passes the rules is written to the database.
* Isolation - Each transaction is treated as a single unit and is run concurrently in isolation with other transactions thus ensuring that the database is finally arrives at the same state it would have if the transactions were run sequentially.
* Durability - This ensures that our data remains committed once it has been committed in case of system failures.

These are some bunch of principles that helps relational database to securely store, retrieve and update data in a reliable and consistent manner, you can head over [here](https://en.wikipedia.org/wiki/ACID) to read up more about ACID.

### Security of Data/Protection of sensitive data

In a Relational database the user is only able to manage and access the databases and tables that they have access to, this ensures that people working with the database cannot manipulate or make operations on objects in the database that they have given access to and none than that. Another thing i like about relational databases is that with the primary key you can get only the attribute of the record that you need, this ensures that you only request for what you need while leaving out what's meant to be hidden.

### Flexibility

Relational databases are often easy to install into any platform and you can access your database in any manner you see fit, either from a terminal or you could query the database using a programming language, php and MySQL are often the normal combination. It is also very easy to integrate relational databases with other systems and we can provision and expand it's capabilities by building tools on top of it.

### Data can be easily extended

If your data is properly structured then you will find that you can easily modify/extend your data, you can change the information on one table and be sure of the integrity of the data in other tables because we did not modify them, then we would just modify our queries to reflect the change. 

I hope you learned something today, You can visit [EDUCBA](https://www.educba.com/relational-database-advantages/) for a free relational database tutorial, however if you prefer watching than reading, you can visit [this tutorial on youtube](https://youtube.com/playlist?list=PLV8vIYTIdSnaLvx1qGjOnYOb989ThPdU0). Please leave a comment and don't forget to hit the like button.