| Oracle FAQ | Your Portal to the Oracle Knowledge Grid | |
Home -> Community -> Usenet -> comp.databases.theory -> Design question
Hi,
I have an application that deals with an entity called "Document". A
"Document" can have several attributes. These attributes can be either
of {int, float, date, string} type. However, I do not know beforehand
the number of attributes. The user may add more attributes to this
"Document" entity. For example, right now it may have attributes such
as <Author>, <Creation_Date>. Later, a user may add <Num_Pages>. So,
modeling the "Document" entity as a relation with attributes as column
names is difficult. I had this approach in mind and wanted to know if
there is a better way.
I was thinking of creating a relation DocAttr(AttributeName, AttributeValue). I can create 4 such relations for each of {int, float, string and date}. DocAttrInt, DocAttrFloat, DocAttrString and DocAttrDate. Then I can store <Author, "Some Name"> in DocAttrString.
This way more attributes can be added on later or existing ones can be removed.
Is there a better way? Keep in mind that I am required to use an
RDBMS.
Thanks,
San
Received on Sun May 04 2003 - 01:37:59 CDT
![]() |
![]() |