Prequel to the normalization stage which focused on normalizing database tables, this section would be based on establishing relationships between them as well as mapping cardinalities.
The process of establishing and defining the relationships between database relations is known as Data Modeling. The end product of data modeling gives what is known as a Schema. This defines the blueprint of the database, as a schema explains the tables present and also the relationships between them.
Recall that database normalization answers the question of “What is”, while data modeling augments the definition and answers the question of “How does”. In this case, “How do the entities relate with each other?”.
Cardinalities would be introduced in the relationship definitions, and this simply denotes numerical aspects of the relationships between rows of the associated tables. This is where terms like one-to-many, or many-to-many would be used.
This section would be divided into two main stages.
In this stage, we would define the core entities and explain what makes them “core”. Questions asked would be “What makes a driver a driver” or “What defines a trip”. This is where we would identify their associations with other normalized entities to fully understand it’s structure.
In this stage, we would then describe how the core entities associates with the rest of the application. This is would be more action specific and would be based on the “normalized tables” and “associations” columns in Normalized Tables and their Associated Entities
Based on the application, this stage would give the core entities in the database model a clear definition of what they can do and what they cannot. Here, a core entity; a passenger for example, would have a set of associated “entities” and would be able to perform a task, like booking a trip.
Data Modeling would be done in both stages.
In our BRT application, the core entities are passengers, drivers and trips which are interconnected in some sort of way. Trips are assigned to drivers while passengers book a trip. Also, passengers and drivers are indirectly connected to one another by trip payments.
Things to note in the schema design stage