Topics
Relational Databases

Relational Databases

Most applications that are built for real-world solutions deal with entities. Entities could be humans, business organizations, or objects.

For example, in a application built for online ecommerce, the entities are the buyer (a human), a store and a bank (businesss organizations), and the items available for purchase (objects). Or an IoT application will have sensors, parameters, microcontrollers, and servers (all objects).

Every entity has attributes that uniquely identify it or assigns it some characteristics.

For example, the buyer will have an email id (unique identifier), name, phone number, postal address (could be common across multiple buyers), and a credit card number (unique to the buyer but there can be multiple). An item for purchase will have an id (unique identifier), a name, a description, a price, and an image. A sensor will have an id (unique identifier) and a type. A parameter will have a name, a minimum value, and a maximum value. A server will have an IP address (unique identifier) and the communication protocol it supports.

Finally, all entities have a relationship with each other in the context of the application.

For example, the store has a relationship with the items in the form of items stocked, the buyer has a relationship with items in the form of the items purchased, the buyer has a relationship with the bank in the form of being a customer and holding an account or a credit card. A sensor will have a relationship with parameters in the form of what data it captures. A microcontroller will have the relationship with sensors in the form form of connections.

This concept of entities, attributes, and relationships between entities, is the crux of how a Relational Database works.