Summary: Documents stored in a database system can have complex internal structure described by languages such as SGML. How to take advantage of this structure presents challenges for database system implementors. We classify the types of queries that need to be supported by SGML-conformant database systems. We then describe several data models that have been proposed for representing documents in a database system and discuss the support these models provide for SGML. Finally we consider query evaluation.