I've designed a few databases in my time, and on more than one occasion the drive to abstract common elements from specific tables has led me to create generic top-level tables which contain those common elements. For example:
Table Column Column
Hamburgers Item Topping
Cheeseburger Tomatoes
Mushroomburger Swiss
Could be "simplified" ("normalized") as:
Table Column Column
FoodTypes ID Name
1 Hamburger
2 Topping
Food Item TypeID
Cheeseburger 1
Mushroomburger 1
Tomatoes 2
Swiss 2
Recently I've gone over the deep end with this approach, abstracting and re-abstracting a fairly complex database design until I was left with something both very simple and yet completely un-resembling of the actual data being stored.
This has led me to the conclusion that all databases could be "summarized" in a single monstrous table called "Entries" with columns:
ID Type Value1 Value2
For example:
ID Type Value1 Value2
4321 Item
8746 Descrip 4321 Food
5673 Item
9876 Descrip 5673 Hamburger
0341 Item
1234 Descrip 0341 Lettuce
5478 Relation 5673 0341
2381 Descrip 5478 Topping
2244 Relation 5673 4321
2160 Descrip 2244 Class
4436 Relation 0341 4321
7547 Descrip 4436 Class
Here, using these 4 columns in 1 table, I have created two objects sharing a common superclass, given them an attribute, and defined not only a relationship between them but the class of that relationship as well. We could now say "Lettuce is a Topping of Hamburger, both of which are Foods".
There would of course be a set of rules for this system, but that is beyond the scope of this question.
My question is, is this not logically the case? If so (or if there is a different, "correct" answer), what is this in relation to real databases? Does such a system exist, or should it not?
I'm not sure if I've gone far enough in my analysis, and I feel like I'm on the verge of some insight which is profoundly obvious to mathematicians and computer scientists (like "yes, all relational data can be described in terms of binary operands like F[a, b]).