Synopsis: Entity-Attribute-Value

Let's have a look at the triviality of Entity-Attribute-Value in a database.

“How do we count the number of rows by date?” This is an example of a simple task for a database programmer. It involves basic SQL syntax:

Press + to interact
SELECT date_reported, COUNT(*)
FROM Bugs
GROUP BY date_reported;

However, the simple solution assumes two things:

  • Values are stored in the same column, as in Bugs.date_reported.

  • Values can be compared to one another so that GROUP BY can accurately group dates with equal values together.

What if we can’t rely on those assumptions? What if the date is stored in the date_reported or report_date column, or in any other column that’s different on each of its rows. What if dates can take a variety of different formats and the ...