December 30, 2021

Every now and then we interact with databases but we may not be aware of that fact. Starting from our favorite social media apps we use everyday like WhatsApp, Twitter, Instagram, banking apps, our common phonebook or contacts app on our phones, mail app, among others to this piece of information you are reading now. We shall agree that databases are part of our modern day life and it is hard to do without them. In fact, the digital world depends on them. Every application that stores some sort of information like username or password requires to have a database. But what are databases?

Simply put, a database is a set of records held in a computer. Lets use a real world example. You open your favorite app say WhatsApp, you receive new messages from your friends and you also send back a reply; maybe an emoji, memoji, image, text, name it. All these messages are not just stored on your phone but they’re stored in a place called a database and attached to your account. Ever wondered why you’re able to restore your messages in case of re-installing an app? It is because all your information is stored somewhere in a place called the database. Therefore, a database refers to an organised collection of records on a computer.

Relational Databases

There are many types of databases like object-oriented databases, distributed databases, data warehouses, cloud databases, relational databases, JSON databases, graph databases, NoSQL databases, among others. However, for our case we shall be focusing on relational databases. With relational databases, data is stored in tables (rows and columns). There are a number of relational database software out there that are being used by both small and large organisations. Among them include Oracle, MySQL, Postgres, SQLite, Microsoft SQL Server, among others. Relational databases enforce relationship among records in the database. In the example below, we have a database to store faculty records of a university. This database has two tables ie. the faculty table and the department table. When you look carefully in the department table, there is a faculty_code column from the faculty table. This implies there is a relationship between the two tables. This relationship could be, there will be no department without a faculty. (Don’t worry about all details you don’t understand now. We shall get back to these in later chapters).

These databases are the ones we manipulate to read information sent to us by friends on social media, send information to others, update our usernames and password, post a picture, among others. To be able us work with them (databases), databases use a language called SQL — Structured Query Language pronounced as “sequel”. It is this language that is used by almost all relational databases to read, insert, update, delete data from the database.