SQL-Based XML Structured Data Access
By Michael M. David
SQL and XML seem to have distinctly different strengths. XML is used to represent
highly structured hierarchical information while SQL is intended for processing
data represented as rows and columns in a relational database. Hierarchical
data structures are excellent for organizing data because they have a singular,
unambiguous point of view, making their semantics very powerful. Relational
databases, on the other hand, are useful because they allow many different
data-structure formations to be created dynamically from the same data. Because
each is important, transforming relational data into a hierarchical structure
will let us create XML documents from a database. We also want to do the reverse,
which will let us import XML documents into a database. Using ANSI SQL's newer
outer join operation, we can perform these transformations between relational
data and XML.
By understanding the similarities of SQL and XML, developers can begin to
work with XML in a similar fashion to the way they work with traditional databases.
Parsers and programs can be written to transparently move data back and forth
between conventional data stores and Web pages without losing or altering
the semantics associated with the data.
SQL's Inner and Outer
Join
In a relational database, a join operation combines rows in different tables
based on one or more matching data or key fields.