Many publishers and in-house documentation departments use document management
systems which are based on SGML-aware relational or object-oriented database
technology (Documentum, Poet...). These systems not only keep track of document
fragments, they also provide version management &c.
On the other hand, marked-up text can itself be viewed as a database, which can
be processed with Perl-SGML or specialized languages like Balise.
Balise is often used to down-translate SGML to HTML or Winhelp or whatever for
distribution/display. This is pretty much the equivalent of a report function in
a database environment.