Tell Me Glossary
 

Documents in Database

Previous previous|next Next Page

Documents along with their associated attributes such as title, author and other custom attributes can be stored in a database.

Consider the following schema where the document structure is distributed across the three tables - DOCTABLE, DEPTTABLE and ORGTABLE.

Here, every record in the DOCTABLE represents a document. Each document consists of its content and associated attributes - DEPT and ORG. A complete document can be formed by joining the above tables:

SELECT
DOCID, LANG, CONTENTTYPE, CONTENT, AUTHOR, DEPT.NAME, ORG.NAME
FROM
DOCTABLE DOC, DEPTTABLE DEPT, ORGTABLE ORG
WHERE
DOC.DEPT=DEPT.ID AND DOC.ORG=ORG.ID

The query of the above type is referred as Document Query. The value of CONTENT column can be indexed as the document content and the value in other columns such as DEPT, ORG, etc. can be indexed as attributes of the document.