I've been forced to use a very uncomfortable structure for a table. After trying to up similar examples, I've discovered the EAV, which seems almost like a pivot of said structure. The attribute order is not set in stone (except that there are no new attributes after a NULL column). For the max amount of attributes N, there are 2*N columns in pairs of Attribute_Name - Attribute value.
EAV example:
ID| Entity | Attribute | Value
__________________________________
1 | Entity1 | Attribute1 | Value1
2 | Entity2 | Attribute1 | Value2
3 | Entity2 | Attribute2 | Value3
4 | Entity2 | Attribute3 | Value4
5 | Entity3 | Attribute1 | Value5
6 | Entity3 | Attribute2 | Value6
Example of my table:
Entity | A_Name1 | A_Value1 | A_Name2 | A_Value2 | A_Name3 | A_Value3
______________________________________________________________________________________
Entity1 | Attribute1 | Value1 | NULL | NULL | NULL | NULL
Entity2 | Attribute2 | Value3 | Attribute1 | Value2 | Attribute3 | Value4
Entity3 | Attribute2 | Value6 | Attribute1 | Value5 | NULL | NULL
Should this be considered separate from EAV structure? Is there any classification for this kind of table structure, or is it one of a kind? Basically, I want to learn as much as possible about it and ways to work around it.
EDIT: Forgot to mention -- the Attribute names might also repeat like this:
Entity | A_Name1 | A_Value1 | A_Name2 | A_Value2 | A_Name3 | A_Value3
______________________________________________________________________________________
Entity1 | Attribute1 | Value1 | NULL | NULL | NULL | NULL
Entity2 | Attribute2 | Value3 | Attribute1 | Value2 | Attribute2 | Value4
Entity3 | Attribute2 | Value6 | Attribute1 | Value5 | NULL | NULL